From 26ca418fd5a2a1f1d913c852b9a4174a0d25b6f1 Mon Sep 17 00:00:00 2001 From: wojciech-turek Date: Mon, 29 Jul 2024 16:52:04 +0200 Subject: [PATCH 1/4] LayerZero deployment to Base and BSC --- .../800_oft_sand/801_deploy_oft_sand.ts | 4 +- .../802_oft_adapter_setup_ethereum.ts | 12 +- .../800_oft_sand/803_oft_sand_setup_base.ts | 10 +- .../800_oft_sand/804_oft_sand_setup_bsc.ts | 14 +- packages/deploy/deployments/base/OFTSand.json | 2950 +++++++++++++++++ .../4bade374f62f6d78bc3ea2aa3ebdd50f.json | 258 ++ .../deployments/bscMainnet/OFTSand.json | 2950 +++++++++++++++++ .../4bade374f62f6d78bc3ea2aa3ebdd50f.json | 258 ++ .../mainnet/OFTAdapterForSand.json | 2129 ++++++++++++ packages/deploy/deployments/mainnet/Sand.json | 879 +++++ .../4bade374f62f6d78bc3ea2aa3ebdd50f.json | 258 ++ packages/deploy/hardhat.config.ts | 6 +- 12 files changed, 9707 insertions(+), 21 deletions(-) create mode 100644 packages/deploy/deployments/base/OFTSand.json create mode 100644 packages/deploy/deployments/base/solcInputs/4bade374f62f6d78bc3ea2aa3ebdd50f.json create mode 100644 packages/deploy/deployments/bscMainnet/OFTSand.json create mode 100644 packages/deploy/deployments/bscMainnet/solcInputs/4bade374f62f6d78bc3ea2aa3ebdd50f.json create mode 100644 packages/deploy/deployments/mainnet/OFTAdapterForSand.json create mode 100644 packages/deploy/deployments/mainnet/Sand.json create mode 100644 packages/deploy/deployments/mainnet/solcInputs/4bade374f62f6d78bc3ea2aa3ebdd50f.json diff --git a/packages/deploy/deploy/800_oft_sand/801_deploy_oft_sand.ts b/packages/deploy/deploy/800_oft_sand/801_deploy_oft_sand.ts index e2f4ad6bd0..d3dc7a564a 100644 --- a/packages/deploy/deploy/800_oft_sand/801_deploy_oft_sand.ts +++ b/packages/deploy/deploy/800_oft_sand/801_deploy_oft_sand.ts @@ -1,5 +1,5 @@ -import {HardhatRuntimeEnvironment} from 'hardhat/types'; import {DeployFunction} from 'hardhat-deploy/types'; +import {HardhatRuntimeEnvironment} from 'hardhat/types'; const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const {deployments, getNamedAccounts} = hre; @@ -7,7 +7,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const {deployer, sandAdmin, sandExecutionAdmin} = await getNamedAccounts(); const TRUSTED_FORWARDER_V2 = await deployments.get('TRUSTED_FORWARDER_V2'); - const EndpointV2 = await deployments.get('EndpointV2'); + const EndpointV2 = await deployments.get('EndPointV2'); await deploy('OFTSand', { from: deployer, diff --git a/packages/deploy/deploy/800_oft_sand/802_oft_adapter_setup_ethereum.ts b/packages/deploy/deploy/800_oft_sand/802_oft_adapter_setup_ethereum.ts index 6b0006e5b9..757982617c 100644 --- a/packages/deploy/deploy/800_oft_sand/802_oft_adapter_setup_ethereum.ts +++ b/packages/deploy/deploy/800_oft_sand/802_oft_adapter_setup_ethereum.ts @@ -1,6 +1,7 @@ +import {ethers} from 'ethers'; import {DeployFunction} from 'hardhat-deploy/types'; import {HardhatRuntimeEnvironment} from 'hardhat/types'; -import {ethers} from 'ethers'; +import {DEPLOY_NETWORKS} from '../../hardhat.config'; const func: DeployFunction = async function ( hre: HardhatRuntimeEnvironment @@ -11,22 +12,21 @@ const func: DeployFunction = async function ( let eidBase, eidBsc; - if (hre.network.name == 'mainnnet') { + if (hre.network.name == 'mainnet') { eidBase = process.env[`EID_${'BASE'}`]; eidBsc = process.env[`EID_${'BSCMAINNET'}`]; } else if (hre.network.name == 'sepolia') { eidBase = process.env[`EID_${'BASESEPOLIA'}`]; eidBsc = process.env[`EID_${'BSCTESTNET'}`]; } else { - eidBsc = 0; - eidBase = 0; + throw new Error('Cannot find EID for network'); } - const hreBase = hre.companionNetworks.base; + const hreBase = hre.companionNetworks[DEPLOY_NETWORKS.BASE_MAINNET]; const deploymentsBase = hreBase.deployments; const OFTSandBase = await deploymentsBase.getOrNull('OFTSand'); - const hreBsc = hre.companionNetworks.bscMainnet; + const hreBsc = hre.companionNetworks[DEPLOY_NETWORKS.BSC_MAINNET]; const deploymentsBsc = hreBsc.deployments; const OFTSandBsc = await deploymentsBsc.getOrNull('OFTSand'); diff --git a/packages/deploy/deploy/800_oft_sand/803_oft_sand_setup_base.ts b/packages/deploy/deploy/800_oft_sand/803_oft_sand_setup_base.ts index a8da46b045..60b3e2c4ca 100644 --- a/packages/deploy/deploy/800_oft_sand/803_oft_sand_setup_base.ts +++ b/packages/deploy/deploy/800_oft_sand/803_oft_sand_setup_base.ts @@ -1,6 +1,7 @@ +import {ethers} from 'ethers'; import {DeployFunction} from 'hardhat-deploy/types'; import {HardhatRuntimeEnvironment} from 'hardhat/types'; -import {ethers} from 'ethers'; +import {DEPLOY_NETWORKS} from '../../hardhat.config'; const func: DeployFunction = async function ( hre: HardhatRuntimeEnvironment @@ -18,17 +19,16 @@ const func: DeployFunction = async function ( eidEthereum = process.env[`EID_${'SEPOLIA'}`]; eidBsc = process.env[`EID_${'BSCTESTNET'}`]; } else { - eidEthereum = 0; - eidBsc = 0; + throw new Error('Cannot find EID for network'); } - const hreEthereum = hre.companionNetworks.mainnet; + const hreEthereum = hre.companionNetworks[DEPLOY_NETWORKS.ETH_MAINNET]; const deploymentsEthereum = hreEthereum.deployments; const OFTAdapterForSand = await deploymentsEthereum.getOrNull( 'OFTAdapterForSand' ); - const hreBsc = hre.companionNetworks.bscMainnet; + const hreBsc = hre.companionNetworks[DEPLOY_NETWORKS.BSC_MAINNET]; const deploymentsBsc = hreBsc.deployments; const OFTSandBsc = await deploymentsBsc.getOrNull('OFTSand'); diff --git a/packages/deploy/deploy/800_oft_sand/804_oft_sand_setup_bsc.ts b/packages/deploy/deploy/800_oft_sand/804_oft_sand_setup_bsc.ts index 8fc9c25591..2517d70a79 100644 --- a/packages/deploy/deploy/800_oft_sand/804_oft_sand_setup_bsc.ts +++ b/packages/deploy/deploy/800_oft_sand/804_oft_sand_setup_bsc.ts @@ -1,6 +1,7 @@ +import {ethers} from 'ethers'; import {DeployFunction} from 'hardhat-deploy/types'; import {HardhatRuntimeEnvironment} from 'hardhat/types'; -import {ethers} from 'ethers'; +import {DEPLOY_NETWORKS} from '../../hardhat.config'; const func: DeployFunction = async function ( hre: HardhatRuntimeEnvironment @@ -18,23 +19,22 @@ const func: DeployFunction = async function ( eidEthereum = process.env[`EID_${'SEPOLIA'}`]; eidBase = process.env[`EID_${'BASESEPOLIA'}`]; } else { - eidEthereum = 0; - eidBase = 0; + throw new Error('Cannot find EID for network'); } - const hreEthereum = hre.companionNetworks.mainnet; + const hreEthereum = hre.companionNetworks[DEPLOY_NETWORKS.ETH_MAINNET]; const deploymentsEthereum = hreEthereum.deployments; const OFTAdapterForSand = await deploymentsEthereum.getOrNull( 'OFTAdapterForSand' ); - const hreBase = hre.companionNetworks.base; + const hreBase = hre.companionNetworks[DEPLOY_NETWORKS.BASE_MAINNET]; const deploymentsBase = hreBase.deployments; const OFTSandBase = await deploymentsBase.getOrNull('OFTSand'); if (OFTAdapterForSand && OFTSandBase) { const isPeerForEthereum = await read( - 'OFTAdapterForSand', + 'OFTSand', 'isPeer', eidEthereum, ethers.zeroPadValue(OFTAdapterForSand.address, 32) @@ -51,7 +51,7 @@ const func: DeployFunction = async function ( } const isPeerForBase = await read( - 'OFTAdapterForSand', + 'OFTSand', 'isPeer', eidBase, ethers.zeroPadValue(OFTSandBase.address, 32) diff --git a/packages/deploy/deployments/base/OFTSand.json b/packages/deploy/deployments/base/OFTSand.json new file mode 100644 index 0000000000..756bc90c34 --- /dev/null +++ b/packages/deploy/deployments/base/OFTSand.json @@ -0,0 +1,2950 @@ +{ + "address": "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "trustedForwarder", + "type": "address" + }, + { + "internalType": "address", + "name": "sandAdmin", + "type": "address" + }, + { + "internalType": "address", + "name": "executionAdmin", + "type": "address" + }, + { + "internalType": "address", + "name": "layerZeroEndpoint", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "AddressInsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "message", + "type": "string" + } + ], + "name": "CallFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "allowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientAllowance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "approver", + "type": "address" + } + ], + "name": "ERC20InvalidApprover", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "ERC20InvalidReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ERC20InvalidSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "ERC20InvalidSpender", + "type": "error" + }, + { + "inputs": [], + "name": "FailedInnerCall", + "type": "error" + }, + { + "inputs": [], + "name": "FirstParamNotSender", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDelegate", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidEndpointCall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidLocalDecimals", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "options", + "type": "bytes" + } + ], + "name": "InvalidOptions", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidOwnerOrSpender", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidSender", + "type": "error" + }, + { + "inputs": [], + "name": "LzTokenUnavailable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + } + ], + "name": "NoPeer", + "type": "error" + }, + { + "inputs": [], + "name": "NotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "msgValue", + "type": "uint256" + } + ], + "name": "NotEnoughNative", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyAdmin", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "OnlyEndpoint", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + } + ], + "name": "OnlyPeer", + "type": "error" + }, + { + "inputs": [], + "name": "OnlySelf", + "type": "error" + }, + { + "inputs": [], + "name": "Overflow", + "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": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "inputs": [], + "name": "SendFunctionDisabled", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "result", + "type": "bytes" + } + ], + "name": "SimulationResult", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountLD", + "type": "uint256" + } + ], + "name": "SlippageExceeded", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "Enabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "internalType": "uint16", + "name": "msgType", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "options", + "type": "bytes" + } + ], + "indexed": false, + "internalType": "struct EnforcedOptionParam[]", + "name": "_enforcedOptions", + "type": "tuple[]" + } + ], + "name": "EnforcedOptionSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "inspector", + "type": "address" + } + ], + "name": "MsgInspectorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "indexed": true, + "internalType": "address", + "name": "toAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountReceivedLD", + "type": "uint256" + } + ], + "name": "OFTReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "indexed": true, + "internalType": "address", + "name": "fromAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountSentLD", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountReceivedLD", + "type": "uint256" + } + ], + "name": "OFTSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "peer", + "type": "bytes32" + } + ], + "name": "PeerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "preCrimeAddress", + "type": "address" + } + ], + "name": "PreCrimeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "superOperator", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "SuperOperator", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newForwarder", + "type": "address" + } + ], + "name": "TrustedForwarderSet", + "type": "event" + }, + { + "inputs": [], + "name": "SEND", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "SEND_AND_CALL", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountNeeded", + "type": "uint256" + } + ], + "name": "addAllowanceIfNeeded", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "origin", + "type": "tuple" + } + ], + "name": "allowInitializePath", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "remaining", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approvalRequired", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "approveAndCall", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approveFor", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "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": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnFor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "uint16", + "name": "_msgType", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_extraOptions", + "type": "bytes" + } + ], + "name": "combineOptions", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimalConversionRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "enable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "endpoint", + "outputs": [ + { + "internalType": "contract ILayerZeroEndpointV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "internalType": "uint16", + "name": "msgType", + "type": "uint16" + } + ], + "name": "enforcedOptions", + "outputs": [ + { + "internalType": "bytes", + "name": "enforcedOption", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTrustedForwarder", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_sender", + "type": "address" + } + ], + "name": "isComposeMsgSender", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_peer", + "type": "bytes32" + } + ], + "name": "isPeer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "who", + "type": "address" + } + ], + "name": "isSuperOperator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "isTrustedForwarder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_executor", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "lzReceive", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "origin", + "type": "tuple" + }, + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "address", + "name": "executor", + "type": "address" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "internalType": "struct InboundPacket[]", + "name": "_packets", + "type": "tuple[]" + } + ], + "name": "lzReceiveAndRevert", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_executor", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "lzReceiveSimulate", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "msgInspector", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "nextNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oApp", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oAppVersion", + "outputs": [ + { + "internalType": "uint64", + "name": "senderVersion", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "receiverVersion", + "type": "uint64" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "oftVersion", + "outputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + }, + { + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "paidCall", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + } + ], + "name": "peers", + "outputs": [ + { + "internalType": "bytes32", + "name": "peer", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "preCrime", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "to", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "amountLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountLD", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "extraOptions", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "composeMsg", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "oftCmd", + "type": "bytes" + } + ], + "internalType": "struct SendParam", + "name": "_sendParam", + "type": "tuple" + } + ], + "name": "quoteOFT", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "minAmountLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxAmountLD", + "type": "uint256" + } + ], + "internalType": "struct OFTLimit", + "name": "oftLimit", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "int256", + "name": "feeAmountLD", + "type": "int256" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "internalType": "struct OFTFeeDetail[]", + "name": "oftFeeDetails", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "amountSentLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountReceivedLD", + "type": "uint256" + } + ], + "internalType": "struct OFTReceipt", + "name": "oftReceipt", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "to", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "amountLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountLD", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "extraOptions", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "composeMsg", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "oftCmd", + "type": "bytes" + } + ], + "internalType": "struct SendParam", + "name": "_sendParam", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "_payInLzToken", + "type": "bool" + } + ], + "name": "quoteSend", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lzTokenFee", + "type": "uint256" + } + ], + "internalType": "struct MessagingFee", + "name": "msgFee", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "to", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "amountLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountLD", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "extraOptions", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "composeMsg", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "oftCmd", + "type": "bytes" + } + ], + "internalType": "struct SendParam", + "name": "_sendParam", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lzTokenFee", + "type": "uint256" + } + ], + "internalType": "struct MessagingFee", + "name": "_fee", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_refundAddress", + "type": "address" + } + ], + "name": "send", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lzTokenFee", + "type": "uint256" + } + ], + "internalType": "struct MessagingFee", + "name": "fee", + "type": "tuple" + } + ], + "internalType": "struct MessagingReceipt", + "name": "msgReceipt", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "amountSentLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountReceivedLD", + "type": "uint256" + } + ], + "internalType": "struct OFTReceipt", + "name": "oftReceipt", + "type": "tuple" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "internalType": "uint16", + "name": "msgType", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "options", + "type": "bytes" + } + ], + "internalType": "struct EnforcedOptionParam[]", + "name": "_enforcedOptions", + "type": "tuple[]" + } + ], + "name": "setEnforcedOptions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_msgInspector", + "type": "address" + } + ], + "name": "setMsgInspector", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_peer", + "type": "bytes32" + } + ], + "name": "setPeer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_preCrime", + "type": "address" + } + ], + "name": "setPreCrime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "superOperator", + "type": "address" + }, + { + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "setSuperOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "trustedForwarder", + "type": "address" + } + ], + "name": "setTrustedForwarder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharedDecimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xc55651bcf7dc996f8bced152804b12064ee3a0be1cc5d6b37b225860491da39b", + "receipt": { + "to": null, + "from": "0xCba49d154b4Bb9a9aD7F5Dad396CB9a0a3a62ABc", + "contractAddress": "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF", + "transactionIndex": 69, + "gasUsed": "3951736", + "logsBloom": "0x00000000800000000000010000000000000000000000000000800000001000000000000020000000000008000000000000000002000000000000000200000000000000000000000000000000000000080001000000000000000000000000000000000000020000000000000000000800000000800010001000000000000000400000000000000000000000000000000000000000000000000400000000800400000000000000008000000000000000000000000000000000000000000000000400000000000000200000001000000000000000000400000000000000000020000001080000000000000000000000000000000000010000000000200000000000", + "blockHash": "0xee7dc16e4b2d1b968a0026224fddfb76e57b04c77dd9776a0f4d58147afb201a", + "transactionHash": "0xc55651bcf7dc996f8bced152804b12064ee3a0be1cc5d6b37b225860491da39b", + "logs": [ + { + "transactionIndex": 69, + "blockNumber": 17735349, + "transactionHash": "0xc55651bcf7dc996f8bced152804b12064ee3a0be1cc5d6b37b225860491da39b", + "address": "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f", + "0x00000000000000000000000018987794f808ee72ae9127058f1c7d079736ca45", + "0x00000000000000000000000018987794f808ee72ae9127058f1c7d079736ca45" + ], + "data": "0x", + "logIndex": 227, + "blockHash": "0xee7dc16e4b2d1b968a0026224fddfb76e57b04c77dd9776a0f4d58147afb201a" + }, + { + "transactionIndex": 69, + "blockNumber": 17735349, + "transactionHash": "0xc55651bcf7dc996f8bced152804b12064ee3a0be1cc5d6b37b225860491da39b", + "address": "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000cba49d154b4bb9a9ad7f5dad396cb9a0a3a62abc" + ], + "data": "0x", + "logIndex": 228, + "blockHash": "0xee7dc16e4b2d1b968a0026224fddfb76e57b04c77dd9776a0f4d58147afb201a" + }, + { + "transactionIndex": 69, + "blockNumber": 17735349, + "transactionHash": "0xc55651bcf7dc996f8bced152804b12064ee3a0be1cc5d6b37b225860491da39b", + "address": "0x1a44076050125825900e736c501f859c50fE728c", + "topics": [ + "0x6ee10e9ed4d6ce9742703a498707862f4b00f1396a87195eb93267b3d7983981" + ], + "data": "0x000000000000000000000000ac531eb26ca1d21b85126de8fb87e80e09002dcf000000000000000000000000cba49d154b4bb9a9ad7f5dad396cb9a0a3a62abc", + "logIndex": 229, + "blockHash": "0xee7dc16e4b2d1b968a0026224fddfb76e57b04c77dd9776a0f4d58147afb201a" + }, + { + "transactionIndex": 69, + "blockNumber": 17735349, + "transactionHash": "0xc55651bcf7dc996f8bced152804b12064ee3a0be1cc5d6b37b225860491da39b", + "address": "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF", + "topics": [ + "0xd91237492a9e30cd2faf361fc103998a382ff0ec2b1b07dc1cbebb76ae2f1ea2", + "0x0000000000000000000000000000000000000000000000000000000000000000" + ], + "data": "0x", + "logIndex": 230, + "blockHash": "0xee7dc16e4b2d1b968a0026224fddfb76e57b04c77dd9776a0f4d58147afb201a" + }, + { + "transactionIndex": 69, + "blockNumber": 17735349, + "transactionHash": "0xc55651bcf7dc996f8bced152804b12064ee3a0be1cc5d6b37b225860491da39b", + "address": "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF", + "topics": [ + "0x54ca1f89aee2b8d11c89b7813c6aa99caa0f8c55c8eccf8b70c3bb42029fa134" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 231, + "blockHash": "0xee7dc16e4b2d1b968a0026224fddfb76e57b04c77dd9776a0f4d58147afb201a" + } + ], + "blockNumber": 17735349, + "cumulativeGasUsed": "18452764", + "status": 1, + "byzantium": true + }, + "args": [ + "0x0000000000000000000000000000000000000000", + "0x18987794f808eE72Ae9127058F1C7d079736Ca45", + "0x18987794f808eE72Ae9127058F1C7d079736Ca45", + "0x1a44076050125825900e736c501f859c50fE728c", + "0xCba49d154b4Bb9a9aD7F5Dad396CB9a0a3a62ABc" + ], + "numDeployments": 1, + "solcInputHash": "4bade374f62f6d78bc3ea2aa3ebdd50f", + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"trustedForwarder\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sandAdmin\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"executionAdmin\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"layerZeroEndpoint\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AddressInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"CallFailed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"allowance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"ERC20InsufficientAllowance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"ERC20InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"approver\",\"type\":\"address\"}],\"name\":\"ERC20InvalidApprover\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"ERC20InvalidReceiver\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ERC20InvalidSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"ERC20InvalidSpender\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FirstParamNotSender\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDelegate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidEndpointCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidLocalDecimals\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"options\",\"type\":\"bytes\"}],\"name\":\"InvalidOptions\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidOwnerOrSpender\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSender\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LzTokenUnavailable\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"}],\"name\":\"NoPeer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotAuthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"msgValue\",\"type\":\"uint256\"}],\"name\":\"NotEnoughNative\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyAdmin\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"OnlyEndpoint\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"}],\"name\":\"OnlyPeer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlySelf\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Overflow\",\"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\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SendFunctionDisabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"result\",\"type\":\"bytes\"}],\"name\":\"SimulationResult\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minAmountLD\",\"type\":\"uint256\"}],\"name\":\"SlippageExceeded\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"Enabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"msgType\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"options\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct EnforcedOptionParam[]\",\"name\":\"_enforcedOptions\",\"type\":\"tuple[]\"}],\"name\":\"EnforcedOptionSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"inspector\",\"type\":\"address\"}],\"name\":\"MsgInspectorSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"guid\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"srcEid\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountReceivedLD\",\"type\":\"uint256\"}],\"name\":\"OFTReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"guid\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"dstEid\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountSentLD\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountReceivedLD\",\"type\":\"uint256\"}],\"name\":\"OFTSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"peer\",\"type\":\"bytes32\"}],\"name\":\"PeerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"preCrimeAddress\",\"type\":\"address\"}],\"name\":\"PreCrimeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"superOperator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"SuperOperator\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newForwarder\",\"type\":\"address\"}],\"name\":\"TrustedForwarderSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"SEND\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SEND_AND_CALL\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountNeeded\",\"type\":\"uint256\"}],\"name\":\"addAllowanceIfNeeded\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"srcEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"struct Origin\",\"name\":\"origin\",\"type\":\"tuple\"}],\"name\":\"allowInitializePath\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"remaining\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"approvalRequired\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"approveAndCall\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approveFor\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"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\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burnFor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_eid\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_msgType\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_extraOptions\",\"type\":\"bytes\"}],\"name\":\"combineOptions\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimalConversionRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"enable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endpoint\",\"outputs\":[{\"internalType\":\"contract ILayerZeroEndpointV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"msgType\",\"type\":\"uint16\"}],\"name\":\"enforcedOptions\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"enforcedOption\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTrustedForwarder\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"srcEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"struct Origin\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"}],\"name\":\"isComposeMsgSender\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_eid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"_peer\",\"type\":\"bytes32\"}],\"name\":\"isPeer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"who\",\"type\":\"address\"}],\"name\":\"isSuperOperator\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"srcEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"struct Origin\",\"name\":\"_origin\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"_guid\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_message\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_executor\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"lzReceive\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"srcEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"struct Origin\",\"name\":\"origin\",\"type\":\"tuple\"},{\"internalType\":\"uint32\",\"name\":\"dstEid\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"guid\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct InboundPacket[]\",\"name\":\"_packets\",\"type\":\"tuple[]\"}],\"name\":\"lzReceiveAndRevert\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"srcEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"struct Origin\",\"name\":\"_origin\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"_guid\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_message\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_executor\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"lzReceiveSimulate\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"msgInspector\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"nextNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"oApp\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"oAppVersion\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"senderVersion\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"receiverVersion\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"oftVersion\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"},{\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"paidCall\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"}],\"name\":\"peers\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"peer\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"preCrime\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"dstEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"to\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"amountLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minAmountLD\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraOptions\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"composeMsg\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"oftCmd\",\"type\":\"bytes\"}],\"internalType\":\"struct SendParam\",\"name\":\"_sendParam\",\"type\":\"tuple\"}],\"name\":\"quoteOFT\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"minAmountLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxAmountLD\",\"type\":\"uint256\"}],\"internalType\":\"struct OFTLimit\",\"name\":\"oftLimit\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"int256\",\"name\":\"feeAmountLD\",\"type\":\"int256\"},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"}],\"internalType\":\"struct OFTFeeDetail[]\",\"name\":\"oftFeeDetails\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amountSentLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountReceivedLD\",\"type\":\"uint256\"}],\"internalType\":\"struct OFTReceipt\",\"name\":\"oftReceipt\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"dstEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"to\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"amountLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minAmountLD\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraOptions\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"composeMsg\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"oftCmd\",\"type\":\"bytes\"}],\"internalType\":\"struct SendParam\",\"name\":\"_sendParam\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"_payInLzToken\",\"type\":\"bool\"}],\"name\":\"quoteSend\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nativeFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lzTokenFee\",\"type\":\"uint256\"}],\"internalType\":\"struct MessagingFee\",\"name\":\"msgFee\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"dstEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"to\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"amountLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minAmountLD\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraOptions\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"composeMsg\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"oftCmd\",\"type\":\"bytes\"}],\"internalType\":\"struct SendParam\",\"name\":\"_sendParam\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nativeFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lzTokenFee\",\"type\":\"uint256\"}],\"internalType\":\"struct MessagingFee\",\"name\":\"_fee\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"_refundAddress\",\"type\":\"address\"}],\"name\":\"send\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"guid\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nativeFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lzTokenFee\",\"type\":\"uint256\"}],\"internalType\":\"struct MessagingFee\",\"name\":\"fee\",\"type\":\"tuple\"}],\"internalType\":\"struct MessagingReceipt\",\"name\":\"msgReceipt\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amountSentLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountReceivedLD\",\"type\":\"uint256\"}],\"internalType\":\"struct OFTReceipt\",\"name\":\"oftReceipt\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_delegate\",\"type\":\"address\"}],\"name\":\"setDelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"msgType\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"options\",\"type\":\"bytes\"}],\"internalType\":\"struct EnforcedOptionParam[]\",\"name\":\"_enforcedOptions\",\"type\":\"tuple[]\"}],\"name\":\"setEnforcedOptions\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_msgInspector\",\"type\":\"address\"}],\"name\":\"setMsgInspector\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_eid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"_peer\",\"type\":\"bytes32\"}],\"name\":\"setPeer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_preCrime\",\"type\":\"address\"}],\"name\":\"setPreCrime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"superOperator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"setSuperOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"trustedForwarder\",\"type\":\"address\"}],\"name\":\"setTrustedForwarder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sharedDecimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"The Sandbox\",\"details\":\"OFTSand is a contract that combines SandBaseToken, ERC2771Handler, and OFTCore functionalities.It provides a token contract implementation of Sand token with LayerZero compatibility.\",\"errors\":{\"AddressEmptyCode(address)\":[{\"details\":\"There's no code at `target` (it is not a contract).\"}],\"AddressInsufficientBalance(address)\":[{\"details\":\"The ETH balance of the account is not enough to perform the operation.\"}],\"CallFailed(string)\":[{\"params\":{\"message\":\"error message returned from the failed call\"}}],\"ERC20InsufficientAllowance(address,uint256,uint256)\":[{\"details\":\"Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\",\"params\":{\"allowance\":\"Amount of tokens a `spender` is allowed to operate with.\",\"needed\":\"Minimum amount required to perform a transfer.\",\"spender\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC20InsufficientBalance(address,uint256,uint256)\":[{\"details\":\"Indicates an error related to the current `balance` of a `sender`. Used in transfers.\",\"params\":{\"balance\":\"Current balance for the interacting account.\",\"needed\":\"Minimum amount required to perform a transfer.\",\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC20InvalidApprover(address)\":[{\"details\":\"Indicates a failure with the `approver` of a token to be approved. Used in approvals.\",\"params\":{\"approver\":\"Address initiating an approval operation.\"}}],\"ERC20InvalidReceiver(address)\":[{\"details\":\"Indicates a failure with the token `receiver`. Used in transfers.\",\"params\":{\"receiver\":\"Address to which tokens are being transferred.\"}}],\"ERC20InvalidSender(address)\":[{\"details\":\"Indicates a failure with the token `sender`. Used in transfers.\",\"params\":{\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC20InvalidSpender(address)\":[{\"details\":\"Indicates a failure with the `spender` to be approved. Used in approvals.\",\"params\":{\"spender\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"FailedInnerCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"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.\"}],\"SafeERC20FailedOperation(address)\":[{\"details\":\"An operation with an ERC20 token failed.\"}]},\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emits when the contract administrator is changed.\",\"params\":{\"newAdmin\":\"The address of the new administrator.\",\"oldAdmin\":\"The address of the previous administrator.\"}},\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Enabled(bool)\":{\"params\":{\"enabled\":\"The new enabled state\"}},\"PreCrimeSet(address)\":{\"details\":\"Emitted when the preCrime contract address is set.\",\"params\":{\"preCrimeAddress\":\"The address of the preCrime contract.\"}},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"addAllowanceIfNeeded(address,address,uint256)\":{\"params\":{\"amountNeeded\":\"The amount requested to spend\",\"owner\":\"The address of the owner of the tokens\",\"spender\":\"The address wanting to spend tokens\"},\"returns\":{\"success\":\"Whether or not the call succeeded.\"}},\"allowInitializePath((uint32,bytes32,uint64))\":{\"details\":\"This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received.This defaults to assuming if a peer has been set, its initialized. Can be overridden by the OApp if there is other logic to determine this.\",\"params\":{\"origin\":\"The origin information containing the source endpoint and sender address.\"},\"returns\":{\"_0\":\"Whether the path has been initialized.\"}},\"allowance(address,address)\":{\"params\":{\"owner\":\"The address whose token is allowed.\",\"spender\":\"The address allowed to transfer.\"},\"returns\":{\"remaining\":\"The amount of token `spender` is allowed to transfer on behalf of `owner`.\"}},\"approvalRequired()\":{\"details\":\"In the case of OFT where the contract IS the token, approval is NOT required.\",\"returns\":{\"_0\":\"requiresApproval Needs approval of the underlying token implementation.\"}},\"approve(address,uint256)\":{\"params\":{\"amount\":\"The number of tokens allowed.\",\"spender\":\"The address to be given rights to transfer.\"},\"returns\":{\"success\":\"Whether or not the call succeeded.\"}},\"approveAndCall(address,uint256,bytes)\":{\"params\":{\"amount\":\"The number of tokens allowed.\",\"data\":\"The bytes for the call.\",\"target\":\"The address to be given rights to transfer and destination of the call.\"},\"returns\":{\"_0\":\"The data of the call.\"}},\"approveFor(address,address,uint256)\":{\"params\":{\"amount\":\"The number of tokens allowed.\",\"owner\":\"The address whose token is allowed.\",\"spender\":\"The address to be given rights to transfer.\"},\"returns\":{\"success\":\"Whether or not the call succeeded.\"}},\"balanceOf(address)\":{\"params\":{\"owner\":\"The address to query the balance of.\"},\"returns\":{\"_0\":\"The amount owned by `owner`.\"}},\"burn(uint256)\":{\"params\":{\"amount\":\"The number of tokens to burn.\"}},\"burnFor(address,uint256)\":{\"params\":{\"amount\":\"The number of tokens to burn.\",\"from\":\"The address whose token to burn.\"}},\"changeAdmin(address)\":{\"details\":\"Change the administrator to be `newAdmin`.\",\"params\":{\"newAdmin\":\"The address of the new administrator.\"}},\"combineOptions(uint32,uint16,bytes)\":{\"details\":\"If there is an enforced lzReceive option: - {gasLimit: 200k, msg.value: 1 ether} AND a caller supplies a lzReceive option: {gasLimit: 100k, msg.value: 0.5 ether} - The resulting options will be {gasLimit: 300k, msg.value: 1.5 ether} when the message is executed on the remote lzReceive() function.This presence of duplicated options is handled off-chain in the verifier/executor.\",\"params\":{\"_eid\":\"The endpoint ID.\",\"_extraOptions\":\"Additional options passed by the caller.\",\"_msgType\":\"The OAPP message type.\"},\"returns\":{\"_0\":\"options The combination of caller specified options AND enforced options.\"}},\"decimals()\":{\"returns\":{\"_0\":\"The number of decimals.\"}},\"getAdmin()\":{\"details\":\"Get the current administrator of this contract.\",\"returns\":{\"_0\":\"The current administrator of this contract.\"}},\"getTrustedForwarder()\":{\"returns\":{\"_0\":\"trustedForwarder address of the trusted forwarder\"}},\"isComposeMsgSender((uint32,bytes32,uint64),bytes,address)\":{\"details\":\"_origin The origin information containing the source endpoint and sender address. - srcEid: The source chain endpoint ID. - sender: The sender address on the src chain. - nonce: The nonce of the message._message The lzReceive payload.Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer.The default sender IS the OAppReceiver implementer.\",\"params\":{\"_sender\":\"The sender address.\"},\"returns\":{\"_0\":\"isSender Is a valid sender.\"}},\"isPeer(uint32,bytes32)\":{\"details\":\"Check if the peer is considered 'trusted' by the OApp.Enables OAppPreCrimeSimulator to check whether a potential Inbound Packet is from a trusted source.\",\"params\":{\"_eid\":\"The endpoint ID to check.\",\"_peer\":\"The peer to check.\"},\"returns\":{\"_0\":\"Whether the peer passed is considered 'trusted' by the OApp.\"}},\"isSuperOperator(address)\":{\"params\":{\"who\":\"The address to query.\"},\"returns\":{\"_0\":\"whether the address has superOperator rights.\"}},\"isTrustedForwarder(address)\":{\"params\":{\"forwarder\":\"address to check\"},\"returns\":{\"_0\":\"is trusted\"}},\"lzReceive((uint32,bytes32,uint64),bytes32,bytes,address,bytes)\":{\"details\":\"Entry point for receiving messages or packets from the endpoint.Entry point for receiving msg/packet from the LayerZero endpoint.\",\"params\":{\"_executor\":\"The address of the executor for the received message.\",\"_extraData\":\"Additional arbitrary data provided by the corresponding executor.\",\"_guid\":\"The unique identifier for the received LayerZero message.\",\"_message\":\"The payload of the received message.\",\"_origin\":\"The origin information containing the source endpoint and sender address. - srcEid: The source chain endpoint ID. - sender: The sender address on the src chain. - nonce: The nonce of the message.\"}},\"lzReceiveAndRevert(((uint32,bytes32,uint64),uint32,address,bytes32,uint256,address,bytes,bytes)[])\":{\"details\":\"Interface for pre-crime simulations. Always reverts at the end with the simulation results.WARNING: MUST revert at the end with the simulation results.Gives the preCrime implementation the ability to mock sending packets to the lzReceive function, WITHOUT actually executing them.\",\"params\":{\"_packets\":\"An array of InboundPacket objects representing received packets to be delivered.\"}},\"lzReceiveSimulate((uint32,bytes32,uint64),bytes32,bytes,address,bytes)\":{\"details\":\"Is effectively an internal function because msg.sender must be address(this). Allows resetting the call stack for 'internal' calls.\",\"params\":{\"_executor\":\"The executor address for the packet.\",\"_extraData\":\"Additional data for the packet.\",\"_guid\":\"The unique identifier of the packet.\",\"_message\":\"The message payload of the packet.\",\"_origin\":\"The origin information containing the source endpoint and sender address. - srcEid: The source chain endpoint ID. - sender: The sender address on the src chain. - nonce: The nonce of the message.\"}},\"name()\":{\"returns\":{\"_0\":\"The name of the token collection.\"}},\"nextNonce(uint32,bytes32)\":{\"details\":\"_srcEid The source endpoint ID._sender The sender address.The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement.Is required by the off-chain executor to determine the OApp expects msg execution is ordered.This is also enforced by the OApp.By default this is NOT enabled. ie. nextNonce is hardcoded to return 0.\",\"returns\":{\"nonce\":\"The next nonce.\"}},\"oApp()\":{\"details\":\"Retrieves the address of the OApp contract.The simulator contract is the base contract for the OApp by default.If the simulator is a separate contract, override this function.\",\"returns\":{\"_0\":\"The address of the OApp contract.\"}},\"oAppVersion()\":{\"returns\":{\"receiverVersion\":\"The version of the OAppReceiver.sol implementation.\",\"senderVersion\":\"The version of the OAppSender.sol implementation.\"}},\"oftVersion()\":{\"details\":\"interfaceId: This specific interface ID is '0x02e49c2c'.version: Indicates a cross-chain compatible msg encoding with other OFTs.If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented. ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\",\"returns\":{\"interfaceId\":\"The interface ID.\",\"version\":\"The version.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"paidCall(address,uint256,bytes)\":{\"params\":{\"amount\":\"The number of tokens allowed to spend.\",\"data\":\"The bytes for the call.\",\"target\":\"The destination of the call, allowed to spend the amount specified\"},\"returns\":{\"_0\":\"The data of the call.\"}},\"quoteOFT((uint32,bytes32,uint256,uint256,bytes,bytes,bytes))\":{\"params\":{\"_sendParam\":\"The parameters for the send operation.\"},\"returns\":{\"oftFeeDetails\":\"The details of OFT fees.\",\"oftLimit\":\"The OFT limit information.\",\"oftReceipt\":\"The OFT receipt information.\"}},\"quoteSend((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),bool)\":{\"details\":\"MessagingFee: LayerZero msg fee - nativeFee: The native fee. - lzTokenFee: The lzToken fee.\",\"params\":{\"_payInLzToken\":\"Flag indicating whether the caller is paying in the LZ token.\",\"_sendParam\":\"The parameters for the send() operation.\"},\"returns\":{\"msgFee\":\"The calculated LayerZero messaging fee from the send() operation.\"}},\"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.\"},\"send((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),(uint256,uint256),address)\":{\"details\":\"Executes the send operation.MessagingReceipt: LayerZero msg receipt - guid: The unique identifier for the sent message. - nonce: The nonce of the sent message. - fee: The LayerZero fee incurred for the message.\",\"params\":{\"_fee\":\"The calculated fee for the send() operation. - nativeFee: The native fee. - lzTokenFee: The lzToken fee.\",\"_refundAddress\":\"The address to receive any excess funds.\",\"_sendParam\":\"The parameters for the send operation.\"},\"returns\":{\"msgReceipt\":\"The receipt for the send operation.\",\"oftReceipt\":\"The OFT receipt information.\"}},\"setDelegate(address)\":{\"details\":\"Only the owner/admin of the OApp can call this function.Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.\",\"params\":{\"_delegate\":\"The address of the delegate to be set.\"}},\"setEnforcedOptions((uint32,uint16,bytes)[])\":{\"details\":\"Sets the enforced options for specific endpoint and message type combinations.Only the owner/admin of the OApp can call this function.Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.These enforced options can vary as the potential options/execution on the remote may differ as per the msgType. eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().\",\"params\":{\"_enforcedOptions\":\"An array of EnforcedOptionParam structures specifying enforced options.\"}},\"setMsgInspector(address)\":{\"details\":\"Sets the message inspector address for the OFT.This is an optional contract that can be used to inspect both 'message' and 'options'.Set it to address(0) to disable it, or set it to a contract address to enable it.\",\"params\":{\"_msgInspector\":\"The address of the message inspector.\"}},\"setPeer(uint32,bytes32)\":{\"details\":\"Only the owner/admin of the OApp can call this function.Indicates that the peer is trusted to send LayerZero messages to this OApp.Set this to bytes32(0) to remove the peer address.Peer is a bytes32 to accommodate non-evm chains.\",\"params\":{\"_eid\":\"The endpoint ID.\",\"_peer\":\"The address of the peer to be associated with the corresponding endpoint.\"}},\"setPreCrime(address)\":{\"details\":\"Sets the preCrime contract address.\",\"params\":{\"_preCrime\":\"The address of the preCrime contract.\"}},\"setSuperOperator(address,bool)\":{\"params\":{\"enabled\":\"set whether the superOperator is enabled or disabled.\",\"superOperator\":\"address that will be given/removed superOperator right.\"}},\"setTrustedForwarder(address)\":{\"params\":{\"trustedForwarder\":\"The new trustedForwarder.\"}},\"sharedDecimals()\":{\"details\":\"Retrieves the shared decimals of the OFT.Sets an implicit cap on the amount of tokens, over uint64.max() will need some sort of outbound cap / totalSupply cap Lowest common decimal denominator between chains. Defaults to 6 decimal places to provide up to 18,446,744,073,709.551615 units (max uint64). For tokens exceeding this totalSupply(), they will need to override the sharedDecimals function with something smaller. ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615\",\"returns\":{\"_0\":\"The shared decimals of the OFT.\"}},\"symbol()\":{\"returns\":{\"_0\":\"The symbol of the token collection.\"}},\"token()\":{\"details\":\"Retrieves the address of the underlying ERC20 implementation.In the case of OFT, address(this) and erc20 are the same contract.\",\"returns\":{\"_0\":\"The address of the OFT token.\"}},\"totalSupply()\":{\"returns\":{\"_0\":\"The total number of tokens in existence.\"}},\"transfer(address,uint256)\":{\"params\":{\"amount\":\"The number of tokens being transfered.\",\"to\":\"The recipient address of the tokens being transfered.\"},\"returns\":{\"success\":\"Whether or not the transfer succeeded.\"}},\"transferFrom(address,address,uint256)\":{\"params\":{\"amount\":\"The number of tokens transfered.\",\"from\":\"The origin address of the tokens being transferred.\",\"to\":\"The recipient address of the tokensbeing transfered.\"},\"returns\":{\"success\":\"Whether or not the transfer succeeded.\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"OFTSand\",\"version\":1},\"userdoc\":{\"errors\":{\"CallFailed(string)\":[{\"notice\":\"Error for failed calls, containing the error message\"}],\"FirstParamNotSender()\":[{\"notice\":\"Error for mismatched first parameter and sender address\"}],\"InvalidAmount()\":[{\"notice\":\"Error for invalid amount\"}],\"InvalidOwnerOrSpender()\":[{\"notice\":\"Error for invalid owner or spender\"}],\"InvalidSender()\":[{\"notice\":\"Error for invalid sender\"}],\"NotAuthorized()\":[{\"notice\":\"Error for unauthorized access\"}],\"OnlyAdmin()\":[{\"notice\":\"Error for admin-only access\"}],\"Overflow()\":[{\"notice\":\"Error for overflow conditions\"}],\"SendFunctionDisabled()\":[{\"notice\":\"Custom error thrown when the send function is called while disabled\"}]},\"events\":{\"Enabled(bool)\":{\"notice\":\"Emitted when the enabled state changes\"}},\"kind\":\"user\",\"methods\":{\"addAllowanceIfNeeded(address,address,uint256)\":{\"notice\":\"Increase the allowance for the spender if needed\"},\"allowInitializePath((uint32,bytes32,uint64))\":{\"notice\":\"Checks if the path initialization is allowed based on the provided origin.\"},\"allowance(address,address)\":{\"notice\":\"Get the allowance of `spender` for `owner`'s tokens.\"},\"approvalRequired()\":{\"notice\":\"Indicates whether the OFT contract requires approval of the 'token()' to send.\"},\"approve(address,uint256)\":{\"notice\":\"Approve `spender` to transfer `amount` tokens.\"},\"approveAndCall(address,uint256,bytes)\":{\"notice\":\"Approve `target` to spend `amount` and call it with data.\"},\"approveFor(address,address,uint256)\":{\"notice\":\"Approve `spender` to transfer `amount` tokens from `owner`.\"},\"balanceOf(address)\":{\"notice\":\"Get the balance of `owner`.\"},\"burn(uint256)\":{\"notice\":\"Burn `amount` tokens.\"},\"burnFor(address,uint256)\":{\"notice\":\"Burn `amount` tokens from `owner`.\"},\"combineOptions(uint32,uint16,bytes)\":{\"notice\":\"Combines options for a given endpoint and message type.\"},\"decimals()\":{\"notice\":\"Get the number of decimals for the token collection.\"},\"endpoint()\":{\"notice\":\"Retrieves the LayerZero endpoint associated with the OApp.\"},\"getTrustedForwarder()\":{\"notice\":\"Get the current trusted forwarder\"},\"isComposeMsgSender((uint32,bytes32,uint64),bytes,address)\":{\"notice\":\"Indicates whether an address is an approved composeMsg sender to the Endpoint.\"},\"isSuperOperator(address)\":{\"notice\":\"check whether address `who` is given superOperator rights.\"},\"isTrustedForwarder(address)\":{\"notice\":\"Checks if an address is a trusted forwarder\"},\"name()\":{\"notice\":\"Get the name of the token collection.\"},\"nextNonce(uint32,bytes32)\":{\"notice\":\"Retrieves the next nonce for a given source endpoint and sender address.\"},\"oAppVersion()\":{\"notice\":\"Retrieves the OApp version information.\"},\"oftVersion()\":{\"notice\":\"Retrieves interfaceID and the version of the OFT.\"},\"paidCall(address,uint256,bytes)\":{\"notice\":\"Temporarily approve `target` to spend `amount` and call it with data. Previous approvals remains unchanged.\"},\"peers(uint32)\":{\"notice\":\"Retrieves the peer (OApp) associated with a corresponding endpoint.\"},\"quoteOFT((uint32,bytes32,uint256,uint256,bytes,bytes,bytes))\":{\"notice\":\"Provides a quote for OFT-related operations.\"},\"quoteSend((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),bool)\":{\"notice\":\"Provides a quote for the send() operation.\"},\"setDelegate(address)\":{\"notice\":\"Sets the delegate address for the OApp.\"},\"setPeer(uint32,bytes32)\":{\"notice\":\"Sets the peer address (OApp instance) for a corresponding endpoint.\"},\"setSuperOperator(address,bool)\":{\"notice\":\"Enable or disable the ability of `superOperator` to transfer tokens of all (superOperator rights).\"},\"setTrustedForwarder(address)\":{\"notice\":\"Change the address of the trusted forwarder for meta-TX.\"},\"symbol()\":{\"notice\":\"Get the symbol for the token collection.\"},\"totalSupply()\":{\"notice\":\"Get the total number of tokens in existence.\"},\"transfer(address,uint256)\":{\"notice\":\"Transfer `amount` tokens to `to`.\"},\"transferFrom(address,address,uint256)\":{\"notice\":\"Transfer `amount` tokens from `from` to `to`.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol\":\"OFTSand\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":2000},\"remappings\":[]},\"sources\":{\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport { IOAppCore, ILayerZeroEndpointV2 } from \\\"./interfaces/IOAppCore.sol\\\";\\n\\n/**\\n * @title OAppCore\\n * @dev Abstract contract implementing the IOAppCore interface with basic OApp configurations.\\n */\\nabstract contract OAppCore is IOAppCore, Ownable {\\n // The LayerZero endpoint associated with the given OApp\\n ILayerZeroEndpointV2 public immutable endpoint;\\n\\n // Mapping to store peers associated with corresponding endpoints\\n mapping(uint32 eid => bytes32 peer) public peers;\\n\\n /**\\n * @dev Constructor to initialize the OAppCore with the provided endpoint and delegate.\\n * @param _endpoint The address of the LOCAL Layer Zero endpoint.\\n * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\\n *\\n * @dev The delegate typically should be set as the owner of the contract.\\n */\\n constructor(address _endpoint, address _delegate) {\\n endpoint = ILayerZeroEndpointV2(_endpoint);\\n\\n if (_delegate == address(0)) revert InvalidDelegate();\\n endpoint.setDelegate(_delegate);\\n }\\n\\n /**\\n * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\\n * @param _eid The endpoint ID.\\n * @param _peer The address of the peer to be associated with the corresponding endpoint.\\n *\\n * @dev Only the owner/admin of the OApp can call this function.\\n * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.\\n * @dev Set this to bytes32(0) to remove the peer address.\\n * @dev Peer is a bytes32 to accommodate non-evm chains.\\n */\\n function setPeer(uint32 _eid, bytes32 _peer) public virtual onlyOwner {\\n _setPeer(_eid, _peer);\\n }\\n\\n /**\\n * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\\n * @param _eid The endpoint ID.\\n * @param _peer The address of the peer to be associated with the corresponding endpoint.\\n *\\n * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.\\n * @dev Set this to bytes32(0) to remove the peer address.\\n * @dev Peer is a bytes32 to accommodate non-evm chains.\\n */\\n function _setPeer(uint32 _eid, bytes32 _peer) internal virtual {\\n peers[_eid] = _peer;\\n emit PeerSet(_eid, _peer);\\n }\\n\\n /**\\n * @notice Internal function to get the peer address associated with a specific endpoint; reverts if NOT set.\\n * ie. the peer is set to bytes32(0).\\n * @param _eid The endpoint ID.\\n * @return peer The address of the peer associated with the specified endpoint.\\n */\\n function _getPeerOrRevert(uint32 _eid) internal view virtual returns (bytes32) {\\n bytes32 peer = peers[_eid];\\n if (peer == bytes32(0)) revert NoPeer(_eid);\\n return peer;\\n }\\n\\n /**\\n * @notice Sets the delegate address for the OApp.\\n * @param _delegate The address of the delegate to be set.\\n *\\n * @dev Only the owner/admin of the OApp can call this function.\\n * @dev Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.\\n */\\n function setDelegate(address _delegate) public onlyOwner {\\n endpoint.setDelegate(_delegate);\\n }\\n}\\n\",\"keccak256\":\"0x13a9c2d1d2c1f086b8624f2e84c4a4702212daae36f701d92bb915b535cbe4cc\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { IOAppReceiver, Origin } from \\\"./interfaces/IOAppReceiver.sol\\\";\\nimport { OAppCore } from \\\"./OAppCore.sol\\\";\\n\\n/**\\n * @title OAppReceiver\\n * @dev Abstract contract implementing the ILayerZeroReceiver interface and extending OAppCore for OApp receivers.\\n */\\nabstract contract OAppReceiver is IOAppReceiver, OAppCore {\\n // Custom error message for when the caller is not the registered endpoint/\\n error OnlyEndpoint(address addr);\\n\\n // @dev The version of the OAppReceiver implementation.\\n // @dev Version is bumped when changes are made to this contract.\\n uint64 internal constant RECEIVER_VERSION = 2;\\n\\n /**\\n * @notice Retrieves the OApp version information.\\n * @return senderVersion The version of the OAppSender.sol contract.\\n * @return receiverVersion The version of the OAppReceiver.sol contract.\\n *\\n * @dev Providing 0 as the default for OAppSender version. Indicates that the OAppSender is not implemented.\\n * ie. this is a RECEIVE only OApp.\\n * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions.\\n */\\n function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\\n return (0, RECEIVER_VERSION);\\n }\\n\\n /**\\n * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint.\\n * @dev _origin The origin information containing the source endpoint and sender address.\\n * - srcEid: The source chain endpoint ID.\\n * - sender: The sender address on the src chain.\\n * - nonce: The nonce of the message.\\n * @dev _message The lzReceive payload.\\n * @param _sender The sender address.\\n * @return isSender Is a valid sender.\\n *\\n * @dev Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer.\\n * @dev The default sender IS the OAppReceiver implementer.\\n */\\n function isComposeMsgSender(\\n Origin calldata /*_origin*/,\\n bytes calldata /*_message*/,\\n address _sender\\n ) public view virtual returns (bool) {\\n return _sender == address(this);\\n }\\n\\n /**\\n * @notice Checks if the path initialization is allowed based on the provided origin.\\n * @param origin The origin information containing the source endpoint and sender address.\\n * @return Whether the path has been initialized.\\n *\\n * @dev This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received.\\n * @dev This defaults to assuming if a peer has been set, its initialized.\\n * Can be overridden by the OApp if there is other logic to determine this.\\n */\\n function allowInitializePath(Origin calldata origin) public view virtual returns (bool) {\\n return peers[origin.srcEid] == origin.sender;\\n }\\n\\n /**\\n * @notice Retrieves the next nonce for a given source endpoint and sender address.\\n * @dev _srcEid The source endpoint ID.\\n * @dev _sender The sender address.\\n * @return nonce The next nonce.\\n *\\n * @dev The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement.\\n * @dev Is required by the off-chain executor to determine the OApp expects msg execution is ordered.\\n * @dev This is also enforced by the OApp.\\n * @dev By default this is NOT enabled. ie. nextNonce is hardcoded to return 0.\\n */\\n function nextNonce(uint32 /*_srcEid*/, bytes32 /*_sender*/) public view virtual returns (uint64 nonce) {\\n return 0;\\n }\\n\\n /**\\n * @dev Entry point for receiving messages or packets from the endpoint.\\n * @param _origin The origin information containing the source endpoint and sender address.\\n * - srcEid: The source chain endpoint ID.\\n * - sender: The sender address on the src chain.\\n * - nonce: The nonce of the message.\\n * @param _guid The unique identifier for the received LayerZero message.\\n * @param _message The payload of the received message.\\n * @param _executor The address of the executor for the received message.\\n * @param _extraData Additional arbitrary data provided by the corresponding executor.\\n *\\n * @dev Entry point for receiving msg/packet from the LayerZero endpoint.\\n */\\n function lzReceive(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address _executor,\\n bytes calldata _extraData\\n ) public payable virtual {\\n // Ensures that only the endpoint can attempt to lzReceive() messages to this OApp.\\n if (address(endpoint) != msg.sender) revert OnlyEndpoint(msg.sender);\\n\\n // Ensure that the sender matches the expected peer for the source endpoint.\\n if (_getPeerOrRevert(_origin.srcEid) != _origin.sender) revert OnlyPeer(_origin.srcEid, _origin.sender);\\n\\n // Call the internal OApp implementation of lzReceive.\\n _lzReceive(_origin, _guid, _message, _executor, _extraData);\\n }\\n\\n /**\\n * @dev Internal function to implement lzReceive logic without needing to copy the basic parameter validation.\\n */\\n function _lzReceive(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address _executor,\\n bytes calldata _extraData\\n ) internal virtual;\\n}\\n\",\"keccak256\":\"0x0174e9f1ec4cefe4b5adc26c392269c699b9ff75965364e5b7264426a462c70b\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppSender.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { SafeERC20, IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport { MessagingParams, MessagingFee, MessagingReceipt } from \\\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\\\";\\nimport { OAppCore } from \\\"./OAppCore.sol\\\";\\n\\n/**\\n * @title OAppSender\\n * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.\\n */\\nabstract contract OAppSender is OAppCore {\\n using SafeERC20 for IERC20;\\n\\n // Custom error messages\\n error NotEnoughNative(uint256 msgValue);\\n error LzTokenUnavailable();\\n\\n // @dev The version of the OAppSender implementation.\\n // @dev Version is bumped when changes are made to this contract.\\n uint64 internal constant SENDER_VERSION = 1;\\n\\n /**\\n * @notice Retrieves the OApp version information.\\n * @return senderVersion The version of the OAppSender.sol contract.\\n * @return receiverVersion The version of the OAppReceiver.sol contract.\\n *\\n * @dev Providing 0 as the default for OAppReceiver version. Indicates that the OAppReceiver is not implemented.\\n * ie. this is a SEND only OApp.\\n * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions\\n */\\n function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\\n return (SENDER_VERSION, 0);\\n }\\n\\n /**\\n * @dev Internal function to interact with the LayerZero EndpointV2.quote() for fee calculation.\\n * @param _dstEid The destination endpoint ID.\\n * @param _message The message payload.\\n * @param _options Additional options for the message.\\n * @param _payInLzToken Flag indicating whether to pay the fee in LZ tokens.\\n * @return fee The calculated MessagingFee for the message.\\n * - nativeFee: The native fee for the message.\\n * - lzTokenFee: The LZ token fee for the message.\\n */\\n function _quote(\\n uint32 _dstEid,\\n bytes memory _message,\\n bytes memory _options,\\n bool _payInLzToken\\n ) internal view virtual returns (MessagingFee memory fee) {\\n return\\n endpoint.quote(\\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken),\\n address(this)\\n );\\n }\\n\\n /**\\n * @dev Internal function to interact with the LayerZero EndpointV2.send() for sending a message.\\n * @param _dstEid The destination endpoint ID.\\n * @param _message The message payload.\\n * @param _options Additional options for the message.\\n * @param _fee The calculated LayerZero fee for the message.\\n * - nativeFee: The native fee.\\n * - lzTokenFee: The lzToken fee.\\n * @param _refundAddress The address to receive any excess fee values sent to the endpoint.\\n * @return receipt The receipt for the sent message.\\n * - guid: The unique identifier for the sent message.\\n * - nonce: The nonce of the sent message.\\n * - fee: The LayerZero fee incurred for the message.\\n */\\n function _lzSend(\\n uint32 _dstEid,\\n bytes memory _message,\\n bytes memory _options,\\n MessagingFee memory _fee,\\n address _refundAddress\\n ) internal virtual returns (MessagingReceipt memory receipt) {\\n // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint.\\n uint256 messageValue = _payNative(_fee.nativeFee);\\n if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);\\n\\n return\\n // solhint-disable-next-line check-send-result\\n endpoint.send{ value: messageValue }(\\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0),\\n _refundAddress\\n );\\n }\\n\\n /**\\n * @dev Internal function to pay the native fee associated with the message.\\n * @param _nativeFee The native fee to be paid.\\n * @return nativeFee The amount of native currency paid.\\n *\\n * @dev If the OApp needs to initiate MULTIPLE LayerZero messages in a single transaction,\\n * this will need to be overridden because msg.value would contain multiple lzFees.\\n * @dev Should be overridden in the event the LayerZero endpoint requires a different native currency.\\n * @dev Some EVMs use an ERC20 as a method for paying transactions/gasFees.\\n * @dev The endpoint is EITHER/OR, ie. it will NOT support both types of native payment at a time.\\n */\\n function _payNative(uint256 _nativeFee) internal virtual returns (uint256 nativeFee) {\\n if (msg.value != _nativeFee) revert NotEnoughNative(msg.value);\\n return _nativeFee;\\n }\\n\\n /**\\n * @dev Internal function to pay the LZ token fee associated with the message.\\n * @param _lzTokenFee The LZ token fee to be paid.\\n *\\n * @dev If the caller is trying to pay in the specified lzToken, then the lzTokenFee is passed to the endpoint.\\n * @dev Any excess sent, is passed back to the specified _refundAddress in the _lzSend().\\n */\\n function _payLzToken(uint256 _lzTokenFee) internal virtual {\\n // @dev Cannot cache the token because it is not immutable in the endpoint.\\n address lzToken = endpoint.lzToken();\\n if (lzToken == address(0)) revert LzTokenUnavailable();\\n\\n // Pay LZ token fee by sending tokens to the endpoint.\\n IERC20(lzToken).safeTransferFrom(msg.sender, address(endpoint), _lzTokenFee);\\n }\\n}\\n\",\"keccak256\":\"0x518cf4adca601923ed4baa6619846a253ea32b8d8775f8bc1faa3dfac7f67c20\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { ILayerZeroEndpointV2 } from \\\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\\\";\\n\\n/**\\n * @title IOAppCore\\n */\\ninterface IOAppCore {\\n // Custom error messages\\n error OnlyPeer(uint32 eid, bytes32 sender);\\n error NoPeer(uint32 eid);\\n error InvalidEndpointCall();\\n error InvalidDelegate();\\n\\n // Event emitted when a peer (OApp) is set for a corresponding endpoint\\n event PeerSet(uint32 eid, bytes32 peer);\\n\\n /**\\n * @notice Retrieves the OApp version information.\\n * @return senderVersion The version of the OAppSender.sol contract.\\n * @return receiverVersion The version of the OAppReceiver.sol contract.\\n */\\n function oAppVersion() external view returns (uint64 senderVersion, uint64 receiverVersion);\\n\\n /**\\n * @notice Retrieves the LayerZero endpoint associated with the OApp.\\n * @return iEndpoint The LayerZero endpoint as an interface.\\n */\\n function endpoint() external view returns (ILayerZeroEndpointV2 iEndpoint);\\n\\n /**\\n * @notice Retrieves the peer (OApp) associated with a corresponding endpoint.\\n * @param _eid The endpoint ID.\\n * @return peer The peer address (OApp instance) associated with the corresponding endpoint.\\n */\\n function peers(uint32 _eid) external view returns (bytes32 peer);\\n\\n /**\\n * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\\n * @param _eid The endpoint ID.\\n * @param _peer The address of the peer to be associated with the corresponding endpoint.\\n */\\n function setPeer(uint32 _eid, bytes32 _peer) external;\\n\\n /**\\n * @notice Sets the delegate address for the OApp Core.\\n * @param _delegate The address of the delegate to be set.\\n */\\n function setDelegate(address _delegate) external;\\n}\\n\",\"keccak256\":\"0x40e49f2de74506e1da5dcaed53a39853f691647f4ceb0fccc8f49a68d3f47c58\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppMsgInspector.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title IOAppMsgInspector\\n * @dev Interface for the OApp Message Inspector, allowing examination of message and options contents.\\n */\\ninterface IOAppMsgInspector {\\n // Custom error message for inspection failure\\n error InspectionFailed(bytes message, bytes options);\\n\\n /**\\n * @notice Allows the inspector to examine LayerZero message contents and optionally throw a revert if invalid.\\n * @param _message The message payload to be inspected.\\n * @param _options Additional options or parameters for inspection.\\n * @return valid A boolean indicating whether the inspection passed (true) or failed (false).\\n *\\n * @dev Optionally done as a revert, OR use the boolean provided to handle the failure.\\n */\\n function inspect(bytes calldata _message, bytes calldata _options) external view returns (bool valid);\\n}\\n\",\"keccak256\":\"0x339654e699043c400cad92de209aa23855ce10211c31cf4114042cc5224d3b7c\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppOptionsType3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Struct representing enforced option parameters.\\n */\\nstruct EnforcedOptionParam {\\n uint32 eid; // Endpoint ID\\n uint16 msgType; // Message Type\\n bytes options; // Additional options\\n}\\n\\n/**\\n * @title IOAppOptionsType3\\n * @dev Interface for the OApp with Type 3 Options, allowing the setting and combining of enforced options.\\n */\\ninterface IOAppOptionsType3 {\\n // Custom error message for invalid options\\n error InvalidOptions(bytes options);\\n\\n // Event emitted when enforced options are set\\n event EnforcedOptionSet(EnforcedOptionParam[] _enforcedOptions);\\n\\n /**\\n * @notice Sets enforced options for specific endpoint and message type combinations.\\n * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\\n */\\n function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) external;\\n\\n /**\\n * @notice Combines options for a given endpoint and message type.\\n * @param _eid The endpoint ID.\\n * @param _msgType The OApp message type.\\n * @param _extraOptions Additional options passed by the caller.\\n * @return options The combination of caller specified options AND enforced options.\\n */\\n function combineOptions(\\n uint32 _eid,\\n uint16 _msgType,\\n bytes calldata _extraOptions\\n ) external view returns (bytes memory options);\\n}\\n\",\"keccak256\":\"0x9fc08a51e9d7c9c710c4eb26f84fe77228305ad7da63fa486ff24ebf2f3bc461\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.20;\\n\\nimport { ILayerZeroReceiver, Origin } from \\\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol\\\";\\n\\ninterface IOAppReceiver is ILayerZeroReceiver {\\n /**\\n * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint.\\n * @param _origin The origin information containing the source endpoint and sender address.\\n * - srcEid: The source chain endpoint ID.\\n * - sender: The sender address on the src chain.\\n * - nonce: The nonce of the message.\\n * @param _message The lzReceive payload.\\n * @param _sender The sender address.\\n * @return isSender Is a valid sender.\\n *\\n * @dev Applications can optionally choose to implement a separate composeMsg sender that is NOT the bridging layer.\\n * @dev The default sender IS the OAppReceiver implementer.\\n */\\n function isComposeMsgSender(\\n Origin calldata _origin,\\n bytes calldata _message,\\n address _sender\\n ) external view returns (bool isSender);\\n}\\n\",\"keccak256\":\"0xd26135185e19b3732746d4a9e2923e896f28dec8664bab161faea2ee26fcdc3d\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OAppOptionsType3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport { IOAppOptionsType3, EnforcedOptionParam } from \\\"../interfaces/IOAppOptionsType3.sol\\\";\\n\\n/**\\n * @title OAppOptionsType3\\n * @dev Abstract contract implementing the IOAppOptionsType3 interface with type 3 options.\\n */\\nabstract contract OAppOptionsType3 is IOAppOptionsType3, Ownable {\\n uint16 internal constant OPTION_TYPE_3 = 3;\\n\\n // @dev The \\\"msgType\\\" should be defined in the child contract.\\n mapping(uint32 eid => mapping(uint16 msgType => bytes enforcedOption)) public enforcedOptions;\\n\\n /**\\n * @dev Sets the enforced options for specific endpoint and message type combinations.\\n * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\\n *\\n * @dev Only the owner/admin of the OApp can call this function.\\n * @dev Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.\\n * @dev These enforced options can vary as the potential options/execution on the remote may differ as per the msgType.\\n * eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay\\n * if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().\\n */\\n function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) public virtual onlyOwner {\\n _setEnforcedOptions(_enforcedOptions);\\n }\\n\\n /**\\n * @dev Sets the enforced options for specific endpoint and message type combinations.\\n * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\\n *\\n * @dev Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.\\n * @dev These enforced options can vary as the potential options/execution on the remote may differ as per the msgType.\\n * eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay\\n * if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().\\n */\\n function _setEnforcedOptions(EnforcedOptionParam[] memory _enforcedOptions) internal virtual {\\n for (uint256 i = 0; i < _enforcedOptions.length; i++) {\\n // @dev Enforced options are only available for optionType 3, as type 1 and 2 dont support combining.\\n _assertOptionsType3(_enforcedOptions[i].options);\\n enforcedOptions[_enforcedOptions[i].eid][_enforcedOptions[i].msgType] = _enforcedOptions[i].options;\\n }\\n\\n emit EnforcedOptionSet(_enforcedOptions);\\n }\\n\\n /**\\n * @notice Combines options for a given endpoint and message type.\\n * @param _eid The endpoint ID.\\n * @param _msgType The OAPP message type.\\n * @param _extraOptions Additional options passed by the caller.\\n * @return options The combination of caller specified options AND enforced options.\\n *\\n * @dev If there is an enforced lzReceive option:\\n * - {gasLimit: 200k, msg.value: 1 ether} AND a caller supplies a lzReceive option: {gasLimit: 100k, msg.value: 0.5 ether}\\n * - The resulting options will be {gasLimit: 300k, msg.value: 1.5 ether} when the message is executed on the remote lzReceive() function.\\n * @dev This presence of duplicated options is handled off-chain in the verifier/executor.\\n */\\n function combineOptions(\\n uint32 _eid,\\n uint16 _msgType,\\n bytes calldata _extraOptions\\n ) public view virtual returns (bytes memory) {\\n bytes memory enforced = enforcedOptions[_eid][_msgType];\\n\\n // No enforced options, pass whatever the caller supplied, even if it's empty or legacy type 1/2 options.\\n if (enforced.length == 0) return _extraOptions;\\n\\n // No caller options, return enforced\\n if (_extraOptions.length == 0) return enforced;\\n\\n // @dev If caller provided _extraOptions, must be type 3 as its the ONLY type that can be combined.\\n if (_extraOptions.length >= 2) {\\n _assertOptionsType3(_extraOptions);\\n // @dev Remove the first 2 bytes containing the type from the _extraOptions and combine with enforced.\\n return bytes.concat(enforced, _extraOptions[2:]);\\n }\\n\\n // No valid set of options was found.\\n revert InvalidOptions(_extraOptions);\\n }\\n\\n /**\\n * @dev Internal function to assert that options are of type 3.\\n * @param _options The options to be checked.\\n */\\n function _assertOptionsType3(bytes memory _options) internal pure virtual {\\n uint16 optionsType;\\n assembly {\\n optionsType := mload(add(_options, 2))\\n }\\n if (optionsType != OPTION_TYPE_3) revert InvalidOptions(_options);\\n }\\n}\\n\",\"keccak256\":\"0x5275636cd47e660a2fdf6c7fe9d41ff3cc866b785cc8a9d88c1b8ca983509f01\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { MessagingReceipt, MessagingFee } from \\\"../../oapp/OAppSender.sol\\\";\\n\\n/**\\n * @dev Struct representing token parameters for the OFT send() operation.\\n */\\nstruct SendParam {\\n uint32 dstEid; // Destination endpoint ID.\\n bytes32 to; // Recipient address.\\n uint256 amountLD; // Amount to send in local decimals.\\n uint256 minAmountLD; // Minimum amount to send in local decimals.\\n bytes extraOptions; // Additional options supplied by the caller to be used in the LayerZero message.\\n bytes composeMsg; // The composed message for the send() operation.\\n bytes oftCmd; // The OFT command to be executed, unused in default OFT implementations.\\n}\\n\\n/**\\n * @dev Struct representing OFT limit information.\\n * @dev These amounts can change dynamically and are up the the specific oft implementation.\\n */\\nstruct OFTLimit {\\n uint256 minAmountLD; // Minimum amount in local decimals that can be sent to the recipient.\\n uint256 maxAmountLD; // Maximum amount in local decimals that can be sent to the recipient.\\n}\\n\\n/**\\n * @dev Struct representing OFT receipt information.\\n */\\nstruct OFTReceipt {\\n uint256 amountSentLD; // Amount of tokens ACTUALLY debited from the sender in local decimals.\\n // @dev In non-default implementations, the amountReceivedLD COULD differ from this value.\\n uint256 amountReceivedLD; // Amount of tokens to be received on the remote side.\\n}\\n\\n/**\\n * @dev Struct representing OFT fee details.\\n * @dev Future proof mechanism to provide a standardized way to communicate fees to things like a UI.\\n */\\nstruct OFTFeeDetail {\\n int256 feeAmountLD; // Amount of the fee in local decimals.\\n string description; // Description of the fee.\\n}\\n\\n/**\\n * @title IOFT\\n * @dev Interface for the OftChain (OFT) token.\\n * @dev Does not inherit ERC20 to accommodate usage by OFTAdapter as well.\\n * @dev This specific interface ID is '0x02e49c2c'.\\n */\\ninterface IOFT {\\n // Custom error messages\\n error InvalidLocalDecimals();\\n error SlippageExceeded(uint256 amountLD, uint256 minAmountLD);\\n\\n // Events\\n event OFTSent(\\n bytes32 indexed guid, // GUID of the OFT message.\\n uint32 dstEid, // Destination Endpoint ID.\\n address indexed fromAddress, // Address of the sender on the src chain.\\n uint256 amountSentLD, // Amount of tokens sent in local decimals.\\n uint256 amountReceivedLD // Amount of tokens received in local decimals.\\n );\\n event OFTReceived(\\n bytes32 indexed guid, // GUID of the OFT message.\\n uint32 srcEid, // Source Endpoint ID.\\n address indexed toAddress, // Address of the recipient on the dst chain.\\n uint256 amountReceivedLD // Amount of tokens received in local decimals.\\n );\\n\\n /**\\n * @notice Retrieves interfaceID and the version of the OFT.\\n * @return interfaceId The interface ID.\\n * @return version The version.\\n *\\n * @dev interfaceId: This specific interface ID is '0x02e49c2c'.\\n * @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.\\n * @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.\\n * ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\\n */\\n function oftVersion() external view returns (bytes4 interfaceId, uint64 version);\\n\\n /**\\n * @notice Retrieves the address of the token associated with the OFT.\\n * @return token The address of the ERC20 token implementation.\\n */\\n function token() external view returns (address);\\n\\n /**\\n * @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\\n * @return requiresApproval Needs approval of the underlying token implementation.\\n *\\n * @dev Allows things like wallet implementers to determine integration requirements,\\n * without understanding the underlying token implementation.\\n */\\n function approvalRequired() external view returns (bool);\\n\\n /**\\n * @notice Retrieves the shared decimals of the OFT.\\n * @return sharedDecimals The shared decimals of the OFT.\\n */\\n function sharedDecimals() external view returns (uint8);\\n\\n /**\\n * @notice Provides a quote for OFT-related operations.\\n * @param _sendParam The parameters for the send operation.\\n * @return limit The OFT limit information.\\n * @return oftFeeDetails The details of OFT fees.\\n * @return receipt The OFT receipt information.\\n */\\n function quoteOFT(\\n SendParam calldata _sendParam\\n ) external view returns (OFTLimit memory, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory);\\n\\n /**\\n * @notice Provides a quote for the send() operation.\\n * @param _sendParam The parameters for the send() operation.\\n * @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.\\n * @return fee The calculated LayerZero messaging fee from the send() operation.\\n *\\n * @dev MessagingFee: LayerZero msg fee\\n * - nativeFee: The native fee.\\n * - lzTokenFee: The lzToken fee.\\n */\\n function quoteSend(SendParam calldata _sendParam, bool _payInLzToken) external view returns (MessagingFee memory);\\n\\n /**\\n * @notice Executes the send() operation.\\n * @param _sendParam The parameters for the send operation.\\n * @param _fee The fee information supplied by the caller.\\n * - nativeFee: The native fee.\\n * - lzTokenFee: The lzToken fee.\\n * @param _refundAddress The address to receive any excess funds from fees etc. on the src.\\n * @return receipt The LayerZero messaging receipt from the send() operation.\\n * @return oftReceipt The OFT receipt information.\\n *\\n * @dev MessagingReceipt: LayerZero msg receipt\\n * - guid: The unique identifier for the sent message.\\n * - nonce: The nonce of the sent message.\\n * - fee: The LayerZero fee incurred for the message.\\n */\\n function send(\\n SendParam calldata _sendParam,\\n MessagingFee calldata _fee,\\n address _refundAddress\\n ) external payable returns (MessagingReceipt memory, OFTReceipt memory);\\n}\\n\",\"keccak256\":\"0x42431bdbe135f7cfefd0be6cd345a6a1045124f6ea707a06756ef2322140eef5\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/libs/OFTComposeMsgCodec.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nlibrary OFTComposeMsgCodec {\\n // Offset constants for decoding composed messages\\n uint8 private constant NONCE_OFFSET = 8;\\n uint8 private constant SRC_EID_OFFSET = 12;\\n uint8 private constant AMOUNT_LD_OFFSET = 44;\\n uint8 private constant COMPOSE_FROM_OFFSET = 76;\\n\\n /**\\n * @dev Encodes a OFT composed message.\\n * @param _nonce The nonce value.\\n * @param _srcEid The source endpoint ID.\\n * @param _amountLD The amount in local decimals.\\n * @param _composeMsg The composed message.\\n * @return _msg The encoded Composed message.\\n */\\n function encode(\\n uint64 _nonce,\\n uint32 _srcEid,\\n uint256 _amountLD,\\n bytes memory _composeMsg // 0x[composeFrom][composeMsg]\\n ) internal pure returns (bytes memory _msg) {\\n _msg = abi.encodePacked(_nonce, _srcEid, _amountLD, _composeMsg);\\n }\\n\\n /**\\n * @dev Retrieves the nonce from the composed message.\\n * @param _msg The message.\\n * @return The nonce value.\\n */\\n function nonce(bytes calldata _msg) internal pure returns (uint64) {\\n return uint64(bytes8(_msg[:NONCE_OFFSET]));\\n }\\n\\n /**\\n * @dev Retrieves the source endpoint ID from the composed message.\\n * @param _msg The message.\\n * @return The source endpoint ID.\\n */\\n function srcEid(bytes calldata _msg) internal pure returns (uint32) {\\n return uint32(bytes4(_msg[NONCE_OFFSET:SRC_EID_OFFSET]));\\n }\\n\\n /**\\n * @dev Retrieves the amount in local decimals from the composed message.\\n * @param _msg The message.\\n * @return The amount in local decimals.\\n */\\n function amountLD(bytes calldata _msg) internal pure returns (uint256) {\\n return uint256(bytes32(_msg[SRC_EID_OFFSET:AMOUNT_LD_OFFSET]));\\n }\\n\\n /**\\n * @dev Retrieves the composeFrom value from the composed message.\\n * @param _msg The message.\\n * @return The composeFrom value.\\n */\\n function composeFrom(bytes calldata _msg) internal pure returns (bytes32) {\\n return bytes32(_msg[AMOUNT_LD_OFFSET:COMPOSE_FROM_OFFSET]);\\n }\\n\\n /**\\n * @dev Retrieves the composed message.\\n * @param _msg The message.\\n * @return The composed message.\\n */\\n function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\\n return _msg[COMPOSE_FROM_OFFSET:];\\n }\\n\\n /**\\n * @dev Converts an address to bytes32.\\n * @param _addr The address to convert.\\n * @return The bytes32 representation of the address.\\n */\\n function addressToBytes32(address _addr) internal pure returns (bytes32) {\\n return bytes32(uint256(uint160(_addr)));\\n }\\n\\n /**\\n * @dev Converts bytes32 to an address.\\n * @param _b The bytes32 value to convert.\\n * @return The address representation of bytes32.\\n */\\n function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\\n return address(uint160(uint256(_b)));\\n }\\n}\\n\",\"keccak256\":\"0xfbdaf41743232e6ff64cd00b495ee854d0225e2bb73a66fe9b413d2780359902\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/OAppPreCrimeSimulator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport { IPreCrime } from \\\"./interfaces/IPreCrime.sol\\\";\\nimport { IOAppPreCrimeSimulator, InboundPacket, Origin } from \\\"./interfaces/IOAppPreCrimeSimulator.sol\\\";\\n\\n/**\\n * @title OAppPreCrimeSimulator\\n * @dev Abstract contract serving as the base for preCrime simulation functionality in an OApp.\\n */\\nabstract contract OAppPreCrimeSimulator is IOAppPreCrimeSimulator, Ownable {\\n // The address of the preCrime implementation.\\n address public preCrime;\\n\\n /**\\n * @dev Retrieves the address of the OApp contract.\\n * @return The address of the OApp contract.\\n *\\n * @dev The simulator contract is the base contract for the OApp by default.\\n * @dev If the simulator is a separate contract, override this function.\\n */\\n function oApp() external view virtual returns (address) {\\n return address(this);\\n }\\n\\n /**\\n * @dev Sets the preCrime contract address.\\n * @param _preCrime The address of the preCrime contract.\\n */\\n function setPreCrime(address _preCrime) public virtual onlyOwner {\\n preCrime = _preCrime;\\n emit PreCrimeSet(_preCrime);\\n }\\n\\n /**\\n * @dev Interface for pre-crime simulations. Always reverts at the end with the simulation results.\\n * @param _packets An array of InboundPacket objects representing received packets to be delivered.\\n *\\n * @dev WARNING: MUST revert at the end with the simulation results.\\n * @dev Gives the preCrime implementation the ability to mock sending packets to the lzReceive function,\\n * WITHOUT actually executing them.\\n */\\n function lzReceiveAndRevert(InboundPacket[] calldata _packets) public payable virtual {\\n for (uint256 i = 0; i < _packets.length; i++) {\\n InboundPacket calldata packet = _packets[i];\\n\\n // Ignore packets that are not from trusted peers.\\n if (!isPeer(packet.origin.srcEid, packet.origin.sender)) continue;\\n\\n // @dev Because a verifier is calling this function, it doesnt have access to executor params:\\n // - address _executor\\n // - bytes calldata _extraData\\n // preCrime will NOT work for OApps that rely on these two parameters inside of their _lzReceive().\\n // They are instead stubbed to default values, address(0) and bytes(\\\"\\\")\\n // @dev Calling this.lzReceiveSimulate removes ability for assembly return 0 callstack exit,\\n // which would cause the revert to be ignored.\\n this.lzReceiveSimulate{ value: packet.value }(\\n packet.origin,\\n packet.guid,\\n packet.message,\\n packet.executor,\\n packet.extraData\\n );\\n }\\n\\n // @dev Revert with the simulation results. msg.sender must implement IPreCrime.buildSimulationResult().\\n revert SimulationResult(IPreCrime(msg.sender).buildSimulationResult());\\n }\\n\\n /**\\n * @dev Is effectively an internal function because msg.sender must be address(this).\\n * Allows resetting the call stack for 'internal' calls.\\n * @param _origin The origin information containing the source endpoint and sender address.\\n * - srcEid: The source chain endpoint ID.\\n * - sender: The sender address on the src chain.\\n * - nonce: The nonce of the message.\\n * @param _guid The unique identifier of the packet.\\n * @param _message The message payload of the packet.\\n * @param _executor The executor address for the packet.\\n * @param _extraData Additional data for the packet.\\n */\\n function lzReceiveSimulate(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address _executor,\\n bytes calldata _extraData\\n ) external payable virtual {\\n // @dev Ensure ONLY can be called 'internally'.\\n if (msg.sender != address(this)) revert OnlySelf();\\n _lzReceiveSimulate(_origin, _guid, _message, _executor, _extraData);\\n }\\n\\n /**\\n * @dev Internal function to handle the OAppPreCrimeSimulator simulated receive.\\n * @param _origin The origin information.\\n * - srcEid: The source chain endpoint ID.\\n * - sender: The sender address from the src chain.\\n * - nonce: The nonce of the LayerZero message.\\n * @param _guid The GUID of the LayerZero message.\\n * @param _message The LayerZero message.\\n * @param _executor The address of the off-chain executor.\\n * @param _extraData Arbitrary data passed by the msg executor.\\n *\\n * @dev Enables the preCrime simulator to mock sending lzReceive() messages,\\n * routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver.\\n */\\n function _lzReceiveSimulate(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address _executor,\\n bytes calldata _extraData\\n ) internal virtual;\\n\\n /**\\n * @dev checks if the specified peer is considered 'trusted' by the OApp.\\n * @param _eid The endpoint Id to check.\\n * @param _peer The peer to check.\\n * @return Whether the peer passed is considered 'trusted' by the OApp.\\n */\\n function isPeer(uint32 _eid, bytes32 _peer) public view virtual returns (bool);\\n}\\n\",\"keccak256\":\"0x205a0abfd8b3c9af2740769f251381b84999b8e9347f3cd50de3ef8290a17750\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/interfaces/IOAppPreCrimeSimulator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\n// @dev Import the Origin so it's exposed to OAppPreCrimeSimulator implementers.\\n// solhint-disable-next-line no-unused-import\\nimport { InboundPacket, Origin } from \\\"../libs/Packet.sol\\\";\\n\\n/**\\n * @title IOAppPreCrimeSimulator Interface\\n * @dev Interface for the preCrime simulation functionality in an OApp.\\n */\\ninterface IOAppPreCrimeSimulator {\\n // @dev simulation result used in PreCrime implementation\\n error SimulationResult(bytes result);\\n error OnlySelf();\\n\\n /**\\n * @dev Emitted when the preCrime contract address is set.\\n * @param preCrimeAddress The address of the preCrime contract.\\n */\\n event PreCrimeSet(address preCrimeAddress);\\n\\n /**\\n * @dev Retrieves the address of the preCrime contract implementation.\\n * @return The address of the preCrime contract.\\n */\\n function preCrime() external view returns (address);\\n\\n /**\\n * @dev Retrieves the address of the OApp contract.\\n * @return The address of the OApp contract.\\n */\\n function oApp() external view returns (address);\\n\\n /**\\n * @dev Sets the preCrime contract address.\\n * @param _preCrime The address of the preCrime contract.\\n */\\n function setPreCrime(address _preCrime) external;\\n\\n /**\\n * @dev Mocks receiving a packet, then reverts with a series of data to infer the state/result.\\n * @param _packets An array of LayerZero InboundPacket objects representing received packets.\\n */\\n function lzReceiveAndRevert(InboundPacket[] calldata _packets) external payable;\\n\\n /**\\n * @dev checks if the specified peer is considered 'trusted' by the OApp.\\n * @param _eid The endpoint Id to check.\\n * @param _peer The peer to check.\\n * @return Whether the peer passed is considered 'trusted' by the OApp.\\n */\\n function isPeer(uint32 _eid, bytes32 _peer) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5d24db150949ea8e6437178e65a942e8c8b7f332e5daf32750f56b23b35b5bb2\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/interfaces/IPreCrime.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\nstruct PreCrimePeer {\\n uint32 eid;\\n bytes32 preCrime;\\n bytes32 oApp;\\n}\\n\\n// TODO not done yet\\ninterface IPreCrime {\\n error OnlyOffChain();\\n\\n // for simulate()\\n error PacketOversize(uint256 max, uint256 actual);\\n error PacketUnsorted();\\n error SimulationFailed(bytes reason);\\n\\n // for preCrime()\\n error SimulationResultNotFound(uint32 eid);\\n error InvalidSimulationResult(uint32 eid, bytes reason);\\n error CrimeFound(bytes crime);\\n\\n function getConfig(bytes[] calldata _packets, uint256[] calldata _packetMsgValues) external returns (bytes memory);\\n\\n function simulate(\\n bytes[] calldata _packets,\\n uint256[] calldata _packetMsgValues\\n ) external payable returns (bytes memory);\\n\\n function buildSimulationResult() external view returns (bytes memory);\\n\\n function preCrime(\\n bytes[] calldata _packets,\\n uint256[] calldata _packetMsgValues,\\n bytes[] calldata _simulations\\n ) external;\\n\\n function version() external view returns (uint64 major, uint8 minor);\\n}\\n\",\"keccak256\":\"0xc8d869f27ef8ceb2e13fdf6a70682fd4dee3f90c4924eb8e125bc1e66cb6af84\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/libs/Packet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { Origin } from \\\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\\\";\\nimport { PacketV1Codec } from \\\"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol\\\";\\n\\n/**\\n * @title InboundPacket\\n * @dev Structure representing an inbound packet received by the contract.\\n */\\nstruct InboundPacket {\\n Origin origin; // Origin information of the packet.\\n uint32 dstEid; // Destination endpointId of the packet.\\n address receiver; // Receiver address for the packet.\\n bytes32 guid; // Unique identifier of the packet.\\n uint256 value; // msg.value of the packet.\\n address executor; // Executor address for the packet.\\n bytes message; // Message payload of the packet.\\n bytes extraData; // Additional arbitrary data for the packet.\\n}\\n\\n/**\\n * @title PacketDecoder\\n * @dev Library for decoding LayerZero packets.\\n */\\nlibrary PacketDecoder {\\n using PacketV1Codec for bytes;\\n\\n /**\\n * @dev Decode an inbound packet from the given packet data.\\n * @param _packet The packet data to decode.\\n * @return packet An InboundPacket struct representing the decoded packet.\\n */\\n function decode(bytes calldata _packet) internal pure returns (InboundPacket memory packet) {\\n packet.origin = Origin(_packet.srcEid(), _packet.sender(), _packet.nonce());\\n packet.dstEid = _packet.dstEid();\\n packet.receiver = _packet.receiverB20();\\n packet.guid = _packet.guid();\\n packet.message = _packet.message();\\n }\\n\\n /**\\n * @dev Decode multiple inbound packets from the given packet data and associated message values.\\n * @param _packets An array of packet data to decode.\\n * @param _packetMsgValues An array of associated message values for each packet.\\n * @return packets An array of InboundPacket structs representing the decoded packets.\\n */\\n function decode(\\n bytes[] calldata _packets,\\n uint256[] memory _packetMsgValues\\n ) internal pure returns (InboundPacket[] memory packets) {\\n packets = new InboundPacket[](_packets.length);\\n for (uint256 i = 0; i < _packets.length; i++) {\\n bytes calldata packet = _packets[i];\\n packets[i] = PacketDecoder.decode(packet);\\n // @dev Allows the verifier to specify the msg.value that gets passed in lzReceive.\\n packets[i].value = _packetMsgValues[i];\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcb2fb1c5b2eb3731de78b479b9c2ab3bba326fe0b0b3a008590f18e881e457a6\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\nimport { IMessageLibManager } from \\\"./IMessageLibManager.sol\\\";\\nimport { IMessagingComposer } from \\\"./IMessagingComposer.sol\\\";\\nimport { IMessagingChannel } from \\\"./IMessagingChannel.sol\\\";\\nimport { IMessagingContext } from \\\"./IMessagingContext.sol\\\";\\n\\nstruct MessagingParams {\\n uint32 dstEid;\\n bytes32 receiver;\\n bytes message;\\n bytes options;\\n bool payInLzToken;\\n}\\n\\nstruct MessagingReceipt {\\n bytes32 guid;\\n uint64 nonce;\\n MessagingFee fee;\\n}\\n\\nstruct MessagingFee {\\n uint256 nativeFee;\\n uint256 lzTokenFee;\\n}\\n\\nstruct Origin {\\n uint32 srcEid;\\n bytes32 sender;\\n uint64 nonce;\\n}\\n\\ninterface ILayerZeroEndpointV2 is IMessageLibManager, IMessagingComposer, IMessagingChannel, IMessagingContext {\\n event PacketSent(bytes encodedPayload, bytes options, address sendLibrary);\\n\\n event PacketVerified(Origin origin, address receiver, bytes32 payloadHash);\\n\\n event PacketDelivered(Origin origin, address receiver);\\n\\n event LzReceiveAlert(\\n address indexed receiver,\\n address indexed executor,\\n Origin origin,\\n bytes32 guid,\\n uint256 gas,\\n uint256 value,\\n bytes message,\\n bytes extraData,\\n bytes reason\\n );\\n\\n event LzTokenSet(address token);\\n\\n event DelegateSet(address sender, address delegate);\\n\\n function quote(MessagingParams calldata _params, address _sender) external view returns (MessagingFee memory);\\n\\n function send(\\n MessagingParams calldata _params,\\n address _refundAddress\\n ) external payable returns (MessagingReceipt memory);\\n\\n function verify(Origin calldata _origin, address _receiver, bytes32 _payloadHash) external;\\n\\n function verifiable(Origin calldata _origin, address _receiver) external view returns (bool);\\n\\n function initializable(Origin calldata _origin, address _receiver) external view returns (bool);\\n\\n function lzReceive(\\n Origin calldata _origin,\\n address _receiver,\\n bytes32 _guid,\\n bytes calldata _message,\\n bytes calldata _extraData\\n ) external payable;\\n\\n // oapp can burn messages partially by calling this function with its own business logic if messages are verified in order\\n function clear(address _oapp, Origin calldata _origin, bytes32 _guid, bytes calldata _message) external;\\n\\n function setLzToken(address _lzToken) external;\\n\\n function lzToken() external view returns (address);\\n\\n function nativeToken() external view returns (address);\\n\\n function setDelegate(address _delegate) external;\\n}\\n\",\"keccak256\":\"0xf7f941bee89ea6369950fe54e8ac476ae6478b958b20fc0e8a83e8ff1364eac3\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\nimport { Origin } from \\\"./ILayerZeroEndpointV2.sol\\\";\\n\\ninterface ILayerZeroReceiver {\\n function allowInitializePath(Origin calldata _origin) external view returns (bool);\\n\\n function nextNonce(uint32 _eid, bytes32 _sender) external view returns (uint64);\\n\\n function lzReceive(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address _executor,\\n bytes calldata _extraData\\n ) external payable;\\n}\\n\",\"keccak256\":\"0x9641abba8d53b08bb517d1b74801dd15ea7b84d77a6719085bd96c8ea94e3ca0\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\n\\nimport { SetConfigParam } from \\\"./IMessageLibManager.sol\\\";\\n\\nenum MessageLibType {\\n Send,\\n Receive,\\n SendAndReceive\\n}\\n\\ninterface IMessageLib is IERC165 {\\n function setConfig(address _oapp, SetConfigParam[] calldata _config) external;\\n\\n function getConfig(uint32 _eid, address _oapp, uint32 _configType) external view returns (bytes memory config);\\n\\n function isSupportedEid(uint32 _eid) external view returns (bool);\\n\\n // message libs of same major version are compatible\\n function version() external view returns (uint64 major, uint8 minor, uint8 endpointVersion);\\n\\n function messageLibType() external view returns (MessageLibType);\\n}\\n\",\"keccak256\":\"0x5cf5f24751b4e3ea1c9c5ded07cedfdfd62566b6daaffcc0144733859c9dba0c\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\nstruct SetConfigParam {\\n uint32 eid;\\n uint32 configType;\\n bytes config;\\n}\\n\\ninterface IMessageLibManager {\\n struct Timeout {\\n address lib;\\n uint256 expiry;\\n }\\n\\n event LibraryRegistered(address newLib);\\n event DefaultSendLibrarySet(uint32 eid, address newLib);\\n event DefaultReceiveLibrarySet(uint32 eid, address newLib);\\n event DefaultReceiveLibraryTimeoutSet(uint32 eid, address oldLib, uint256 expiry);\\n event SendLibrarySet(address sender, uint32 eid, address newLib);\\n event ReceiveLibrarySet(address receiver, uint32 eid, address newLib);\\n event ReceiveLibraryTimeoutSet(address receiver, uint32 eid, address oldLib, uint256 timeout);\\n\\n function registerLibrary(address _lib) external;\\n\\n function isRegisteredLibrary(address _lib) external view returns (bool);\\n\\n function getRegisteredLibraries() external view returns (address[] memory);\\n\\n function setDefaultSendLibrary(uint32 _eid, address _newLib) external;\\n\\n function defaultSendLibrary(uint32 _eid) external view returns (address);\\n\\n function setDefaultReceiveLibrary(uint32 _eid, address _newLib, uint256 _gracePeriod) external;\\n\\n function defaultReceiveLibrary(uint32 _eid) external view returns (address);\\n\\n function setDefaultReceiveLibraryTimeout(uint32 _eid, address _lib, uint256 _expiry) external;\\n\\n function defaultReceiveLibraryTimeout(uint32 _eid) external view returns (address lib, uint256 expiry);\\n\\n function isSupportedEid(uint32 _eid) external view returns (bool);\\n\\n function isValidReceiveLibrary(address _receiver, uint32 _eid, address _lib) external view returns (bool);\\n\\n /// ------------------- OApp interfaces -------------------\\n function setSendLibrary(address _oapp, uint32 _eid, address _newLib) external;\\n\\n function getSendLibrary(address _sender, uint32 _eid) external view returns (address lib);\\n\\n function isDefaultSendLibrary(address _sender, uint32 _eid) external view returns (bool);\\n\\n function setReceiveLibrary(address _oapp, uint32 _eid, address _newLib, uint256 _gracePeriod) external;\\n\\n function getReceiveLibrary(address _receiver, uint32 _eid) external view returns (address lib, bool isDefault);\\n\\n function setReceiveLibraryTimeout(address _oapp, uint32 _eid, address _lib, uint256 _expiry) external;\\n\\n function receiveLibraryTimeout(address _receiver, uint32 _eid) external view returns (address lib, uint256 expiry);\\n\\n function setConfig(address _oapp, address _lib, SetConfigParam[] calldata _params) external;\\n\\n function getConfig(\\n address _oapp,\\n address _lib,\\n uint32 _eid,\\n uint32 _configType\\n ) external view returns (bytes memory config);\\n}\\n\",\"keccak256\":\"0x919b37133adff4dc528e3061deb2789c3149971b530c61e556fb3d09ab315dfc\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingChannel.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\ninterface IMessagingChannel {\\n event InboundNonceSkipped(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce);\\n event PacketNilified(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);\\n event PacketBurnt(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);\\n\\n function eid() external view returns (uint32);\\n\\n // this is an emergency function if a message cannot be verified for some reasons\\n // required to provide _nextNonce to avoid race condition\\n function skip(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce) external;\\n\\n function nilify(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;\\n\\n function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;\\n\\n function nextGuid(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (bytes32);\\n\\n function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);\\n\\n function outboundNonce(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (uint64);\\n\\n function inboundPayloadHash(\\n address _receiver,\\n uint32 _srcEid,\\n bytes32 _sender,\\n uint64 _nonce\\n ) external view returns (bytes32);\\n\\n function lazyInboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);\\n}\\n\",\"keccak256\":\"0x0878f64dffebf58c4165569416372f40860fab546b88cd926eba0d5cb6d8d972\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingComposer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\ninterface IMessagingComposer {\\n event ComposeSent(address from, address to, bytes32 guid, uint16 index, bytes message);\\n event ComposeDelivered(address from, address to, bytes32 guid, uint16 index);\\n event LzComposeAlert(\\n address indexed from,\\n address indexed to,\\n address indexed executor,\\n bytes32 guid,\\n uint16 index,\\n uint256 gas,\\n uint256 value,\\n bytes message,\\n bytes extraData,\\n bytes reason\\n );\\n\\n function composeQueue(\\n address _from,\\n address _to,\\n bytes32 _guid,\\n uint16 _index\\n ) external view returns (bytes32 messageHash);\\n\\n function sendCompose(address _to, bytes32 _guid, uint16 _index, bytes calldata _message) external;\\n\\n function lzCompose(\\n address _from,\\n address _to,\\n bytes32 _guid,\\n uint16 _index,\\n bytes calldata _message,\\n bytes calldata _extraData\\n ) external payable;\\n}\\n\",\"keccak256\":\"0x85bc7090134529ec474866dc4bb1c48692d518c756eb0a961c82574829c51901\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingContext.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\ninterface IMessagingContext {\\n function isSendingMessage() external view returns (bool);\\n\\n function getSendContext() external view returns (uint32 dstEid, address sender);\\n}\\n\",\"keccak256\":\"0xff0c546c2813dae3e440882f46b377375f7461b0714efd80bd3f0c6e5cb8da4e\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\nimport { MessagingFee } from \\\"./ILayerZeroEndpointV2.sol\\\";\\nimport { IMessageLib } from \\\"./IMessageLib.sol\\\";\\n\\nstruct Packet {\\n uint64 nonce;\\n uint32 srcEid;\\n address sender;\\n uint32 dstEid;\\n bytes32 receiver;\\n bytes32 guid;\\n bytes message;\\n}\\n\\ninterface ISendLib is IMessageLib {\\n function send(\\n Packet calldata _packet,\\n bytes calldata _options,\\n bool _payInLzToken\\n ) external returns (MessagingFee memory, bytes memory encodedPacket);\\n\\n function quote(\\n Packet calldata _packet,\\n bytes calldata _options,\\n bool _payInLzToken\\n ) external view returns (MessagingFee memory);\\n\\n function setTreasury(address _treasury) external;\\n\\n function withdrawFee(address _to, uint256 _amount) external;\\n\\n function withdrawLzTokenFee(address _lzToken, address _to, uint256 _amount) external;\\n}\\n\",\"keccak256\":\"0xf1c07bc61e7b1dce195ed12d50f87980fbf2d63cac1326fd28287f55fe0ba625\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/AddressCast.sol\":{\"content\":\"// SPDX-License-Identifier: LZBL-1.2\\n\\npragma solidity ^0.8.20;\\n\\nlibrary AddressCast {\\n error AddressCast_InvalidSizeForAddress();\\n error AddressCast_InvalidAddress();\\n\\n function toBytes32(bytes calldata _addressBytes) internal pure returns (bytes32 result) {\\n if (_addressBytes.length > 32) revert AddressCast_InvalidAddress();\\n result = bytes32(_addressBytes);\\n unchecked {\\n uint256 offset = 32 - _addressBytes.length;\\n result = result >> (offset * 8);\\n }\\n }\\n\\n function toBytes32(address _address) internal pure returns (bytes32 result) {\\n result = bytes32(uint256(uint160(_address)));\\n }\\n\\n function toBytes(bytes32 _addressBytes32, uint256 _size) internal pure returns (bytes memory result) {\\n if (_size == 0 || _size > 32) revert AddressCast_InvalidSizeForAddress();\\n result = new bytes(_size);\\n unchecked {\\n uint256 offset = 256 - _size * 8;\\n assembly {\\n mstore(add(result, 32), shl(offset, _addressBytes32))\\n }\\n }\\n }\\n\\n function toAddress(bytes32 _addressBytes32) internal pure returns (address result) {\\n result = address(uint160(uint256(_addressBytes32)));\\n }\\n\\n function toAddress(bytes calldata _addressBytes) internal pure returns (address result) {\\n if (_addressBytes.length != 20) revert AddressCast_InvalidAddress();\\n result = address(bytes20(_addressBytes));\\n }\\n}\\n\",\"keccak256\":\"0x2ebbcaaab3554edcd41b581f1a72ac1806afbfb8047d0d47ff098f9af30d6deb\",\"license\":\"LZBL-1.2\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol\":{\"content\":\"// SPDX-License-Identifier: LZBL-1.2\\n\\npragma solidity ^0.8.20;\\n\\nimport { Packet } from \\\"../../interfaces/ISendLib.sol\\\";\\nimport { AddressCast } from \\\"../../libs/AddressCast.sol\\\";\\n\\nlibrary PacketV1Codec {\\n using AddressCast for address;\\n using AddressCast for bytes32;\\n\\n uint8 internal constant PACKET_VERSION = 1;\\n\\n // header (version + nonce + path)\\n // version\\n uint256 private constant PACKET_VERSION_OFFSET = 0;\\n // nonce\\n uint256 private constant NONCE_OFFSET = 1;\\n // path\\n uint256 private constant SRC_EID_OFFSET = 9;\\n uint256 private constant SENDER_OFFSET = 13;\\n uint256 private constant DST_EID_OFFSET = 45;\\n uint256 private constant RECEIVER_OFFSET = 49;\\n // payload (guid + message)\\n uint256 private constant GUID_OFFSET = 81; // keccak256(nonce + path)\\n uint256 private constant MESSAGE_OFFSET = 113;\\n\\n function encode(Packet memory _packet) internal pure returns (bytes memory encodedPacket) {\\n encodedPacket = abi.encodePacked(\\n PACKET_VERSION,\\n _packet.nonce,\\n _packet.srcEid,\\n _packet.sender.toBytes32(),\\n _packet.dstEid,\\n _packet.receiver,\\n _packet.guid,\\n _packet.message\\n );\\n }\\n\\n function encodePacketHeader(Packet memory _packet) internal pure returns (bytes memory) {\\n return\\n abi.encodePacked(\\n PACKET_VERSION,\\n _packet.nonce,\\n _packet.srcEid,\\n _packet.sender.toBytes32(),\\n _packet.dstEid,\\n _packet.receiver\\n );\\n }\\n\\n function encodePayload(Packet memory _packet) internal pure returns (bytes memory) {\\n return abi.encodePacked(_packet.guid, _packet.message);\\n }\\n\\n function header(bytes calldata _packet) internal pure returns (bytes calldata) {\\n return _packet[0:GUID_OFFSET];\\n }\\n\\n function version(bytes calldata _packet) internal pure returns (uint8) {\\n return uint8(bytes1(_packet[PACKET_VERSION_OFFSET:NONCE_OFFSET]));\\n }\\n\\n function nonce(bytes calldata _packet) internal pure returns (uint64) {\\n return uint64(bytes8(_packet[NONCE_OFFSET:SRC_EID_OFFSET]));\\n }\\n\\n function srcEid(bytes calldata _packet) internal pure returns (uint32) {\\n return uint32(bytes4(_packet[SRC_EID_OFFSET:SENDER_OFFSET]));\\n }\\n\\n function sender(bytes calldata _packet) internal pure returns (bytes32) {\\n return bytes32(_packet[SENDER_OFFSET:DST_EID_OFFSET]);\\n }\\n\\n function senderAddressB20(bytes calldata _packet) internal pure returns (address) {\\n return sender(_packet).toAddress();\\n }\\n\\n function dstEid(bytes calldata _packet) internal pure returns (uint32) {\\n return uint32(bytes4(_packet[DST_EID_OFFSET:RECEIVER_OFFSET]));\\n }\\n\\n function receiver(bytes calldata _packet) internal pure returns (bytes32) {\\n return bytes32(_packet[RECEIVER_OFFSET:GUID_OFFSET]);\\n }\\n\\n function receiverB20(bytes calldata _packet) internal pure returns (address) {\\n return receiver(_packet).toAddress();\\n }\\n\\n function guid(bytes calldata _packet) internal pure returns (bytes32) {\\n return bytes32(_packet[GUID_OFFSET:MESSAGE_OFFSET]);\\n }\\n\\n function message(bytes calldata _packet) internal pure returns (bytes calldata) {\\n return bytes(_packet[MESSAGE_OFFSET:]);\\n }\\n\\n function payload(bytes calldata _packet) internal pure returns (bytes calldata) {\\n return bytes(_packet[GUID_OFFSET:]);\\n }\\n\\n function payloadHash(bytes calldata _packet) internal pure returns (bytes32) {\\n return keccak256(payload(_packet));\\n }\\n}\\n\",\"keccak256\":\"0xc84cf1bf785977fe1fbe7566eef902c2db68d0e163813ebe6c34921754802680\",\"license\":\"LZBL-1.2\"},\"@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/interfaces/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../token/ERC20/IERC20.sol\\\";\\n\",\"keccak256\":\"0xce41876e78d1badc0512229b4d14e4daf83bc1003d7f83978d18e0e56f965b9c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard ERC20 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 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 ERC721 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 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 EIP-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 ERC1155 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 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\":\"0x60c65f701957fdd6faea1acb0bb45825791d473693ed9ecb34726fdfaa849dd7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xc6a8ff0ea489379b61faa647490411b80102578440ab9d84e9a957cc12164e70\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * ==== Security Considerations\\n *\\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\\n * generally recommended is:\\n *\\n * ```solidity\\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\\n * doThing(..., value);\\n * }\\n *\\n * function doThing(..., uint256 value) public {\\n * token.safeTransferFrom(msg.sender, address(this), value);\\n * ...\\n * }\\n * ```\\n *\\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\\n * {SafeERC20-safeTransferFrom}).\\n *\\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\\n * contracts should have entry points that don't rely on permit.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n *\\n * CAUTION: See Security Considerations above.\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x6008dabfe393240d73d7dd7688033f72740d570aa422254d29a7dce8568f3aff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\nimport {IERC20Permit} from \\\"../extensions/IERC20Permit.sol\\\";\\nimport {Address} from \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n /**\\n * @dev An operation with an ERC20 token failed.\\n */\\n error SafeERC20FailedOperation(address token);\\n\\n /**\\n * @dev Indicates a failed `decreaseAllowance` request.\\n */\\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n forceApprove(token, spender, oldAllowance + value);\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\\n * value, non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\\n unchecked {\\n uint256 currentAllowance = token.allowance(address(this), spender);\\n if (currentAllowance < requestedDecrease) {\\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\\n }\\n forceApprove(token, spender, currentAllowance - requestedDecrease);\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data);\\n if (returndata.length != 0 && !abi.decode(returndata, (bool))) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;\\n }\\n}\\n\",\"keccak256\":\"0x37bb49513c49c87c4642a891b13b63571bc87013dde806617aa1efb54605f386\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error AddressInsufficientBalance(address account);\\n\\n /**\\n * @dev There's no code at `target` (it is not a contract).\\n */\\n error AddressEmptyCode(address target);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedInnerCall();\\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 AddressInsufficientBalance(address(this));\\n }\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n if (!success) {\\n revert FailedInnerCall();\\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 * {FailedInnerCall} 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 AddressInsufficientBalance(address(this));\\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 {FailedInnerCall}) in case of an\\n * 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 {FailedInnerCall} 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 {FailedInnerCall}.\\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 /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert FailedInnerCall();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaf28a975a78550e45f65e559a3ad6a5ad43b9b8a37366999abd1b7084eb70721\",\"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/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\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[EIP 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\":\"0x4296879f55019b23e135000eb36896057e7101fb7fb859c5ef690cf14643757b\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nimport {SendParam, OFTReceipt, MessagingReceipt, MessagingFee} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol\\\";\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport {Context} from \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport {OFTCore} from \\\"./oft/OFTCore.sol\\\";\\nimport {ERC2771Handler} from \\\"./sand/ERC2771Handler.sol\\\";\\nimport {SandBaseToken} from \\\"./sand/SandBaseToken.sol\\\";\\n\\n/// @title OFTSand\\n/// @author The Sandbox\\n/// @dev OFTSand is a contract that combines SandBaseToken, ERC2771Handler, and OFTCore functionalities.\\n/// @dev It provides a token contract implementation of Sand token with LayerZero compatibility.\\ncontract OFTSand is SandBaseToken, ERC2771Handler, OFTCore {\\n bool internal _enabled;\\n\\n /// @notice Emitted when the enabled state changes\\n /// @param enabled The new enabled state\\n event Enabled(bool enabled);\\n\\n /// @notice Custom error thrown when the send function is called while disabled\\n error SendFunctionDisabled();\\n\\n constructor(\\n address trustedForwarder,\\n address sandAdmin,\\n address executionAdmin,\\n address layerZeroEndpoint,\\n address owner\\n ) SandBaseToken(sandAdmin, executionAdmin, address(0), 0) OFTCore(18, layerZeroEndpoint, owner) Ownable(owner) {\\n __ERC2771Handler_initialize(trustedForwarder);\\n _enable(true);\\n }\\n\\n /// @notice Change the address of the trusted forwarder for meta-TX.\\n /// @param trustedForwarder The new trustedForwarder.\\n function setTrustedForwarder(address trustedForwarder) external onlyOwner {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function enable(bool enabled) external onlyAdmin {\\n _enable(enabled);\\n }\\n\\n function getEnabled() external view returns (bool) {\\n return _enabled;\\n }\\n\\n /// @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\\n /// @return requiresApproval Needs approval of the underlying token implementation.\\n /// @dev In the case of OFT where the contract IS the token, approval is NOT required.\\n function approvalRequired() external pure virtual returns (bool) {\\n return false;\\n }\\n\\n /// @dev Retrieves the address of the underlying ERC20 implementation.\\n /// @return The address of the OFT token.\\n /// @dev In the case of OFT, address(this) and erc20 are the same contract.\\n function token() external view returns (address) {\\n return address(this);\\n }\\n\\n function send(\\n SendParam calldata _sendParam,\\n MessagingFee calldata _fee,\\n address _refundAddress\\n ) public payable virtual override returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) {\\n if (!_enabled) {\\n revert SendFunctionDisabled();\\n }\\n\\n super.send(_sendParam, _fee, _refundAddress);\\n }\\n\\n function _enable(bool enabled) internal {\\n _enabled = enabled;\\n emit Enabled(_enabled);\\n }\\n\\n /// @dev Burns tokens from the sender's specified balance.\\n /// @param _from The address to debit the tokens from.\\n /// @param _amountLD The amount of tokens to send in local decimals.\\n /// @param _minAmountLD The minimum amount to send in local decimals.\\n /// @param _dstEid The destination chain ID.\\n /// @return amountSentLD The amount sent in local decimals.\\n /// @return amountReceivedLD The amount received in local decimals on the remote.\\n function _debit(\\n address _from,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n uint32 _dstEid\\n ) internal virtual override returns (uint256 amountSentLD, uint256 amountReceivedLD) {\\n (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid);\\n\\n // @dev In NON-default OFT, amountSentLD could be 100, with a 10% fee, the amountReceivedLD amount is 90,\\n // therefore amountSentLD CAN differ from amountReceivedLD.\\n\\n // @dev Default OFT burns on src.\\n _burn(_from, amountSentLD);\\n }\\n\\n /// @dev Credits tokens to the specified address.\\n /// @param _to The address to credit the tokens to.\\n /// @param _amountLD The amount of tokens to credit in local decimals.\\n /// @dev _srcEid The source chain ID.\\n /// @return amountReceivedLD The amount of tokens ACTUALLY received in local decimals.\\n function _credit(\\n address _to,\\n uint256 _amountLD,\\n uint32 /*_srcEid*/\\n ) internal virtual override returns (uint256 amountReceivedLD) {\\n // @dev Default OFT mints on dst.\\n _mint(_to, _amountLD);\\n // @dev In the case of NON-default OFT, the _amountLD MIGHT not be == amountReceivedLD.\\n return _amountLD;\\n }\\n\\n function _msgSender() internal view override(ERC2771Handler, Context) returns (address sender) {\\n return ERC2771Handler._msgSender();\\n }\\n\\n function _msgData() internal view override(ERC2771Handler, Context) returns (bytes calldata) {\\n return ERC2771Handler._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x906a95e61308a1f9882f0cdaa7c0a92e90548139807d6858b0ae892bab109d38\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/interfaces/IERC20Extended.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport {IERC20} from \\\"@openzeppelin/contracts/interfaces/IERC20.sol\\\";\\n\\ninterface IERC20Extended is IERC20 {\\n function burnFor(address from, uint256 amount) external;\\n\\n function burn(uint256 amount) external;\\n\\n function approveFor(address owner, address spender, uint256 amount) external returns (bool success);\\n}\\n\",\"keccak256\":\"0x8732e387712417ba58adca32a39bba00ca6591220b7373b2e15f3a5f2a02357c\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/interfaces/IErrors.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\n/// @title Errors\\n/// @author The Sandbox\\n/// @custom:security-contact contact-blockchain@sandbox.game\\n/// @notice Common errors\\ninterface IErrors {\\n /// @notice Error for overflow conditions\\n error Overflow();\\n\\n /// @notice Error for unauthorized access\\n error NotAuthorized();\\n\\n /// @notice Error for invalid sender\\n error InvalidSender();\\n\\n /// @notice Error for invalid amount\\n error InvalidAmount();\\n\\n /// @notice Error for invalid owner or spender\\n error InvalidOwnerOrSpender();\\n\\n /// @notice Error for mismatched first parameter and sender address\\n error FirstParamNotSender();\\n\\n /// @notice Error for failed calls, containing the error message\\n /// @param message error message returned from the failed call\\n error CallFailed(string message);\\n\\n /// @notice Error for admin-only access\\n error OnlyAdmin();\\n}\\n\",\"keccak256\":\"0x73a0517d65a567aaf6181ab1d3c68b6e7fdc20b098e013826db83bc8620fb635\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/libraries/BytesUtil.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nlibrary BytesUtil {\\n uint256 private constant DATA_MIN_LENGTH = 68;\\n\\n /// @dev Check if the data == _address.\\n /// @param data The bytes passed to the function.\\n /// @param _address The address to compare to.\\n /// @return Whether the first param == _address.\\n function doFirstParamEqualsAddress(bytes memory data, address _address) internal pure returns (bool) {\\n if (data.length < DATA_MIN_LENGTH) {\\n return false;\\n }\\n uint256 value;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n value := mload(add(data, 36))\\n }\\n return value == uint256(uint160(_address));\\n }\\n}\\n\",\"keccak256\":\"0xaf46fb2fdd191a593f1c1563b9c27675cdc06689f3cb9ab1a1eb7d09c2b3a9a5\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/oft/OFTCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nimport {OApp, Origin} from \\\"./oapp/OApp.sol\\\";\\nimport {OAppOptionsType3} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OAppOptionsType3.sol\\\";\\nimport {IOAppMsgInspector} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppMsgInspector.sol\\\";\\n\\nimport {OAppPreCrimeSimulator} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/OAppPreCrimeSimulator.sol\\\";\\n\\nimport {IOFT, SendParam, OFTLimit, OFTReceipt, OFTFeeDetail, MessagingReceipt, MessagingFee} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol\\\";\\nimport {OFTMsgCodec} from \\\"./libraries/OFTMsgCodec.sol\\\";\\nimport {OFTComposeMsgCodec} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/libs/OFTComposeMsgCodec.sol\\\";\\n\\n/// @title OFTCore\\n/// @dev Abstract contract for the OftChain (OFT) token.\\n/// @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFTCore.sol'\\n/// but has been modified to support ERC2771 compatibility.\\nabstract contract OFTCore is IOFT, OApp, OAppPreCrimeSimulator, OAppOptionsType3 {\\n using OFTMsgCodec for bytes;\\n using OFTMsgCodec for bytes32;\\n\\n // @notice Provides a conversion rate when swapping between denominations of SD and LD\\n // - shareDecimals == SD == shared Decimals\\n // - localDecimals == LD == local decimals\\n // @dev Considers that tokens have different decimal amounts on various chains.\\n // @dev eg.\\n // For a token\\n // - locally with 4 decimals --> 1.2345 => uint(12345)\\n // - remotely with 2 decimals --> 1.23 => uint(123)\\n // - The conversion rate would be 10 ** (4 - 2) = 100\\n // @dev If you want to send 1.2345 -> (uint 12345), you CANNOT represent that value on the remote,\\n // you can only display 1.23 -> uint(123).\\n // @dev To preserve the dust that would otherwise be lost on that conversion,\\n // we need to unify a denomination that can be represented on ALL chains inside of the OFT mesh\\n uint256 public immutable decimalConversionRate;\\n\\n // @notice Msg types that are used to identify the various OFT operations.\\n // @dev This can be extended in child contracts for non-default oft operations\\n // @dev These values are used in things like combineOptions() in OAppOptionsType3.sol.\\n uint16 public constant SEND = 1;\\n uint16 public constant SEND_AND_CALL = 2;\\n\\n // Address of an optional contract to inspect both 'message' and 'options'\\n address public msgInspector;\\n event MsgInspectorSet(address inspector);\\n\\n /// @dev Constructor.\\n /// @param _localDecimals The decimals of the token on the local chain (this chain).\\n /// @param _endpoint The address of the LayerZero endpoint.\\n /// @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\\n constructor(uint8 _localDecimals, address _endpoint, address _delegate) OApp(_endpoint, _delegate) {\\n if (_localDecimals < sharedDecimals()) revert InvalidLocalDecimals();\\n decimalConversionRate = 10 ** (_localDecimals - sharedDecimals());\\n }\\n\\n /// @notice Retrieves interfaceID and the version of the OFT.\\n /// @return interfaceId The interface ID.\\n /// @return version The version.\\n /// @dev interfaceId: This specific interface ID is '0x02e49c2c'.\\n /// @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.\\n /// @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.\\n /// ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\\n function oftVersion() external pure virtual returns (bytes4 interfaceId, uint64 version) {\\n return (type(IOFT).interfaceId, 1);\\n }\\n\\n /// @dev Retrieves the shared decimals of the OFT.\\n /// @return The shared decimals of the OFT.\\n /// @dev Sets an implicit cap on the amount of tokens, over uint64.max() will need some sort of outbound cap / totalSupply cap\\n /// Lowest common decimal denominator between chains.\\n /// Defaults to 6 decimal places to provide up to 18,446,744,073,709.551615 units (max uint64).\\n /// For tokens exceeding this totalSupply(), they will need to override the sharedDecimals function with something smaller.\\n /// ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615\\n function sharedDecimals() public view virtual returns (uint8) {\\n return 6;\\n }\\n\\n /// @dev Sets the message inspector address for the OFT.\\n /// @param _msgInspector The address of the message inspector.\\n /// @dev This is an optional contract that can be used to inspect both 'message' and 'options'.\\n /// @dev Set it to address(0) to disable it, or set it to a contract address to enable it.\\n function setMsgInspector(address _msgInspector) public virtual onlyOwner {\\n msgInspector = _msgInspector;\\n emit MsgInspectorSet(_msgInspector);\\n }\\n\\n /// @notice Provides a quote for OFT-related operations.\\n /// @param _sendParam The parameters for the send operation.\\n /// @return oftLimit The OFT limit information.\\n /// @return oftFeeDetails The details of OFT fees.\\n /// @return oftReceipt The OFT receipt information.\\n function quoteOFT(\\n SendParam calldata _sendParam\\n )\\n external\\n view\\n virtual\\n returns (OFTLimit memory oftLimit, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory oftReceipt)\\n {\\n uint256 minAmountLD = 0; // Unused in the default implementation.\\n uint256 maxAmountLD = type(uint64).max; // Unused in the default implementation.\\n oftLimit = OFTLimit(minAmountLD, maxAmountLD);\\n\\n // Unused in the default implementation; reserved for future complex fee details.\\n oftFeeDetails = new OFTFeeDetail[](0);\\n\\n // @dev This is the same as the send() operation, but without the actual send.\\n // - amountSentLD is the amount in local decimals that would be sent from the sender.\\n // - amountReceivedLD is the amount in local decimals that will be credited to the recipient on the remote OFT instance.\\n // @dev The amountSentLD MIGHT not equal the amount the user actually receives. HOWEVER, the default does.\\n (uint256 amountSentLD, uint256 amountReceivedLD) = _debitView(\\n _sendParam.amountLD,\\n _sendParam.minAmountLD,\\n _sendParam.dstEid\\n );\\n oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD);\\n }\\n\\n /// @notice Provides a quote for the send() operation.\\n /// @param _sendParam The parameters for the send() operation.\\n /// @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.\\n /// @return msgFee The calculated LayerZero messaging fee from the send() operation.\\n /// @dev MessagingFee: LayerZero msg fee\\n /// - nativeFee: The native fee.\\n /// - lzTokenFee: The lzToken fee.\\n function quoteSend(\\n SendParam calldata _sendParam,\\n bool _payInLzToken\\n ) external view virtual returns (MessagingFee memory msgFee) {\\n // @dev mock the amount to receive, this is the same operation used in the send().\\n // The quote is as similar as possible to the actual send() operation.\\n (, uint256 amountReceivedLD) = _debitView(_sendParam.amountLD, _sendParam.minAmountLD, _sendParam.dstEid);\\n\\n // @dev Builds the options and OFT message to quote in the endpoint.\\n (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD);\\n\\n // @dev Calculates the LayerZero fee for the send() operation.\\n return _quote(_sendParam.dstEid, message, options, _payInLzToken);\\n }\\n\\n /// @dev Executes the send operation.\\n /// @param _sendParam The parameters for the send operation.\\n /// @param _fee The calculated fee for the send() operation.\\n /// - nativeFee: The native fee.\\n /// - lzTokenFee: The lzToken fee.\\n /// @param _refundAddress The address to receive any excess funds.\\n /// @return msgReceipt The receipt for the send operation.\\n /// @return oftReceipt The OFT receipt information.\\n /// @dev MessagingReceipt: LayerZero msg receipt\\n /// - guid: The unique identifier for the sent message.\\n /// - nonce: The nonce of the sent message.\\n /// - fee: The LayerZero fee incurred for the message.\\n function send(\\n SendParam calldata _sendParam,\\n MessagingFee calldata _fee,\\n address _refundAddress\\n ) public payable virtual returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) {\\n // @dev Applies the token transfers regarding this send() operation.\\n // - amountSentLD is the amount in local decimals that was ACTUALLY sent/debited from the sender.\\n // - amountReceivedLD is the amount in local decimals that will be received/credited to the recipient on the remote OFT instance.\\n (uint256 amountSentLD, uint256 amountReceivedLD) = _debit(\\n _msgSender(),\\n _sendParam.amountLD,\\n _sendParam.minAmountLD,\\n _sendParam.dstEid\\n );\\n\\n // @dev Builds the options and OFT message to quote in the endpoint.\\n (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD);\\n\\n // @dev Sends the message to the LayerZero endpoint and returns the LayerZero msg receipt.\\n msgReceipt = _lzSend(_sendParam.dstEid, message, options, _fee, _refundAddress);\\n // @dev Formulate the OFT receipt.\\n oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD);\\n\\n emit OFTSent(msgReceipt.guid, _sendParam.dstEid, _msgSender(), amountSentLD, amountReceivedLD);\\n }\\n\\n /// @dev Internal function to build the message and options.\\n /// @param _sendParam The parameters for the send() operation.\\n /// @param _amountLD The amount in local decimals.\\n /// @return message The encoded message.\\n /// @return options The encoded options.\\n function _buildMsgAndOptions(\\n SendParam calldata _sendParam,\\n uint256 _amountLD\\n ) internal view virtual returns (bytes memory message, bytes memory options) {\\n bool hasCompose;\\n // @dev This generated message has the msg.sender encoded into the payload so the remote knows who the caller is.\\n (message, hasCompose) = OFTMsgCodec.encode(\\n _sendParam.to,\\n _toSD(_amountLD),\\n // @dev Must be include a non empty bytes if you want to compose, EVEN if you dont need it on the remote.\\n // EVEN if you dont require an arbitrary payload to be sent... eg. '0x01'\\n _sendParam.composeMsg,\\n _msgSender()\\n );\\n // @dev Change the msg type depending if its composed or not.\\n uint16 msgType = hasCompose ? SEND_AND_CALL : SEND;\\n // @dev Combine the callers _extraOptions with the enforced options via the OAppOptionsType3.\\n options = combineOptions(_sendParam.dstEid, msgType, _sendParam.extraOptions);\\n\\n // @dev Optionally inspect the message and options depending if the OApp owner has set a msg inspector.\\n // @dev If it fails inspection, needs to revert in the implementation. ie. does not rely on return boolean\\n if (msgInspector != address(0)) IOAppMsgInspector(msgInspector).inspect(message, options);\\n }\\n\\n /// @dev Internal function to handle the receive on the LayerZero endpoint.\\n /// @param _origin The origin information.\\n /// - srcEid: The source chain endpoint ID.\\n /// - sender: The sender address from the src chain.\\n /// - nonce: The nonce of the LayerZero message.\\n /// @param _guid The unique identifier for the received LayerZero message.\\n /// @param _message The encoded message.\\n /// @dev _executor The address of the executor.\\n /// @dev _extraData Additional data.\\n\\n function _lzReceive(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address /*_executor*/, // @dev unused in the default implementation.\\n bytes calldata /*_extraData*/ // @dev unused in the default implementation.\\n ) internal virtual override {\\n // @dev The src sending chain doesnt know the address length on this chain (potentially non-evm)\\n // Thus everything is bytes32() encoded in flight.\\n address toAddress = _message.sendTo().bytes32ToAddress();\\n // @dev Credit the amountLD to the recipient and return the ACTUAL amount the recipient received in local decimals\\n uint256 amountReceivedLD = _credit(toAddress, _toLD(_message.amountSD()), _origin.srcEid);\\n\\n if (_message.isComposed()) {\\n // @dev Proprietary composeMsg format for the OFT.\\n bytes memory composeMsg = OFTComposeMsgCodec.encode(\\n _origin.nonce,\\n _origin.srcEid,\\n amountReceivedLD,\\n _message.composeMsg()\\n );\\n\\n // @dev Stores the lzCompose payload that will be executed in a separate tx.\\n // Standardizes functionality for executing arbitrary contract invocation on some non-evm chains.\\n // @dev The off-chain executor will listen and process the msg based on the src-chain-callers compose options passed.\\n // @dev The index is used when a OApp needs to compose multiple msgs on lzReceive.\\n // For default OFT implementation there is only 1 compose msg per lzReceive, thus its always 0.\\n endpoint.sendCompose(toAddress, _guid, 0 /* the index of the composed message*/, composeMsg);\\n }\\n\\n emit OFTReceived(_guid, _origin.srcEid, toAddress, amountReceivedLD);\\n }\\n\\n /// @dev Internal function to handle the OAppPreCrimeSimulator simulated receive.\\n /// @param _origin The origin information.\\n /// - srcEid: The source chain endpoint ID.\\n /// - sender: The sender address from the src chain.\\n /// - nonce: The nonce of the LayerZero message.\\n /// @param _guid The unique identifier for the received LayerZero message.\\n /// @param _message The LayerZero message.\\n /// @param _executor The address of the off-chain executor.\\n /// @param _extraData Arbitrary data passed by the msg executor.\\n /// @dev Enables the preCrime simulator to mock sending lzReceive() messages,\\n /// routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver.\\n function _lzReceiveSimulate(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address _executor,\\n bytes calldata _extraData\\n ) internal virtual override {\\n _lzReceive(_origin, _guid, _message, _executor, _extraData);\\n }\\n\\n /// @dev Check if the peer is considered 'trusted' by the OApp.\\n /// @param _eid The endpoint ID to check.\\n /// @param _peer The peer to check.\\n /// @return Whether the peer passed is considered 'trusted' by the OApp.\\n /// @dev Enables OAppPreCrimeSimulator to check whether a potential Inbound Packet is from a trusted source.\\n function isPeer(uint32 _eid, bytes32 _peer) public view virtual override returns (bool) {\\n return peers[_eid] == _peer;\\n }\\n\\n /// @dev Internal function to remove dust from the given local decimal amount.\\n /// @param _amountLD The amount in local decimals.\\n /// @return amountLD The amount after removing dust.\\n /// @dev Prevents the loss of dust when moving amounts between chains with different decimals.\\n /// @dev eg. uint(123) with a conversion rate of 100 becomes uint(100).\\n function _removeDust(uint256 _amountLD) internal view virtual returns (uint256 amountLD) {\\n return (_amountLD / decimalConversionRate) * decimalConversionRate;\\n }\\n\\n /// @dev Internal function to convert an amount from shared decimals into local decimals.\\n /// @param _amountSD The amount in shared decimals.\\n /// @return amountLD The amount in local decimals.\\n function _toLD(uint64 _amountSD) internal view virtual returns (uint256 amountLD) {\\n return _amountSD * decimalConversionRate;\\n }\\n\\n /// @dev Internal function to convert an amount from local decimals into shared decimals.\\n /// @param _amountLD The amount in local decimals.\\n /// @return amountSD The amount in shared decimals.\\n function _toSD(uint256 _amountLD) internal view virtual returns (uint64 amountSD) {\\n return uint64(_amountLD / decimalConversionRate);\\n }\\n\\n /// @dev Internal function to mock the amount mutation from a OFT debit() operation.\\n /// @param _amountLD The amount to send in local decimals.\\n /// @param _minAmountLD The minimum amount to send in local decimals.\\n /// @dev _dstEid The destination endpoint ID.\\n /// @return amountSentLD The amount sent, in local decimals.\\n /// @return amountReceivedLD The amount to be received on the remote chain, in local decimals.\\n /// @dev This is where things like fees would be calculated and deducted from the amount to be received on the remote.\\n function _debitView(\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n uint32 /*_dstEid*/\\n ) internal view virtual returns (uint256 amountSentLD, uint256 amountReceivedLD) {\\n // @dev Remove the dust so nothing is lost on the conversion between chains with different decimals for the token.\\n amountSentLD = _removeDust(_amountLD);\\n // @dev The amount to send is the same as amount received in the default implementation.\\n amountReceivedLD = amountSentLD;\\n\\n // @dev Check for slippage.\\n if (amountReceivedLD < _minAmountLD) {\\n revert SlippageExceeded(amountReceivedLD, _minAmountLD);\\n }\\n }\\n\\n /// @dev Internal function to perform a debit operation.\\n /// @param _from The address to debit.\\n /// @param _amountLD The amount to send in local decimals.\\n /// @param _minAmountLD The minimum amount to send in local decimals.\\n /// @param _dstEid The destination endpoint ID.\\n /// @return amountSentLD The amount sent in local decimals.\\n /// @return amountReceivedLD The amount received in local decimals on the remote.\\n /// @dev Defined here but are intended to be overriden depending on the OFT implementation.\\n /// @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD.\\n function _debit(\\n address _from,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n uint32 _dstEid\\n ) internal virtual returns (uint256 amountSentLD, uint256 amountReceivedLD);\\n\\n /// @dev Internal function to perform a credit operation.\\n /// @param _to The address to credit.\\n /// @param _amountLD The amount to credit in local decimals.\\n /// @param _srcEid The source endpoint ID.\\n /// @return amountReceivedLD The amount ACTUALLY received in local decimals.\\n /// @dev Defined here but are intended to be overriden depending on the OFT implementation.\\n /// @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD.\\n\\n function _credit(\\n address _to,\\n uint256 _amountLD,\\n uint32 _srcEid\\n ) internal virtual returns (uint256 amountReceivedLD);\\n}\\n\",\"keccak256\":\"0x9e0e9be45f8ce68f9230febff5feaee523023799797083396253d000204babdc\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/oft/libraries/OFTMsgCodec.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nlibrary OFTMsgCodec {\\n // Offset constants for encoding and decoding OFT messages\\n uint8 private constant SEND_TO_OFFSET = 32;\\n uint8 private constant SEND_AMOUNT_SD_OFFSET = 40;\\n\\n /**\\n * @dev Encodes an OFT LayerZero message.\\n * @param _sendTo The recipient address.\\n * @param _amountShared The amount in shared decimals.\\n * @param _composeMsg The composed message.\\n * @param _sender The msg sender\\n * @return _msg The encoded message.\\n * @return hasCompose A boolean indicating whether the message has a composed payload.\\n */\\n function encode(\\n bytes32 _sendTo,\\n uint64 _amountShared,\\n bytes memory _composeMsg,\\n address _sender\\n ) internal pure returns (bytes memory _msg, bool hasCompose) {\\n hasCompose = _composeMsg.length > 0;\\n // @dev Remote chains will want to know the composed function caller ie. msg.sender on the src.\\n _msg = hasCompose\\n ? abi.encodePacked(_sendTo, _amountShared, addressToBytes32(_sender), _composeMsg)\\n : abi.encodePacked(_sendTo, _amountShared);\\n }\\n\\n /**\\n * @dev Checks if the OFT message is composed.\\n * @param _msg The OFT message.\\n * @return A boolean indicating whether the message is composed.\\n */\\n function isComposed(bytes calldata _msg) internal pure returns (bool) {\\n return _msg.length > SEND_AMOUNT_SD_OFFSET;\\n }\\n\\n /**\\n * @dev Retrieves the recipient address from the OFT message.\\n * @param _msg The OFT message.\\n * @return The recipient address.\\n */\\n function sendTo(bytes calldata _msg) internal pure returns (bytes32) {\\n return bytes32(_msg[:SEND_TO_OFFSET]);\\n }\\n\\n /**\\n * @dev Retrieves the amount in shared decimals from the OFT message.\\n * @param _msg The OFT message.\\n * @return The amount in shared decimals.\\n */\\n function amountSD(bytes calldata _msg) internal pure returns (uint64) {\\n return uint64(bytes8(_msg[SEND_TO_OFFSET:SEND_AMOUNT_SD_OFFSET]));\\n }\\n\\n /**\\n * @dev Retrieves the composed message from the OFT message.\\n * @param _msg The OFT message.\\n * @return The composed message.\\n */\\n function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\\n return _msg[SEND_AMOUNT_SD_OFFSET:];\\n }\\n\\n /**\\n * @dev Converts an address to bytes32.\\n * @param _addr The address to convert.\\n * @return The bytes32 representation of the address.\\n */\\n function addressToBytes32(address _addr) internal pure returns (bytes32) {\\n return bytes32(uint256(uint160(_addr)));\\n }\\n\\n /**\\n * @dev Converts bytes32 to an address.\\n * @param _b The bytes32 value to convert.\\n * @return The address representation of bytes32.\\n */\\n function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\\n return address(uint160(uint256(_b)));\\n }\\n}\\n\",\"keccak256\":\"0xf706ea7e0523d956e2a9d479690c7f455533d20c49ae4473fb10dfc3c9221faa\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/oft/oapp/OApp.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\n// @dev Import the 'MessagingFee' and 'MessagingReceipt' so it's exposed to OApp implementers\\n// solhint-disable-next-line no-unused-import\\nimport {OAppSender, MessagingFee, MessagingReceipt} from \\\"./OAppSender.sol\\\";\\n// @dev Import the 'Origin' so it's exposed to OApp implementers\\n// solhint-disable-next-line no-unused-import\\nimport {OAppReceiver, Origin} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppReceiver.sol\\\";\\nimport {OAppCore} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppCore.sol\\\";\\n\\n/**\\n * @title OApp\\n * @dev Abstract contract serving as the base for OApp implementation, combining OAppSender and OAppReceiver functionality.\\n * @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OApp.sol'\\n * but has been modified to support ERC2771 compatibility.\\n */\\nabstract contract OApp is OAppSender, OAppReceiver {\\n /**\\n * @dev Constructor to initialize the OApp with the provided endpoint and owner.\\n * @param _endpoint The address of the LOCAL LayerZero endpoint.\\n * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\\n */\\n constructor(address _endpoint, address _delegate) OAppCore(_endpoint, _delegate) {}\\n\\n /**\\n * @notice Retrieves the OApp version information.\\n * @return senderVersion The version of the OAppSender.sol implementation.\\n * @return receiverVersion The version of the OAppReceiver.sol implementation.\\n */\\n function oAppVersion()\\n public\\n pure\\n virtual\\n override(OAppSender, OAppReceiver)\\n returns (uint64 senderVersion, uint64 receiverVersion)\\n {\\n return (SENDER_VERSION, RECEIVER_VERSION);\\n }\\n}\\n\",\"keccak256\":\"0x0ba47a702d1d5689b38a055a72110529225cfa0570e3f102a5de45af70dcee82\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/oft/oapp/OAppSender.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nimport {SafeERC20, IERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {MessagingParams, MessagingFee, MessagingReceipt} from \\\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\\\";\\nimport {OAppCore} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppCore.sol\\\";\\n/**\\n * @title OAppSender\\n * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.\\n * @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppSender.sol'\\n * but has been modified to support ERC2771 compatibility.\\n */\\nabstract contract OAppSender is OAppCore {\\n using SafeERC20 for IERC20;\\n\\n // Custom error messages\\n error NotEnoughNative(uint256 msgValue);\\n error LzTokenUnavailable();\\n\\n // @dev The version of the OAppSender implementation.\\n // @dev Version is bumped when changes are made to this contract.\\n uint64 internal constant SENDER_VERSION = 1;\\n\\n /**\\n * @notice Retrieves the OApp version information.\\n * @return senderVersion The version of the OAppSender.sol contract.\\n * @return receiverVersion The version of the OAppReceiver.sol contract.\\n *\\n * @dev Providing 0 as the default for OAppReceiver version. Indicates that the OAppReceiver is not implemented.\\n * ie. this is a SEND only OApp.\\n * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions\\n */\\n function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\\n return (SENDER_VERSION, 0);\\n }\\n\\n /**\\n * @dev Internal function to interact with the LayerZero EndpointV2.quote() for fee calculation.\\n * @param _dstEid The destination endpoint ID.\\n * @param _message The message payload.\\n * @param _options Additional options for the message.\\n * @param _payInLzToken Flag indicating whether to pay the fee in LZ tokens.\\n * @return fee The calculated MessagingFee for the message.\\n * - nativeFee: The native fee for the message.\\n * - lzTokenFee: The LZ token fee for the message.\\n */\\n function _quote(\\n uint32 _dstEid,\\n bytes memory _message,\\n bytes memory _options,\\n bool _payInLzToken\\n ) internal view virtual returns (MessagingFee memory fee) {\\n return\\n endpoint.quote(\\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken),\\n address(this)\\n );\\n }\\n\\n /**\\n * @dev Internal function to interact with the LayerZero EndpointV2.send() for sending a message.\\n * @param _dstEid The destination endpoint ID.\\n * @param _message The message payload.\\n * @param _options Additional options for the message.\\n * @param _fee The calculated LayerZero fee for the message.\\n * - nativeFee: The native fee.\\n * - lzTokenFee: The lzToken fee.\\n * @param _refundAddress The address to receive any excess fee values sent to the endpoint.\\n * @return receipt The receipt for the sent message.\\n * - guid: The unique identifier for the sent message.\\n * - nonce: The nonce of the sent message.\\n * - fee: The LayerZero fee incurred for the message.\\n */\\n function _lzSend(\\n uint32 _dstEid,\\n bytes memory _message,\\n bytes memory _options,\\n MessagingFee memory _fee,\\n address _refundAddress\\n ) internal virtual returns (MessagingReceipt memory receipt) {\\n // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint.\\n uint256 messageValue = _payNative(_fee.nativeFee);\\n if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);\\n\\n return\\n // solhint-disable-next-line check-send-result\\n endpoint.send{value: messageValue}(\\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0),\\n _refundAddress\\n );\\n }\\n\\n /**\\n * @dev Internal function to pay the native fee associated with the message.\\n * @param _nativeFee The native fee to be paid.\\n * @return nativeFee The amount of native currency paid.\\n *\\n * @dev If the OApp needs to initiate MULTIPLE LayerZero messages in a single transaction,\\n * this will need to be overridden because msg.value would contain multiple lzFees.\\n * @dev Should be overridden in the event the LayerZero endpoint requires a different native currency.\\n * @dev Some EVMs use an ERC20 as a method for paying transactions/gasFees.\\n * @dev The endpoint is EITHER/OR, ie. it will NOT support both types of native payment at a time.\\n */\\n function _payNative(uint256 _nativeFee) internal virtual returns (uint256 nativeFee) {\\n if (msg.value != _nativeFee) revert NotEnoughNative(msg.value);\\n return _nativeFee;\\n }\\n\\n /**\\n * @dev Internal function to pay the LZ token fee associated with the message.\\n * @param _lzTokenFee The LZ token fee to be paid.\\n *\\n * @dev If the caller is trying to pay in the specified lzToken, then the lzTokenFee is passed to the endpoint.\\n * @dev Any excess sent, is passed back to the specified _refundAddress in the _lzSend().\\n */\\n function _payLzToken(uint256 _lzTokenFee) internal virtual {\\n // @dev Cannot cache the token because it is not immutable in the endpoint.\\n address lzToken = endpoint.lzToken();\\n if (lzToken == address(0)) revert LzTokenUnavailable();\\n\\n // Pay LZ token fee by sending tokens to the endpoint.\\n IERC20(lzToken).safeTransferFrom(_msgSender(), address(endpoint), _lzTokenFee);\\n }\\n}\\n\",\"keccak256\":\"0x4f4a30772bee7afac6945cdfb978202470722aa244c614efb245d2e4cd205bf3\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/sand/ERC20BaseToken.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nimport {Context} from \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport {IERC20Errors} from \\\"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\\\";\\nimport {ERC20Internal} from \\\"./ERC20Internal.sol\\\";\\nimport {IErrors} from \\\"../interfaces/IErrors.sol\\\";\\nimport {IERC20, IERC20Extended} from \\\"../interfaces/IERC20Extended.sol\\\";\\nimport {WithSuperOperators} from \\\"./WithSuperOperators.sol\\\";\\n\\nabstract contract ERC20BaseToken is\\n IErrors,\\n WithSuperOperators,\\n IERC20,\\n IERC20Extended,\\n IERC20Errors,\\n ERC20Internal,\\n Context\\n{\\n string internal _name;\\n string internal _symbol;\\n address internal immutable _operator;\\n uint256 internal _totalSupply;\\n mapping(address => uint256) internal _balances;\\n mapping(address => mapping(address => uint256)) internal _allowances;\\n\\n constructor(string memory tokenName, string memory tokenSymbol, address admin, address operator) {\\n _name = tokenName;\\n _symbol = tokenSymbol;\\n _admin = admin;\\n _operator = operator;\\n }\\n\\n /// @notice Transfer `amount` tokens to `to`.\\n /// @param to The recipient address of the tokens being transfered.\\n /// @param amount The number of tokens being transfered.\\n /// @return success Whether or not the transfer succeeded.\\n function transfer(address to, uint256 amount) external override returns (bool success) {\\n _transfer(_msgSender(), to, amount);\\n return true;\\n }\\n\\n /// @notice Transfer `amount` tokens from `from` to `to`.\\n /// @param from The origin address of the tokens being transferred.\\n /// @param to The recipient address of the tokensbeing transfered.\\n /// @param amount The number of tokens transfered.\\n /// @return success Whether or not the transfer succeeded.\\n function transferFrom(address from, address to, uint256 amount) external override returns (bool success) {\\n if (_msgSender() != from && !_superOperators[_msgSender()] && _msgSender() != _operator) {\\n uint256 currentAllowance = _allowances[from][_msgSender()];\\n if (currentAllowance != ~uint256(0)) {\\n // save gas when allowance is maximal by not reducing it (see https://github.com/ethereum/EIPs/issues/717)\\n if (currentAllowance < amount) {\\n revert ERC20InsufficientAllowance(_msgSender(), currentAllowance, amount);\\n }\\n _allowances[from][_msgSender()] = currentAllowance - amount;\\n }\\n }\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /// @notice Burn `amount` tokens.\\n /// @param amount The number of tokens to burn.\\n function burn(uint256 amount) external override {\\n _burn(_msgSender(), amount);\\n }\\n\\n /// @notice Burn `amount` tokens from `owner`.\\n /// @param from The address whose token to burn.\\n /// @param amount The number of tokens to burn.\\n function burnFor(address from, uint256 amount) external override {\\n _burn(from, amount);\\n }\\n\\n /// @notice Approve `spender` to transfer `amount` tokens.\\n /// @param spender The address to be given rights to transfer.\\n /// @param amount The number of tokens allowed.\\n /// @return success Whether or not the call succeeded.\\n function approve(address spender, uint256 amount) external override returns (bool success) {\\n _approveFor(_msgSender(), spender, amount);\\n return true;\\n }\\n\\n /// @notice Get the name of the token collection.\\n /// @return The name of the token collection.\\n function name() external view virtual returns (string memory) {\\n //added virtual\\n return _name;\\n }\\n\\n /// @notice Get the symbol for the token collection.\\n /// @return The symbol of the token collection.\\n function symbol() external view virtual returns (string memory) {\\n //added virtual\\n return _symbol;\\n }\\n\\n /// @notice Get the total number of tokens in existence.\\n /// @return The total number of tokens in existence.\\n function totalSupply() external view override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /// @notice Get the balance of `owner`.\\n /// @param owner The address to query the balance of.\\n /// @return The amount owned by `owner`.\\n function balanceOf(address owner) external view override returns (uint256) {\\n return _balances[owner];\\n }\\n\\n /// @notice Get the allowance of `spender` for `owner`'s tokens.\\n /// @param owner The address whose token is allowed.\\n /// @param spender The address allowed to transfer.\\n /// @return remaining The amount of token `spender` is allowed to transfer on behalf of `owner`.\\n function allowance(address owner, address spender) external view override returns (uint256 remaining) {\\n return _allowances[owner][spender];\\n }\\n\\n /// @notice Get the number of decimals for the token collection.\\n /// @return The number of decimals.\\n function decimals() external pure virtual returns (uint8) {\\n return uint8(18);\\n }\\n\\n /// @notice Approve `spender` to transfer `amount` tokens from `owner`.\\n /// @param owner The address whose token is allowed.\\n /// @param spender The address to be given rights to transfer.\\n /// @param amount The number of tokens allowed.\\n /// @return success Whether or not the call succeeded.\\n function approveFor(address owner, address spender, uint256 amount) public override returns (bool success) {\\n if (!(_msgSender() == owner || _superOperators[_msgSender()] || _msgSender() == _operator)) {\\n revert NotAuthorized();\\n }\\n _approveFor(owner, spender, amount);\\n return true;\\n }\\n\\n /// @notice Increase the allowance for the spender if needed\\n /// @param owner The address of the owner of the tokens\\n /// @param spender The address wanting to spend tokens\\n /// @param amountNeeded The amount requested to spend\\n /// @return success Whether or not the call succeeded.\\n function addAllowanceIfNeeded(address owner, address spender, uint256 amountNeeded) public returns (bool success) {\\n if (!(_msgSender() == owner || _superOperators[_msgSender()] || _msgSender() == _operator)) {\\n revert InvalidSender();\\n }\\n _addAllowanceIfNeeded(owner, spender, amountNeeded);\\n return true;\\n }\\n\\n /// @dev See addAllowanceIfNeeded.\\n function _addAllowanceIfNeeded(\\n address owner,\\n address spender,\\n uint256 amountNeeded /*(ERC20Internal, ERC20ExecuteExtension, ERC20BasicApproveExtension)*/\\n ) internal virtual override {\\n if (amountNeeded > 0 && !isSuperOperator(spender) && spender != _operator) {\\n uint256 currentAllowance = _allowances[owner][spender];\\n if (currentAllowance < amountNeeded) {\\n _approveFor(owner, spender, amountNeeded);\\n }\\n }\\n }\\n\\n /// @dev See approveFor.\\n function _approveFor(\\n address owner,\\n address spender,\\n uint256 amount /*(ERC20BasicApproveExtension, ERC20Internal)*/\\n ) internal virtual override {\\n if (owner == address(0) || spender == address(0)) {\\n revert InvalidOwnerOrSpender();\\n }\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /// @dev See transfer.\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount /*(ERC20Internal, ERC20ExecuteExtension)*/\\n ) internal virtual override {\\n if (to == address(0) || to == address(this)) {\\n revert ERC20InvalidReceiver(to);\\n }\\n uint256 currentBalance = _balances[from];\\n if (currentBalance < amount) {\\n revert ERC20InsufficientBalance(from, currentBalance, amount);\\n }\\n _balances[from] = currentBalance - amount;\\n _balances[to] += amount;\\n emit Transfer(from, to, amount);\\n }\\n\\n /// @dev Mint tokens for a recipient.\\n /// @param to The recipient address.\\n /// @param amount The number of token to mint.\\n function _mint(address to, uint256 amount) internal {\\n if (to == address(0)) {\\n revert ERC20InvalidReceiver(to);\\n }\\n if (amount == 0) {\\n revert InvalidAmount();\\n }\\n uint256 currentTotalSupply = _totalSupply;\\n uint256 newTotalSupply = currentTotalSupply + amount;\\n if (newTotalSupply <= currentTotalSupply) {\\n revert Overflow();\\n }\\n _totalSupply = newTotalSupply;\\n _balances[to] += amount;\\n emit Transfer(address(0), to, amount);\\n }\\n\\n /// @dev Burn tokens from an address.\\n /// @param from The address whose tokens to burn.\\n /// @param amount The number of token to burn.\\n function _burn(address from, uint256 amount) internal {\\n if (amount == 0) {\\n revert InvalidAmount();\\n }\\n if (_msgSender() != from && !_superOperators[_msgSender()] && _msgSender() != _operator) {\\n uint256 currentAllowance = _allowances[from][_msgSender()];\\n if (currentAllowance != ~uint256(0)) {\\n // save gas when allowance is maximal by not reducing it (see https://github.com/ethereum/EIPs/issues/717)\\n if (currentAllowance < amount) {\\n revert ERC20InsufficientAllowance(_msgSender(), currentAllowance, amount);\\n }\\n _allowances[from][_msgSender()] = currentAllowance - amount;\\n }\\n }\\n\\n uint256 currentBalance = _balances[from];\\n if (currentBalance < amount) {\\n revert ERC20InsufficientBalance(from, currentBalance, amount);\\n }\\n _balances[from] = currentBalance - amount;\\n _totalSupply -= amount;\\n emit Transfer(from, address(0), amount);\\n }\\n}\\n\",\"keccak256\":\"0xe59413e1d9248cb497327b3801ca43900fc1b480ab7b03c83c6d86dc09e2bb44\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/sand/ERC20BasicApproveExtension.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport {Context} from \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport {ERC20Internal} from \\\"./ERC20Internal.sol\\\";\\nimport {IErrors} from \\\"../interfaces/IErrors.sol\\\";\\nimport {BytesUtil} from \\\"../libraries/BytesUtil.sol\\\";\\n\\nabstract contract ERC20BasicApproveExtension is IErrors, ERC20Internal, Context {\\n /// @notice Approve `target` to spend `amount` and call it with data.\\n /// @param target The address to be given rights to transfer and destination of the call.\\n /// @param amount The number of tokens allowed.\\n /// @param data The bytes for the call.\\n /// @return The data of the call.\\n function approveAndCall(\\n address target,\\n uint256 amount,\\n bytes calldata data\\n ) external payable returns (bytes memory) {\\n if (!BytesUtil.doFirstParamEqualsAddress(data, _msgSender())) {\\n revert FirstParamNotSender();\\n }\\n\\n _approveFor(_msgSender(), target, amount);\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returnData) = target.call{value: msg.value}(data);\\n if (!success) {\\n revert CallFailed(string(returnData));\\n }\\n return returnData;\\n }\\n\\n /// @notice Temporarily approve `target` to spend `amount` and call it with data.\\n /// Previous approvals remains unchanged.\\n /// @param target The destination of the call, allowed to spend the amount specified\\n /// @param amount The number of tokens allowed to spend.\\n /// @param data The bytes for the call.\\n /// @return The data of the call.\\n function paidCall(address target, uint256 amount, bytes calldata data) external payable returns (bytes memory) {\\n if (!BytesUtil.doFirstParamEqualsAddress(data, _msgSender())) {\\n revert FirstParamNotSender();\\n }\\n\\n if (amount > 0) {\\n _addAllowanceIfNeeded(_msgSender(), target, amount);\\n }\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returnData) = target.call{value: msg.value}(data);\\n if (!success) {\\n revert CallFailed(string(returnData));\\n }\\n\\n return returnData;\\n }\\n}\\n\",\"keccak256\":\"0x08439cbd5ce3b567804d278d85ee1a93340ad26b9555e198059318b2e4cc0f88\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/sand/ERC20Internal.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nabstract contract ERC20Internal {\\n function _approveFor(address owner, address target, uint256 amount) internal virtual;\\n\\n function _addAllowanceIfNeeded(address owner, address spender, uint256 amountNeeded) internal virtual;\\n\\n function _transfer(address from, address to, uint256 amount) internal virtual;\\n}\\n\",\"keccak256\":\"0x48bf018193074544e657b431eed0e6128c28d5d3c2655c98c9c89965e7729653\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/sand/ERC2771Handler.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// solhint-disable-next-line compiler-version\\npragma solidity 0.8.23;\\n\\n/// @title ERC2771Handler\\n/// @author The Sandbox\\n/// @notice Handle meta-transactions\\n/// @dev minimal ERC2771 handler to keep bytecode-size down\\n/// based on: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.6.0/contracts/metatx/ERC2771Context.sol\\n/// with an initializer for proxies and a mutable forwarder\\nabstract contract ERC2771Handler {\\n address internal _trustedForwarder;\\n\\n event TrustedForwarderSet(address indexed newForwarder);\\n\\n /// @dev Initializes the contract\\n /// @param forwarder trusted forwarder address\\n function __ERC2771Handler_initialize(address forwarder) internal {\\n _trustedForwarder = forwarder;\\n emit TrustedForwarderSet(_trustedForwarder);\\n }\\n\\n /// @notice Checks if an address is a trusted forwarder\\n /// @param forwarder address to check\\n /// @return is trusted\\n function isTrustedForwarder(address forwarder) public view returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n /// @notice Get the current trusted forwarder\\n /// @return trustedForwarder address of the trusted forwarder\\n function getTrustedForwarder() external view returns (address) {\\n return _trustedForwarder;\\n }\\n\\n /// @dev if the call comes from the trusted forwarder, it gets the real sender by checking the encoded address in the data\\n /// @return sender address of the real sender\\n function _msgSender() internal view virtual returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return msg.sender;\\n }\\n }\\n\\n /// @dev if the call comes from the trusted forwarder, it substracts the sender address from `msg.data` to get the real `msg.data`\\n /// @return the real `msg.data`\\n function _msgData() internal view virtual returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return msg.data;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x740d1ad5b4dea0a78c29422d27ad22bc649505221bda874599a0370843c9dcad\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/sand/SandBaseToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport {ERC20BasicApproveExtension} from \\\"./ERC20BasicApproveExtension.sol\\\";\\nimport {ERC20BaseToken} from \\\"./ERC20BaseToken.sol\\\";\\n\\ncontract SandBaseToken is ERC20BaseToken, ERC20BasicApproveExtension {\\n constructor(\\n address sandAdmin,\\n address executionAdmin,\\n address beneficiary,\\n uint256 amount\\n ) ERC20BaseToken(\\\"SAND\\\", \\\"SAND\\\", sandAdmin, executionAdmin) {\\n _changeAdmin(sandAdmin);\\n if (beneficiary != address(0)) {\\n uint256 initialSupply = amount * (1 ether);\\n _mint(beneficiary, initialSupply);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x8254a5881123a631ca9cc035e8d54667e5081ccd51971974eee43ac2b82bda78\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/sand/WithAdmin.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// solhint-disable-next-line compiler-version\\npragma solidity 0.8.23;\\n\\nimport {IErrors} from \\\"../interfaces/IErrors.sol\\\";\\n\\ncontract WithAdmin is IErrors {\\n address internal _admin;\\n\\n /// @dev Emits when the contract administrator is changed.\\n /// @param oldAdmin The address of the previous administrator.\\n /// @param newAdmin The address of the new administrator.\\n event AdminChanged(address indexed oldAdmin, address indexed newAdmin);\\n\\n modifier onlyAdmin() {\\n if (msg.sender != _admin) {\\n revert OnlyAdmin();\\n }\\n _;\\n }\\n\\n /// @dev Get the current administrator of this contract.\\n /// @return The current administrator of this contract.\\n function getAdmin() external view returns (address) {\\n return _admin;\\n }\\n\\n /// @dev Change the administrator to be `newAdmin`.\\n /// @param newAdmin The address of the new administrator.\\n function changeAdmin(address newAdmin) external onlyAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_admin, newAdmin);\\n _admin = newAdmin;\\n }\\n}\\n\",\"keccak256\":\"0x1e31132c4458d4d9206e04ffd9ff718ce214885619d17817a23ed1e71a09b7c5\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/sand/WithSuperOperators.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// solhint-disable-next-line compiler-version\\npragma solidity 0.8.23;\\n\\nimport {IErrors} from \\\"../interfaces/IErrors.sol\\\";\\nimport {WithAdmin} from \\\"./WithAdmin.sol\\\";\\n\\ncontract WithSuperOperators is IErrors, WithAdmin {\\n mapping(address => bool) internal _superOperators;\\n\\n event SuperOperator(address indexed superOperator, bool indexed enabled);\\n\\n /// @notice Enable or disable the ability of `superOperator` to transfer tokens of all (superOperator rights).\\n /// @param superOperator address that will be given/removed superOperator right.\\n /// @param enabled set whether the superOperator is enabled or disabled.\\n function setSuperOperator(address superOperator, bool enabled) external onlyAdmin {\\n _superOperators[superOperator] = enabled;\\n emit SuperOperator(superOperator, enabled);\\n }\\n\\n /// @notice check whether address `who` is given superOperator rights.\\n /// @param who The address to query.\\n /// @return whether the address has superOperator rights.\\n function isSuperOperator(address who) public view returns (bool) {\\n return _superOperators[who];\\n }\\n}\\n\",\"keccak256\":\"0x1ce81eb500d864992267e6c86e1fe01262efaa5707eb33cc1f8c7d01a3d4c207\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60e06040523480156200001157600080fd5b5060405162004c4c38038062004c4c8339810160408190526200003491620004cb565b6012828281818181878b8b6000806040518060400160405280600481526020016314d0539160e21b8152506040518060400160405280600481526020016314d0539160e21b815250858583600290816200008f9190620005e2565b5060036200009e8482620005e2565b50600080546001600160a01b0319166001600160a01b039384161790551660805250620000cd90508462000252565b6001600160a01b0382161562000103576000620000f382670de0b6b3a7640000620006c4565b9050620001018382620002ad565b505b5050506001600160a01b03821690506200013857604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6200014381620003b2565b506001600160a01b0380831660a05281166200017257604051632d618d8160e21b815260040160405180910390fd5b60a05160405163ca5eb5e160e01b81526001600160a01b0383811660048301529091169063ca5eb5e190602401600060405180830381600087803b158015620001ba57600080fd5b505af1158015620001cf573d6000803e3d6000fd5b5050505050505050620001e76200040460201b60201c565b60ff168360ff1610156200020e576040516301e9714b60e41b815260040160405180910390fd5b6200021b600684620006e4565b6200022890600a620007fd565b60c052506200023b915086905062000409565b62000247600162000453565b50505050506200082b565b600080546040516001600160a01b03808516939216917f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f91a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038216620002e15760405163ec442f0560e01b81526001600160a01b03831660048201526024016200012f565b80600003620003035760405163162908e360e11b815260040160405180910390fd5b600454600062000314838362000815565b90508181116200033757604051631a93c68960e11b815260040160405180910390fd5b60048190556001600160a01b038416600090815260056020526040812080548592906200036690849062000815565b90915550506040518381526001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a350505050565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600690565b600780546001600160a01b0319166001600160a01b0383169081179091556040517fd91237492a9e30cd2faf361fc103998a382ff0ec2b1b07dc1cbebb76ae2f1ea290600090a250565b600c805460ff60a01b1916600160a01b8315158102919091179182905560405160ff9190920416151581527f54ca1f89aee2b8d11c89b7813c6aa99caa0f8c55c8eccf8b70c3bb42029fa1349060200160405180910390a150565b80516001600160a01b0381168114620004c657600080fd5b919050565b600080600080600060a08688031215620004e457600080fd5b620004ef86620004ae565b9450620004ff60208701620004ae565b93506200050f60408701620004ae565b92506200051f60608701620004ae565b91506200052f60808701620004ae565b90509295509295909350565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200056657607f821691505b6020821081036200058757634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620005dd576000816000526020600020601f850160051c81016020861015620005b85750805b601f850160051c820191505b81811015620005d957828155600101620005c4565b5050505b505050565b81516001600160401b03811115620005fe57620005fe6200053b565b62000616816200060f845462000551565b846200058d565b602080601f8311600181146200064e5760008415620006355750858301515b600019600386901b1c1916600185901b178555620005d9565b600085815260208120601f198616915b828110156200067f578886015182559484019460019091019084016200065e565b50858210156200069e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417620006de57620006de620006ae565b92915050565b60ff8281168282160390811115620006de57620006de620006ae565b600181815b8085111562000741578160001904821115620007255762000725620006ae565b808516156200073357918102915b93841c939080029062000705565b509250929050565b6000826200075a57506001620006de565b816200076957506000620006de565b81600181146200078257600281146200078d57620007ad565b6001915050620006de565b60ff841115620007a157620007a1620006ae565b50506001821b620006de565b5060208310610133831016604e8410600b8410161715620007d2575081810a620006de565b620007de838362000700565b8060001904821115620007f557620007f5620006ae565b029392505050565b60006200080e60ff84168362000749565b9392505050565b80820180821115620006de57620006de620006ae565b60805160a05160c05161438f620008bd600039600081816108d401528181612a8201528181612af70152612bbe01526000818161071b01528181610ccc0152818161196f01528181611dec015281816124f101528181612cd801528181612f340152613017015260008181610e2401528181610fbb0152818161110601528181611f5001526125ee015261438f6000f3fe6080604052600436106103765760003560e01c806370a08231116101d1578063bb0b6a5311610102578063ce1b815f116100a0578063dd62ed3e1161006f578063dd62ed3e14610ac2578063f2fde38b14610b08578063fc0c546a14610670578063ff7bd03d14610b2857600080fd5b8063ce1b815f14610a51578063d045a0dc14610a6f578063d424388514610a82578063da74222814610aa257600080fd5b8063bd815db0116100dc578063bd815db0146109ea578063c7c7f5b3146109fd578063ca5eb5e114610a1e578063cae9ca5114610a3e57600080fd5b8063bb0b6a531461098a578063bb1e23cb146109b7578063bc70b354146109ca57600080fd5b806395d89b411161016f578063a9059cbb11610149578063a9059cbb1461090a578063ac9fe4211461092a578063b731ea0a1461094a578063b98bd0701461096a57600080fd5b806395d89b41146108ad578063963efcaa146108c25780639f68b964146108f657600080fd5b806382413eac116101ab57806382413eac1461083b578063857749b01461085b5780638da5cb5b1461086f5780638f2839701461088d57600080fd5b806370a08231146107b4578063715018a6146107ea5780637d25a05e146107ff57600080fd5b8063313ce567116102ab5780635535d461116102495780635e280f11116102235780635e280f1114610709578063654b748a1461073d5780636e9960c3146107765780636fc1b31e1461079457600080fd5b80635535d46114610683578063572b6c05146106a35780635a0dfe4d146106d257600080fd5b80633b7b5a16116102855780633b7b5a161461061057806342966c68146106305780634df68ada1461065057806352ae28791461067057600080fd5b8063313ce567146105a15780633400288b146105c35780633b6f743b146105e357600080fd5b806317442b70116103185780631dd319cb116102f25780631dd319cb1461052c5780631f5e13341461054c57806323b872dd146105615780632b9917461461058157600080fd5b806317442b70146104bb57806318160ddd146104dd57806318de0afd146104fc57600080fd5b8063111ecdad11610354578063111ecdad1461040557806313137d651461043d578063134d4f2514610452578063156a0d0f1461047a57600080fd5b806306fdde031461037b578063095ea7b3146103a65780630d35b415146103d6575b600080fd5b34801561038757600080fd5b50610390610b48565b60405161039d91906132e2565b60405180910390f35b3480156103b257600080fd5b506103c66103c136600461330a565b610bda565b604051901515815260200161039d565b3480156103e257600080fd5b506103f66103f136600461334e565b610bf8565b60405161039d93929190613383565b34801561041157600080fd5b50600c54610425906001600160a01b031681565b6040516001600160a01b03909116815260200161039d565b61045061044b366004613495565b610cca565b005b34801561045e57600080fd5b50610467600281565b60405161ffff909116815260200161039d565b34801561048657600080fd5b50604080517f02e49c2c000000000000000000000000000000000000000000000000000000008152600160208201520161039d565b3480156104c757600080fd5b506040805160018152600260208201520161039d565b3480156104e957600080fd5b506004545b60405190815260200161039d565b34801561050857600080fd5b50600c5474010000000000000000000000000000000000000000900460ff166103c6565b34801561053857600080fd5b5061045061054736600461330a565b610dbc565b34801561055857600080fd5b50610467600181565b34801561056d57600080fd5b506103c661057c366004613535565b610dca565b34801561058d57600080fd5b506103c661059c366004613535565b610f65565b3480156105ad57600080fd5b5060125b60405160ff909116815260200161039d565b3480156105cf57600080fd5b506104506105de36600461358f565b611037565b3480156105ef57600080fd5b506106036105fe3660046135b9565b611049565b60405161039d919061360b565b34801561061c57600080fd5b506103c661062b366004613535565b6110b0565b34801561063c57600080fd5b5061045061064b366004613622565b611182565b34801561065c57600080fd5b5061045061066b36600461363b565b611196565b34801561067c57600080fd5b5030610425565b34801561068f57600080fd5b5061039061069e36600461366a565b6111ca565b3480156106af57600080fd5b506103c66106be36600461369d565b6007546001600160a01b0391821691161490565b3480156106de57600080fd5b506103c66106ed36600461358f565b63ffffffff919091166000908152600960205260409020541490565b34801561071557600080fd5b506104257f000000000000000000000000000000000000000000000000000000000000000081565b34801561074957600080fd5b506103c661075836600461369d565b6001600160a01b031660009081526001602052604090205460ff1690565b34801561078257600080fd5b506000546001600160a01b0316610425565b3480156107a057600080fd5b506104506107af36600461369d565b61126f565b3480156107c057600080fd5b506104ee6107cf36600461369d565b6001600160a01b031660009081526005602052604090205490565b3480156107f657600080fd5b506104506112d9565b34801561080b57600080fd5b5061082261081a36600461358f565b600092915050565b60405167ffffffffffffffff909116815260200161039d565b34801561084757600080fd5b506103c66108563660046136ba565b6112ed565b34801561086757600080fd5b5060066105b1565b34801561087b57600080fd5b506008546001600160a01b0316610425565b34801561089957600080fd5b506104506108a836600461369d565b611302565b3480156108b957600080fd5b50610390611336565b3480156108ce57600080fd5b506104ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561090257600080fd5b5060006103c6565b34801561091657600080fd5b506103c661092536600461330a565b611345565b34801561093657600080fd5b50610450610945366004613721565b611359565b34801561095657600080fd5b50600a54610425906001600160a01b031681565b34801561097657600080fd5b50610450610985366004613794565b6113f6565b34801561099657600080fd5b506104ee6109a53660046137d6565b60096020526000908152604090205481565b6103906109c53660046137f1565b611410565b3480156109d657600080fd5b506103906109e536600461384d565b611546565b6104506109f8366004613794565b611707565b610a10610a0b366004613896565b6118aa565b60405161039d929190613904565b348015610a2a57600080fd5b50610450610a3936600461369d565b61192f565b610390610a4c3660046137f1565b6119ce565b348015610a5d57600080fd5b506007546001600160a01b0316610425565b610450610a7d366004613495565b611a5b565b348015610a8e57600080fd5b50610450610a9d36600461369d565b611aa3565b348015610aae57600080fd5b50610450610abd36600461369d565b611b06565b348015610ace57600080fd5b506104ee610add366004613957565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b348015610b1457600080fd5b50610450610b2336600461369d565b611b3d565b348015610b3457600080fd5b506103c6610b43366004613985565b611b91565b606060028054610b57906139a1565b80601f0160208091040260200160405190810160405280929190818152602001828054610b83906139a1565b8015610bd05780601f10610ba557610100808354040283529160200191610bd0565b820191906000526020600020905b815481529060010190602001808311610bb357829003601f168201915b5050505050905090565b6000610bee610be7611bc7565b8484611bd6565b5060015b92915050565b60408051808201909152600080825260208201526060610c2b604051806040016040528060008152602001600081525090565b604080518082018252600080825267ffffffffffffffff602080840182905284518381529081019094529195509182610c87565b604080518082019091526000815260606020820152815260200190600190039081610c5f5790505b509350600080610cac604089013560608a0135610ca760208c018c6137d6565b611c8c565b60408051808201909152918252602082015296989597505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163314610d33576040517f91ac5e4f0000000000000000000000000000000000000000000000000000000081523360048201526024015b60405180910390fd5b60208701803590610d4d90610d48908a6137d6565b611ce9565b14610da457610d5f60208801886137d6565b6040517fc26bebcc00000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015260208801356024820152604401610d2a565b610db387878787878787611d3e565b50505050505050565b610dc68282611ebe565b5050565b6000836001600160a01b0316610dde611bc7565b6001600160a01b031614158015610e1b575060016000610dfc611bc7565b6001600160a01b0316815260208101919091526040016000205460ff16155b8015610e6057507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610e54611bc7565b6001600160a01b031614155b15610f4f576001600160a01b038416600090815260066020526040812081610e86611bc7565b6001600160a01b0316815260208101919091526040016000205490506000198114610f4d5782811015610f0757610ebb611bc7565b6040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024810182905260448101849052606401610d2a565b610f118382613a01565b6001600160a01b038616600090815260066020526040812090610f32611bc7565b6001600160a01b031681526020810191909152604001600020555b505b610f5a848484612162565b5060015b9392505050565b6000836001600160a01b0316610f79611bc7565b6001600160a01b03161480610fb3575060016000610f95611bc7565b6001600160a01b0316815260208101919091526040016000205460ff165b80610ff657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610feb611bc7565b6001600160a01b0316145b61102c576040517fea8e4eb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f5a848484611bd6565b61103f6122c8565b610dc6828261233f565b6040805180820190915260008082526020820152600061107960408501356060860135610ca760208801886137d6565b9150506000806110898684612394565b90925090506110a661109e60208801886137d6565b8383886124db565b9695505050505050565b6000836001600160a01b03166110c4611bc7565b6001600160a01b031614806110fe5750600160006110e0611bc7565b6001600160a01b0316815260208101919091526040016000205460ff165b8061114157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611136611bc7565b6001600160a01b0316145b611177576040517fddb5de5e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f5a8484846125bc565b61119361118d611bc7565b82611ebe565b50565b6000546001600160a01b031633146111c157604051634755657960e01b815260040160405180910390fd5b61119381612668565b600b602090815260009283526040808420909152908252902080546111ee906139a1565b80601f016020809104026020016040519081016040528092919081815260200182805461121a906139a1565b80156112675780601f1061123c57610100808354040283529160200191611267565b820191906000526020600020905b81548152906001019060200180831161124a57829003601f168201915b505050505081565b6112776122c8565b600c805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527ff0be4f1e87349231d80c36b33f9e8639658eeaf474014dee15a3e6a4d4414197906020015b60405180910390a150565b6112e16122c8565b6112eb60006126e9565b565b6001600160a01b03811630145b949350505050565b6000546001600160a01b0316331461132d57604051634755657960e01b815260040160405180910390fd5b61119381612748565b606060038054610b57906139a1565b6000610bee611352611bc7565b8484612162565b6000546001600160a01b0316331461138457604051634755657960e01b815260040160405180910390fd5b6001600160a01b03821660008181526001602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915590519092917f44f92d27abdf4cfb6a7d712c3af68f3be086d4ca747ab802c36f67d6790060d891a35050565b6113fe6122c8565b610dc661140b8284613ab9565b6127b0565b606061145a83838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506114559250611bc7915050565b6128b7565b611490576040517fb42a7caa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83156114a8576114a86114a1611bc7565b86866125bc565b600080866001600160a01b03163486866040516114c6929190613bcf565b60006040518083038185875af1925050503d8060008114611503576040519150601f19603f3d011682016040523d82523d6000602084013e611508565b606091505b5091509150816110a657806040517fb5e1dc2d000000000000000000000000000000000000000000000000000000008152600401610d2a91906132e2565b63ffffffff84166000908152600b6020908152604080832061ffff8716845290915281208054606092919061157a906139a1565b80601f01602080910402602001604051908101604052809291908181526020018280546115a6906139a1565b80156115f35780601f106115c8576101008083540402835291602001916115f3565b820191906000526020600020905b8154815290600101906020018083116115d657829003601f168201915b5050505050905080516000036116435783838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294506112fa9350505050565b60008390036116535790506112fa565b600283106116d15761169a84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506128e292505050565b806116a88460028188613bdf565b6040516020016116ba93929190613c09565b6040516020818303038152906040529150506112fa565b83836040517f9a6d49cd000000000000000000000000000000000000000000000000000000008152600401610d2a929190613c5c565b60005b81811015611810573683838381811061172557611725613c70565b90506020028101906117379190613c86565b905061176a61174960208301836137d6565b602083013563ffffffff919091166000908152600960205260409020541490565b6117745750611808565b3063d045a0dc60c08301358360a0810135611793610100830183613cc4565b6117a4610100890160e08a0161369d565b6117b26101208a018a613cc4565b6040518963ffffffff1660e01b81526004016117d49796959493929190613d3f565b6000604051808303818588803b1580156117ed57600080fd5b505af1158015611801573d6000803e3d6000fd5b5050505050505b60010161170a565b50336001600160a01b0316638e9e70996040518163ffffffff1660e01b8152600401600060405180830381865afa15801561184f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526118779190810190613dc6565b6040517f8351eea7000000000000000000000000000000000000000000000000000000008152600401610d2a91906132e2565b6118b261324a565b6040805180820190915260008082526020820152600c5474010000000000000000000000000000000000000000900460ff1661191a576040517f3a4155f600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611925858585612927565b5050935093915050565b6119376122c8565b6040517fca5eb5e10000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063ca5eb5e190602401600060405180830381600087803b1580156119b357600080fd5b505af11580156119c7573d6000803e3d6000fd5b5050505050565b6060611a1383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506114559250611bc7915050565b611a49576040517fb42a7caa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114a8611a54611bc7565b8686611bd6565b333014611a94576040517f14d4a4e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610db387878787878787610da4565b611aab6122c8565b600a805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fd48d879cef83a1c0bdda516f27b13ddb1b3f8bbac1c9e1511bb2a659c2427760906020016112ce565b611b0e6122c8565b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b611b456122c8565b6001600160a01b038116611b88576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610d2a565b611193816126e9565b6000602082018035906009908390611ba990866137d6565b63ffffffff1681526020810191909152604001600020541492915050565b6000611bd1612a39565b905090565b6001600160a01b0383161580611bf357506001600160a01b038216155b15611c2a576040517f0cbe44ec00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0383811660008181526006602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b600080611c9885612a7e565b915081905083811015611ce1576040517f71c4efed0000000000000000000000000000000000000000000000000000000081526004810182905260248101859052604401610d2a565b935093915050565b63ffffffff811660009081526009602052604081205480610bf2576040517ff6ff4fb700000000000000000000000000000000000000000000000000000000815263ffffffff84166004820152602401610d2a565b6000611d50611d4d8787612ab5565b90565b90506000611d7c82611d6a611d658a8a612acd565b612af0565b611d7760208d018d6137d6565b612b26565b90506028861115611e5c576000611db9611d9c60608c0160408d01613e34565b611da960208d018d6137d6565b84611db48c8c612b3a565b612b85565b6040517f7cb590120000000000000000000000000000000000000000000000000000000081529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690637cb5901290611e289086908d906000908790600401613e51565b600060405180830381600087803b158015611e4257600080fd5b505af1158015611e56573d6000803e3d6000fd5b50505050505b6001600160a01b038216887fefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c611e9560208d018d6137d6565b6040805163ffffffff9092168252602082018690520160405180910390a3505050505050505050565b80600003611ef8576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816001600160a01b0316611f0a611bc7565b6001600160a01b031614158015611f47575060016000611f28611bc7565b6001600160a01b0316815260208101919091526040016000205460ff16155b8015611f8c57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611f80611bc7565b6001600160a01b031614155b1561207b576001600160a01b038216600090815260066020526040812081611fb2611bc7565b6001600160a01b0316815260208101919091526040016000205490506000198114612079578181101561203357611fe7611bc7565b6040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024810182905260448101839052606401610d2a565b61203d8282613a01565b6001600160a01b03841660009081526006602052604081209061205e611bc7565b6001600160a01b031681526020810191909152604001600020555b505b6001600160a01b038216600090815260056020526040902054818110156120e7576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401610d2a565b6120f18282613a01565b6001600160a01b0384166000908152600560205260408120919091556004805484929061211f908490613a01565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001611c7f565b6001600160a01b038216158061218057506001600160a01b03821630145b156121c2576040517fec442f050000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610d2a565b6001600160a01b0383166000908152600560205260409020548181101561222e576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401610d2a565b6122388282613a01565b6001600160a01b03808616600090815260056020526040808220939093559085168152908120805484929061226e908490613e83565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516122ba91815260200190565b60405180910390a350505050565b6122d0611bc7565b6001600160a01b03166122eb6008546001600160a01b031690565b6001600160a01b0316146112eb57612301611bc7565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526001600160a01b039091166004820152602401610d2a565b63ffffffff8216600081815260096020908152604091829020849055815192835282018390527f238399d427b947898edb290f5ff0f9109849b1c3ba196a42e35f00c50a54b98b910160405180910390a15050565b60608060006123fa85602001356123aa86612bb7565b6123b760a0890189613cc4565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506123f59250611bc7915050565b612be3565b909350905060008161240d576001612410565b60025b905061243061242260208801886137d6565b826109e560808a018a613cc4565b600c549093506001600160a01b0316156124d257600c546040517f043a78eb0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063043a78eb9061248f9087908790600401613e96565b602060405180830381865afa1580156124ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124d09190613ebb565b505b50509250929050565b60408051808201909152600080825260208201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ddc28c586040518060a001604052808863ffffffff16815260200161253e89611ce9565b8152602001878152602001868152602001851515815250306040518363ffffffff1660e01b8152600401612573929190613ed8565b6040805180830381865afa15801561258f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125b39190613f81565b95945050505050565b6000811180156125e557506001600160a01b03821660009081526001602052604090205460ff16155b801561262357507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614155b15612663576001600160a01b038084166000908152600660209081526040808320938616835292905220548181101561266157612661848484611bd6565b505b505050565b600c80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000008315158102919091179182905560405160ff9190920416151581527f54ca1f89aee2b8d11c89b7813c6aa99caa0f8c55c8eccf8b70c3bb42029fa134906020016112ce565b600880546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080546040516001600160a01b03808516939216917f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f91a36000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60005b8151811015612887576127e28282815181106127d1576127d1613c70565b6020026020010151604001516128e2565b8181815181106127f4576127f4613c70565b602002602001015160400151600b600084848151811061281657612816613c70565b60200260200101516000015163ffffffff1663ffffffff168152602001908152602001600020600084848151811061285057612850613c70565b60200260200101516020015161ffff1661ffff168152602001908152602001600020908161287e9190613fed565b506001016127b3565b507fbe4864a8e820971c0247f5992e2da559595f7bf076a21cb5928d443d2a13b674816040516112ce91906140ad565b60006044835110156128cb57506000610bf2565b5060248201516001600160a01b0382161492915050565b600281015161ffff8116600314610dc657816040517f9a6d49cd000000000000000000000000000000000000000000000000000000008152600401610d2a91906132e2565b61292f61324a565b604080518082019091526000808252602082015260008061296d612951611bc7565b604089013560608a013561296860208c018c6137d6565b612c7f565b9150915060008061297e8984612394565b90925090506129aa61299360208b018b6137d6565b83836129a4368d90038d018d614138565b8b612ca5565b955060405180604001604052808581526020018481525094506129cb611bc7565b86516001600160a01b0391909116907f85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a612a0860208d018d6137d6565b6040805163ffffffff909216825260208201899052810187905260600160405180910390a350505050935093915050565b6007546000906001600160a01b03163303612a7957507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c90565b503390565b60007f0000000000000000000000000000000000000000000000000000000000000000612aab818461416a565b610bf2919061418c565b6000612ac46020828486613bdf565b610f5e916141a3565b6000612add602860208486613bdf565b612ae6916141c1565b60c01c9392505050565b6000610bf27f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff841661418c565b6000612b328484612db0565b509092915050565b6060612b498260288186613bdf565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929695505050505050565b606084848484604051602001612b9e9493929190614209565b6040516020818303038152906040529050949350505050565b6000610bf27f00000000000000000000000000000000000000000000000000000000000000008361416a565b8151606090151580612c44578585604051602001612c3092919091825260c01b7fffffffffffffffff00000000000000000000000000000000000000000000000016602082015260280190565b604051602081830303815290604052612c74565b85856001600160a01b03851686604051602001612c649493929190614287565b6040516020818303038152906040525b915094509492505050565b600080612c8d858585611c8c565b9092509050612c9c8683611ebe565b94509492505050565b612cad61324a565b6000612cbc8460000151612eef565b602085015190915015612cd657612cd68460200151612f30565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632637a450826040518060a001604052808b63ffffffff168152602001612d268c611ce9565b81526020018a815260200189815260200160008960200151111515815250866040518463ffffffff1660e01b8152600401612d62929190613ed8565b60806040518083038185885af1158015612d80573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612da591906142e0565b979650505050505050565b6001600160a01b038216612dfb576040517fec442f050000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610d2a565b80600003612e35576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004546000612e448383613e83565b9050818111612e7f576040517f35278d1200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60048190556001600160a01b03841660009081526005602052604081208054859290612eac908490613e83565b90915550506040518381526001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016122ba565b6000813414612f2c576040517f9f704120000000000000000000000000000000000000000000000000000000008152346004820152602401610d2a565b5090565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e4fe1d946040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fb4919061432a565b90506001600160a01b038116612ff6576040517f5373352a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610dc6613001611bc7565b604080516001600160a01b0383811660248301527f0000000000000000000000000000000000000000000000000000000000000000808216604484015260648084018990528451808503909101815260849093019093526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790528516929190869061266190859060006130b98383613120565b905080516000141580156130de5750808060200190518101906130dc9190613ebb565b155b15612663576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610d2a565b6060610f5e8383600084600080856001600160a01b031684866040516131469190614347565b60006040518083038185875af1925050503d8060008114613183576040519150601f19603f3d011682016040523d82523d6000602084013e613188565b606091505b50915091506110a68683836060826131a8576131a382613208565b610f5e565b81511580156131bf57506001600160a01b0384163b155b15613201576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401610d2a565b5080610f5e565b8051156132185780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604051806060016040528060008019168152602001600067ffffffffffffffff16815260200161328d604051806040016040528060008152602001600081525090565b905290565b60005b838110156132ad578181015183820152602001613295565b50506000910152565b600081518084526132ce816020860160208601613292565b601f01601f19169290920160200192915050565b602081526000610f5e60208301846132b6565b6001600160a01b038116811461119357600080fd5b6000806040838503121561331d57600080fd5b8235613328816132f5565b946020939093013593505050565b600060e0828403121561334857600080fd5b50919050565b60006020828403121561336057600080fd5b813567ffffffffffffffff81111561337757600080fd5b6112fa84828501613336565b8351815260208085015190820152600060a08201604060a0604085015281865180845260c08601915060c08160051b8701019350602080890160005b8381101561341c578887037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff40018552815180518852830151838801879052613409878901826132b6565b97505093820193908201906001016133bf565b505087516060880152505050602085015160808501525090506112fa565b60006060828403121561334857600080fd5b60008083601f84011261345e57600080fd5b50813567ffffffffffffffff81111561347657600080fd5b60208301915083602082850101111561348e57600080fd5b9250929050565b600080600080600080600060e0888a0312156134b057600080fd5b6134ba898961343a565b965060608801359550608088013567ffffffffffffffff808211156134de57600080fd5b6134ea8b838c0161344c565b909750955060a08a013591506134ff826132f5565b90935060c0890135908082111561351557600080fd5b506135228a828b0161344c565b989b979a50959850939692959293505050565b60008060006060848603121561354a57600080fd5b8335613555816132f5565b92506020840135613565816132f5565b929592945050506040919091013590565b803563ffffffff8116811461358a57600080fd5b919050565b600080604083850312156135a257600080fd5b61332883613576565b801515811461119357600080fd5b600080604083850312156135cc57600080fd5b823567ffffffffffffffff8111156135e357600080fd5b6135ef85828601613336565b9250506020830135613600816135ab565b809150509250929050565b815181526020808301519082015260408101610bf2565b60006020828403121561363457600080fd5b5035919050565b60006020828403121561364d57600080fd5b8135610f5e816135ab565b803561ffff8116811461358a57600080fd5b6000806040838503121561367d57600080fd5b61368683613576565b915061369460208401613658565b90509250929050565b6000602082840312156136af57600080fd5b8135610f5e816132f5565b60008060008060a085870312156136d057600080fd5b6136da868661343a565b9350606085013567ffffffffffffffff8111156136f657600080fd5b6137028782880161344c565b9094509250506080850135613716816132f5565b939692955090935050565b6000806040838503121561373457600080fd5b823561373f816132f5565b91506020830135613600816135ab565b60008083601f84011261376157600080fd5b50813567ffffffffffffffff81111561377957600080fd5b6020830191508360208260051b850101111561348e57600080fd5b600080602083850312156137a757600080fd5b823567ffffffffffffffff8111156137be57600080fd5b6137ca8582860161374f565b90969095509350505050565b6000602082840312156137e857600080fd5b610f5e82613576565b6000806000806060858703121561380757600080fd5b8435613812816132f5565b935060208501359250604085013567ffffffffffffffff81111561383557600080fd5b6138418782880161344c565b95989497509550505050565b6000806000806060858703121561386357600080fd5b61386c85613576565b935061387a60208601613658565b9250604085013567ffffffffffffffff81111561383557600080fd5b600080600083850360808112156138ac57600080fd5b843567ffffffffffffffff8111156138c357600080fd5b6138cf87828801613336565b9450506040601f19820112156138e457600080fd5b5060208401915060608401356138f9816132f5565b809150509250925092565b600060c0820190508351825267ffffffffffffffff60208501511660208301526040840151613940604084018280518252602090810151910152565b5082516080830152602083015160a0830152610f5e565b6000806040838503121561396a57600080fd5b8235613975816132f5565b91506020830135613600816132f5565b60006060828403121561399757600080fd5b610f5e838361343a565b600181811c908216806139b557607f821691505b60208210810361334857634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610bf257610bf26139eb565b6040516060810167ffffffffffffffff81118282101715613a3757613a376139d5565b60405290565b6040805190810167ffffffffffffffff81118282101715613a3757613a376139d5565b604051601f8201601f1916810167ffffffffffffffff81118282101715613a8957613a896139d5565b604052919050565b600067ffffffffffffffff821115613aab57613aab6139d5565b50601f01601f191660200190565b600067ffffffffffffffff80841115613ad457613ad46139d5565b8360051b6020613ae5818301613a60565b868152918501918181019036841115613afd57600080fd5b865b84811015613bc357803586811115613b175760008081fd5b88016060368290031215613b2b5760008081fd5b613b33613a14565b613b3c82613576565b8152613b49868301613658565b8682015260408083013589811115613b615760008081fd5b929092019136601f840112613b765760008081fd5b8235613b89613b8482613a91565b613a60565b8181523689838701011115613b9e5760008081fd5b818986018a830137600091810189019190915290820152845250918301918301613aff565b50979650505050505050565b8183823760009101908152919050565b60008085851115613bef57600080fd5b83861115613bfc57600080fd5b5050820193919092039150565b60008451613c1b818460208901613292565b8201838582376000930192835250909392505050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b6020815260006112fa602083018486613c31565b634e487b7160e01b600052603260045260246000fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec1833603018112613cba57600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613cf957600080fd5b83018035915067ffffffffffffffff821115613d1457600080fd5b60200191503681900382131561348e57600080fd5b67ffffffffffffffff8116811461119357600080fd5b63ffffffff613d4d89613576565b1681526020880135602082015260006040890135613d6a81613d29565b67ffffffffffffffff811660408401525087606083015260e06080830152613d9660e083018789613c31565b6001600160a01b03861660a084015282810360c0840152613db8818587613c31565b9a9950505050505050505050565b600060208284031215613dd857600080fd5b815167ffffffffffffffff811115613def57600080fd5b8201601f81018413613e0057600080fd5b8051613e0e613b8482613a91565b818152856020838501011115613e2357600080fd5b6125b3826020830160208601613292565b600060208284031215613e4657600080fd5b8135610f5e81613d29565b6001600160a01b038516815283602082015261ffff831660408201526080606082015260006110a660808301846132b6565b80820180821115610bf257610bf26139eb565b604081526000613ea960408301856132b6565b82810360208401526125b381856132b6565b600060208284031215613ecd57600080fd5b8151610f5e816135ab565b6040815263ffffffff8351166040820152602083015160608201526000604084015160a06080840152613f0e60e08401826132b6565b90506060850151603f198483030160a0850152613f2b82826132b6565b60809690960151151560c08501525050506001600160a01b039190911660209091015290565b600060408284031215613f6357600080fd5b613f6b613a3d565b9050815181526020820151602082015292915050565b600060408284031215613f9357600080fd5b610f5e8383613f51565b601f821115612663576000816000526020600020601f850160051c81016020861015613fc65750805b601f850160051c820191505b81811015613fe557828155600101613fd2565b505050505050565b815167ffffffffffffffff811115614007576140076139d5565b61401b8161401584546139a1565b84613f9d565b602080601f83116001811461405057600084156140385750858301515b600019600386901b1c1916600185901b178555613fe5565b600085815260208120601f198616915b8281101561407f57888601518255948401946001909101908401614060565b508582101561409d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b8381101561412a57888303603f190185528151805163ffffffff1684528781015161ffff16888501528601516060878501819052614116818601836132b6565b9689019694505050908601906001016140d6565b509098975050505050505050565b60006040828403121561414a57600080fd5b614152613a3d565b82358152602083013560208201528091505092915050565b60008261418757634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610bf257610bf26139eb565b80356020831015610bf257600019602084900360031b1b1692915050565b7fffffffffffffffff00000000000000000000000000000000000000000000000081358181169160088510156142015780818660080360031b1b83161692505b505092915050565b7fffffffffffffffff0000000000000000000000000000000000000000000000008560c01b1681527fffffffff000000000000000000000000000000000000000000000000000000008460e01b16600882015282600c8201526000825161427781602c850160208701613292565b91909101602c0195945050505050565b8481527fffffffffffffffff0000000000000000000000000000000000000000000000008460c01b166020820152826028820152600082516142d0816048850160208701613292565b9190910160480195945050505050565b6000608082840312156142f257600080fd5b6142fa613a14565b82518152602083015161430c81613d29565b602082015261431e8460408501613f51565b60408201529392505050565b60006020828403121561433c57600080fd5b8151610f5e816132f5565b60008251613cba81846020870161329256fea26469706673582212205d8189a387e58495723f0d49c0b4599049735f611a555fdb290fde04ed49f9a964736f6c63430008170033", + "deployedBytecode": "0x6080604052600436106103765760003560e01c806370a08231116101d1578063bb0b6a5311610102578063ce1b815f116100a0578063dd62ed3e1161006f578063dd62ed3e14610ac2578063f2fde38b14610b08578063fc0c546a14610670578063ff7bd03d14610b2857600080fd5b8063ce1b815f14610a51578063d045a0dc14610a6f578063d424388514610a82578063da74222814610aa257600080fd5b8063bd815db0116100dc578063bd815db0146109ea578063c7c7f5b3146109fd578063ca5eb5e114610a1e578063cae9ca5114610a3e57600080fd5b8063bb0b6a531461098a578063bb1e23cb146109b7578063bc70b354146109ca57600080fd5b806395d89b411161016f578063a9059cbb11610149578063a9059cbb1461090a578063ac9fe4211461092a578063b731ea0a1461094a578063b98bd0701461096a57600080fd5b806395d89b41146108ad578063963efcaa146108c25780639f68b964146108f657600080fd5b806382413eac116101ab57806382413eac1461083b578063857749b01461085b5780638da5cb5b1461086f5780638f2839701461088d57600080fd5b806370a08231146107b4578063715018a6146107ea5780637d25a05e146107ff57600080fd5b8063313ce567116102ab5780635535d461116102495780635e280f11116102235780635e280f1114610709578063654b748a1461073d5780636e9960c3146107765780636fc1b31e1461079457600080fd5b80635535d46114610683578063572b6c05146106a35780635a0dfe4d146106d257600080fd5b80633b7b5a16116102855780633b7b5a161461061057806342966c68146106305780634df68ada1461065057806352ae28791461067057600080fd5b8063313ce567146105a15780633400288b146105c35780633b6f743b146105e357600080fd5b806317442b70116103185780631dd319cb116102f25780631dd319cb1461052c5780631f5e13341461054c57806323b872dd146105615780632b9917461461058157600080fd5b806317442b70146104bb57806318160ddd146104dd57806318de0afd146104fc57600080fd5b8063111ecdad11610354578063111ecdad1461040557806313137d651461043d578063134d4f2514610452578063156a0d0f1461047a57600080fd5b806306fdde031461037b578063095ea7b3146103a65780630d35b415146103d6575b600080fd5b34801561038757600080fd5b50610390610b48565b60405161039d91906132e2565b60405180910390f35b3480156103b257600080fd5b506103c66103c136600461330a565b610bda565b604051901515815260200161039d565b3480156103e257600080fd5b506103f66103f136600461334e565b610bf8565b60405161039d93929190613383565b34801561041157600080fd5b50600c54610425906001600160a01b031681565b6040516001600160a01b03909116815260200161039d565b61045061044b366004613495565b610cca565b005b34801561045e57600080fd5b50610467600281565b60405161ffff909116815260200161039d565b34801561048657600080fd5b50604080517f02e49c2c000000000000000000000000000000000000000000000000000000008152600160208201520161039d565b3480156104c757600080fd5b506040805160018152600260208201520161039d565b3480156104e957600080fd5b506004545b60405190815260200161039d565b34801561050857600080fd5b50600c5474010000000000000000000000000000000000000000900460ff166103c6565b34801561053857600080fd5b5061045061054736600461330a565b610dbc565b34801561055857600080fd5b50610467600181565b34801561056d57600080fd5b506103c661057c366004613535565b610dca565b34801561058d57600080fd5b506103c661059c366004613535565b610f65565b3480156105ad57600080fd5b5060125b60405160ff909116815260200161039d565b3480156105cf57600080fd5b506104506105de36600461358f565b611037565b3480156105ef57600080fd5b506106036105fe3660046135b9565b611049565b60405161039d919061360b565b34801561061c57600080fd5b506103c661062b366004613535565b6110b0565b34801561063c57600080fd5b5061045061064b366004613622565b611182565b34801561065c57600080fd5b5061045061066b36600461363b565b611196565b34801561067c57600080fd5b5030610425565b34801561068f57600080fd5b5061039061069e36600461366a565b6111ca565b3480156106af57600080fd5b506103c66106be36600461369d565b6007546001600160a01b0391821691161490565b3480156106de57600080fd5b506103c66106ed36600461358f565b63ffffffff919091166000908152600960205260409020541490565b34801561071557600080fd5b506104257f000000000000000000000000000000000000000000000000000000000000000081565b34801561074957600080fd5b506103c661075836600461369d565b6001600160a01b031660009081526001602052604090205460ff1690565b34801561078257600080fd5b506000546001600160a01b0316610425565b3480156107a057600080fd5b506104506107af36600461369d565b61126f565b3480156107c057600080fd5b506104ee6107cf36600461369d565b6001600160a01b031660009081526005602052604090205490565b3480156107f657600080fd5b506104506112d9565b34801561080b57600080fd5b5061082261081a36600461358f565b600092915050565b60405167ffffffffffffffff909116815260200161039d565b34801561084757600080fd5b506103c66108563660046136ba565b6112ed565b34801561086757600080fd5b5060066105b1565b34801561087b57600080fd5b506008546001600160a01b0316610425565b34801561089957600080fd5b506104506108a836600461369d565b611302565b3480156108b957600080fd5b50610390611336565b3480156108ce57600080fd5b506104ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561090257600080fd5b5060006103c6565b34801561091657600080fd5b506103c661092536600461330a565b611345565b34801561093657600080fd5b50610450610945366004613721565b611359565b34801561095657600080fd5b50600a54610425906001600160a01b031681565b34801561097657600080fd5b50610450610985366004613794565b6113f6565b34801561099657600080fd5b506104ee6109a53660046137d6565b60096020526000908152604090205481565b6103906109c53660046137f1565b611410565b3480156109d657600080fd5b506103906109e536600461384d565b611546565b6104506109f8366004613794565b611707565b610a10610a0b366004613896565b6118aa565b60405161039d929190613904565b348015610a2a57600080fd5b50610450610a3936600461369d565b61192f565b610390610a4c3660046137f1565b6119ce565b348015610a5d57600080fd5b506007546001600160a01b0316610425565b610450610a7d366004613495565b611a5b565b348015610a8e57600080fd5b50610450610a9d36600461369d565b611aa3565b348015610aae57600080fd5b50610450610abd36600461369d565b611b06565b348015610ace57600080fd5b506104ee610add366004613957565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b348015610b1457600080fd5b50610450610b2336600461369d565b611b3d565b348015610b3457600080fd5b506103c6610b43366004613985565b611b91565b606060028054610b57906139a1565b80601f0160208091040260200160405190810160405280929190818152602001828054610b83906139a1565b8015610bd05780601f10610ba557610100808354040283529160200191610bd0565b820191906000526020600020905b815481529060010190602001808311610bb357829003601f168201915b5050505050905090565b6000610bee610be7611bc7565b8484611bd6565b5060015b92915050565b60408051808201909152600080825260208201526060610c2b604051806040016040528060008152602001600081525090565b604080518082018252600080825267ffffffffffffffff602080840182905284518381529081019094529195509182610c87565b604080518082019091526000815260606020820152815260200190600190039081610c5f5790505b509350600080610cac604089013560608a0135610ca760208c018c6137d6565b611c8c565b60408051808201909152918252602082015296989597505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163314610d33576040517f91ac5e4f0000000000000000000000000000000000000000000000000000000081523360048201526024015b60405180910390fd5b60208701803590610d4d90610d48908a6137d6565b611ce9565b14610da457610d5f60208801886137d6565b6040517fc26bebcc00000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015260208801356024820152604401610d2a565b610db387878787878787611d3e565b50505050505050565b610dc68282611ebe565b5050565b6000836001600160a01b0316610dde611bc7565b6001600160a01b031614158015610e1b575060016000610dfc611bc7565b6001600160a01b0316815260208101919091526040016000205460ff16155b8015610e6057507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610e54611bc7565b6001600160a01b031614155b15610f4f576001600160a01b038416600090815260066020526040812081610e86611bc7565b6001600160a01b0316815260208101919091526040016000205490506000198114610f4d5782811015610f0757610ebb611bc7565b6040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024810182905260448101849052606401610d2a565b610f118382613a01565b6001600160a01b038616600090815260066020526040812090610f32611bc7565b6001600160a01b031681526020810191909152604001600020555b505b610f5a848484612162565b5060015b9392505050565b6000836001600160a01b0316610f79611bc7565b6001600160a01b03161480610fb3575060016000610f95611bc7565b6001600160a01b0316815260208101919091526040016000205460ff165b80610ff657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610feb611bc7565b6001600160a01b0316145b61102c576040517fea8e4eb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f5a848484611bd6565b61103f6122c8565b610dc6828261233f565b6040805180820190915260008082526020820152600061107960408501356060860135610ca760208801886137d6565b9150506000806110898684612394565b90925090506110a661109e60208801886137d6565b8383886124db565b9695505050505050565b6000836001600160a01b03166110c4611bc7565b6001600160a01b031614806110fe5750600160006110e0611bc7565b6001600160a01b0316815260208101919091526040016000205460ff165b8061114157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611136611bc7565b6001600160a01b0316145b611177576040517fddb5de5e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f5a8484846125bc565b61119361118d611bc7565b82611ebe565b50565b6000546001600160a01b031633146111c157604051634755657960e01b815260040160405180910390fd5b61119381612668565b600b602090815260009283526040808420909152908252902080546111ee906139a1565b80601f016020809104026020016040519081016040528092919081815260200182805461121a906139a1565b80156112675780601f1061123c57610100808354040283529160200191611267565b820191906000526020600020905b81548152906001019060200180831161124a57829003601f168201915b505050505081565b6112776122c8565b600c805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527ff0be4f1e87349231d80c36b33f9e8639658eeaf474014dee15a3e6a4d4414197906020015b60405180910390a150565b6112e16122c8565b6112eb60006126e9565b565b6001600160a01b03811630145b949350505050565b6000546001600160a01b0316331461132d57604051634755657960e01b815260040160405180910390fd5b61119381612748565b606060038054610b57906139a1565b6000610bee611352611bc7565b8484612162565b6000546001600160a01b0316331461138457604051634755657960e01b815260040160405180910390fd5b6001600160a01b03821660008181526001602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915590519092917f44f92d27abdf4cfb6a7d712c3af68f3be086d4ca747ab802c36f67d6790060d891a35050565b6113fe6122c8565b610dc661140b8284613ab9565b6127b0565b606061145a83838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506114559250611bc7915050565b6128b7565b611490576040517fb42a7caa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83156114a8576114a86114a1611bc7565b86866125bc565b600080866001600160a01b03163486866040516114c6929190613bcf565b60006040518083038185875af1925050503d8060008114611503576040519150601f19603f3d011682016040523d82523d6000602084013e611508565b606091505b5091509150816110a657806040517fb5e1dc2d000000000000000000000000000000000000000000000000000000008152600401610d2a91906132e2565b63ffffffff84166000908152600b6020908152604080832061ffff8716845290915281208054606092919061157a906139a1565b80601f01602080910402602001604051908101604052809291908181526020018280546115a6906139a1565b80156115f35780601f106115c8576101008083540402835291602001916115f3565b820191906000526020600020905b8154815290600101906020018083116115d657829003601f168201915b5050505050905080516000036116435783838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294506112fa9350505050565b60008390036116535790506112fa565b600283106116d15761169a84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506128e292505050565b806116a88460028188613bdf565b6040516020016116ba93929190613c09565b6040516020818303038152906040529150506112fa565b83836040517f9a6d49cd000000000000000000000000000000000000000000000000000000008152600401610d2a929190613c5c565b60005b81811015611810573683838381811061172557611725613c70565b90506020028101906117379190613c86565b905061176a61174960208301836137d6565b602083013563ffffffff919091166000908152600960205260409020541490565b6117745750611808565b3063d045a0dc60c08301358360a0810135611793610100830183613cc4565b6117a4610100890160e08a0161369d565b6117b26101208a018a613cc4565b6040518963ffffffff1660e01b81526004016117d49796959493929190613d3f565b6000604051808303818588803b1580156117ed57600080fd5b505af1158015611801573d6000803e3d6000fd5b5050505050505b60010161170a565b50336001600160a01b0316638e9e70996040518163ffffffff1660e01b8152600401600060405180830381865afa15801561184f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526118779190810190613dc6565b6040517f8351eea7000000000000000000000000000000000000000000000000000000008152600401610d2a91906132e2565b6118b261324a565b6040805180820190915260008082526020820152600c5474010000000000000000000000000000000000000000900460ff1661191a576040517f3a4155f600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611925858585612927565b5050935093915050565b6119376122c8565b6040517fca5eb5e10000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063ca5eb5e190602401600060405180830381600087803b1580156119b357600080fd5b505af11580156119c7573d6000803e3d6000fd5b5050505050565b6060611a1383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506114559250611bc7915050565b611a49576040517fb42a7caa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114a8611a54611bc7565b8686611bd6565b333014611a94576040517f14d4a4e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610db387878787878787610da4565b611aab6122c8565b600a805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fd48d879cef83a1c0bdda516f27b13ddb1b3f8bbac1c9e1511bb2a659c2427760906020016112ce565b611b0e6122c8565b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b611b456122c8565b6001600160a01b038116611b88576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610d2a565b611193816126e9565b6000602082018035906009908390611ba990866137d6565b63ffffffff1681526020810191909152604001600020541492915050565b6000611bd1612a39565b905090565b6001600160a01b0383161580611bf357506001600160a01b038216155b15611c2a576040517f0cbe44ec00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0383811660008181526006602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b600080611c9885612a7e565b915081905083811015611ce1576040517f71c4efed0000000000000000000000000000000000000000000000000000000081526004810182905260248101859052604401610d2a565b935093915050565b63ffffffff811660009081526009602052604081205480610bf2576040517ff6ff4fb700000000000000000000000000000000000000000000000000000000815263ffffffff84166004820152602401610d2a565b6000611d50611d4d8787612ab5565b90565b90506000611d7c82611d6a611d658a8a612acd565b612af0565b611d7760208d018d6137d6565b612b26565b90506028861115611e5c576000611db9611d9c60608c0160408d01613e34565b611da960208d018d6137d6565b84611db48c8c612b3a565b612b85565b6040517f7cb590120000000000000000000000000000000000000000000000000000000081529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690637cb5901290611e289086908d906000908790600401613e51565b600060405180830381600087803b158015611e4257600080fd5b505af1158015611e56573d6000803e3d6000fd5b50505050505b6001600160a01b038216887fefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c611e9560208d018d6137d6565b6040805163ffffffff9092168252602082018690520160405180910390a3505050505050505050565b80600003611ef8576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816001600160a01b0316611f0a611bc7565b6001600160a01b031614158015611f47575060016000611f28611bc7565b6001600160a01b0316815260208101919091526040016000205460ff16155b8015611f8c57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611f80611bc7565b6001600160a01b031614155b1561207b576001600160a01b038216600090815260066020526040812081611fb2611bc7565b6001600160a01b0316815260208101919091526040016000205490506000198114612079578181101561203357611fe7611bc7565b6040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024810182905260448101839052606401610d2a565b61203d8282613a01565b6001600160a01b03841660009081526006602052604081209061205e611bc7565b6001600160a01b031681526020810191909152604001600020555b505b6001600160a01b038216600090815260056020526040902054818110156120e7576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401610d2a565b6120f18282613a01565b6001600160a01b0384166000908152600560205260408120919091556004805484929061211f908490613a01565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001611c7f565b6001600160a01b038216158061218057506001600160a01b03821630145b156121c2576040517fec442f050000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610d2a565b6001600160a01b0383166000908152600560205260409020548181101561222e576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401610d2a565b6122388282613a01565b6001600160a01b03808616600090815260056020526040808220939093559085168152908120805484929061226e908490613e83565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516122ba91815260200190565b60405180910390a350505050565b6122d0611bc7565b6001600160a01b03166122eb6008546001600160a01b031690565b6001600160a01b0316146112eb57612301611bc7565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526001600160a01b039091166004820152602401610d2a565b63ffffffff8216600081815260096020908152604091829020849055815192835282018390527f238399d427b947898edb290f5ff0f9109849b1c3ba196a42e35f00c50a54b98b910160405180910390a15050565b60608060006123fa85602001356123aa86612bb7565b6123b760a0890189613cc4565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506123f59250611bc7915050565b612be3565b909350905060008161240d576001612410565b60025b905061243061242260208801886137d6565b826109e560808a018a613cc4565b600c549093506001600160a01b0316156124d257600c546040517f043a78eb0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063043a78eb9061248f9087908790600401613e96565b602060405180830381865afa1580156124ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124d09190613ebb565b505b50509250929050565b60408051808201909152600080825260208201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ddc28c586040518060a001604052808863ffffffff16815260200161253e89611ce9565b8152602001878152602001868152602001851515815250306040518363ffffffff1660e01b8152600401612573929190613ed8565b6040805180830381865afa15801561258f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125b39190613f81565b95945050505050565b6000811180156125e557506001600160a01b03821660009081526001602052604090205460ff16155b801561262357507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614155b15612663576001600160a01b038084166000908152600660209081526040808320938616835292905220548181101561266157612661848484611bd6565b505b505050565b600c80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000008315158102919091179182905560405160ff9190920416151581527f54ca1f89aee2b8d11c89b7813c6aa99caa0f8c55c8eccf8b70c3bb42029fa134906020016112ce565b600880546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080546040516001600160a01b03808516939216917f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f91a36000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60005b8151811015612887576127e28282815181106127d1576127d1613c70565b6020026020010151604001516128e2565b8181815181106127f4576127f4613c70565b602002602001015160400151600b600084848151811061281657612816613c70565b60200260200101516000015163ffffffff1663ffffffff168152602001908152602001600020600084848151811061285057612850613c70565b60200260200101516020015161ffff1661ffff168152602001908152602001600020908161287e9190613fed565b506001016127b3565b507fbe4864a8e820971c0247f5992e2da559595f7bf076a21cb5928d443d2a13b674816040516112ce91906140ad565b60006044835110156128cb57506000610bf2565b5060248201516001600160a01b0382161492915050565b600281015161ffff8116600314610dc657816040517f9a6d49cd000000000000000000000000000000000000000000000000000000008152600401610d2a91906132e2565b61292f61324a565b604080518082019091526000808252602082015260008061296d612951611bc7565b604089013560608a013561296860208c018c6137d6565b612c7f565b9150915060008061297e8984612394565b90925090506129aa61299360208b018b6137d6565b83836129a4368d90038d018d614138565b8b612ca5565b955060405180604001604052808581526020018481525094506129cb611bc7565b86516001600160a01b0391909116907f85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a612a0860208d018d6137d6565b6040805163ffffffff909216825260208201899052810187905260600160405180910390a350505050935093915050565b6007546000906001600160a01b03163303612a7957507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c90565b503390565b60007f0000000000000000000000000000000000000000000000000000000000000000612aab818461416a565b610bf2919061418c565b6000612ac46020828486613bdf565b610f5e916141a3565b6000612add602860208486613bdf565b612ae6916141c1565b60c01c9392505050565b6000610bf27f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff841661418c565b6000612b328484612db0565b509092915050565b6060612b498260288186613bdf565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929695505050505050565b606084848484604051602001612b9e9493929190614209565b6040516020818303038152906040529050949350505050565b6000610bf27f00000000000000000000000000000000000000000000000000000000000000008361416a565b8151606090151580612c44578585604051602001612c3092919091825260c01b7fffffffffffffffff00000000000000000000000000000000000000000000000016602082015260280190565b604051602081830303815290604052612c74565b85856001600160a01b03851686604051602001612c649493929190614287565b6040516020818303038152906040525b915094509492505050565b600080612c8d858585611c8c565b9092509050612c9c8683611ebe565b94509492505050565b612cad61324a565b6000612cbc8460000151612eef565b602085015190915015612cd657612cd68460200151612f30565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632637a450826040518060a001604052808b63ffffffff168152602001612d268c611ce9565b81526020018a815260200189815260200160008960200151111515815250866040518463ffffffff1660e01b8152600401612d62929190613ed8565b60806040518083038185885af1158015612d80573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612da591906142e0565b979650505050505050565b6001600160a01b038216612dfb576040517fec442f050000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610d2a565b80600003612e35576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004546000612e448383613e83565b9050818111612e7f576040517f35278d1200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60048190556001600160a01b03841660009081526005602052604081208054859290612eac908490613e83565b90915550506040518381526001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016122ba565b6000813414612f2c576040517f9f704120000000000000000000000000000000000000000000000000000000008152346004820152602401610d2a565b5090565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e4fe1d946040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fb4919061432a565b90506001600160a01b038116612ff6576040517f5373352a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610dc6613001611bc7565b604080516001600160a01b0383811660248301527f0000000000000000000000000000000000000000000000000000000000000000808216604484015260648084018990528451808503909101815260849093019093526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790528516929190869061266190859060006130b98383613120565b905080516000141580156130de5750808060200190518101906130dc9190613ebb565b155b15612663576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610d2a565b6060610f5e8383600084600080856001600160a01b031684866040516131469190614347565b60006040518083038185875af1925050503d8060008114613183576040519150601f19603f3d011682016040523d82523d6000602084013e613188565b606091505b50915091506110a68683836060826131a8576131a382613208565b610f5e565b81511580156131bf57506001600160a01b0384163b155b15613201576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401610d2a565b5080610f5e565b8051156132185780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604051806060016040528060008019168152602001600067ffffffffffffffff16815260200161328d604051806040016040528060008152602001600081525090565b905290565b60005b838110156132ad578181015183820152602001613295565b50506000910152565b600081518084526132ce816020860160208601613292565b601f01601f19169290920160200192915050565b602081526000610f5e60208301846132b6565b6001600160a01b038116811461119357600080fd5b6000806040838503121561331d57600080fd5b8235613328816132f5565b946020939093013593505050565b600060e0828403121561334857600080fd5b50919050565b60006020828403121561336057600080fd5b813567ffffffffffffffff81111561337757600080fd5b6112fa84828501613336565b8351815260208085015190820152600060a08201604060a0604085015281865180845260c08601915060c08160051b8701019350602080890160005b8381101561341c578887037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff40018552815180518852830151838801879052613409878901826132b6565b97505093820193908201906001016133bf565b505087516060880152505050602085015160808501525090506112fa565b60006060828403121561334857600080fd5b60008083601f84011261345e57600080fd5b50813567ffffffffffffffff81111561347657600080fd5b60208301915083602082850101111561348e57600080fd5b9250929050565b600080600080600080600060e0888a0312156134b057600080fd5b6134ba898961343a565b965060608801359550608088013567ffffffffffffffff808211156134de57600080fd5b6134ea8b838c0161344c565b909750955060a08a013591506134ff826132f5565b90935060c0890135908082111561351557600080fd5b506135228a828b0161344c565b989b979a50959850939692959293505050565b60008060006060848603121561354a57600080fd5b8335613555816132f5565b92506020840135613565816132f5565b929592945050506040919091013590565b803563ffffffff8116811461358a57600080fd5b919050565b600080604083850312156135a257600080fd5b61332883613576565b801515811461119357600080fd5b600080604083850312156135cc57600080fd5b823567ffffffffffffffff8111156135e357600080fd5b6135ef85828601613336565b9250506020830135613600816135ab565b809150509250929050565b815181526020808301519082015260408101610bf2565b60006020828403121561363457600080fd5b5035919050565b60006020828403121561364d57600080fd5b8135610f5e816135ab565b803561ffff8116811461358a57600080fd5b6000806040838503121561367d57600080fd5b61368683613576565b915061369460208401613658565b90509250929050565b6000602082840312156136af57600080fd5b8135610f5e816132f5565b60008060008060a085870312156136d057600080fd5b6136da868661343a565b9350606085013567ffffffffffffffff8111156136f657600080fd5b6137028782880161344c565b9094509250506080850135613716816132f5565b939692955090935050565b6000806040838503121561373457600080fd5b823561373f816132f5565b91506020830135613600816135ab565b60008083601f84011261376157600080fd5b50813567ffffffffffffffff81111561377957600080fd5b6020830191508360208260051b850101111561348e57600080fd5b600080602083850312156137a757600080fd5b823567ffffffffffffffff8111156137be57600080fd5b6137ca8582860161374f565b90969095509350505050565b6000602082840312156137e857600080fd5b610f5e82613576565b6000806000806060858703121561380757600080fd5b8435613812816132f5565b935060208501359250604085013567ffffffffffffffff81111561383557600080fd5b6138418782880161344c565b95989497509550505050565b6000806000806060858703121561386357600080fd5b61386c85613576565b935061387a60208601613658565b9250604085013567ffffffffffffffff81111561383557600080fd5b600080600083850360808112156138ac57600080fd5b843567ffffffffffffffff8111156138c357600080fd5b6138cf87828801613336565b9450506040601f19820112156138e457600080fd5b5060208401915060608401356138f9816132f5565b809150509250925092565b600060c0820190508351825267ffffffffffffffff60208501511660208301526040840151613940604084018280518252602090810151910152565b5082516080830152602083015160a0830152610f5e565b6000806040838503121561396a57600080fd5b8235613975816132f5565b91506020830135613600816132f5565b60006060828403121561399757600080fd5b610f5e838361343a565b600181811c908216806139b557607f821691505b60208210810361334857634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610bf257610bf26139eb565b6040516060810167ffffffffffffffff81118282101715613a3757613a376139d5565b60405290565b6040805190810167ffffffffffffffff81118282101715613a3757613a376139d5565b604051601f8201601f1916810167ffffffffffffffff81118282101715613a8957613a896139d5565b604052919050565b600067ffffffffffffffff821115613aab57613aab6139d5565b50601f01601f191660200190565b600067ffffffffffffffff80841115613ad457613ad46139d5565b8360051b6020613ae5818301613a60565b868152918501918181019036841115613afd57600080fd5b865b84811015613bc357803586811115613b175760008081fd5b88016060368290031215613b2b5760008081fd5b613b33613a14565b613b3c82613576565b8152613b49868301613658565b8682015260408083013589811115613b615760008081fd5b929092019136601f840112613b765760008081fd5b8235613b89613b8482613a91565b613a60565b8181523689838701011115613b9e5760008081fd5b818986018a830137600091810189019190915290820152845250918301918301613aff565b50979650505050505050565b8183823760009101908152919050565b60008085851115613bef57600080fd5b83861115613bfc57600080fd5b5050820193919092039150565b60008451613c1b818460208901613292565b8201838582376000930192835250909392505050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b6020815260006112fa602083018486613c31565b634e487b7160e01b600052603260045260246000fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec1833603018112613cba57600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613cf957600080fd5b83018035915067ffffffffffffffff821115613d1457600080fd5b60200191503681900382131561348e57600080fd5b67ffffffffffffffff8116811461119357600080fd5b63ffffffff613d4d89613576565b1681526020880135602082015260006040890135613d6a81613d29565b67ffffffffffffffff811660408401525087606083015260e06080830152613d9660e083018789613c31565b6001600160a01b03861660a084015282810360c0840152613db8818587613c31565b9a9950505050505050505050565b600060208284031215613dd857600080fd5b815167ffffffffffffffff811115613def57600080fd5b8201601f81018413613e0057600080fd5b8051613e0e613b8482613a91565b818152856020838501011115613e2357600080fd5b6125b3826020830160208601613292565b600060208284031215613e4657600080fd5b8135610f5e81613d29565b6001600160a01b038516815283602082015261ffff831660408201526080606082015260006110a660808301846132b6565b80820180821115610bf257610bf26139eb565b604081526000613ea960408301856132b6565b82810360208401526125b381856132b6565b600060208284031215613ecd57600080fd5b8151610f5e816135ab565b6040815263ffffffff8351166040820152602083015160608201526000604084015160a06080840152613f0e60e08401826132b6565b90506060850151603f198483030160a0850152613f2b82826132b6565b60809690960151151560c08501525050506001600160a01b039190911660209091015290565b600060408284031215613f6357600080fd5b613f6b613a3d565b9050815181526020820151602082015292915050565b600060408284031215613f9357600080fd5b610f5e8383613f51565b601f821115612663576000816000526020600020601f850160051c81016020861015613fc65750805b601f850160051c820191505b81811015613fe557828155600101613fd2565b505050505050565b815167ffffffffffffffff811115614007576140076139d5565b61401b8161401584546139a1565b84613f9d565b602080601f83116001811461405057600084156140385750858301515b600019600386901b1c1916600185901b178555613fe5565b600085815260208120601f198616915b8281101561407f57888601518255948401946001909101908401614060565b508582101561409d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b8381101561412a57888303603f190185528151805163ffffffff1684528781015161ffff16888501528601516060878501819052614116818601836132b6565b9689019694505050908601906001016140d6565b509098975050505050505050565b60006040828403121561414a57600080fd5b614152613a3d565b82358152602083013560208201528091505092915050565b60008261418757634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610bf257610bf26139eb565b80356020831015610bf257600019602084900360031b1b1692915050565b7fffffffffffffffff00000000000000000000000000000000000000000000000081358181169160088510156142015780818660080360031b1b83161692505b505092915050565b7fffffffffffffffff0000000000000000000000000000000000000000000000008560c01b1681527fffffffff000000000000000000000000000000000000000000000000000000008460e01b16600882015282600c8201526000825161427781602c850160208701613292565b91909101602c0195945050505050565b8481527fffffffffffffffff0000000000000000000000000000000000000000000000008460c01b166020820152826028820152600082516142d0816048850160208701613292565b9190910160480195945050505050565b6000608082840312156142f257600080fd5b6142fa613a14565b82518152602083015161430c81613d29565b602082015261431e8460408501613f51565b60408201529392505050565b60006020828403121561433c57600080fd5b8151610f5e816132f5565b60008251613cba81846020870161329256fea26469706673582212205d8189a387e58495723f0d49c0b4599049735f611a555fdb290fde04ed49f9a964736f6c63430008170033", + "devdoc": { + "author": "The Sandbox", + "details": "OFTSand is a contract that combines SandBaseToken, ERC2771Handler, and OFTCore functionalities.It provides a token contract implementation of Sand token with LayerZero compatibility.", + "errors": { + "AddressEmptyCode(address)": [ + { + "details": "There's no code at `target` (it is not a contract)." + } + ], + "AddressInsufficientBalance(address)": [ + { + "details": "The ETH balance of the account is not enough to perform the operation." + } + ], + "CallFailed(string)": [ + { + "params": { + "message": "error message returned from the failed call" + } + } + ], + "ERC20InsufficientAllowance(address,uint256,uint256)": [ + { + "details": "Indicates a failure with the `spender`’s `allowance`. Used in transfers.", + "params": { + "allowance": "Amount of tokens a `spender` is allowed to operate with.", + "needed": "Minimum amount required to perform a transfer.", + "spender": "Address that may be allowed to operate on tokens without being their owner." + } + } + ], + "ERC20InsufficientBalance(address,uint256,uint256)": [ + { + "details": "Indicates an error related to the current `balance` of a `sender`. Used in transfers.", + "params": { + "balance": "Current balance for the interacting account.", + "needed": "Minimum amount required to perform a transfer.", + "sender": "Address whose tokens are being transferred." + } + } + ], + "ERC20InvalidApprover(address)": [ + { + "details": "Indicates a failure with the `approver` of a token to be approved. Used in approvals.", + "params": { + "approver": "Address initiating an approval operation." + } + } + ], + "ERC20InvalidReceiver(address)": [ + { + "details": "Indicates a failure with the token `receiver`. Used in transfers.", + "params": { + "receiver": "Address to which tokens are being transferred." + } + } + ], + "ERC20InvalidSender(address)": [ + { + "details": "Indicates a failure with the token `sender`. Used in transfers.", + "params": { + "sender": "Address whose tokens are being transferred." + } + } + ], + "ERC20InvalidSpender(address)": [ + { + "details": "Indicates a failure with the `spender` to be approved. Used in approvals.", + "params": { + "spender": "Address that may be allowed to operate on tokens without being their owner." + } + } + ], + "FailedInnerCall()": [ + { + "details": "A call to an address target failed. The target may have reverted." + } + ], + "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." + } + ], + "SafeERC20FailedOperation(address)": [ + { + "details": "An operation with an ERC20 token failed." + } + ] + }, + "events": { + "AdminChanged(address,address)": { + "details": "Emits when the contract administrator is changed.", + "params": { + "newAdmin": "The address of the new administrator.", + "oldAdmin": "The address of the previous administrator." + } + }, + "Approval(address,address,uint256)": { + "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." + }, + "Enabled(bool)": { + "params": { + "enabled": "The new enabled state" + } + }, + "PreCrimeSet(address)": { + "details": "Emitted when the preCrime contract address is set.", + "params": { + "preCrimeAddress": "The address of the preCrime contract." + } + }, + "Transfer(address,address,uint256)": { + "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." + } + }, + "kind": "dev", + "methods": { + "addAllowanceIfNeeded(address,address,uint256)": { + "params": { + "amountNeeded": "The amount requested to spend", + "owner": "The address of the owner of the tokens", + "spender": "The address wanting to spend tokens" + }, + "returns": { + "success": "Whether or not the call succeeded." + } + }, + "allowInitializePath((uint32,bytes32,uint64))": { + "details": "This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received.This defaults to assuming if a peer has been set, its initialized. Can be overridden by the OApp if there is other logic to determine this.", + "params": { + "origin": "The origin information containing the source endpoint and sender address." + }, + "returns": { + "_0": "Whether the path has been initialized." + } + }, + "allowance(address,address)": { + "params": { + "owner": "The address whose token is allowed.", + "spender": "The address allowed to transfer." + }, + "returns": { + "remaining": "The amount of token `spender` is allowed to transfer on behalf of `owner`." + } + }, + "approvalRequired()": { + "details": "In the case of OFT where the contract IS the token, approval is NOT required.", + "returns": { + "_0": "requiresApproval Needs approval of the underlying token implementation." + } + }, + "approve(address,uint256)": { + "params": { + "amount": "The number of tokens allowed.", + "spender": "The address to be given rights to transfer." + }, + "returns": { + "success": "Whether or not the call succeeded." + } + }, + "approveAndCall(address,uint256,bytes)": { + "params": { + "amount": "The number of tokens allowed.", + "data": "The bytes for the call.", + "target": "The address to be given rights to transfer and destination of the call." + }, + "returns": { + "_0": "The data of the call." + } + }, + "approveFor(address,address,uint256)": { + "params": { + "amount": "The number of tokens allowed.", + "owner": "The address whose token is allowed.", + "spender": "The address to be given rights to transfer." + }, + "returns": { + "success": "Whether or not the call succeeded." + } + }, + "balanceOf(address)": { + "params": { + "owner": "The address to query the balance of." + }, + "returns": { + "_0": "The amount owned by `owner`." + } + }, + "burn(uint256)": { + "params": { + "amount": "The number of tokens to burn." + } + }, + "burnFor(address,uint256)": { + "params": { + "amount": "The number of tokens to burn.", + "from": "The address whose token to burn." + } + }, + "changeAdmin(address)": { + "details": "Change the administrator to be `newAdmin`.", + "params": { + "newAdmin": "The address of the new administrator." + } + }, + "combineOptions(uint32,uint16,bytes)": { + "details": "If there is an enforced lzReceive option: - {gasLimit: 200k, msg.value: 1 ether} AND a caller supplies a lzReceive option: {gasLimit: 100k, msg.value: 0.5 ether} - The resulting options will be {gasLimit: 300k, msg.value: 1.5 ether} when the message is executed on the remote lzReceive() function.This presence of duplicated options is handled off-chain in the verifier/executor.", + "params": { + "_eid": "The endpoint ID.", + "_extraOptions": "Additional options passed by the caller.", + "_msgType": "The OAPP message type." + }, + "returns": { + "_0": "options The combination of caller specified options AND enforced options." + } + }, + "decimals()": { + "returns": { + "_0": "The number of decimals." + } + }, + "getAdmin()": { + "details": "Get the current administrator of this contract.", + "returns": { + "_0": "The current administrator of this contract." + } + }, + "getTrustedForwarder()": { + "returns": { + "_0": "trustedForwarder address of the trusted forwarder" + } + }, + "isComposeMsgSender((uint32,bytes32,uint64),bytes,address)": { + "details": "_origin The origin information containing the source endpoint and sender address. - srcEid: The source chain endpoint ID. - sender: The sender address on the src chain. - nonce: The nonce of the message._message The lzReceive payload.Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer.The default sender IS the OAppReceiver implementer.", + "params": { + "_sender": "The sender address." + }, + "returns": { + "_0": "isSender Is a valid sender." + } + }, + "isPeer(uint32,bytes32)": { + "details": "Check if the peer is considered 'trusted' by the OApp.Enables OAppPreCrimeSimulator to check whether a potential Inbound Packet is from a trusted source.", + "params": { + "_eid": "The endpoint ID to check.", + "_peer": "The peer to check." + }, + "returns": { + "_0": "Whether the peer passed is considered 'trusted' by the OApp." + } + }, + "isSuperOperator(address)": { + "params": { + "who": "The address to query." + }, + "returns": { + "_0": "whether the address has superOperator rights." + } + }, + "isTrustedForwarder(address)": { + "params": { + "forwarder": "address to check" + }, + "returns": { + "_0": "is trusted" + } + }, + "lzReceive((uint32,bytes32,uint64),bytes32,bytes,address,bytes)": { + "details": "Entry point for receiving messages or packets from the endpoint.Entry point for receiving msg/packet from the LayerZero endpoint.", + "params": { + "_executor": "The address of the executor for the received message.", + "_extraData": "Additional arbitrary data provided by the corresponding executor.", + "_guid": "The unique identifier for the received LayerZero message.", + "_message": "The payload of the received message.", + "_origin": "The origin information containing the source endpoint and sender address. - srcEid: The source chain endpoint ID. - sender: The sender address on the src chain. - nonce: The nonce of the message." + } + }, + "lzReceiveAndRevert(((uint32,bytes32,uint64),uint32,address,bytes32,uint256,address,bytes,bytes)[])": { + "details": "Interface for pre-crime simulations. Always reverts at the end with the simulation results.WARNING: MUST revert at the end with the simulation results.Gives the preCrime implementation the ability to mock sending packets to the lzReceive function, WITHOUT actually executing them.", + "params": { + "_packets": "An array of InboundPacket objects representing received packets to be delivered." + } + }, + "lzReceiveSimulate((uint32,bytes32,uint64),bytes32,bytes,address,bytes)": { + "details": "Is effectively an internal function because msg.sender must be address(this). Allows resetting the call stack for 'internal' calls.", + "params": { + "_executor": "The executor address for the packet.", + "_extraData": "Additional data for the packet.", + "_guid": "The unique identifier of the packet.", + "_message": "The message payload of the packet.", + "_origin": "The origin information containing the source endpoint and sender address. - srcEid: The source chain endpoint ID. - sender: The sender address on the src chain. - nonce: The nonce of the message." + } + }, + "name()": { + "returns": { + "_0": "The name of the token collection." + } + }, + "nextNonce(uint32,bytes32)": { + "details": "_srcEid The source endpoint ID._sender The sender address.The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement.Is required by the off-chain executor to determine the OApp expects msg execution is ordered.This is also enforced by the OApp.By default this is NOT enabled. ie. nextNonce is hardcoded to return 0.", + "returns": { + "nonce": "The next nonce." + } + }, + "oApp()": { + "details": "Retrieves the address of the OApp contract.The simulator contract is the base contract for the OApp by default.If the simulator is a separate contract, override this function.", + "returns": { + "_0": "The address of the OApp contract." + } + }, + "oAppVersion()": { + "returns": { + "receiverVersion": "The version of the OAppReceiver.sol implementation.", + "senderVersion": "The version of the OAppSender.sol implementation." + } + }, + "oftVersion()": { + "details": "interfaceId: This specific interface ID is '0x02e49c2c'.version: Indicates a cross-chain compatible msg encoding with other OFTs.If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented. ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)", + "returns": { + "interfaceId": "The interface ID.", + "version": "The version." + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "paidCall(address,uint256,bytes)": { + "params": { + "amount": "The number of tokens allowed to spend.", + "data": "The bytes for the call.", + "target": "The destination of the call, allowed to spend the amount specified" + }, + "returns": { + "_0": "The data of the call." + } + }, + "quoteOFT((uint32,bytes32,uint256,uint256,bytes,bytes,bytes))": { + "params": { + "_sendParam": "The parameters for the send operation." + }, + "returns": { + "oftFeeDetails": "The details of OFT fees.", + "oftLimit": "The OFT limit information.", + "oftReceipt": "The OFT receipt information." + } + }, + "quoteSend((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),bool)": { + "details": "MessagingFee: LayerZero msg fee - nativeFee: The native fee. - lzTokenFee: The lzToken fee.", + "params": { + "_payInLzToken": "Flag indicating whether the caller is paying in the LZ token.", + "_sendParam": "The parameters for the send() operation." + }, + "returns": { + "msgFee": "The calculated LayerZero messaging fee from the send() operation." + } + }, + "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." + }, + "send((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),(uint256,uint256),address)": { + "details": "Executes the send operation.MessagingReceipt: LayerZero msg receipt - guid: The unique identifier for the sent message. - nonce: The nonce of the sent message. - fee: The LayerZero fee incurred for the message.", + "params": { + "_fee": "The calculated fee for the send() operation. - nativeFee: The native fee. - lzTokenFee: The lzToken fee.", + "_refundAddress": "The address to receive any excess funds.", + "_sendParam": "The parameters for the send operation." + }, + "returns": { + "msgReceipt": "The receipt for the send operation.", + "oftReceipt": "The OFT receipt information." + } + }, + "setDelegate(address)": { + "details": "Only the owner/admin of the OApp can call this function.Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.", + "params": { + "_delegate": "The address of the delegate to be set." + } + }, + "setEnforcedOptions((uint32,uint16,bytes)[])": { + "details": "Sets the enforced options for specific endpoint and message type combinations.Only the owner/admin of the OApp can call this function.Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.These enforced options can vary as the potential options/execution on the remote may differ as per the msgType. eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().", + "params": { + "_enforcedOptions": "An array of EnforcedOptionParam structures specifying enforced options." + } + }, + "setMsgInspector(address)": { + "details": "Sets the message inspector address for the OFT.This is an optional contract that can be used to inspect both 'message' and 'options'.Set it to address(0) to disable it, or set it to a contract address to enable it.", + "params": { + "_msgInspector": "The address of the message inspector." + } + }, + "setPeer(uint32,bytes32)": { + "details": "Only the owner/admin of the OApp can call this function.Indicates that the peer is trusted to send LayerZero messages to this OApp.Set this to bytes32(0) to remove the peer address.Peer is a bytes32 to accommodate non-evm chains.", + "params": { + "_eid": "The endpoint ID.", + "_peer": "The address of the peer to be associated with the corresponding endpoint." + } + }, + "setPreCrime(address)": { + "details": "Sets the preCrime contract address.", + "params": { + "_preCrime": "The address of the preCrime contract." + } + }, + "setSuperOperator(address,bool)": { + "params": { + "enabled": "set whether the superOperator is enabled or disabled.", + "superOperator": "address that will be given/removed superOperator right." + } + }, + "setTrustedForwarder(address)": { + "params": { + "trustedForwarder": "The new trustedForwarder." + } + }, + "sharedDecimals()": { + "details": "Retrieves the shared decimals of the OFT.Sets an implicit cap on the amount of tokens, over uint64.max() will need some sort of outbound cap / totalSupply cap Lowest common decimal denominator between chains. Defaults to 6 decimal places to provide up to 18,446,744,073,709.551615 units (max uint64). For tokens exceeding this totalSupply(), they will need to override the sharedDecimals function with something smaller. ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615", + "returns": { + "_0": "The shared decimals of the OFT." + } + }, + "symbol()": { + "returns": { + "_0": "The symbol of the token collection." + } + }, + "token()": { + "details": "Retrieves the address of the underlying ERC20 implementation.In the case of OFT, address(this) and erc20 are the same contract.", + "returns": { + "_0": "The address of the OFT token." + } + }, + "totalSupply()": { + "returns": { + "_0": "The total number of tokens in existence." + } + }, + "transfer(address,uint256)": { + "params": { + "amount": "The number of tokens being transfered.", + "to": "The recipient address of the tokens being transfered." + }, + "returns": { + "success": "Whether or not the transfer succeeded." + } + }, + "transferFrom(address,address,uint256)": { + "params": { + "amount": "The number of tokens transfered.", + "from": "The origin address of the tokens being transferred.", + "to": "The recipient address of the tokensbeing transfered." + }, + "returns": { + "success": "Whether or not the transfer succeeded." + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "title": "OFTSand", + "version": 1 + }, + "userdoc": { + "errors": { + "CallFailed(string)": [ + { + "notice": "Error for failed calls, containing the error message" + } + ], + "FirstParamNotSender()": [ + { + "notice": "Error for mismatched first parameter and sender address" + } + ], + "InvalidAmount()": [ + { + "notice": "Error for invalid amount" + } + ], + "InvalidOwnerOrSpender()": [ + { + "notice": "Error for invalid owner or spender" + } + ], + "InvalidSender()": [ + { + "notice": "Error for invalid sender" + } + ], + "NotAuthorized()": [ + { + "notice": "Error for unauthorized access" + } + ], + "OnlyAdmin()": [ + { + "notice": "Error for admin-only access" + } + ], + "Overflow()": [ + { + "notice": "Error for overflow conditions" + } + ], + "SendFunctionDisabled()": [ + { + "notice": "Custom error thrown when the send function is called while disabled" + } + ] + }, + "events": { + "Enabled(bool)": { + "notice": "Emitted when the enabled state changes" + } + }, + "kind": "user", + "methods": { + "addAllowanceIfNeeded(address,address,uint256)": { + "notice": "Increase the allowance for the spender if needed" + }, + "allowInitializePath((uint32,bytes32,uint64))": { + "notice": "Checks if the path initialization is allowed based on the provided origin." + }, + "allowance(address,address)": { + "notice": "Get the allowance of `spender` for `owner`'s tokens." + }, + "approvalRequired()": { + "notice": "Indicates whether the OFT contract requires approval of the 'token()' to send." + }, + "approve(address,uint256)": { + "notice": "Approve `spender` to transfer `amount` tokens." + }, + "approveAndCall(address,uint256,bytes)": { + "notice": "Approve `target` to spend `amount` and call it with data." + }, + "approveFor(address,address,uint256)": { + "notice": "Approve `spender` to transfer `amount` tokens from `owner`." + }, + "balanceOf(address)": { + "notice": "Get the balance of `owner`." + }, + "burn(uint256)": { + "notice": "Burn `amount` tokens." + }, + "burnFor(address,uint256)": { + "notice": "Burn `amount` tokens from `owner`." + }, + "combineOptions(uint32,uint16,bytes)": { + "notice": "Combines options for a given endpoint and message type." + }, + "decimals()": { + "notice": "Get the number of decimals for the token collection." + }, + "endpoint()": { + "notice": "Retrieves the LayerZero endpoint associated with the OApp." + }, + "getTrustedForwarder()": { + "notice": "Get the current trusted forwarder" + }, + "isComposeMsgSender((uint32,bytes32,uint64),bytes,address)": { + "notice": "Indicates whether an address is an approved composeMsg sender to the Endpoint." + }, + "isSuperOperator(address)": { + "notice": "check whether address `who` is given superOperator rights." + }, + "isTrustedForwarder(address)": { + "notice": "Checks if an address is a trusted forwarder" + }, + "name()": { + "notice": "Get the name of the token collection." + }, + "nextNonce(uint32,bytes32)": { + "notice": "Retrieves the next nonce for a given source endpoint and sender address." + }, + "oAppVersion()": { + "notice": "Retrieves the OApp version information." + }, + "oftVersion()": { + "notice": "Retrieves interfaceID and the version of the OFT." + }, + "paidCall(address,uint256,bytes)": { + "notice": "Temporarily approve `target` to spend `amount` and call it with data. Previous approvals remains unchanged." + }, + "peers(uint32)": { + "notice": "Retrieves the peer (OApp) associated with a corresponding endpoint." + }, + "quoteOFT((uint32,bytes32,uint256,uint256,bytes,bytes,bytes))": { + "notice": "Provides a quote for OFT-related operations." + }, + "quoteSend((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),bool)": { + "notice": "Provides a quote for the send() operation." + }, + "setDelegate(address)": { + "notice": "Sets the delegate address for the OApp." + }, + "setPeer(uint32,bytes32)": { + "notice": "Sets the peer address (OApp instance) for a corresponding endpoint." + }, + "setSuperOperator(address,bool)": { + "notice": "Enable or disable the ability of `superOperator` to transfer tokens of all (superOperator rights)." + }, + "setTrustedForwarder(address)": { + "notice": "Change the address of the trusted forwarder for meta-TX." + }, + "symbol()": { + "notice": "Get the symbol for the token collection." + }, + "totalSupply()": { + "notice": "Get the total number of tokens in existence." + }, + "transfer(address,uint256)": { + "notice": "Transfer `amount` tokens to `to`." + }, + "transferFrom(address,address,uint256)": { + "notice": "Transfer `amount` tokens from `from` to `to`." + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 14049, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_admin", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 14121, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_superOperators", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 13042, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_name", + "offset": 0, + "slot": "2", + "type": "t_string_storage" + }, + { + "astId": 13044, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_symbol", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + }, + { + "astId": 13048, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_totalSupply", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 13052, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_balances", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 13058, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_allowances", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 13902, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_trustedForwarder", + "offset": 0, + "slot": "7", + "type": "t_address" + }, + { + "astId": 8589, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_owner", + "offset": 0, + "slot": "8", + "type": "t_address" + }, + { + "astId": 2127, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "peers", + "offset": 0, + "slot": "9", + "type": "t_mapping(t_uint32,t_bytes32)" + }, + { + "astId": 3370, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "preCrime", + "offset": 0, + "slot": "10", + "type": "t_address" + }, + { + "astId": 2743, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "enforcedOptions", + "offset": 0, + "slot": "11", + "type": "t_mapping(t_uint32,t_mapping(t_uint16,t_bytes_storage))" + }, + { + "astId": 12074, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "msgInspector", + "offset": 0, + "slot": "12", + "type": "t_address" + }, + { + "astId": 11552, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_enabled", + "offset": 20, + "slot": "12", + "type": "t_bool" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint16,t_bytes_storage)": { + "encoding": "mapping", + "key": "t_uint16", + "label": "mapping(uint16 => bytes)", + "numberOfBytes": "32", + "value": "t_bytes_storage" + }, + "t_mapping(t_uint32,t_bytes32)": { + "encoding": "mapping", + "key": "t_uint32", + "label": "mapping(uint32 => bytes32)", + "numberOfBytes": "32", + "value": "t_bytes32" + }, + "t_mapping(t_uint32,t_mapping(t_uint16,t_bytes_storage))": { + "encoding": "mapping", + "key": "t_uint32", + "label": "mapping(uint32 => mapping(uint16 => bytes))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint16,t_bytes_storage)" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint16": { + "encoding": "inplace", + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + } + } + } +} \ No newline at end of file diff --git a/packages/deploy/deployments/base/solcInputs/4bade374f62f6d78bc3ea2aa3ebdd50f.json b/packages/deploy/deployments/base/solcInputs/4bade374f62f6d78bc3ea2aa3ebdd50f.json new file mode 100644 index 0000000000..a766e97989 --- /dev/null +++ b/packages/deploy/deployments/base/solcInputs/4bade374f62f6d78bc3ea2aa3ebdd50f.json @@ -0,0 +1,258 @@ +{ + "language": "Solidity", + "sources": { + "@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/IExecutor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { Origin } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\n\nimport { IWorker } from \"./IWorker.sol\";\nimport { ILayerZeroExecutor } from \"./ILayerZeroExecutor.sol\";\n\ninterface IExecutor is IWorker, ILayerZeroExecutor {\n struct DstConfigParam {\n uint32 dstEid;\n uint64 lzReceiveBaseGas;\n uint64 lzComposeBaseGas;\n uint16 multiplierBps;\n uint128 floorMarginUSD;\n uint128 nativeCap;\n }\n\n struct DstConfig {\n uint64 lzReceiveBaseGas;\n uint16 multiplierBps;\n uint128 floorMarginUSD; // uses priceFeed PRICE_RATIO_DENOMINATOR\n uint128 nativeCap;\n uint64 lzComposeBaseGas;\n }\n\n struct ExecutionParams {\n address receiver;\n Origin origin;\n bytes32 guid;\n bytes message;\n bytes extraData;\n uint256 gasLimit;\n }\n\n struct NativeDropParams {\n address receiver;\n uint256 amount;\n }\n\n event DstConfigSet(DstConfigParam[] params);\n event NativeDropApplied(Origin origin, uint32 dstEid, address oapp, NativeDropParams[] params, bool[] success);\n\n function dstConfig(uint32 _dstEid) external view returns (uint64, uint16, uint128, uint128, uint64);\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/IExecutorFeeLib.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { IExecutor } from \"./IExecutor.sol\";\n\ninterface IExecutorFeeLib {\n struct FeeParams {\n address priceFeed;\n uint32 dstEid;\n address sender;\n uint256 calldataSize;\n uint16 defaultMultiplierBps;\n }\n\n error Executor_NoOptions();\n error Executor_NativeAmountExceedsCap(uint256 amount, uint256 cap);\n error Executor_UnsupportedOptionType(uint8 optionType);\n error Executor_InvalidExecutorOptions(uint256 cursor);\n error Executor_ZeroLzReceiveGasProvided();\n error Executor_ZeroLzComposeGasProvided();\n error Executor_EidNotSupported(uint32 eid);\n\n function getFeeOnSend(\n FeeParams calldata _params,\n IExecutor.DstConfig calldata _dstConfig,\n bytes calldata _options\n ) external returns (uint256 fee);\n\n function getFee(\n FeeParams calldata _params,\n IExecutor.DstConfig calldata _dstConfig,\n bytes calldata _options\n ) external view returns (uint256 fee);\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/ILayerZeroExecutor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface ILayerZeroExecutor {\n // @notice query price and assign jobs at the same time\n // @param _dstEid - the destination endpoint identifier\n // @param _sender - the source sending contract address. executors may apply price discrimination to senders\n // @param _calldataSize - dynamic data size of message + caller params\n // @param _options - optional parameters for extra service plugins, e.g. sending dust tokens at the destination chain\n function assignJob(\n uint32 _dstEid,\n address _sender,\n uint256 _calldataSize,\n bytes calldata _options\n ) external returns (uint256 price);\n\n // @notice query the executor price for relaying the payload and its proof to the destination chain\n // @param _dstEid - the destination endpoint identifier\n // @param _sender - the source sending contract address. executors may apply price discrimination to senders\n // @param _calldataSize - dynamic data size of message + caller params\n // @param _options - optional parameters for extra service plugins, e.g. sending dust tokens at the destination chain\n function getFee(\n uint32 _dstEid,\n address _sender,\n uint256 _calldataSize,\n bytes calldata _options\n ) external view returns (uint256 price);\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/ILayerZeroTreasury.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface ILayerZeroTreasury {\n function getFee(\n address _sender,\n uint32 _dstEid,\n uint256 _totalNativeFee,\n bool _payInLzToken\n ) external view returns (uint256 fee);\n\n function payFee(\n address _sender,\n uint32 _dstEid,\n uint256 _totalNativeFee,\n bool _payInLzToken\n ) external payable returns (uint256 fee);\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/IWorker.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IWorker {\n event SetWorkerLib(address workerLib);\n event SetPriceFeed(address priceFeed);\n event SetDefaultMultiplierBps(uint16 multiplierBps);\n event SetSupportedOptionTypes(uint32 dstEid, uint8[] optionTypes);\n event Withdraw(address lib, address to, uint256 amount);\n\n error Worker_NotAllowed();\n error Worker_OnlyMessageLib();\n error Worker_RoleRenouncingDisabled();\n\n function setPriceFeed(address _priceFeed) external;\n\n function priceFeed() external view returns (address);\n\n function setDefaultMultiplierBps(uint16 _multiplierBps) external;\n\n function defaultMultiplierBps() external view returns (uint16);\n\n function withdrawFee(address _lib, address _to, uint256 _amount) external;\n\n function setSupportedOptionTypes(uint32 _eid, uint8[] calldata _optionTypes) external;\n\n function getSupportedOptionTypes(uint32 _eid) external view returns (uint8[] memory);\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/libs/SafeCall.sol": { + "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\n\npragma solidity ^0.8.20;\n\n/// @dev copied from https://github.com/nomad-xyz/ExcessivelySafeCall/blob/main/src/ExcessivelySafeCall.sol.\nlibrary SafeCall {\n /// @notice calls a contract with a specified gas limit and value and captures the return data\n /// @param _target The address to call\n /// @param _gas The amount of gas to forward to the remote contract\n /// @param _value The value in wei to send to the remote contract\n /// to memory.\n /// @param _maxCopy The maximum number of bytes of returndata to copy\n /// to memory.\n /// @param _calldata The data to send to the remote contract\n /// @return success and returndata, as `.call()`. Returndata is capped to\n /// `_maxCopy` bytes.\n function safeCall(\n address _target,\n uint256 _gas,\n uint256 _value,\n uint16 _maxCopy,\n bytes memory _calldata\n ) internal returns (bool, bytes memory) {\n // check that target has code\n uint size;\n assembly {\n size := extcodesize(_target)\n }\n if (size == 0) {\n return (false, new bytes(0));\n }\n\n // set up for assembly call\n uint256 _toCopy;\n bool _success;\n bytes memory _returnData = new bytes(_maxCopy);\n // dispatch message to recipient\n // by assembly calling \"handle\" function\n // we call via assembly to avoid memcopying a very large returndata\n // returned by a malicious contract\n assembly {\n _success := call(\n _gas, // gas\n _target, // recipient\n _value, // ether value\n add(_calldata, 0x20), // inloc\n mload(_calldata), // inlen\n 0, // outloc\n 0 // outlen\n )\n // limit our copy to 100 bytes\n _toCopy := returndatasize()\n if gt(_toCopy, _maxCopy) {\n _toCopy := _maxCopy\n }\n // Store the length of the copied bytes\n mstore(_returnData, _toCopy)\n // copy the bytes from returndata[0:_toCopy]\n returndatacopy(add(_returnData, 0x20), 0, _toCopy)\n }\n return (_success, _returnData);\n }\n\n /// @notice Use when you _really_ really _really_ don't trust the called\n /// contract. This prevents the called contract from causing reversion of\n /// the caller in as many ways as we can.\n /// @dev The main difference between this and a solidity low-level call is\n /// that we limit the number of bytes that the callee can cause to be\n /// copied to caller memory. This prevents stupid things like malicious\n /// contracts returning 10,000,000 bytes causing a local OOG when copying\n /// to memory.\n /// @param _target The address to call\n /// @param _gas The amount of gas to forward to the remote contract\n /// @param _maxCopy The maximum number of bytes of returndata to copy\n /// to memory.\n /// @param _calldata The data to send to the remote contract\n /// @return success and returndata, as `.call()`. Returndata is capped to\n /// `_maxCopy` bytes.\n function safeStaticCall(\n address _target,\n uint256 _gas,\n uint16 _maxCopy,\n bytes memory _calldata\n ) internal view returns (bool, bytes memory) {\n // check that target has code\n uint size;\n assembly {\n size := extcodesize(_target)\n }\n if (size == 0) {\n return (false, new bytes(0));\n }\n\n // set up for assembly call\n uint256 _toCopy;\n bool _success;\n bytes memory _returnData = new bytes(_maxCopy);\n // dispatch message to recipient\n // by assembly calling \"handle\" function\n // we call via assembly to avoid memcopying a very large returndata\n // returned by a malicious contract\n assembly {\n _success := staticcall(\n _gas, // gas\n _target, // recipient\n add(_calldata, 0x20), // inloc\n mload(_calldata), // inlen\n 0, // outloc\n 0 // outlen\n )\n // limit our copy to 256 bytes\n _toCopy := returndatasize()\n if gt(_toCopy, _maxCopy) {\n _toCopy := _maxCopy\n }\n // Store the length of the copied bytes\n mstore(_returnData, _toCopy)\n // copy the bytes from returndata[0:_toCopy]\n returndatacopy(add(_returnData, 0x20), 0, _toCopy)\n }\n return (_success, _returnData);\n }\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/MessageLibBase.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\n/// @dev simply a container of endpoint address and local eid\nabstract contract MessageLibBase {\n address internal immutable endpoint;\n uint32 internal immutable localEid;\n\n error LZ_MessageLib_OnlyEndpoint();\n\n modifier onlyEndpoint() {\n if (endpoint != msg.sender) revert LZ_MessageLib_OnlyEndpoint();\n _;\n }\n\n constructor(address _endpoint, uint32 _localEid) {\n endpoint = _endpoint;\n localEid = _localEid;\n }\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/SendLibBase.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { Transfer } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Transfer.sol\";\n\nimport { ILayerZeroExecutor } from \"./interfaces/ILayerZeroExecutor.sol\";\nimport { ILayerZeroTreasury } from \"./interfaces/ILayerZeroTreasury.sol\";\nimport { SafeCall } from \"./libs/SafeCall.sol\";\nimport { MessageLibBase } from \"./MessageLibBase.sol\";\n\nstruct WorkerOptions {\n uint8 workerId;\n bytes options;\n}\n\nstruct SetDefaultExecutorConfigParam {\n uint32 eid;\n ExecutorConfig config;\n}\n\nstruct ExecutorConfig {\n uint32 maxMessageSize;\n address executor;\n}\n\n/// @dev base contract for both SendLibBaseE1 and SendLibBaseE2\nabstract contract SendLibBase is MessageLibBase, Ownable {\n using SafeCall for address;\n\n address private constant DEFAULT_CONFIG = address(0);\n uint16 internal constant TREASURY_MAX_COPY = 32;\n\n uint256 internal immutable treasuryGasLimit;\n uint256 internal treasuryNativeFeeCap;\n\n // config\n address public treasury;\n mapping(address oapp => mapping(uint32 eid => ExecutorConfig)) public executorConfigs;\n\n // accumulated fees for workers and treasury\n mapping(address worker => uint256) public fees;\n\n event ExecutorFeePaid(address executor, uint256 fee);\n event TreasurySet(address treasury);\n event DefaultExecutorConfigsSet(SetDefaultExecutorConfigParam[] params);\n event ExecutorConfigSet(address oapp, uint32 eid, ExecutorConfig config);\n event TreasuryNativeFeeCapSet(uint256 newTreasuryNativeFeeCap);\n\n error LZ_MessageLib_InvalidMessageSize(uint256 actual, uint256 max);\n error LZ_MessageLib_InvalidAmount(uint256 requested, uint256 available);\n error LZ_MessageLib_TransferFailed();\n error LZ_MessageLib_InvalidExecutor();\n error LZ_MessageLib_ZeroMessageSize();\n\n constructor(\n address _endpoint,\n uint32 _localEid,\n uint256 _treasuryGasLimit,\n uint256 _treasuryNativeFeeCap\n ) MessageLibBase(_endpoint, _localEid) {\n treasuryGasLimit = _treasuryGasLimit;\n treasuryNativeFeeCap = _treasuryNativeFeeCap;\n }\n\n function setDefaultExecutorConfigs(SetDefaultExecutorConfigParam[] calldata _params) external onlyOwner {\n for (uint256 i = 0; i < _params.length; ++i) {\n SetDefaultExecutorConfigParam calldata param = _params[i];\n\n if (param.config.executor == address(0x0)) revert LZ_MessageLib_InvalidExecutor();\n if (param.config.maxMessageSize == 0) revert LZ_MessageLib_ZeroMessageSize();\n\n executorConfigs[DEFAULT_CONFIG][param.eid] = param.config;\n }\n emit DefaultExecutorConfigsSet(_params);\n }\n\n /// @dev the new value can not be greater than the old value, i.e. down only\n function setTreasuryNativeFeeCap(uint256 _newTreasuryNativeFeeCap) external onlyOwner {\n // assert the new value is no greater than the old value\n if (_newTreasuryNativeFeeCap > treasuryNativeFeeCap)\n revert LZ_MessageLib_InvalidAmount(_newTreasuryNativeFeeCap, treasuryNativeFeeCap);\n treasuryNativeFeeCap = _newTreasuryNativeFeeCap;\n emit TreasuryNativeFeeCapSet(_newTreasuryNativeFeeCap);\n }\n\n // ============================ View ===================================\n // @dev get the executor config and if not set, return the default config\n function getExecutorConfig(address _oapp, uint32 _remoteEid) public view returns (ExecutorConfig memory rtnConfig) {\n ExecutorConfig storage defaultConfig = executorConfigs[DEFAULT_CONFIG][_remoteEid];\n ExecutorConfig storage customConfig = executorConfigs[_oapp][_remoteEid];\n\n uint32 maxMessageSize = customConfig.maxMessageSize;\n rtnConfig.maxMessageSize = maxMessageSize != 0 ? maxMessageSize : defaultConfig.maxMessageSize;\n\n address executor = customConfig.executor;\n rtnConfig.executor = executor != address(0x0) ? executor : defaultConfig.executor;\n }\n\n // ======================= Internal =======================\n function _assertMessageSize(uint256 _actual, uint256 _max) internal pure {\n if (_actual > _max) revert LZ_MessageLib_InvalidMessageSize(_actual, _max);\n }\n\n function _payExecutor(\n address _executor,\n uint32 _dstEid,\n address _sender,\n uint256 _msgSize,\n bytes memory _executorOptions\n ) internal returns (uint256 executorFee) {\n executorFee = ILayerZeroExecutor(_executor).assignJob(_dstEid, _sender, _msgSize, _executorOptions);\n if (executorFee > 0) {\n fees[_executor] += executorFee;\n }\n emit ExecutorFeePaid(_executor, executorFee);\n }\n\n function _payTreasury(\n address _sender,\n uint32 _dstEid,\n uint256 _totalNativeFee,\n bool _payInLzToken\n ) internal returns (uint256 treasuryNativeFee, uint256 lzTokenFee) {\n if (treasury != address(0x0)) {\n bytes memory callData = abi.encodeCall(\n ILayerZeroTreasury.payFee,\n (_sender, _dstEid, _totalNativeFee, _payInLzToken)\n );\n (bool success, bytes memory result) = treasury.safeCall(treasuryGasLimit, 0, TREASURY_MAX_COPY, callData);\n\n (treasuryNativeFee, lzTokenFee) = _parseTreasuryResult(_totalNativeFee, _payInLzToken, success, result);\n // fee should be in lzTokenFee if payInLzToken, otherwise in native\n if (treasuryNativeFee > 0) {\n fees[treasury] += treasuryNativeFee;\n }\n }\n }\n\n /// @dev the abstract process for quote() is:\n /// 0/ split out the executor options and options of other workers\n /// 1/ quote workers\n /// 2/ quote executor\n /// 3/ quote treasury\n /// @return nativeFee, lzTokenFee\n function _quote(\n address _sender,\n uint32 _dstEid,\n uint256 _msgSize,\n bool _payInLzToken,\n bytes calldata _options\n ) internal view returns (uint256, uint256) {\n (bytes memory executorOptions, WorkerOptions[] memory validationOptions) = _splitOptions(_options);\n\n // quote the verifier used in the library. for ULN, it is a list of DVNs\n uint256 nativeFee = _quoteVerifier(_sender, _dstEid, validationOptions);\n\n // quote executor\n ExecutorConfig memory config = getExecutorConfig(_sender, _dstEid);\n // assert msg size\n _assertMessageSize(_msgSize, config.maxMessageSize);\n\n nativeFee += ILayerZeroExecutor(config.executor).getFee(_dstEid, _sender, _msgSize, executorOptions);\n\n // quote treasury\n (uint256 treasuryNativeFee, uint256 lzTokenFee) = _quoteTreasury(_sender, _dstEid, nativeFee, _payInLzToken);\n nativeFee += treasuryNativeFee;\n\n return (nativeFee, lzTokenFee);\n }\n\n /// @dev this interface should be DoS-free if the user is paying with native. properties\n /// 1/ treasury can return an overly high lzToken fee\n /// 2/ if treasury returns an overly high native fee, it will be capped by maxNativeFee,\n /// which can be reasoned with the configurations\n /// 3/ the owner can not configure the treasury in a way that force this function to revert\n function _quoteTreasury(\n address _sender,\n uint32 _dstEid,\n uint256 _totalNativeFee,\n bool _payInLzToken\n ) internal view returns (uint256 nativeFee, uint256 lzTokenFee) {\n // treasury must be set, and it has to be a contract\n if (treasury != address(0x0)) {\n bytes memory callData = abi.encodeCall(\n ILayerZeroTreasury.getFee,\n (_sender, _dstEid, _totalNativeFee, _payInLzToken)\n );\n (bool success, bytes memory result) = treasury.safeStaticCall(\n treasuryGasLimit,\n TREASURY_MAX_COPY,\n callData\n );\n\n return _parseTreasuryResult(_totalNativeFee, _payInLzToken, success, result);\n }\n }\n\n function _parseTreasuryResult(\n uint256 _totalNativeFee,\n bool _payInLzToken,\n bool _success,\n bytes memory _result\n ) internal view returns (uint256 nativeFee, uint256 lzTokenFee) {\n // failure, charges nothing\n if (!_success || _result.length < TREASURY_MAX_COPY) return (0, 0);\n\n // parse the result\n uint256 treasureFeeQuote = abi.decode(_result, (uint256));\n if (_payInLzToken) {\n lzTokenFee = treasureFeeQuote;\n } else {\n // pay in native\n // we must prevent high-treasuryFee Dos attack\n // nativeFee = min(treasureFeeQuote, maxNativeFee)\n // opportunistically raise the maxNativeFee to be the same as _totalNativeFee\n // can't use the _totalNativeFee alone because the oapp can use custom workers to force the fee to 0.\n // maxNativeFee = max (_totalNativeFee, treasuryNativeFeeCap)\n uint256 maxNativeFee = _totalNativeFee > treasuryNativeFeeCap ? _totalNativeFee : treasuryNativeFeeCap;\n\n // min (treasureFeeQuote, nativeFeeCap)\n nativeFee = treasureFeeQuote > maxNativeFee ? maxNativeFee : treasureFeeQuote;\n }\n }\n\n /// @dev authenticated by msg.sender only\n function _debitFee(uint256 _amount) internal {\n uint256 fee = fees[msg.sender];\n if (_amount > fee) revert LZ_MessageLib_InvalidAmount(_amount, fee);\n unchecked {\n fees[msg.sender] = fee - _amount;\n }\n }\n\n function _setTreasury(address _treasury) internal {\n treasury = _treasury;\n emit TreasurySet(_treasury);\n }\n\n function _setExecutorConfig(uint32 _remoteEid, address _oapp, ExecutorConfig memory _config) internal {\n executorConfigs[_oapp][_remoteEid] = _config;\n emit ExecutorConfigSet(_oapp, _remoteEid, _config);\n }\n\n // ======================= Virtual =======================\n /// @dev these two functions will be overridden with specific logics of the library function\n function _quoteVerifier(\n address _oapp,\n uint32 _eid,\n WorkerOptions[] memory _options\n ) internal view virtual returns (uint256 nativeFee);\n\n /// @dev this function will split the options into executorOptions and validationOptions\n function _splitOptions(\n bytes calldata _options\n ) internal view virtual returns (bytes memory executorOptions, WorkerOptions[] memory validationOptions);\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/libs/DVNOptions.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { BytesLib } from \"solidity-bytes-utils/contracts/BytesLib.sol\";\n\nimport { BitMap256 } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/BitMaps.sol\";\nimport { CalldataBytesLib } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/CalldataBytesLib.sol\";\n\nlibrary DVNOptions {\n using CalldataBytesLib for bytes;\n using BytesLib for bytes;\n\n uint8 internal constant WORKER_ID = 2;\n uint8 internal constant OPTION_TYPE_PRECRIME = 1;\n\n error DVN_InvalidDVNIdx();\n error DVN_InvalidDVNOptions(uint256 cursor);\n\n /// @dev group dvn options by its idx\n /// @param _options [dvn_id][dvn_option][dvn_id][dvn_option]...\n /// dvn_option = [option_size][dvn_idx][option_type][option]\n /// option_size = len(dvn_idx) + len(option_type) + len(option)\n /// dvn_id: uint8, dvn_idx: uint8, option_size: uint16, option_type: uint8, option: bytes\n /// @return dvnOptions the grouped options, still share the same format of _options\n /// @return dvnIndices the dvn indices\n function groupDVNOptionsByIdx(\n bytes memory _options\n ) internal pure returns (bytes[] memory dvnOptions, uint8[] memory dvnIndices) {\n if (_options.length == 0) return (dvnOptions, dvnIndices);\n\n uint8 numDVNs = getNumDVNs(_options);\n\n // if there is only 1 dvn, we can just return the whole options\n if (numDVNs == 1) {\n dvnOptions = new bytes[](1);\n dvnOptions[0] = _options;\n\n dvnIndices = new uint8[](1);\n dvnIndices[0] = _options.toUint8(3); // dvn idx\n return (dvnOptions, dvnIndices);\n }\n\n // otherwise, we need to group the options by dvn_idx\n dvnIndices = new uint8[](numDVNs);\n dvnOptions = new bytes[](numDVNs);\n unchecked {\n uint256 cursor = 0;\n uint256 start = 0;\n uint8 lastDVNIdx = 255; // 255 is an invalid dvn_idx\n\n while (cursor < _options.length) {\n ++cursor; // skip worker_id\n\n // optionLength asserted in getNumDVNs (skip check)\n uint16 optionLength = _options.toUint16(cursor);\n cursor += 2;\n\n // dvnIdx asserted in getNumDVNs (skip check)\n uint8 dvnIdx = _options.toUint8(cursor);\n\n // dvnIdx must equal to the lastDVNIdx for the first option\n // so it is always skipped in the first option\n // this operation slices out options whenever the scan finds a different lastDVNIdx\n if (lastDVNIdx == 255) {\n lastDVNIdx = dvnIdx;\n } else if (dvnIdx != lastDVNIdx) {\n uint256 len = cursor - start - 3; // 3 is for worker_id and option_length\n bytes memory opt = _options.slice(start, len);\n _insertDVNOptions(dvnOptions, dvnIndices, lastDVNIdx, opt);\n\n // reset the start and lastDVNIdx\n start += len;\n lastDVNIdx = dvnIdx;\n }\n\n cursor += optionLength;\n }\n\n // skip check the cursor here because the cursor is asserted in getNumDVNs\n // if we have reached the end of the options, we need to process the last dvn\n uint256 size = cursor - start;\n bytes memory op = _options.slice(start, size);\n _insertDVNOptions(dvnOptions, dvnIndices, lastDVNIdx, op);\n\n // revert dvnIndices to start from 0\n for (uint8 i = 0; i < numDVNs; ++i) {\n --dvnIndices[i];\n }\n }\n }\n\n function _insertDVNOptions(\n bytes[] memory _dvnOptions,\n uint8[] memory _dvnIndices,\n uint8 _dvnIdx,\n bytes memory _newOptions\n ) internal pure {\n // dvnIdx starts from 0 but default value of dvnIndices is 0,\n // so we tell if the slot is empty by adding 1 to dvnIdx\n if (_dvnIdx == 255) revert DVN_InvalidDVNIdx();\n uint8 dvnIdxAdj = _dvnIdx + 1;\n\n for (uint256 j = 0; j < _dvnIndices.length; ++j) {\n uint8 index = _dvnIndices[j];\n if (dvnIdxAdj == index) {\n _dvnOptions[j] = abi.encodePacked(_dvnOptions[j], _newOptions);\n break;\n } else if (index == 0) {\n // empty slot, that means it is the first time we see this dvn\n _dvnIndices[j] = dvnIdxAdj;\n _dvnOptions[j] = _newOptions;\n break;\n }\n }\n }\n\n /// @dev get the number of unique dvns\n /// @param _options the format is the same as groupDVNOptionsByIdx\n function getNumDVNs(bytes memory _options) internal pure returns (uint8 numDVNs) {\n uint256 cursor = 0;\n BitMap256 bitmap;\n\n // find number of unique dvn_idx\n unchecked {\n while (cursor < _options.length) {\n ++cursor; // skip worker_id\n\n uint16 optionLength = _options.toUint16(cursor);\n cursor += 2;\n if (optionLength < 2) revert DVN_InvalidDVNOptions(cursor); // at least 1 byte for dvn_idx and 1 byte for option_type\n\n uint8 dvnIdx = _options.toUint8(cursor);\n\n // if dvnIdx is not set, increment numDVNs\n // max num of dvns is 255, 255 is an invalid dvn_idx\n // The order of the dvnIdx is not required to be sequential, as enforcing the order may weaken\n // the composability of the options. e.g. if we refrain from enforcing the order, an OApp that has\n // already enforced certain options can append additional options to the end of the enforced\n // ones without restrictions.\n if (dvnIdx == 255) revert DVN_InvalidDVNIdx();\n if (!bitmap.get(dvnIdx)) {\n ++numDVNs;\n bitmap = bitmap.set(dvnIdx);\n }\n\n cursor += optionLength;\n }\n }\n if (cursor != _options.length) revert DVN_InvalidDVNOptions(cursor);\n }\n\n /// @dev decode the next dvn option from _options starting from the specified cursor\n /// @param _options the format is the same as groupDVNOptionsByIdx\n /// @param _cursor the cursor to start decoding\n /// @return optionType the type of the option\n /// @return option the option\n /// @return cursor the cursor to start decoding the next option\n function nextDVNOption(\n bytes calldata _options,\n uint256 _cursor\n ) internal pure returns (uint8 optionType, bytes calldata option, uint256 cursor) {\n unchecked {\n // skip worker id\n cursor = _cursor + 1;\n\n // read option size\n uint16 size = _options.toU16(cursor);\n cursor += 2;\n\n // read option type\n optionType = _options.toU8(cursor + 1); // skip dvn_idx\n\n // startCursor and endCursor are used to slice the option from _options\n uint256 startCursor = cursor + 2; // skip option type and dvn_idx\n uint256 endCursor = cursor + size;\n option = _options[startCursor:endCursor];\n cursor += size;\n }\n }\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/libs/UlnOptions.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { SafeCast } from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\n\nimport { ExecutorOptions } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/ExecutorOptions.sol\";\n\nimport { DVNOptions } from \"./DVNOptions.sol\";\n\nlibrary UlnOptions {\n using SafeCast for uint256;\n\n uint16 internal constant TYPE_1 = 1; // legacy options type 1\n uint16 internal constant TYPE_2 = 2; // legacy options type 2\n uint16 internal constant TYPE_3 = 3;\n\n error LZ_ULN_InvalidWorkerOptions(uint256 cursor);\n error LZ_ULN_InvalidWorkerId(uint8 workerId);\n error LZ_ULN_InvalidLegacyType1Option();\n error LZ_ULN_InvalidLegacyType2Option();\n error LZ_ULN_UnsupportedOptionType(uint16 optionType);\n\n /// @dev decode the options into executorOptions and dvnOptions\n /// @param _options the options can be either legacy options (type 1 or 2) or type 3 options\n /// @return executorOptions the executor options, share the same format of type 3 options\n /// @return dvnOptions the dvn options, share the same format of type 3 options\n function decode(\n bytes calldata _options\n ) internal pure returns (bytes memory executorOptions, bytes memory dvnOptions) {\n // at least 2 bytes for the option type, but can have no options\n if (_options.length < 2) revert LZ_ULN_InvalidWorkerOptions(0);\n\n uint16 optionsType = uint16(bytes2(_options[0:2]));\n uint256 cursor = 2;\n\n // type3 options: [worker_option][worker_option]...\n // worker_option: [worker_id][option_size][option]\n // worker_id: uint8, option_size: uint16, option: bytes\n if (optionsType == TYPE_3) {\n unchecked {\n uint256 start = cursor;\n uint8 lastWorkerId; // worker_id starts from 1, so 0 is an invalid worker_id\n\n // heuristic: we assume that the options are mostly EXECUTOR options only\n // checking the workerID can reduce gas usage for most cases\n while (cursor < _options.length) {\n uint8 workerId = uint8(bytes1(_options[cursor:cursor + 1]));\n if (workerId == 0) revert LZ_ULN_InvalidWorkerId(0);\n\n // workerId must equal to the lastWorkerId for the first option\n // so it is always skipped in the first option\n // this operation slices out options whenever the the scan finds a different workerId\n if (lastWorkerId == 0) {\n lastWorkerId = workerId;\n } else if (workerId != lastWorkerId) {\n bytes calldata op = _options[start:cursor]; // slice out the last worker's options\n (executorOptions, dvnOptions) = _insertWorkerOptions(\n executorOptions,\n dvnOptions,\n lastWorkerId,\n op\n );\n\n // reset the start cursor and lastWorkerId\n start = cursor;\n lastWorkerId = workerId;\n }\n\n ++cursor; // for workerId\n\n uint16 size = uint16(bytes2(_options[cursor:cursor + 2]));\n if (size == 0) revert LZ_ULN_InvalidWorkerOptions(cursor);\n cursor += size + 2;\n }\n\n // the options length must be the same as the cursor at the end\n if (cursor != _options.length) revert LZ_ULN_InvalidWorkerOptions(cursor);\n\n // if we have reached the end of the options and the options are not empty\n // we need to process the last worker's options\n if (_options.length > 2) {\n bytes calldata op = _options[start:cursor];\n (executorOptions, dvnOptions) = _insertWorkerOptions(executorOptions, dvnOptions, lastWorkerId, op);\n }\n }\n } else {\n executorOptions = decodeLegacyOptions(optionsType, _options);\n }\n }\n\n function _insertWorkerOptions(\n bytes memory _executorOptions,\n bytes memory _dvnOptions,\n uint8 _workerId,\n bytes calldata _newOptions\n ) private pure returns (bytes memory, bytes memory) {\n if (_workerId == ExecutorOptions.WORKER_ID) {\n _executorOptions = _executorOptions.length == 0\n ? _newOptions\n : abi.encodePacked(_executorOptions, _newOptions);\n } else if (_workerId == DVNOptions.WORKER_ID) {\n _dvnOptions = _dvnOptions.length == 0 ? _newOptions : abi.encodePacked(_dvnOptions, _newOptions);\n } else {\n revert LZ_ULN_InvalidWorkerId(_workerId);\n }\n return (_executorOptions, _dvnOptions);\n }\n\n /// @dev decode the legacy options (type 1 or 2) into executorOptions\n /// @param _optionType the legacy option type\n /// @param _options the legacy options, which still has the option type in the first 2 bytes\n /// @return executorOptions the executor options, share the same format of type 3 options\n /// Data format:\n /// legacy type 1: [extraGas]\n /// legacy type 2: [extraGas][dstNativeAmt][dstNativeAddress]\n /// extraGas: uint256, dstNativeAmt: uint256, dstNativeAddress: bytes\n function decodeLegacyOptions(\n uint16 _optionType,\n bytes calldata _options\n ) internal pure returns (bytes memory executorOptions) {\n if (_optionType == TYPE_1) {\n if (_options.length != 34) revert LZ_ULN_InvalidLegacyType1Option();\n\n // execution gas\n uint128 executionGas = uint256(bytes32(_options[2:2 + 32])).toUint128();\n\n // dont use the encode function in the ExecutorOptions lib for saving gas by calling abi.encodePacked once\n // the result is a lzReceive option: [executor_id][option_size][option_type][execution_gas]\n // option_type: uint8, execution_gas: uint128\n // option_size = len(option_type) + len(execution_gas) = 1 + 16 = 17\n executorOptions = abi.encodePacked(\n ExecutorOptions.WORKER_ID,\n uint16(17), // 16 + 1, 16 for option_length, + 1 for option_type\n ExecutorOptions.OPTION_TYPE_LZRECEIVE,\n executionGas\n );\n } else if (_optionType == TYPE_2) {\n // receiver size <= 32\n if (_options.length <= 66 || _options.length > 98) revert LZ_ULN_InvalidLegacyType2Option();\n\n // execution gas\n uint128 executionGas = uint256(bytes32(_options[2:2 + 32])).toUint128();\n\n // nativeDrop (amount + receiver)\n uint128 amount = uint256(bytes32(_options[34:34 + 32])).toUint128(); // offset 2 + 32\n bytes32 receiver;\n unchecked {\n uint256 receiverLen = _options.length - 66; // offset 2 + 32 + 32\n receiver = bytes32(_options[66:]);\n receiver = receiver >> (8 * (32 - receiverLen)); // padding 0 to the left\n }\n\n // dont use the encode function in the ExecutorOptions lib for saving gas by calling abi.encodePacked once\n // the result has one lzReceive option and one nativeDrop option:\n // [executor_id][lzReceive_option_size][option_type][execution_gas] +\n // [executor_id][nativeDrop_option_size][option_type][nativeDrop_amount][receiver]\n // option_type: uint8, execution_gas: uint128, nativeDrop_amount: uint128, receiver: bytes32\n // lzReceive_option_size = len(option_type) + len(execution_gas) = 1 + 16 = 17\n // nativeDrop_option_size = len(option_type) + len(nativeDrop_amount) + len(receiver) = 1 + 16 + 32 = 49\n executorOptions = abi.encodePacked(\n ExecutorOptions.WORKER_ID,\n uint16(17), // 16 + 1, 16 for option_length, + 1 for option_type\n ExecutorOptions.OPTION_TYPE_LZRECEIVE,\n executionGas,\n ExecutorOptions.WORKER_ID,\n uint16(49), // 48 + 1, 32 + 16 for option_length, + 1 for option_type\n ExecutorOptions.OPTION_TYPE_NATIVE_DROP,\n amount,\n receiver\n );\n } else {\n revert LZ_ULN_UnsupportedOptionType(_optionType);\n }\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppCore.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { ILayerZeroEndpointV2 } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\n\n/**\n * @title IOAppCore\n */\ninterface IOAppCore {\n // Custom error messages\n error OnlyPeer(uint32 eid, bytes32 sender);\n error NoPeer(uint32 eid);\n error InvalidEndpointCall();\n error InvalidDelegate();\n\n // Event emitted when a peer (OApp) is set for a corresponding endpoint\n event PeerSet(uint32 eid, bytes32 peer);\n\n /**\n * @notice Retrieves the OApp version information.\n * @return senderVersion The version of the OAppSender.sol contract.\n * @return receiverVersion The version of the OAppReceiver.sol contract.\n */\n function oAppVersion() external view returns (uint64 senderVersion, uint64 receiverVersion);\n\n /**\n * @notice Retrieves the LayerZero endpoint associated with the OApp.\n * @return iEndpoint The LayerZero endpoint as an interface.\n */\n function endpoint() external view returns (ILayerZeroEndpointV2 iEndpoint);\n\n /**\n * @notice Retrieves the peer (OApp) associated with a corresponding endpoint.\n * @param _eid The endpoint ID.\n * @return peer The peer address (OApp instance) associated with the corresponding endpoint.\n */\n function peers(uint32 _eid) external view returns (bytes32 peer);\n\n /**\n * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\n * @param _eid The endpoint ID.\n * @param _peer The address of the peer to be associated with the corresponding endpoint.\n */\n function setPeer(uint32 _eid, bytes32 _peer) external;\n\n /**\n * @notice Sets the delegate address for the OApp Core.\n * @param _delegate The address of the delegate to be set.\n */\n function setDelegate(address _delegate) external;\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppMsgInspector.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\n/**\n * @title IOAppMsgInspector\n * @dev Interface for the OApp Message Inspector, allowing examination of message and options contents.\n */\ninterface IOAppMsgInspector {\n // Custom error message for inspection failure\n error InspectionFailed(bytes message, bytes options);\n\n /**\n * @notice Allows the inspector to examine LayerZero message contents and optionally throw a revert if invalid.\n * @param _message The message payload to be inspected.\n * @param _options Additional options or parameters for inspection.\n * @return valid A boolean indicating whether the inspection passed (true) or failed (false).\n *\n * @dev Optionally done as a revert, OR use the boolean provided to handle the failure.\n */\n function inspect(bytes calldata _message, bytes calldata _options) external view returns (bool valid);\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppOptionsType3.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Struct representing enforced option parameters.\n */\nstruct EnforcedOptionParam {\n uint32 eid; // Endpoint ID\n uint16 msgType; // Message Type\n bytes options; // Additional options\n}\n\n/**\n * @title IOAppOptionsType3\n * @dev Interface for the OApp with Type 3 Options, allowing the setting and combining of enforced options.\n */\ninterface IOAppOptionsType3 {\n // Custom error message for invalid options\n error InvalidOptions(bytes options);\n\n // Event emitted when enforced options are set\n event EnforcedOptionSet(EnforcedOptionParam[] _enforcedOptions);\n\n /**\n * @notice Sets enforced options for specific endpoint and message type combinations.\n * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\n */\n function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) external;\n\n /**\n * @notice Combines options for a given endpoint and message type.\n * @param _eid The endpoint ID.\n * @param _msgType The OApp message type.\n * @param _extraOptions Additional options passed by the caller.\n * @return options The combination of caller specified options AND enforced options.\n */\n function combineOptions(\n uint32 _eid,\n uint16 _msgType,\n bytes calldata _extraOptions\n ) external view returns (bytes memory options);\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppReceiver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport { ILayerZeroReceiver, Origin } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol\";\n\ninterface IOAppReceiver is ILayerZeroReceiver {\n /**\n * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint.\n * @param _origin The origin information containing the source endpoint and sender address.\n * - srcEid: The source chain endpoint ID.\n * - sender: The sender address on the src chain.\n * - nonce: The nonce of the message.\n * @param _message The lzReceive payload.\n * @param _sender The sender address.\n * @return isSender Is a valid sender.\n *\n * @dev Applications can optionally choose to implement a separate composeMsg sender that is NOT the bridging layer.\n * @dev The default sender IS the OAppReceiver implementer.\n */\n function isComposeMsgSender(\n Origin calldata _origin,\n bytes calldata _message,\n address _sender\n ) external view returns (bool isSender);\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OAppOptionsType3.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { IOAppOptionsType3, EnforcedOptionParam } from \"../interfaces/IOAppOptionsType3.sol\";\n\n/**\n * @title OAppOptionsType3\n * @dev Abstract contract implementing the IOAppOptionsType3 interface with type 3 options.\n */\nabstract contract OAppOptionsType3 is IOAppOptionsType3, Ownable {\n uint16 internal constant OPTION_TYPE_3 = 3;\n\n // @dev The \"msgType\" should be defined in the child contract.\n mapping(uint32 eid => mapping(uint16 msgType => bytes enforcedOption)) public enforcedOptions;\n\n /**\n * @dev Sets the enforced options for specific endpoint and message type combinations.\n * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\n *\n * @dev Only the owner/admin of the OApp can call this function.\n * @dev Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.\n * @dev These enforced options can vary as the potential options/execution on the remote may differ as per the msgType.\n * eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay\n * if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().\n */\n function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) public virtual onlyOwner {\n _setEnforcedOptions(_enforcedOptions);\n }\n\n /**\n * @dev Sets the enforced options for specific endpoint and message type combinations.\n * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\n *\n * @dev Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.\n * @dev These enforced options can vary as the potential options/execution on the remote may differ as per the msgType.\n * eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay\n * if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().\n */\n function _setEnforcedOptions(EnforcedOptionParam[] memory _enforcedOptions) internal virtual {\n for (uint256 i = 0; i < _enforcedOptions.length; i++) {\n // @dev Enforced options are only available for optionType 3, as type 1 and 2 dont support combining.\n _assertOptionsType3(_enforcedOptions[i].options);\n enforcedOptions[_enforcedOptions[i].eid][_enforcedOptions[i].msgType] = _enforcedOptions[i].options;\n }\n\n emit EnforcedOptionSet(_enforcedOptions);\n }\n\n /**\n * @notice Combines options for a given endpoint and message type.\n * @param _eid The endpoint ID.\n * @param _msgType The OAPP message type.\n * @param _extraOptions Additional options passed by the caller.\n * @return options The combination of caller specified options AND enforced options.\n *\n * @dev If there is an enforced lzReceive option:\n * - {gasLimit: 200k, msg.value: 1 ether} AND a caller supplies a lzReceive option: {gasLimit: 100k, msg.value: 0.5 ether}\n * - The resulting options will be {gasLimit: 300k, msg.value: 1.5 ether} when the message is executed on the remote lzReceive() function.\n * @dev This presence of duplicated options is handled off-chain in the verifier/executor.\n */\n function combineOptions(\n uint32 _eid,\n uint16 _msgType,\n bytes calldata _extraOptions\n ) public view virtual returns (bytes memory) {\n bytes memory enforced = enforcedOptions[_eid][_msgType];\n\n // No enforced options, pass whatever the caller supplied, even if it's empty or legacy type 1/2 options.\n if (enforced.length == 0) return _extraOptions;\n\n // No caller options, return enforced\n if (_extraOptions.length == 0) return enforced;\n\n // @dev If caller provided _extraOptions, must be type 3 as its the ONLY type that can be combined.\n if (_extraOptions.length >= 2) {\n _assertOptionsType3(_extraOptions);\n // @dev Remove the first 2 bytes containing the type from the _extraOptions and combine with enforced.\n return bytes.concat(enforced, _extraOptions[2:]);\n }\n\n // No valid set of options was found.\n revert InvalidOptions(_extraOptions);\n }\n\n /**\n * @dev Internal function to assert that options are of type 3.\n * @param _options The options to be checked.\n */\n function _assertOptionsType3(bytes memory _options) internal pure virtual {\n uint16 optionsType;\n assembly {\n optionsType := mload(add(_options, 2))\n }\n if (optionsType != OPTION_TYPE_3) revert InvalidOptions(_options);\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppCore.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { IOAppCore, ILayerZeroEndpointV2 } from \"./interfaces/IOAppCore.sol\";\n\n/**\n * @title OAppCore\n * @dev Abstract contract implementing the IOAppCore interface with basic OApp configurations.\n */\nabstract contract OAppCore is IOAppCore, Ownable {\n // The LayerZero endpoint associated with the given OApp\n ILayerZeroEndpointV2 public immutable endpoint;\n\n // Mapping to store peers associated with corresponding endpoints\n mapping(uint32 eid => bytes32 peer) public peers;\n\n /**\n * @dev Constructor to initialize the OAppCore with the provided endpoint and delegate.\n * @param _endpoint The address of the LOCAL Layer Zero endpoint.\n * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n *\n * @dev The delegate typically should be set as the owner of the contract.\n */\n constructor(address _endpoint, address _delegate) {\n endpoint = ILayerZeroEndpointV2(_endpoint);\n\n if (_delegate == address(0)) revert InvalidDelegate();\n endpoint.setDelegate(_delegate);\n }\n\n /**\n * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\n * @param _eid The endpoint ID.\n * @param _peer The address of the peer to be associated with the corresponding endpoint.\n *\n * @dev Only the owner/admin of the OApp can call this function.\n * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.\n * @dev Set this to bytes32(0) to remove the peer address.\n * @dev Peer is a bytes32 to accommodate non-evm chains.\n */\n function setPeer(uint32 _eid, bytes32 _peer) public virtual onlyOwner {\n _setPeer(_eid, _peer);\n }\n\n /**\n * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\n * @param _eid The endpoint ID.\n * @param _peer The address of the peer to be associated with the corresponding endpoint.\n *\n * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.\n * @dev Set this to bytes32(0) to remove the peer address.\n * @dev Peer is a bytes32 to accommodate non-evm chains.\n */\n function _setPeer(uint32 _eid, bytes32 _peer) internal virtual {\n peers[_eid] = _peer;\n emit PeerSet(_eid, _peer);\n }\n\n /**\n * @notice Internal function to get the peer address associated with a specific endpoint; reverts if NOT set.\n * ie. the peer is set to bytes32(0).\n * @param _eid The endpoint ID.\n * @return peer The address of the peer associated with the specified endpoint.\n */\n function _getPeerOrRevert(uint32 _eid) internal view virtual returns (bytes32) {\n bytes32 peer = peers[_eid];\n if (peer == bytes32(0)) revert NoPeer(_eid);\n return peer;\n }\n\n /**\n * @notice Sets the delegate address for the OApp.\n * @param _delegate The address of the delegate to be set.\n *\n * @dev Only the owner/admin of the OApp can call this function.\n * @dev Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.\n */\n function setDelegate(address _delegate) public onlyOwner {\n endpoint.setDelegate(_delegate);\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppReceiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { IOAppReceiver, Origin } from \"./interfaces/IOAppReceiver.sol\";\nimport { OAppCore } from \"./OAppCore.sol\";\n\n/**\n * @title OAppReceiver\n * @dev Abstract contract implementing the ILayerZeroReceiver interface and extending OAppCore for OApp receivers.\n */\nabstract contract OAppReceiver is IOAppReceiver, OAppCore {\n // Custom error message for when the caller is not the registered endpoint/\n error OnlyEndpoint(address addr);\n\n // @dev The version of the OAppReceiver implementation.\n // @dev Version is bumped when changes are made to this contract.\n uint64 internal constant RECEIVER_VERSION = 2;\n\n /**\n * @notice Retrieves the OApp version information.\n * @return senderVersion The version of the OAppSender.sol contract.\n * @return receiverVersion The version of the OAppReceiver.sol contract.\n *\n * @dev Providing 0 as the default for OAppSender version. Indicates that the OAppSender is not implemented.\n * ie. this is a RECEIVE only OApp.\n * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions.\n */\n function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\n return (0, RECEIVER_VERSION);\n }\n\n /**\n * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint.\n * @dev _origin The origin information containing the source endpoint and sender address.\n * - srcEid: The source chain endpoint ID.\n * - sender: The sender address on the src chain.\n * - nonce: The nonce of the message.\n * @dev _message The lzReceive payload.\n * @param _sender The sender address.\n * @return isSender Is a valid sender.\n *\n * @dev Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer.\n * @dev The default sender IS the OAppReceiver implementer.\n */\n function isComposeMsgSender(\n Origin calldata /*_origin*/,\n bytes calldata /*_message*/,\n address _sender\n ) public view virtual returns (bool) {\n return _sender == address(this);\n }\n\n /**\n * @notice Checks if the path initialization is allowed based on the provided origin.\n * @param origin The origin information containing the source endpoint and sender address.\n * @return Whether the path has been initialized.\n *\n * @dev This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received.\n * @dev This defaults to assuming if a peer has been set, its initialized.\n * Can be overridden by the OApp if there is other logic to determine this.\n */\n function allowInitializePath(Origin calldata origin) public view virtual returns (bool) {\n return peers[origin.srcEid] == origin.sender;\n }\n\n /**\n * @notice Retrieves the next nonce for a given source endpoint and sender address.\n * @dev _srcEid The source endpoint ID.\n * @dev _sender The sender address.\n * @return nonce The next nonce.\n *\n * @dev The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement.\n * @dev Is required by the off-chain executor to determine the OApp expects msg execution is ordered.\n * @dev This is also enforced by the OApp.\n * @dev By default this is NOT enabled. ie. nextNonce is hardcoded to return 0.\n */\n function nextNonce(uint32 /*_srcEid*/, bytes32 /*_sender*/) public view virtual returns (uint64 nonce) {\n return 0;\n }\n\n /**\n * @dev Entry point for receiving messages or packets from the endpoint.\n * @param _origin The origin information containing the source endpoint and sender address.\n * - srcEid: The source chain endpoint ID.\n * - sender: The sender address on the src chain.\n * - nonce: The nonce of the message.\n * @param _guid The unique identifier for the received LayerZero message.\n * @param _message The payload of the received message.\n * @param _executor The address of the executor for the received message.\n * @param _extraData Additional arbitrary data provided by the corresponding executor.\n *\n * @dev Entry point for receiving msg/packet from the LayerZero endpoint.\n */\n function lzReceive(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address _executor,\n bytes calldata _extraData\n ) public payable virtual {\n // Ensures that only the endpoint can attempt to lzReceive() messages to this OApp.\n if (address(endpoint) != msg.sender) revert OnlyEndpoint(msg.sender);\n\n // Ensure that the sender matches the expected peer for the source endpoint.\n if (_getPeerOrRevert(_origin.srcEid) != _origin.sender) revert OnlyPeer(_origin.srcEid, _origin.sender);\n\n // Call the internal OApp implementation of lzReceive.\n _lzReceive(_origin, _guid, _message, _executor, _extraData);\n }\n\n /**\n * @dev Internal function to implement lzReceive logic without needing to copy the basic parameter validation.\n */\n function _lzReceive(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address _executor,\n bytes calldata _extraData\n ) internal virtual;\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppSender.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { SafeERC20, IERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { MessagingParams, MessagingFee, MessagingReceipt } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport { OAppCore } from \"./OAppCore.sol\";\n\n/**\n * @title OAppSender\n * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.\n */\nabstract contract OAppSender is OAppCore {\n using SafeERC20 for IERC20;\n\n // Custom error messages\n error NotEnoughNative(uint256 msgValue);\n error LzTokenUnavailable();\n\n // @dev The version of the OAppSender implementation.\n // @dev Version is bumped when changes are made to this contract.\n uint64 internal constant SENDER_VERSION = 1;\n\n /**\n * @notice Retrieves the OApp version information.\n * @return senderVersion The version of the OAppSender.sol contract.\n * @return receiverVersion The version of the OAppReceiver.sol contract.\n *\n * @dev Providing 0 as the default for OAppReceiver version. Indicates that the OAppReceiver is not implemented.\n * ie. this is a SEND only OApp.\n * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions\n */\n function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\n return (SENDER_VERSION, 0);\n }\n\n /**\n * @dev Internal function to interact with the LayerZero EndpointV2.quote() for fee calculation.\n * @param _dstEid The destination endpoint ID.\n * @param _message The message payload.\n * @param _options Additional options for the message.\n * @param _payInLzToken Flag indicating whether to pay the fee in LZ tokens.\n * @return fee The calculated MessagingFee for the message.\n * - nativeFee: The native fee for the message.\n * - lzTokenFee: The LZ token fee for the message.\n */\n function _quote(\n uint32 _dstEid,\n bytes memory _message,\n bytes memory _options,\n bool _payInLzToken\n ) internal view virtual returns (MessagingFee memory fee) {\n return\n endpoint.quote(\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken),\n address(this)\n );\n }\n\n /**\n * @dev Internal function to interact with the LayerZero EndpointV2.send() for sending a message.\n * @param _dstEid The destination endpoint ID.\n * @param _message The message payload.\n * @param _options Additional options for the message.\n * @param _fee The calculated LayerZero fee for the message.\n * - nativeFee: The native fee.\n * - lzTokenFee: The lzToken fee.\n * @param _refundAddress The address to receive any excess fee values sent to the endpoint.\n * @return receipt The receipt for the sent message.\n * - guid: The unique identifier for the sent message.\n * - nonce: The nonce of the sent message.\n * - fee: The LayerZero fee incurred for the message.\n */\n function _lzSend(\n uint32 _dstEid,\n bytes memory _message,\n bytes memory _options,\n MessagingFee memory _fee,\n address _refundAddress\n ) internal virtual returns (MessagingReceipt memory receipt) {\n // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint.\n uint256 messageValue = _payNative(_fee.nativeFee);\n if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);\n\n return\n // solhint-disable-next-line check-send-result\n endpoint.send{ value: messageValue }(\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0),\n _refundAddress\n );\n }\n\n /**\n * @dev Internal function to pay the native fee associated with the message.\n * @param _nativeFee The native fee to be paid.\n * @return nativeFee The amount of native currency paid.\n *\n * @dev If the OApp needs to initiate MULTIPLE LayerZero messages in a single transaction,\n * this will need to be overridden because msg.value would contain multiple lzFees.\n * @dev Should be overridden in the event the LayerZero endpoint requires a different native currency.\n * @dev Some EVMs use an ERC20 as a method for paying transactions/gasFees.\n * @dev The endpoint is EITHER/OR, ie. it will NOT support both types of native payment at a time.\n */\n function _payNative(uint256 _nativeFee) internal virtual returns (uint256 nativeFee) {\n if (msg.value != _nativeFee) revert NotEnoughNative(msg.value);\n return _nativeFee;\n }\n\n /**\n * @dev Internal function to pay the LZ token fee associated with the message.\n * @param _lzTokenFee The LZ token fee to be paid.\n *\n * @dev If the caller is trying to pay in the specified lzToken, then the lzTokenFee is passed to the endpoint.\n * @dev Any excess sent, is passed back to the specified _refundAddress in the _lzSend().\n */\n function _payLzToken(uint256 _lzTokenFee) internal virtual {\n // @dev Cannot cache the token because it is not immutable in the endpoint.\n address lzToken = endpoint.lzToken();\n if (lzToken == address(0)) revert LzTokenUnavailable();\n\n // Pay LZ token fee by sending tokens to the endpoint.\n IERC20(lzToken).safeTransferFrom(msg.sender, address(endpoint), _lzTokenFee);\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { MessagingReceipt, MessagingFee } from \"../../oapp/OAppSender.sol\";\n\n/**\n * @dev Struct representing token parameters for the OFT send() operation.\n */\nstruct SendParam {\n uint32 dstEid; // Destination endpoint ID.\n bytes32 to; // Recipient address.\n uint256 amountLD; // Amount to send in local decimals.\n uint256 minAmountLD; // Minimum amount to send in local decimals.\n bytes extraOptions; // Additional options supplied by the caller to be used in the LayerZero message.\n bytes composeMsg; // The composed message for the send() operation.\n bytes oftCmd; // The OFT command to be executed, unused in default OFT implementations.\n}\n\n/**\n * @dev Struct representing OFT limit information.\n * @dev These amounts can change dynamically and are up the the specific oft implementation.\n */\nstruct OFTLimit {\n uint256 minAmountLD; // Minimum amount in local decimals that can be sent to the recipient.\n uint256 maxAmountLD; // Maximum amount in local decimals that can be sent to the recipient.\n}\n\n/**\n * @dev Struct representing OFT receipt information.\n */\nstruct OFTReceipt {\n uint256 amountSentLD; // Amount of tokens ACTUALLY debited from the sender in local decimals.\n // @dev In non-default implementations, the amountReceivedLD COULD differ from this value.\n uint256 amountReceivedLD; // Amount of tokens to be received on the remote side.\n}\n\n/**\n * @dev Struct representing OFT fee details.\n * @dev Future proof mechanism to provide a standardized way to communicate fees to things like a UI.\n */\nstruct OFTFeeDetail {\n int256 feeAmountLD; // Amount of the fee in local decimals.\n string description; // Description of the fee.\n}\n\n/**\n * @title IOFT\n * @dev Interface for the OftChain (OFT) token.\n * @dev Does not inherit ERC20 to accommodate usage by OFTAdapter as well.\n * @dev This specific interface ID is '0x02e49c2c'.\n */\ninterface IOFT {\n // Custom error messages\n error InvalidLocalDecimals();\n error SlippageExceeded(uint256 amountLD, uint256 minAmountLD);\n\n // Events\n event OFTSent(\n bytes32 indexed guid, // GUID of the OFT message.\n uint32 dstEid, // Destination Endpoint ID.\n address indexed fromAddress, // Address of the sender on the src chain.\n uint256 amountSentLD, // Amount of tokens sent in local decimals.\n uint256 amountReceivedLD // Amount of tokens received in local decimals.\n );\n event OFTReceived(\n bytes32 indexed guid, // GUID of the OFT message.\n uint32 srcEid, // Source Endpoint ID.\n address indexed toAddress, // Address of the recipient on the dst chain.\n uint256 amountReceivedLD // Amount of tokens received in local decimals.\n );\n\n /**\n * @notice Retrieves interfaceID and the version of the OFT.\n * @return interfaceId The interface ID.\n * @return version The version.\n *\n * @dev interfaceId: This specific interface ID is '0x02e49c2c'.\n * @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.\n * @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.\n * ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\n */\n function oftVersion() external view returns (bytes4 interfaceId, uint64 version);\n\n /**\n * @notice Retrieves the address of the token associated with the OFT.\n * @return token The address of the ERC20 token implementation.\n */\n function token() external view returns (address);\n\n /**\n * @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\n * @return requiresApproval Needs approval of the underlying token implementation.\n *\n * @dev Allows things like wallet implementers to determine integration requirements,\n * without understanding the underlying token implementation.\n */\n function approvalRequired() external view returns (bool);\n\n /**\n * @notice Retrieves the shared decimals of the OFT.\n * @return sharedDecimals The shared decimals of the OFT.\n */\n function sharedDecimals() external view returns (uint8);\n\n /**\n * @notice Provides a quote for OFT-related operations.\n * @param _sendParam The parameters for the send operation.\n * @return limit The OFT limit information.\n * @return oftFeeDetails The details of OFT fees.\n * @return receipt The OFT receipt information.\n */\n function quoteOFT(\n SendParam calldata _sendParam\n ) external view returns (OFTLimit memory, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory);\n\n /**\n * @notice Provides a quote for the send() operation.\n * @param _sendParam The parameters for the send() operation.\n * @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.\n * @return fee The calculated LayerZero messaging fee from the send() operation.\n *\n * @dev MessagingFee: LayerZero msg fee\n * - nativeFee: The native fee.\n * - lzTokenFee: The lzToken fee.\n */\n function quoteSend(SendParam calldata _sendParam, bool _payInLzToken) external view returns (MessagingFee memory);\n\n /**\n * @notice Executes the send() operation.\n * @param _sendParam The parameters for the send operation.\n * @param _fee The fee information supplied by the caller.\n * - nativeFee: The native fee.\n * - lzTokenFee: The lzToken fee.\n * @param _refundAddress The address to receive any excess funds from fees etc. on the src.\n * @return receipt The LayerZero messaging receipt from the send() operation.\n * @return oftReceipt The OFT receipt information.\n *\n * @dev MessagingReceipt: LayerZero msg receipt\n * - guid: The unique identifier for the sent message.\n * - nonce: The nonce of the sent message.\n * - fee: The LayerZero fee incurred for the message.\n */\n function send(\n SendParam calldata _sendParam,\n MessagingFee calldata _fee,\n address _refundAddress\n ) external payable returns (MessagingReceipt memory, OFTReceipt memory);\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/libs/OFTComposeMsgCodec.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nlibrary OFTComposeMsgCodec {\n // Offset constants for decoding composed messages\n uint8 private constant NONCE_OFFSET = 8;\n uint8 private constant SRC_EID_OFFSET = 12;\n uint8 private constant AMOUNT_LD_OFFSET = 44;\n uint8 private constant COMPOSE_FROM_OFFSET = 76;\n\n /**\n * @dev Encodes a OFT composed message.\n * @param _nonce The nonce value.\n * @param _srcEid The source endpoint ID.\n * @param _amountLD The amount in local decimals.\n * @param _composeMsg The composed message.\n * @return _msg The encoded Composed message.\n */\n function encode(\n uint64 _nonce,\n uint32 _srcEid,\n uint256 _amountLD,\n bytes memory _composeMsg // 0x[composeFrom][composeMsg]\n ) internal pure returns (bytes memory _msg) {\n _msg = abi.encodePacked(_nonce, _srcEid, _amountLD, _composeMsg);\n }\n\n /**\n * @dev Retrieves the nonce from the composed message.\n * @param _msg The message.\n * @return The nonce value.\n */\n function nonce(bytes calldata _msg) internal pure returns (uint64) {\n return uint64(bytes8(_msg[:NONCE_OFFSET]));\n }\n\n /**\n * @dev Retrieves the source endpoint ID from the composed message.\n * @param _msg The message.\n * @return The source endpoint ID.\n */\n function srcEid(bytes calldata _msg) internal pure returns (uint32) {\n return uint32(bytes4(_msg[NONCE_OFFSET:SRC_EID_OFFSET]));\n }\n\n /**\n * @dev Retrieves the amount in local decimals from the composed message.\n * @param _msg The message.\n * @return The amount in local decimals.\n */\n function amountLD(bytes calldata _msg) internal pure returns (uint256) {\n return uint256(bytes32(_msg[SRC_EID_OFFSET:AMOUNT_LD_OFFSET]));\n }\n\n /**\n * @dev Retrieves the composeFrom value from the composed message.\n * @param _msg The message.\n * @return The composeFrom value.\n */\n function composeFrom(bytes calldata _msg) internal pure returns (bytes32) {\n return bytes32(_msg[AMOUNT_LD_OFFSET:COMPOSE_FROM_OFFSET]);\n }\n\n /**\n * @dev Retrieves the composed message.\n * @param _msg The message.\n * @return The composed message.\n */\n function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\n return _msg[COMPOSE_FROM_OFFSET:];\n }\n\n /**\n * @dev Converts an address to bytes32.\n * @param _addr The address to convert.\n * @return The bytes32 representation of the address.\n */\n function addressToBytes32(address _addr) internal pure returns (bytes32) {\n return bytes32(uint256(uint160(_addr)));\n }\n\n /**\n * @dev Converts bytes32 to an address.\n * @param _b The bytes32 value to convert.\n * @return The address representation of bytes32.\n */\n function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\n return address(uint160(uint256(_b)));\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/libs/OFTMsgCodec.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nlibrary OFTMsgCodec {\n // Offset constants for encoding and decoding OFT messages\n uint8 private constant SEND_TO_OFFSET = 32;\n uint8 private constant SEND_AMOUNT_SD_OFFSET = 40;\n\n /**\n * @dev Encodes an OFT LayerZero message.\n * @param _sendTo The recipient address.\n * @param _amountShared The amount in shared decimals.\n * @param _composeMsg The composed message.\n * @return _msg The encoded message.\n * @return hasCompose A boolean indicating whether the message has a composed payload.\n */\n function encode(\n bytes32 _sendTo,\n uint64 _amountShared,\n bytes memory _composeMsg\n ) internal view returns (bytes memory _msg, bool hasCompose) {\n hasCompose = _composeMsg.length > 0;\n // @dev Remote chains will want to know the composed function caller ie. msg.sender on the src.\n _msg = hasCompose\n ? abi.encodePacked(_sendTo, _amountShared, addressToBytes32(msg.sender), _composeMsg)\n : abi.encodePacked(_sendTo, _amountShared);\n }\n\n /**\n * @dev Checks if the OFT message is composed.\n * @param _msg The OFT message.\n * @return A boolean indicating whether the message is composed.\n */\n function isComposed(bytes calldata _msg) internal pure returns (bool) {\n return _msg.length > SEND_AMOUNT_SD_OFFSET;\n }\n\n /**\n * @dev Retrieves the recipient address from the OFT message.\n * @param _msg The OFT message.\n * @return The recipient address.\n */\n function sendTo(bytes calldata _msg) internal pure returns (bytes32) {\n return bytes32(_msg[:SEND_TO_OFFSET]);\n }\n\n /**\n * @dev Retrieves the amount in shared decimals from the OFT message.\n * @param _msg The OFT message.\n * @return The amount in shared decimals.\n */\n function amountSD(bytes calldata _msg) internal pure returns (uint64) {\n return uint64(bytes8(_msg[SEND_TO_OFFSET:SEND_AMOUNT_SD_OFFSET]));\n }\n\n /**\n * @dev Retrieves the composed message from the OFT message.\n * @param _msg The OFT message.\n * @return The composed message.\n */\n function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\n return _msg[SEND_AMOUNT_SD_OFFSET:];\n }\n\n /**\n * @dev Converts an address to bytes32.\n * @param _addr The address to convert.\n * @return The bytes32 representation of the address.\n */\n function addressToBytes32(address _addr) internal pure returns (bytes32) {\n return bytes32(uint256(uint160(_addr)));\n }\n\n /**\n * @dev Converts bytes32 to an address.\n * @param _b The bytes32 value to convert.\n * @return The address representation of bytes32.\n */\n function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\n return address(uint160(uint256(_b)));\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/interfaces/IOAppPreCrimeSimulator.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\n// @dev Import the Origin so it's exposed to OAppPreCrimeSimulator implementers.\n// solhint-disable-next-line no-unused-import\nimport { InboundPacket, Origin } from \"../libs/Packet.sol\";\n\n/**\n * @title IOAppPreCrimeSimulator Interface\n * @dev Interface for the preCrime simulation functionality in an OApp.\n */\ninterface IOAppPreCrimeSimulator {\n // @dev simulation result used in PreCrime implementation\n error SimulationResult(bytes result);\n error OnlySelf();\n\n /**\n * @dev Emitted when the preCrime contract address is set.\n * @param preCrimeAddress The address of the preCrime contract.\n */\n event PreCrimeSet(address preCrimeAddress);\n\n /**\n * @dev Retrieves the address of the preCrime contract implementation.\n * @return The address of the preCrime contract.\n */\n function preCrime() external view returns (address);\n\n /**\n * @dev Retrieves the address of the OApp contract.\n * @return The address of the OApp contract.\n */\n function oApp() external view returns (address);\n\n /**\n * @dev Sets the preCrime contract address.\n * @param _preCrime The address of the preCrime contract.\n */\n function setPreCrime(address _preCrime) external;\n\n /**\n * @dev Mocks receiving a packet, then reverts with a series of data to infer the state/result.\n * @param _packets An array of LayerZero InboundPacket objects representing received packets.\n */\n function lzReceiveAndRevert(InboundPacket[] calldata _packets) external payable;\n\n /**\n * @dev checks if the specified peer is considered 'trusted' by the OApp.\n * @param _eid The endpoint Id to check.\n * @param _peer The peer to check.\n * @return Whether the peer passed is considered 'trusted' by the OApp.\n */\n function isPeer(uint32 _eid, bytes32 _peer) external view returns (bool);\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/interfaces/IPreCrime.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\nstruct PreCrimePeer {\n uint32 eid;\n bytes32 preCrime;\n bytes32 oApp;\n}\n\n// TODO not done yet\ninterface IPreCrime {\n error OnlyOffChain();\n\n // for simulate()\n error PacketOversize(uint256 max, uint256 actual);\n error PacketUnsorted();\n error SimulationFailed(bytes reason);\n\n // for preCrime()\n error SimulationResultNotFound(uint32 eid);\n error InvalidSimulationResult(uint32 eid, bytes reason);\n error CrimeFound(bytes crime);\n\n function getConfig(bytes[] calldata _packets, uint256[] calldata _packetMsgValues) external returns (bytes memory);\n\n function simulate(\n bytes[] calldata _packets,\n uint256[] calldata _packetMsgValues\n ) external payable returns (bytes memory);\n\n function buildSimulationResult() external view returns (bytes memory);\n\n function preCrime(\n bytes[] calldata _packets,\n uint256[] calldata _packetMsgValues,\n bytes[] calldata _simulations\n ) external;\n\n function version() external view returns (uint64 major, uint8 minor);\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/libs/Packet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { Origin } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport { PacketV1Codec } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol\";\n\n/**\n * @title InboundPacket\n * @dev Structure representing an inbound packet received by the contract.\n */\nstruct InboundPacket {\n Origin origin; // Origin information of the packet.\n uint32 dstEid; // Destination endpointId of the packet.\n address receiver; // Receiver address for the packet.\n bytes32 guid; // Unique identifier of the packet.\n uint256 value; // msg.value of the packet.\n address executor; // Executor address for the packet.\n bytes message; // Message payload of the packet.\n bytes extraData; // Additional arbitrary data for the packet.\n}\n\n/**\n * @title PacketDecoder\n * @dev Library for decoding LayerZero packets.\n */\nlibrary PacketDecoder {\n using PacketV1Codec for bytes;\n\n /**\n * @dev Decode an inbound packet from the given packet data.\n * @param _packet The packet data to decode.\n * @return packet An InboundPacket struct representing the decoded packet.\n */\n function decode(bytes calldata _packet) internal pure returns (InboundPacket memory packet) {\n packet.origin = Origin(_packet.srcEid(), _packet.sender(), _packet.nonce());\n packet.dstEid = _packet.dstEid();\n packet.receiver = _packet.receiverB20();\n packet.guid = _packet.guid();\n packet.message = _packet.message();\n }\n\n /**\n * @dev Decode multiple inbound packets from the given packet data and associated message values.\n * @param _packets An array of packet data to decode.\n * @param _packetMsgValues An array of associated message values for each packet.\n * @return packets An array of InboundPacket structs representing the decoded packets.\n */\n function decode(\n bytes[] calldata _packets,\n uint256[] memory _packetMsgValues\n ) internal pure returns (InboundPacket[] memory packets) {\n packets = new InboundPacket[](_packets.length);\n for (uint256 i = 0; i < _packets.length; i++) {\n bytes calldata packet = _packets[i];\n packets[i] = PacketDecoder.decode(packet);\n // @dev Allows the verifier to specify the msg.value that gets passed in lzReceive.\n packets[i].value = _packetMsgValues[i];\n }\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/OAppPreCrimeSimulator.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { IPreCrime } from \"./interfaces/IPreCrime.sol\";\nimport { IOAppPreCrimeSimulator, InboundPacket, Origin } from \"./interfaces/IOAppPreCrimeSimulator.sol\";\n\n/**\n * @title OAppPreCrimeSimulator\n * @dev Abstract contract serving as the base for preCrime simulation functionality in an OApp.\n */\nabstract contract OAppPreCrimeSimulator is IOAppPreCrimeSimulator, Ownable {\n // The address of the preCrime implementation.\n address public preCrime;\n\n /**\n * @dev Retrieves the address of the OApp contract.\n * @return The address of the OApp contract.\n *\n * @dev The simulator contract is the base contract for the OApp by default.\n * @dev If the simulator is a separate contract, override this function.\n */\n function oApp() external view virtual returns (address) {\n return address(this);\n }\n\n /**\n * @dev Sets the preCrime contract address.\n * @param _preCrime The address of the preCrime contract.\n */\n function setPreCrime(address _preCrime) public virtual onlyOwner {\n preCrime = _preCrime;\n emit PreCrimeSet(_preCrime);\n }\n\n /**\n * @dev Interface for pre-crime simulations. Always reverts at the end with the simulation results.\n * @param _packets An array of InboundPacket objects representing received packets to be delivered.\n *\n * @dev WARNING: MUST revert at the end with the simulation results.\n * @dev Gives the preCrime implementation the ability to mock sending packets to the lzReceive function,\n * WITHOUT actually executing them.\n */\n function lzReceiveAndRevert(InboundPacket[] calldata _packets) public payable virtual {\n for (uint256 i = 0; i < _packets.length; i++) {\n InboundPacket calldata packet = _packets[i];\n\n // Ignore packets that are not from trusted peers.\n if (!isPeer(packet.origin.srcEid, packet.origin.sender)) continue;\n\n // @dev Because a verifier is calling this function, it doesnt have access to executor params:\n // - address _executor\n // - bytes calldata _extraData\n // preCrime will NOT work for OApps that rely on these two parameters inside of their _lzReceive().\n // They are instead stubbed to default values, address(0) and bytes(\"\")\n // @dev Calling this.lzReceiveSimulate removes ability for assembly return 0 callstack exit,\n // which would cause the revert to be ignored.\n this.lzReceiveSimulate{ value: packet.value }(\n packet.origin,\n packet.guid,\n packet.message,\n packet.executor,\n packet.extraData\n );\n }\n\n // @dev Revert with the simulation results. msg.sender must implement IPreCrime.buildSimulationResult().\n revert SimulationResult(IPreCrime(msg.sender).buildSimulationResult());\n }\n\n /**\n * @dev Is effectively an internal function because msg.sender must be address(this).\n * Allows resetting the call stack for 'internal' calls.\n * @param _origin The origin information containing the source endpoint and sender address.\n * - srcEid: The source chain endpoint ID.\n * - sender: The sender address on the src chain.\n * - nonce: The nonce of the message.\n * @param _guid The unique identifier of the packet.\n * @param _message The message payload of the packet.\n * @param _executor The executor address for the packet.\n * @param _extraData Additional data for the packet.\n */\n function lzReceiveSimulate(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address _executor,\n bytes calldata _extraData\n ) external payable virtual {\n // @dev Ensure ONLY can be called 'internally'.\n if (msg.sender != address(this)) revert OnlySelf();\n _lzReceiveSimulate(_origin, _guid, _message, _executor, _extraData);\n }\n\n /**\n * @dev Internal function to handle the OAppPreCrimeSimulator simulated receive.\n * @param _origin The origin information.\n * - srcEid: The source chain endpoint ID.\n * - sender: The sender address from the src chain.\n * - nonce: The nonce of the LayerZero message.\n * @param _guid The GUID of the LayerZero message.\n * @param _message The LayerZero message.\n * @param _executor The address of the off-chain executor.\n * @param _extraData Arbitrary data passed by the msg executor.\n *\n * @dev Enables the preCrime simulator to mock sending lzReceive() messages,\n * routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver.\n */\n function _lzReceiveSimulate(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address _executor,\n bytes calldata _extraData\n ) internal virtual;\n\n /**\n * @dev checks if the specified peer is considered 'trusted' by the OApp.\n * @param _eid The endpoint Id to check.\n * @param _peer The peer to check.\n * @return Whether the peer passed is considered 'trusted' by the OApp.\n */\n function isPeer(uint32 _eid, bytes32 _peer) public view virtual returns (bool);\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/EndpointV2ViewUpgradeable.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\nimport \"./interfaces/ILayerZeroEndpointV2.sol\";\n\nenum ExecutionState {\n NotExecutable, // executor: waits for PayloadVerified event and starts polling for executable\n VerifiedButNotExecutable, // executor: starts active polling for executable\n Executable,\n Executed\n}\n\ncontract EndpointV2ViewUpgradeable is Initializable {\n bytes32 public constant EMPTY_PAYLOAD_HASH = bytes32(0);\n bytes32 public constant NIL_PAYLOAD_HASH = bytes32(type(uint256).max);\n\n ILayerZeroEndpointV2 public endpoint;\n\n function __EndpointV2View_init(address _endpoint) internal onlyInitializing {\n __EndpointV2View_init_unchained(_endpoint);\n }\n\n function __EndpointV2View_init_unchained(address _endpoint) internal onlyInitializing {\n endpoint = ILayerZeroEndpointV2(_endpoint);\n }\n\n function initializable(Origin memory _origin, address _receiver) public view returns (bool) {\n try endpoint.initializable(_origin, _receiver) returns (bool _initializable) {\n return _initializable;\n } catch {\n return false;\n }\n }\n\n /// @dev check if a message is verifiable.\n function verifiable(\n Origin memory _origin,\n address _receiver,\n address _receiveLib,\n bytes32 _payloadHash\n ) public view returns (bool) {\n if (!endpoint.isValidReceiveLibrary(_receiver, _origin.srcEid, _receiveLib)) return false;\n\n if (!endpoint.verifiable(_origin, _receiver)) return false;\n\n // checked in _inbound for verify\n if (_payloadHash == EMPTY_PAYLOAD_HASH) return false;\n\n return true;\n }\n\n /// @dev check if a message is executable.\n /// @return ExecutionState of Executed, Executable, or NotExecutable\n function executable(Origin memory _origin, address _receiver) public view returns (ExecutionState) {\n bytes32 payloadHash = endpoint.inboundPayloadHash(_receiver, _origin.srcEid, _origin.sender, _origin.nonce);\n\n // executed if the payload hash has been cleared and the nonce is less than or equal to lazyInboundNonce\n if (\n payloadHash == EMPTY_PAYLOAD_HASH &&\n _origin.nonce <= endpoint.lazyInboundNonce(_receiver, _origin.srcEid, _origin.sender)\n ) {\n return ExecutionState.Executed;\n }\n\n // executable if nonce has not been executed and has not been nilified and nonce is less than or equal to inboundNonce\n if (\n payloadHash != NIL_PAYLOAD_HASH &&\n _origin.nonce <= endpoint.inboundNonce(_receiver, _origin.srcEid, _origin.sender)\n ) {\n return ExecutionState.Executable;\n }\n\n // only start active executable polling if payload hash is not empty nor nil\n if (payloadHash != EMPTY_PAYLOAD_HASH && payloadHash != NIL_PAYLOAD_HASH) {\n return ExecutionState.VerifiedButNotExecutable;\n }\n\n // return NotExecutable as a catch-all\n return ExecutionState.NotExecutable;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { IMessageLibManager } from \"./IMessageLibManager.sol\";\nimport { IMessagingComposer } from \"./IMessagingComposer.sol\";\nimport { IMessagingChannel } from \"./IMessagingChannel.sol\";\nimport { IMessagingContext } from \"./IMessagingContext.sol\";\n\nstruct MessagingParams {\n uint32 dstEid;\n bytes32 receiver;\n bytes message;\n bytes options;\n bool payInLzToken;\n}\n\nstruct MessagingReceipt {\n bytes32 guid;\n uint64 nonce;\n MessagingFee fee;\n}\n\nstruct MessagingFee {\n uint256 nativeFee;\n uint256 lzTokenFee;\n}\n\nstruct Origin {\n uint32 srcEid;\n bytes32 sender;\n uint64 nonce;\n}\n\ninterface ILayerZeroEndpointV2 is IMessageLibManager, IMessagingComposer, IMessagingChannel, IMessagingContext {\n event PacketSent(bytes encodedPayload, bytes options, address sendLibrary);\n\n event PacketVerified(Origin origin, address receiver, bytes32 payloadHash);\n\n event PacketDelivered(Origin origin, address receiver);\n\n event LzReceiveAlert(\n address indexed receiver,\n address indexed executor,\n Origin origin,\n bytes32 guid,\n uint256 gas,\n uint256 value,\n bytes message,\n bytes extraData,\n bytes reason\n );\n\n event LzTokenSet(address token);\n\n event DelegateSet(address sender, address delegate);\n\n function quote(MessagingParams calldata _params, address _sender) external view returns (MessagingFee memory);\n\n function send(\n MessagingParams calldata _params,\n address _refundAddress\n ) external payable returns (MessagingReceipt memory);\n\n function verify(Origin calldata _origin, address _receiver, bytes32 _payloadHash) external;\n\n function verifiable(Origin calldata _origin, address _receiver) external view returns (bool);\n\n function initializable(Origin calldata _origin, address _receiver) external view returns (bool);\n\n function lzReceive(\n Origin calldata _origin,\n address _receiver,\n bytes32 _guid,\n bytes calldata _message,\n bytes calldata _extraData\n ) external payable;\n\n // oapp can burn messages partially by calling this function with its own business logic if messages are verified in order\n function clear(address _oapp, Origin calldata _origin, bytes32 _guid, bytes calldata _message) external;\n\n function setLzToken(address _lzToken) external;\n\n function lzToken() external view returns (address);\n\n function nativeToken() external view returns (address);\n\n function setDelegate(address _delegate) external;\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { Origin } from \"./ILayerZeroEndpointV2.sol\";\n\ninterface ILayerZeroReceiver {\n function allowInitializePath(Origin calldata _origin) external view returns (bool);\n\n function nextNonce(uint32 _eid, bytes32 _sender) external view returns (uint64);\n\n function lzReceive(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address _executor,\n bytes calldata _extraData\n ) external payable;\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLib.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { IERC165 } from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\nimport { SetConfigParam } from \"./IMessageLibManager.sol\";\n\nenum MessageLibType {\n Send,\n Receive,\n SendAndReceive\n}\n\ninterface IMessageLib is IERC165 {\n function setConfig(address _oapp, SetConfigParam[] calldata _config) external;\n\n function getConfig(uint32 _eid, address _oapp, uint32 _configType) external view returns (bytes memory config);\n\n function isSupportedEid(uint32 _eid) external view returns (bool);\n\n // message libs of same major version are compatible\n function version() external view returns (uint64 major, uint8 minor, uint8 endpointVersion);\n\n function messageLibType() external view returns (MessageLibType);\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nstruct SetConfigParam {\n uint32 eid;\n uint32 configType;\n bytes config;\n}\n\ninterface IMessageLibManager {\n struct Timeout {\n address lib;\n uint256 expiry;\n }\n\n event LibraryRegistered(address newLib);\n event DefaultSendLibrarySet(uint32 eid, address newLib);\n event DefaultReceiveLibrarySet(uint32 eid, address newLib);\n event DefaultReceiveLibraryTimeoutSet(uint32 eid, address oldLib, uint256 expiry);\n event SendLibrarySet(address sender, uint32 eid, address newLib);\n event ReceiveLibrarySet(address receiver, uint32 eid, address newLib);\n event ReceiveLibraryTimeoutSet(address receiver, uint32 eid, address oldLib, uint256 timeout);\n\n function registerLibrary(address _lib) external;\n\n function isRegisteredLibrary(address _lib) external view returns (bool);\n\n function getRegisteredLibraries() external view returns (address[] memory);\n\n function setDefaultSendLibrary(uint32 _eid, address _newLib) external;\n\n function defaultSendLibrary(uint32 _eid) external view returns (address);\n\n function setDefaultReceiveLibrary(uint32 _eid, address _newLib, uint256 _gracePeriod) external;\n\n function defaultReceiveLibrary(uint32 _eid) external view returns (address);\n\n function setDefaultReceiveLibraryTimeout(uint32 _eid, address _lib, uint256 _expiry) external;\n\n function defaultReceiveLibraryTimeout(uint32 _eid) external view returns (address lib, uint256 expiry);\n\n function isSupportedEid(uint32 _eid) external view returns (bool);\n\n function isValidReceiveLibrary(address _receiver, uint32 _eid, address _lib) external view returns (bool);\n\n /// ------------------- OApp interfaces -------------------\n function setSendLibrary(address _oapp, uint32 _eid, address _newLib) external;\n\n function getSendLibrary(address _sender, uint32 _eid) external view returns (address lib);\n\n function isDefaultSendLibrary(address _sender, uint32 _eid) external view returns (bool);\n\n function setReceiveLibrary(address _oapp, uint32 _eid, address _newLib, uint256 _gracePeriod) external;\n\n function getReceiveLibrary(address _receiver, uint32 _eid) external view returns (address lib, bool isDefault);\n\n function setReceiveLibraryTimeout(address _oapp, uint32 _eid, address _lib, uint256 _expiry) external;\n\n function receiveLibraryTimeout(address _receiver, uint32 _eid) external view returns (address lib, uint256 expiry);\n\n function setConfig(address _oapp, address _lib, SetConfigParam[] calldata _params) external;\n\n function getConfig(\n address _oapp,\n address _lib,\n uint32 _eid,\n uint32 _configType\n ) external view returns (bytes memory config);\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingChannel.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IMessagingChannel {\n event InboundNonceSkipped(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce);\n event PacketNilified(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);\n event PacketBurnt(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);\n\n function eid() external view returns (uint32);\n\n // this is an emergency function if a message cannot be verified for some reasons\n // required to provide _nextNonce to avoid race condition\n function skip(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce) external;\n\n function nilify(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;\n\n function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;\n\n function nextGuid(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (bytes32);\n\n function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);\n\n function outboundNonce(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (uint64);\n\n function inboundPayloadHash(\n address _receiver,\n uint32 _srcEid,\n bytes32 _sender,\n uint64 _nonce\n ) external view returns (bytes32);\n\n function lazyInboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingComposer.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IMessagingComposer {\n event ComposeSent(address from, address to, bytes32 guid, uint16 index, bytes message);\n event ComposeDelivered(address from, address to, bytes32 guid, uint16 index);\n event LzComposeAlert(\n address indexed from,\n address indexed to,\n address indexed executor,\n bytes32 guid,\n uint16 index,\n uint256 gas,\n uint256 value,\n bytes message,\n bytes extraData,\n bytes reason\n );\n\n function composeQueue(\n address _from,\n address _to,\n bytes32 _guid,\n uint16 _index\n ) external view returns (bytes32 messageHash);\n\n function sendCompose(address _to, bytes32 _guid, uint16 _index, bytes calldata _message) external;\n\n function lzCompose(\n address _from,\n address _to,\n bytes32 _guid,\n uint16 _index,\n bytes calldata _message,\n bytes calldata _extraData\n ) external payable;\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingContext.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IMessagingContext {\n function isSendingMessage() external view returns (bool);\n\n function getSendContext() external view returns (uint32 dstEid, address sender);\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { MessagingFee } from \"./ILayerZeroEndpointV2.sol\";\nimport { IMessageLib } from \"./IMessageLib.sol\";\n\nstruct Packet {\n uint64 nonce;\n uint32 srcEid;\n address sender;\n uint32 dstEid;\n bytes32 receiver;\n bytes32 guid;\n bytes message;\n}\n\ninterface ISendLib is IMessageLib {\n function send(\n Packet calldata _packet,\n bytes calldata _options,\n bool _payInLzToken\n ) external returns (MessagingFee memory, bytes memory encodedPacket);\n\n function quote(\n Packet calldata _packet,\n bytes calldata _options,\n bool _payInLzToken\n ) external view returns (MessagingFee memory);\n\n function setTreasury(address _treasury) external;\n\n function withdrawFee(address _to, uint256 _amount) external;\n\n function withdrawLzTokenFee(address _lzToken, address _to, uint256 _amount) external;\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/AddressCast.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nlibrary AddressCast {\n error AddressCast_InvalidSizeForAddress();\n error AddressCast_InvalidAddress();\n\n function toBytes32(bytes calldata _addressBytes) internal pure returns (bytes32 result) {\n if (_addressBytes.length > 32) revert AddressCast_InvalidAddress();\n result = bytes32(_addressBytes);\n unchecked {\n uint256 offset = 32 - _addressBytes.length;\n result = result >> (offset * 8);\n }\n }\n\n function toBytes32(address _address) internal pure returns (bytes32 result) {\n result = bytes32(uint256(uint160(_address)));\n }\n\n function toBytes(bytes32 _addressBytes32, uint256 _size) internal pure returns (bytes memory result) {\n if (_size == 0 || _size > 32) revert AddressCast_InvalidSizeForAddress();\n result = new bytes(_size);\n unchecked {\n uint256 offset = 256 - _size * 8;\n assembly {\n mstore(add(result, 32), shl(offset, _addressBytes32))\n }\n }\n }\n\n function toAddress(bytes32 _addressBytes32) internal pure returns (address result) {\n result = address(uint160(uint256(_addressBytes32)));\n }\n\n function toAddress(bytes calldata _addressBytes) internal pure returns (address result) {\n if (_addressBytes.length != 20) revert AddressCast_InvalidAddress();\n result = address(bytes20(_addressBytes));\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/CalldataBytesLib.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nlibrary CalldataBytesLib {\n function toU8(bytes calldata _bytes, uint256 _start) internal pure returns (uint8) {\n return uint8(_bytes[_start]);\n }\n\n function toU16(bytes calldata _bytes, uint256 _start) internal pure returns (uint16) {\n unchecked {\n uint256 end = _start + 2;\n return uint16(bytes2(_bytes[_start:end]));\n }\n }\n\n function toU32(bytes calldata _bytes, uint256 _start) internal pure returns (uint32) {\n unchecked {\n uint256 end = _start + 4;\n return uint32(bytes4(_bytes[_start:end]));\n }\n }\n\n function toU64(bytes calldata _bytes, uint256 _start) internal pure returns (uint64) {\n unchecked {\n uint256 end = _start + 8;\n return uint64(bytes8(_bytes[_start:end]));\n }\n }\n\n function toU128(bytes calldata _bytes, uint256 _start) internal pure returns (uint128) {\n unchecked {\n uint256 end = _start + 16;\n return uint128(bytes16(_bytes[_start:end]));\n }\n }\n\n function toU256(bytes calldata _bytes, uint256 _start) internal pure returns (uint256) {\n unchecked {\n uint256 end = _start + 32;\n return uint256(bytes32(_bytes[_start:end]));\n }\n }\n\n function toAddr(bytes calldata _bytes, uint256 _start) internal pure returns (address) {\n unchecked {\n uint256 end = _start + 20;\n return address(bytes20(_bytes[_start:end]));\n }\n }\n\n function toB32(bytes calldata _bytes, uint256 _start) internal pure returns (bytes32) {\n unchecked {\n uint256 end = _start + 32;\n return bytes32(_bytes[_start:end]);\n }\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Errors.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nlibrary Errors {\n error LZ_LzTokenUnavailable();\n error LZ_InvalidReceiveLibrary();\n error LZ_InvalidNonce(uint64 nonce);\n error LZ_InvalidArgument();\n error LZ_InvalidExpiry();\n error LZ_InvalidAmount(uint256 required, uint256 supplied);\n error LZ_OnlyRegisteredOrDefaultLib();\n error LZ_OnlyRegisteredLib();\n error LZ_OnlyNonDefaultLib();\n error LZ_Unauthorized();\n error LZ_DefaultSendLibUnavailable();\n error LZ_DefaultReceiveLibUnavailable();\n error LZ_PathNotInitializable();\n error LZ_PathNotVerifiable();\n error LZ_OnlySendLib();\n error LZ_OnlyReceiveLib();\n error LZ_UnsupportedEid();\n error LZ_UnsupportedInterface();\n error LZ_AlreadyRegistered();\n error LZ_SameValue();\n error LZ_InvalidPayloadHash();\n error LZ_PayloadHashNotFound(bytes32 expected, bytes32 actual);\n error LZ_ComposeNotFound(bytes32 expected, bytes32 actual);\n error LZ_ComposeExists();\n error LZ_SendReentrancy();\n error LZ_NotImplemented();\n error LZ_InsufficientFee(\n uint256 requiredNative,\n uint256 suppliedNative,\n uint256 requiredLzToken,\n uint256 suppliedLzToken\n );\n error LZ_ZeroLzTokenFee();\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/GUID.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { AddressCast } from \"./AddressCast.sol\";\n\nlibrary GUID {\n using AddressCast for address;\n\n function generate(\n uint64 _nonce,\n uint32 _srcEid,\n address _sender,\n uint32 _dstEid,\n bytes32 _receiver\n ) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(_nonce, _srcEid, _sender.toBytes32(), _dstEid, _receiver));\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Transfer.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nlibrary Transfer {\n using SafeERC20 for IERC20;\n\n address internal constant ADDRESS_ZERO = address(0);\n\n error Transfer_NativeFailed(address _to, uint256 _value);\n error Transfer_ToAddressIsZero();\n\n function native(address _to, uint256 _value) internal {\n if (_to == ADDRESS_ZERO) revert Transfer_ToAddressIsZero();\n (bool success, ) = _to.call{ value: _value }(\"\");\n if (!success) revert Transfer_NativeFailed(_to, _value);\n }\n\n function token(address _token, address _to, uint256 _value) internal {\n if (_to == ADDRESS_ZERO) revert Transfer_ToAddressIsZero();\n IERC20(_token).safeTransfer(_to, _value);\n }\n\n function nativeOrToken(address _token, address _to, uint256 _value) internal {\n if (_token == ADDRESS_ZERO) {\n native(_to, _value);\n } else {\n token(_token, _to, _value);\n }\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/BitMaps.sol": { + "content": "// SPDX-License-Identifier: MIT\n\n// modified from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/structs/BitMaps.sol\npragma solidity ^0.8.20;\n\ntype BitMap256 is uint256;\n\nusing BitMaps for BitMap256 global;\n\nlibrary BitMaps {\n /**\n * @dev Returns whether the bit at `index` is set.\n */\n function get(BitMap256 bitmap, uint8 index) internal pure returns (bool) {\n uint256 mask = 1 << index;\n return BitMap256.unwrap(bitmap) & mask != 0;\n }\n\n /**\n * @dev Sets the bit at `index`.\n */\n function set(BitMap256 bitmap, uint8 index) internal pure returns (BitMap256) {\n uint256 mask = 1 << index;\n return BitMap256.wrap(BitMap256.unwrap(bitmap) | mask);\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/ExecutorOptions.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { CalldataBytesLib } from \"../../libs/CalldataBytesLib.sol\";\n\nlibrary ExecutorOptions {\n using CalldataBytesLib for bytes;\n\n uint8 internal constant WORKER_ID = 1;\n\n uint8 internal constant OPTION_TYPE_LZRECEIVE = 1;\n uint8 internal constant OPTION_TYPE_NATIVE_DROP = 2;\n uint8 internal constant OPTION_TYPE_LZCOMPOSE = 3;\n uint8 internal constant OPTION_TYPE_ORDERED_EXECUTION = 4;\n\n error Executor_InvalidLzReceiveOption();\n error Executor_InvalidNativeDropOption();\n error Executor_InvalidLzComposeOption();\n\n /// @dev decode the next executor option from the options starting from the specified cursor\n /// @param _options [executor_id][executor_option][executor_id][executor_option]...\n /// executor_option = [option_size][option_type][option]\n /// option_size = len(option_type) + len(option)\n /// executor_id: uint8, option_size: uint16, option_type: uint8, option: bytes\n /// @param _cursor the cursor to start decoding from\n /// @return optionType the type of the option\n /// @return option the option of the executor\n /// @return cursor the cursor to start decoding the next executor option\n function nextExecutorOption(\n bytes calldata _options,\n uint256 _cursor\n ) internal pure returns (uint8 optionType, bytes calldata option, uint256 cursor) {\n unchecked {\n // skip worker id\n cursor = _cursor + 1;\n\n // read option size\n uint16 size = _options.toU16(cursor);\n cursor += 2;\n\n // read option type\n optionType = _options.toU8(cursor);\n\n // startCursor and endCursor are used to slice the option from _options\n uint256 startCursor = cursor + 1; // skip option type\n uint256 endCursor = cursor + size;\n option = _options[startCursor:endCursor];\n cursor += size;\n }\n }\n\n function decodeLzReceiveOption(bytes calldata _option) internal pure returns (uint128 gas, uint128 value) {\n if (_option.length != 16 && _option.length != 32) revert Executor_InvalidLzReceiveOption();\n gas = _option.toU128(0);\n value = _option.length == 32 ? _option.toU128(16) : 0;\n }\n\n function decodeNativeDropOption(bytes calldata _option) internal pure returns (uint128 amount, bytes32 receiver) {\n if (_option.length != 48) revert Executor_InvalidNativeDropOption();\n amount = _option.toU128(0);\n receiver = _option.toB32(16);\n }\n\n function decodeLzComposeOption(\n bytes calldata _option\n ) internal pure returns (uint16 index, uint128 gas, uint128 value) {\n if (_option.length != 18 && _option.length != 34) revert Executor_InvalidLzComposeOption();\n index = _option.toU16(0);\n gas = _option.toU128(2);\n value = _option.length == 34 ? _option.toU128(18) : 0;\n }\n\n function encodeLzReceiveOption(uint128 _gas, uint128 _value) internal pure returns (bytes memory) {\n return _value == 0 ? abi.encodePacked(_gas) : abi.encodePacked(_gas, _value);\n }\n\n function encodeNativeDropOption(uint128 _amount, bytes32 _receiver) internal pure returns (bytes memory) {\n return abi.encodePacked(_amount, _receiver);\n }\n\n function encodeLzComposeOption(uint16 _index, uint128 _gas, uint128 _value) internal pure returns (bytes memory) {\n return _value == 0 ? abi.encodePacked(_index, _gas) : abi.encodePacked(_index, _gas, _value);\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { Packet } from \"../../interfaces/ISendLib.sol\";\nimport { AddressCast } from \"../../libs/AddressCast.sol\";\n\nlibrary PacketV1Codec {\n using AddressCast for address;\n using AddressCast for bytes32;\n\n uint8 internal constant PACKET_VERSION = 1;\n\n // header (version + nonce + path)\n // version\n uint256 private constant PACKET_VERSION_OFFSET = 0;\n // nonce\n uint256 private constant NONCE_OFFSET = 1;\n // path\n uint256 private constant SRC_EID_OFFSET = 9;\n uint256 private constant SENDER_OFFSET = 13;\n uint256 private constant DST_EID_OFFSET = 45;\n uint256 private constant RECEIVER_OFFSET = 49;\n // payload (guid + message)\n uint256 private constant GUID_OFFSET = 81; // keccak256(nonce + path)\n uint256 private constant MESSAGE_OFFSET = 113;\n\n function encode(Packet memory _packet) internal pure returns (bytes memory encodedPacket) {\n encodedPacket = abi.encodePacked(\n PACKET_VERSION,\n _packet.nonce,\n _packet.srcEid,\n _packet.sender.toBytes32(),\n _packet.dstEid,\n _packet.receiver,\n _packet.guid,\n _packet.message\n );\n }\n\n function encodePacketHeader(Packet memory _packet) internal pure returns (bytes memory) {\n return\n abi.encodePacked(\n PACKET_VERSION,\n _packet.nonce,\n _packet.srcEid,\n _packet.sender.toBytes32(),\n _packet.dstEid,\n _packet.receiver\n );\n }\n\n function encodePayload(Packet memory _packet) internal pure returns (bytes memory) {\n return abi.encodePacked(_packet.guid, _packet.message);\n }\n\n function header(bytes calldata _packet) internal pure returns (bytes calldata) {\n return _packet[0:GUID_OFFSET];\n }\n\n function version(bytes calldata _packet) internal pure returns (uint8) {\n return uint8(bytes1(_packet[PACKET_VERSION_OFFSET:NONCE_OFFSET]));\n }\n\n function nonce(bytes calldata _packet) internal pure returns (uint64) {\n return uint64(bytes8(_packet[NONCE_OFFSET:SRC_EID_OFFSET]));\n }\n\n function srcEid(bytes calldata _packet) internal pure returns (uint32) {\n return uint32(bytes4(_packet[SRC_EID_OFFSET:SENDER_OFFSET]));\n }\n\n function sender(bytes calldata _packet) internal pure returns (bytes32) {\n return bytes32(_packet[SENDER_OFFSET:DST_EID_OFFSET]);\n }\n\n function senderAddressB20(bytes calldata _packet) internal pure returns (address) {\n return sender(_packet).toAddress();\n }\n\n function dstEid(bytes calldata _packet) internal pure returns (uint32) {\n return uint32(bytes4(_packet[DST_EID_OFFSET:RECEIVER_OFFSET]));\n }\n\n function receiver(bytes calldata _packet) internal pure returns (bytes32) {\n return bytes32(_packet[RECEIVER_OFFSET:GUID_OFFSET]);\n }\n\n function receiverB20(bytes calldata _packet) internal pure returns (address) {\n return receiver(_packet).toAddress();\n }\n\n function guid(bytes calldata _packet) internal pure returns (bytes32) {\n return bytes32(_packet[GUID_OFFSET:MESSAGE_OFFSET]);\n }\n\n function message(bytes calldata _packet) internal pure returns (bytes calldata) {\n return bytes(_packet[MESSAGE_OFFSET:]);\n }\n\n function payload(bytes calldata _packet) internal pure returns (bytes calldata) {\n return bytes(_packet[GUID_OFFSET:]);\n }\n\n function payloadHash(bytes calldata _packet) internal pure returns (bytes32) {\n return keccak256(payload(_packet));\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/MessagingContext.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { IMessagingContext } from \"./interfaces/IMessagingContext.sol\";\nimport { Errors } from \"./libs/Errors.sol\";\n\n/// this contract acts as a non-reentrancy guard and a source of messaging context\n/// the context includes the remote eid and the sender address\n/// it separates the send and receive context to allow messaging receipts (send back on receive())\nabstract contract MessagingContext is IMessagingContext {\n uint256 private constant NOT_ENTERED = 1;\n uint256 private _sendContext = NOT_ENTERED;\n\n /// @dev the sendContext is set to 8 bytes 0s + 4 bytes eid + 20 bytes sender\n modifier sendContext(uint32 _dstEid, address _sender) {\n if (_sendContext != NOT_ENTERED) revert Errors.LZ_SendReentrancy();\n _sendContext = (uint256(_dstEid) << 160) | uint160(_sender);\n _;\n _sendContext = NOT_ENTERED;\n }\n\n /// @dev returns true if sending message\n function isSendingMessage() public view returns (bool) {\n return _sendContext != NOT_ENTERED;\n }\n\n /// @dev returns (eid, sender) if sending message, (0, 0) otherwise\n function getSendContext() external view returns (uint32, address) {\n return isSendingMessage() ? _getSendContext(_sendContext) : (0, address(0));\n }\n\n function _getSendContext(uint256 _context) internal pure returns (uint32, address) {\n return (uint32(_context >> 160), address(uint160(_context)));\n }\n}\n" + }, + "@layerzerolabs/test-devtools-evm-hardhat/contracts/mocks/EndpointV2Mock.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.22;\n\nimport { SafeCast } from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport { ILayerZeroEndpointV2, MessagingParams, MessagingReceipt, MessagingFee, Origin } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport { ExecutionState } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/EndpointV2ViewUpgradeable.sol\";\nimport { ILayerZeroReceiver } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol\";\nimport { SetConfigParam } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol\";\nimport { MessagingContext } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/MessagingContext.sol\";\nimport { Packet } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol\";\nimport { OFTMsgCodec } from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/libs/OFTMsgCodec.sol\";\nimport { Origin } from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppReceiver.sol\";\nimport { Errors } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Errors.sol\";\nimport { GUID } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/GUID.sol\";\nimport { ExecutorOptions } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/ExecutorOptions.sol\";\nimport { PacketV1Codec } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol\";\nimport { WorkerOptions } from \"@layerzerolabs/lz-evm-messagelib-v2/contracts/SendLibBase.sol\";\nimport { IExecutorFeeLib } from \"@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/IExecutorFeeLib.sol\";\nimport { DVNOptions } from \"@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/libs/DVNOptions.sol\";\nimport { UlnOptions } from \"@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/libs/UlnOptions.sol\";\nimport { CalldataBytesLib } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/CalldataBytesLib.sol\";\n\ncontract EndpointV2Mock is ILayerZeroEndpointV2, MessagingContext {\n using ExecutorOptions for bytes;\n using OFTMsgCodec for bytes;\n using OFTMsgCodec for bytes32;\n using OFTMsgCodec for address;\n using SafeCast for uint256;\n using CalldataBytesLib for bytes;\n\n bytes32 public constant EMPTY_PAYLOAD_HASH = bytes32(0);\n\n uint32 public immutable eid;\n mapping(address => address) public lzEndpointLookup;\n\n mapping(address receiver => mapping(uint32 srcEid => mapping(bytes32 sender => uint64 nonce)))\n public lazyInboundNonce;\n mapping(address receiver => mapping(uint32 srcEid => mapping(bytes32 sender => mapping(uint64 inboundNonce => bytes32 payloadHash))))\n public inboundPayloadHash;\n mapping(address sender => mapping(uint32 dstEid => mapping(bytes32 receiver => uint64 nonce))) public outboundNonce;\n\n RelayerFeeConfig public relayerFeeConfig;\n ProtocolFeeConfig protocolFeeConfig;\n uint256 public verifierFee;\n\n struct ProtocolFeeConfig {\n uint256 zroFee;\n uint256 nativeBP;\n }\n\n struct RelayerFeeConfig {\n uint128 dstPriceRatio; // 10^10\n uint128 dstGasPriceInWei;\n uint128 dstNativeAmtCap;\n uint64 baseGas;\n uint64 gasPerByte;\n }\n\n uint8 internal constant _NOT_ENTERED = 1;\n uint8 internal constant _ENTERED = 2;\n uint8 internal _receive_entered_state = 1;\n modifier receiveNonReentrant() {\n require(_receive_entered_state == _NOT_ENTERED, \"LayerZeroMock: no receive reentrancy\");\n _receive_entered_state = _ENTERED;\n _;\n _receive_entered_state = _NOT_ENTERED;\n }\n\n event ValueTransferFailed(address indexed to, uint256 indexed quantity);\n\n constructor(uint32 _eid) {\n eid = _eid;\n // init config\n relayerFeeConfig = RelayerFeeConfig({\n dstPriceRatio: 1e10, // 1:1, same chain, same native coin\n dstGasPriceInWei: 1e10,\n dstNativeAmtCap: 1e19,\n baseGas: 100,\n gasPerByte: 1\n });\n protocolFeeConfig = ProtocolFeeConfig({ zroFee: 1e18, nativeBP: 1000 }); // BP 0.1\n verifierFee = 1e16;\n }\n\n function send(\n MessagingParams calldata _params,\n address _refundAddress\n ) public payable sendContext(_params.dstEid, msg.sender) returns (MessagingReceipt memory receipt) {\n if (_params.payInLzToken) revert Errors.LZ_LzTokenUnavailable();\n\n address lzEndpoint = lzEndpointLookup[_params.receiver.bytes32ToAddress()];\n require(lzEndpoint != address(0), \"LayerZeroMock: destination LayerZero Endpoint not found\");\n\n // get the correct outbound nonce\n uint64 latestNonce = _outbound(msg.sender, _params.dstEid, _params.receiver);\n\n Packet memory packet = Packet({\n nonce: latestNonce,\n srcEid: eid,\n sender: msg.sender,\n dstEid: _params.dstEid,\n receiver: _params.receiver,\n guid: GUID.generate(latestNonce, eid, msg.sender, _params.dstEid, _params.receiver),\n message: _params.message\n });\n receipt.guid = packet.guid;\n receipt.nonce = packet.nonce;\n receipt.fee = _quote(_params, msg.sender);\n require(msg.value >= receipt.fee.nativeFee, \"LayerZeroMock: not enough native for fees\");\n\n // refund if they send too much\n uint256 amount = msg.value - receipt.fee.nativeFee;\n if (amount > 0) {\n (bool success, ) = _refundAddress.call{ value: amount }(\"\");\n require(success, \"LayerZeroMock: failed to refund\");\n }\n\n uint256 totalGas;\n uint256 dstAmount;\n (totalGas, dstAmount) = executeNativeAirDropAndReturnLzGas(_params.options);\n\n // TODO fix\n // composed calls with correct gas\n\n Origin memory origin = Origin({\n srcEid: packet.srcEid,\n sender: packet.sender.addressToBytes32(),\n nonce: packet.nonce\n });\n\n bytes memory payload = PacketV1Codec.encodePayload(packet);\n bytes32 payloadHash = keccak256(payload);\n\n EndpointV2Mock(lzEndpoint).receivePayload{ value: dstAmount }(\n origin,\n packet.receiver.bytes32ToAddress(),\n payloadHash,\n packet.message,\n totalGas,\n dstAmount,\n packet.guid\n );\n }\n\n function receivePayload(\n Origin calldata _origin,\n address _receiver,\n bytes32 _payloadHash,\n bytes calldata _message,\n uint256 _gas,\n uint256 _msgValue,\n bytes32 _guid\n ) external payable receiveNonReentrant {\n inboundPayloadHash[_receiver][_origin.srcEid][_origin.sender][_origin.nonce] = _payloadHash;\n if (_msgValue > 0) {\n try\n ILayerZeroReceiver(_receiver).lzReceive{ value: _msgValue, gas: _gas }(\n _origin,\n _guid,\n _message,\n address(0),\n \"\"\n )\n {} catch (bytes memory /*reason*/) {}\n } else {\n try\n ILayerZeroReceiver(_receiver).lzReceive{ gas: _gas }(_origin, _guid, _message, address(0), \"\")\n {} catch (bytes memory /*reason*/) {}\n }\n }\n\n function getExecutorFee(uint256 _payloadSize, bytes calldata _options) public view returns (uint256) {\n uint256 nativeFee;\n // 2) get Executor fee\n // a) decodeLzReceiveOption\n // b) decodeNativeDropOption\n // c) decodeLzComposeOption\n (uint256 totalDstAmount, uint256 totalGas) = _decodeExecutorOptions(_options);\n uint256 remoteGasTotal = relayerFeeConfig.dstGasPriceInWei * (relayerFeeConfig.baseGas + totalGas);\n nativeFee += totalDstAmount + remoteGasTotal;\n\n // tokenConversionRate = dstPrice / localPrice\n // basePrice = totalRemoteToken * tokenConversionRate\n uint256 basePrice = (nativeFee * relayerFeeConfig.dstPriceRatio) / 10 ** 10;\n\n // pricePerByte = (dstGasPriceInWei * gasPerBytes) * tokenConversionRate\n uint256 pricePerByte = ((relayerFeeConfig.dstGasPriceInWei *\n relayerFeeConfig.gasPerByte *\n relayerFeeConfig.dstPriceRatio) / 10 ** 10) * _payloadSize;\n\n return basePrice + pricePerByte;\n }\n\n function _quote(\n MessagingParams calldata _params,\n address /*_sender*/\n ) internal view returns (MessagingFee memory messagingFee) {\n (bytes memory executorOptions, ) = splitOptions(_params.options);\n\n // 2) get Executor fee\n uint256 executorFee = this.getExecutorFee(_params.message.length, executorOptions);\n\n // 1) get Verifier fee\n // 3) get Treasury fee\n uint256 treasuryAndVerifierFee = _getTreasuryAndVerifierFees(executorFee, verifierFee);\n\n messagingFee.lzTokenFee = 0;\n messagingFee.nativeFee = executorFee + treasuryAndVerifierFee;\n }\n\n function _getTreasuryAndVerifierFees(uint256 _executorFee, uint256 _verifierFee) internal view returns (uint256) {\n return ((_executorFee + _verifierFee) * protocolFeeConfig.nativeBP) / 10000;\n }\n\n function _outbound(address _sender, uint32 _dstEid, bytes32 _receiver) internal returns (uint64 nonce) {\n unchecked {\n nonce = ++outboundNonce[_sender][_dstEid][_receiver];\n }\n }\n\n function setDestLzEndpoint(address destAddr, address lzEndpointAddr) external {\n lzEndpointLookup[destAddr] = lzEndpointAddr;\n }\n\n function _decodeExecutorOptions(\n bytes calldata _options\n ) internal view returns (uint256 dstAmount, uint256 totalGas) {\n if (_options.length == 0) {\n revert IExecutorFeeLib.Executor_NoOptions();\n }\n\n uint256 cursor = 0;\n totalGas = relayerFeeConfig.baseGas;\n\n while (cursor < _options.length) {\n (uint8 optionType, bytes calldata option, uint256 newCursor) = _options.nextExecutorOption(cursor);\n cursor = newCursor;\n\n if (optionType == ExecutorOptions.OPTION_TYPE_LZRECEIVE) {\n (uint128 gas, uint128 value) = ExecutorOptions.decodeLzReceiveOption(option);\n dstAmount += value;\n totalGas += gas;\n } else if (optionType == ExecutorOptions.OPTION_TYPE_NATIVE_DROP) {\n (uint128 nativeDropAmount, ) = ExecutorOptions.decodeNativeDropOption(option);\n dstAmount += nativeDropAmount;\n } else if (optionType == ExecutorOptions.OPTION_TYPE_LZCOMPOSE) {\n (, uint128 gas, uint128 value) = ExecutorOptions.decodeLzComposeOption(option);\n dstAmount += value;\n totalGas += gas;\n } else {\n revert IExecutorFeeLib.Executor_UnsupportedOptionType(optionType);\n }\n }\n\n if (cursor != _options.length) revert IExecutorFeeLib.Executor_InvalidExecutorOptions(cursor);\n if (dstAmount > relayerFeeConfig.dstNativeAmtCap)\n revert IExecutorFeeLib.Executor_NativeAmountExceedsCap(dstAmount, relayerFeeConfig.dstNativeAmtCap);\n }\n\n function splitOptions(bytes calldata _options) internal pure returns (bytes memory, WorkerOptions[] memory) {\n (bytes memory executorOpts, bytes memory dvnOpts) = decode(_options);\n\n if (dvnOpts.length == 0) {\n return (executorOpts, new WorkerOptions[](0));\n }\n\n WorkerOptions[] memory workerOpts = new WorkerOptions[](1);\n workerOpts[0] = WorkerOptions(DVNOptions.WORKER_ID, dvnOpts);\n return (executorOpts, workerOpts);\n }\n\n function decode(\n bytes calldata _options\n ) internal pure returns (bytes memory executorOptions, bytes memory dvnOptions) {\n // at least 2 bytes for the option type, but can have no options\n if (_options.length < 2) revert UlnOptions.LZ_ULN_InvalidWorkerOptions(0);\n\n uint16 optionsType = uint16(bytes2(_options[0:2]));\n uint256 cursor = 2;\n\n // type3 options: [worker_option][worker_option]...\n // worker_option: [worker_id][option_size][option]\n // worker_id: uint8, option_size: uint16, option: bytes\n if (optionsType == UlnOptions.TYPE_3) {\n unchecked {\n uint256 start = cursor;\n uint8 lastWorkerId; // worker_id starts from 1, so 0 is an invalid worker_id\n\n // heuristic: we assume that the options are mostly EXECUTOR options only\n // checking the workerID can reduce gas usage for most cases\n while (cursor < _options.length) {\n uint8 workerId = uint8(bytes1(_options[cursor:cursor + 1]));\n if (workerId == 0) revert UlnOptions.LZ_ULN_InvalidWorkerId(0);\n\n // workerId must equal to the lastWorkerId for the first option\n // so it is always skipped in the first option\n // this operation slices out options whenever the scan finds a different workerId\n if (lastWorkerId == 0) {\n lastWorkerId = workerId;\n } else if (workerId != lastWorkerId) {\n bytes calldata op = _options[start:cursor]; // slice out the last worker's options\n (executorOptions, dvnOptions) = _insertWorkerOptions(\n executorOptions,\n dvnOptions,\n lastWorkerId,\n op\n );\n\n // reset the start cursor and lastWorkerId\n start = cursor;\n lastWorkerId = workerId;\n }\n\n ++cursor; // for workerId\n\n uint16 size = uint16(bytes2(_options[cursor:cursor + 2]));\n if (size == 0) revert UlnOptions.LZ_ULN_InvalidWorkerOptions(cursor);\n cursor += size + 2;\n }\n\n // the options length must be the same as the cursor at the end\n if (cursor != _options.length) revert UlnOptions.LZ_ULN_InvalidWorkerOptions(cursor);\n\n // if we have reached the end of the options and the options are not empty\n // we need to process the last worker's options\n if (_options.length > 2) {\n bytes calldata op = _options[start:cursor];\n (executorOptions, dvnOptions) = _insertWorkerOptions(executorOptions, dvnOptions, lastWorkerId, op);\n }\n }\n } else {\n executorOptions = decodeLegacyOptions(optionsType, _options);\n }\n }\n\n function _insertWorkerOptions(\n bytes memory _executorOptions,\n bytes memory _dvnOptions,\n uint8 _workerId,\n bytes calldata _newOptions\n ) private pure returns (bytes memory, bytes memory) {\n if (_workerId == ExecutorOptions.WORKER_ID) {\n _executorOptions = _executorOptions.length == 0\n ? _newOptions\n : abi.encodePacked(_executorOptions, _newOptions);\n } else if (_workerId == DVNOptions.WORKER_ID) {\n _dvnOptions = _dvnOptions.length == 0 ? _newOptions : abi.encodePacked(_dvnOptions, _newOptions);\n } else {\n revert UlnOptions.LZ_ULN_InvalidWorkerId(_workerId);\n }\n return (_executorOptions, _dvnOptions);\n }\n\n function decodeLegacyOptions(\n uint16 _optionType,\n bytes calldata _options\n ) internal pure returns (bytes memory executorOptions) {\n if (_optionType == UlnOptions.TYPE_1) {\n if (_options.length != 34) revert UlnOptions.LZ_ULN_InvalidLegacyType1Option();\n\n // execution gas\n uint128 executionGas = uint256(bytes32(_options[2:2 + 32])).toUint128();\n\n // dont use the encode function in the ExecutorOptions lib for saving gas by calling abi.encodePacked once\n // the result is a lzReceive option: [executor_id][option_size][option_type][execution_gas]\n // option_type: uint8, execution_gas: uint128\n // option_size = len(option_type) + len(execution_gas) = 1 + 16 = 17\n executorOptions = abi.encodePacked(\n ExecutorOptions.WORKER_ID,\n uint16(17), // 16 + 1, 16 for option_length, + 1 for option_type\n ExecutorOptions.OPTION_TYPE_LZRECEIVE,\n executionGas\n );\n } else if (_optionType == UlnOptions.TYPE_2) {\n // receiver size <= 32\n if (_options.length <= 66 || _options.length > 98) revert UlnOptions.LZ_ULN_InvalidLegacyType2Option();\n\n // execution gas\n uint128 executionGas = uint256(bytes32(_options[2:2 + 32])).toUint128();\n\n // nativeDrop (amount + receiver)\n uint128 amount = uint256(bytes32(_options[34:34 + 32])).toUint128(); // offset 2 + 32\n bytes32 receiver;\n unchecked {\n uint256 receiverLen = _options.length - 66; // offset 2 + 32 + 32\n receiver = bytes32(_options[66:]);\n receiver = receiver >> (8 * (32 - receiverLen)); // padding 0 to the left\n }\n\n // dont use the encode function in the ExecutorOptions lib for saving gas by calling abi.encodePacked once\n // the result has one lzReceive option and one nativeDrop option:\n // [executor_id][lzReceive_option_size][option_type][execution_gas] +\n // [executor_id][nativeDrop_option_size][option_type][nativeDrop_amount][receiver]\n // option_type: uint8, execution_gas: uint128, nativeDrop_amount: uint128, receiver: bytes32\n // lzReceive_option_size = len(option_type) + len(execution_gas) = 1 + 16 = 17\n // nativeDrop_option_size = len(option_type) + len(nativeDrop_amount) + len(receiver) = 1 + 16 + 32 = 49\n executorOptions = abi.encodePacked(\n ExecutorOptions.WORKER_ID,\n uint16(17), // 16 + 1, 16 for option_length, + 1 for option_type\n ExecutorOptions.OPTION_TYPE_LZRECEIVE,\n executionGas,\n ExecutorOptions.WORKER_ID,\n uint16(49), // 48 + 1, 32 + 16 for option_length, + 1 for option_type\n ExecutorOptions.OPTION_TYPE_NATIVE_DROP,\n amount,\n receiver\n );\n } else {\n revert UlnOptions.LZ_ULN_UnsupportedOptionType(_optionType);\n }\n }\n\n // NOT IMPLEMENTING\n function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external {}\n\n function clear(address _oapp, Origin calldata _origin, bytes32 _guid, bytes calldata _message) external {}\n\n mapping(address from => mapping(address to => mapping(bytes32 guid => mapping(uint16 index => bytes32 messageHash))))\n public composeQueue;\n\n function defaultReceiveLibrary(uint32 /*_eid*/) external pure returns (address) {\n return address(0);\n }\n\n function defaultReceiveLibraryTimeout(uint32 /*_eid*/) external pure returns (address lib, uint256 expiry) {\n return (address(0), 0);\n }\n\n function defaultSendLibrary(uint32 /*_eid*/) external pure returns (address) {\n return address(0);\n }\n\n function executable(Origin calldata /*_origin*/, address /*receiver*/) external pure returns (ExecutionState) {\n return ExecutionState.NotExecutable;\n }\n\n function getConfig(\n address /*_oapp*/,\n address /*_lib*/,\n uint32 /*_eid*/,\n uint32 /*_configType*/\n ) external pure returns (bytes memory config) {\n return bytes(\"0x\");\n }\n\n function getReceiveLibrary(\n address /*receiver*/,\n uint32 /*_eid*/\n ) external pure returns (address lib, bool isDefault) {\n return (address(0), false);\n }\n\n function getRegisteredLibraries() external pure returns (address[] memory) {\n address[] memory addresses = new address[](1);\n addresses[0] = address(0);\n return addresses;\n }\n\n function getSendLibrary(address /*_sender*/, uint32 /*_eid*/) external pure returns (address lib) {\n return address(0);\n }\n\n function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64) {\n return lazyInboundNonce[_receiver][_srcEid][_sender];\n }\n\n function isDefaultSendLibrary(address /*_sender*/, uint32 /*_eid*/) external pure returns (bool) {\n return false;\n }\n\n function isRegisteredLibrary(address /*_lib*/) external pure returns (bool) {\n return false;\n }\n\n function isSupportedEid(uint32 /*_eid*/) external pure returns (bool) {\n return false;\n }\n\n function lzCompose(\n address /*_from,*/,\n address /*_to,*/,\n bytes32 /*_guid,*/,\n uint16 /*_index,*/,\n bytes calldata /*_message,*/,\n bytes calldata /*_extraData*/\n ) external payable {}\n\n function lzReceive(\n Origin calldata /*_origin,*/,\n address /*_receiver,*/,\n bytes32 /*_guid,*/,\n bytes calldata /*_message,*/,\n bytes calldata /*_extraData*/\n ) external payable {}\n\n function lzToken() external pure returns (address) {\n return address(0);\n }\n\n function nativeToken() external pure returns (address) {\n return address(0);\n }\n\n function nextGuid(\n address /*_sender,*/,\n uint32 /*_dstEid,*/,\n bytes32 /*_receiver*/\n ) external pure returns (bytes32) {\n return 0;\n }\n\n function nilify(\n address /*_oapp,*/,\n uint32 /*_srcEid,*/,\n bytes32 /*_sender,*/,\n uint64 /*_nonce,*/,\n bytes32 /*_payloadHash*/\n ) external {}\n\n function quote(MessagingParams calldata _params, address _sender) external view returns (MessagingFee memory) {\n return _quote(_params, _sender);\n }\n\n mapping(address receiver => mapping(uint32 srcEid => Timeout)) public receiveLibraryTimeout;\n\n function registerLibrary(address /*_lib*/) public {}\n\n function sendCompose(address, /*_to*/ bytes32, /*_guid*/ uint16, /*_index*/ bytes calldata /*_message*/) external {}\n\n function setConfig(address, /*_oapp*/ address, /*_lib*/ SetConfigParam[] calldata /*_params*/) external {}\n\n function setDefaultReceiveLibrary(uint32 /*_eid*/, address /*_newLib*/, uint256 /*_gracePeriod*/) external {}\n\n function setDefaultReceiveLibraryTimeout(uint32 /*_eid*/, address /*_lib*/, uint256 /*_expiry*/) external {}\n\n function setDefaultSendLibrary(uint32 /*_eid*/, address /*_newLib*/) external {}\n\n function setDelegate(address /*_delegate*/) external {}\n\n function setLzToken(address /*_lzToken*/) external {}\n\n function setReceiveLibrary(\n address,\n /*_oapp*/ uint32,\n /*_eid*/ address,\n /*_newLib*/ uint256 /*_gracePeriod*/\n ) external {}\n\n function setReceiveLibraryTimeout(\n address,\n /*_oapp*/ uint32,\n /*_eid*/ address,\n /*_lib*/ uint256 /*_gracePeriod*/\n ) external {}\n\n function setSendLibrary(address, /*_oapp*/ uint32, /*_eid*/ address /*_newLib*/) external {}\n\n function skip(address, /*_oapp*/ uint32, /*_srcEid*/ bytes32, /*_sender*/ uint64 /*_nonce*/) external {}\n\n function verifiable(\n Origin calldata /*_origin*/,\n address /*_receiver*/,\n address /*_receiveLib*/,\n bytes32 /*_payloadHash*/\n ) external pure returns (bool) {\n return false;\n }\n\n function verify(Origin calldata /*origin*/, address /*_receiver*/, bytes32 /*_payloadHash*/) external {}\n\n // Helper Functions\n function executeNativeAirDropAndReturnLzGas(\n bytes calldata _options\n ) public returns (uint256 totalGas, uint256 dstAmount) {\n (bytes memory executorOpts, ) = decode(_options);\n return this._executeNativeAirDropAndReturnLzGas(executorOpts);\n }\n\n function _executeNativeAirDropAndReturnLzGas(\n bytes calldata _options\n ) public returns (uint256 totalGas, uint256 dstAmount) {\n if (_options.length == 0) {\n revert IExecutorFeeLib.Executor_NoOptions();\n }\n\n uint256 cursor = 0;\n while (cursor < _options.length) {\n (uint8 optionType, bytes calldata option, uint256 newCursor) = _options.nextExecutorOption(cursor);\n cursor = newCursor;\n\n if (optionType == ExecutorOptions.OPTION_TYPE_LZRECEIVE) {\n (uint128 gas, uint128 value) = ExecutorOptions.decodeLzReceiveOption(option);\n totalGas += gas;\n dstAmount += value;\n } else if (optionType == ExecutorOptions.OPTION_TYPE_NATIVE_DROP) {\n (uint128 nativeDropAmount, bytes32 receiver) = ExecutorOptions.decodeNativeDropOption(option);\n (bool success, ) = receiver.bytes32ToAddress().call{ value: nativeDropAmount }(\"\");\n if (!success) {\n emit ValueTransferFailed(receiver.bytes32ToAddress(), nativeDropAmount);\n }\n } else {\n revert IExecutorFeeLib.Executor_UnsupportedOptionType(optionType);\n }\n }\n\n if (cursor != _options.length) revert IExecutorFeeLib.Executor_InvalidExecutorOptions(cursor);\n }\n\n function _initializable(\n Origin calldata _origin,\n address _receiver,\n uint64 _lazyInboundNonce\n ) internal view returns (bool) {\n return\n _lazyInboundNonce > 0 || // allowInitializePath already checked\n ILayerZeroReceiver(_receiver).allowInitializePath(_origin);\n }\n\n /// @dev bytes(0) payloadHash can never be submitted\n function _verifiable(\n Origin calldata _origin,\n address _receiver,\n uint64 _lazyInboundNonce\n ) internal view returns (bool) {\n return\n _origin.nonce > _lazyInboundNonce || // either initializing an empty slot or reverifying\n inboundPayloadHash[_receiver][_origin.srcEid][_origin.sender][_origin.nonce] != EMPTY_PAYLOAD_HASH; // only allow reverifying if it hasn't been executed\n }\n\n // ========================= VIEW FUNCTIONS FOR OFFCHAIN ONLY =========================\n // Not involved in any state transition function.\n // ====================================================================================\n function initializable(Origin calldata _origin, address _receiver) external view returns (bool) {\n return _initializable(_origin, _receiver, lazyInboundNonce[_receiver][_origin.srcEid][_origin.sender]);\n }\n\n function verifiable(Origin calldata _origin, address _receiver) external view returns (bool) {\n return _verifiable(_origin, _receiver, lazyInboundNonce[_receiver][_origin.srcEid][_origin.sender]);\n }\n\n /// @dev called when the endpoint checks if the msgLib attempting to verify the msg is the configured msgLib of the Oapp\n /// @dev this check provides the ability for Oapp to lock in a trusted msgLib\n /// @dev it will fist check if the msgLib is the currently configured one. then check if the msgLib is the one in grace period of msgLib versioning upgrade\n function isValidReceiveLibrary(\n address _receiver,\n uint32 _srcEid,\n address _actualReceiveLib\n ) public view returns (bool) {\n return true;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Storage of the initializable contract.\n *\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n * when using with upgradeable contracts.\n *\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n */\n struct InitializableStorage {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n uint64 _initialized;\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool _initializing;\n }\n\n // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n /**\n * @dev The contract is already initialized.\n */\n error InvalidInitialization();\n\n /**\n * @dev The contract is not initializing.\n */\n error NotInitializing();\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint64 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n * production.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n // solhint-disable-next-line var-name-mixedcase\n InitializableStorage storage $ = _getInitializableStorage();\n\n // Cache values to avoid duplicated sloads\n bool isTopLevelCall = !$._initializing;\n uint64 initialized = $._initialized;\n\n // Allowed calls:\n // - initialSetup: the contract is not in the initializing state and no previous version was\n // initialized\n // - construction: the contract is initialized at version 1 (no reininitialization) and the\n // current contract is just being deployed\n bool initialSetup = initialized == 0 && isTopLevelCall;\n bool construction = initialized == 1 && address(this).code.length == 0;\n\n if (!initialSetup && !construction) {\n revert InvalidInitialization();\n }\n $._initialized = 1;\n if (isTopLevelCall) {\n $._initializing = true;\n }\n _;\n if (isTopLevelCall) {\n $._initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint64 version) {\n // solhint-disable-next-line var-name-mixedcase\n InitializableStorage storage $ = _getInitializableStorage();\n\n if ($._initializing || $._initialized >= version) {\n revert InvalidInitialization();\n }\n $._initialized = version;\n $._initializing = true;\n _;\n $._initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n _checkInitializing();\n _;\n }\n\n /**\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n */\n function _checkInitializing() internal view virtual {\n if (!_isInitializing()) {\n revert NotInitializing();\n }\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n // solhint-disable-next-line var-name-mixedcase\n InitializableStorage storage $ = _getInitializableStorage();\n\n if ($._initializing) {\n revert InvalidInitialization();\n }\n if ($._initialized != type(uint64).max) {\n $._initialized = type(uint64).max;\n emit Initialized(type(uint64).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint64) {\n return _getInitializableStorage()._initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _getInitializableStorage()._initializing;\n }\n\n /**\n * @dev Returns a pointer to the storage namespace.\n */\n // solhint-disable-next-line var-name-mixedcase\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n assembly {\n $.slot := INITIALIZABLE_STORAGE\n }\n }\n}\n" + }, + "@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/interfaces/draft-IERC6093.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 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 ERC721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 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 EIP-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 ERC1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 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/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../token/ERC20/IERC20.sol\";\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\nimport {IERC20Permit} from \"../extensions/IERC20Permit.sol\";\nimport {Address} from \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance < requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 && !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\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 AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\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 * {FailedInnerCall} 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 AddressInsufficientBalance(address(this));\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 {FailedInnerCall}) in case of an\n * 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 {FailedInnerCall} 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 {FailedInnerCall}.\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 /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\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/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\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[EIP 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/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.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 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" + }, + "@sandbox-smart-contracts/oft-sand/contracts/interfaces/IERC20Extended.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.23;\n\nimport {IERC20} from \"@openzeppelin/contracts/interfaces/IERC20.sol\";\n\ninterface IERC20Extended is IERC20 {\n function burnFor(address from, uint256 amount) external;\n\n function burn(uint256 amount) external;\n\n function approveFor(address owner, address spender, uint256 amount) external returns (bool success);\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/interfaces/IErrors.sol": { + "content": "//SPDX-License-Identifier: MIT\n\npragma solidity 0.8.23;\n\n/// @title Errors\n/// @author The Sandbox\n/// @custom:security-contact contact-blockchain@sandbox.game\n/// @notice Common errors\ninterface IErrors {\n /// @notice Error for overflow conditions\n error Overflow();\n\n /// @notice Error for unauthorized access\n error NotAuthorized();\n\n /// @notice Error for invalid sender\n error InvalidSender();\n\n /// @notice Error for invalid amount\n error InvalidAmount();\n\n /// @notice Error for invalid owner or spender\n error InvalidOwnerOrSpender();\n\n /// @notice Error for mismatched first parameter and sender address\n error FirstParamNotSender();\n\n /// @notice Error for failed calls, containing the error message\n /// @param message error message returned from the failed call\n error CallFailed(string message);\n\n /// @notice Error for admin-only access\n error OnlyAdmin();\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/libraries/BytesUtil.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nlibrary BytesUtil {\n uint256 private constant DATA_MIN_LENGTH = 68;\n\n /// @dev Check if the data == _address.\n /// @param data The bytes passed to the function.\n /// @param _address The address to compare to.\n /// @return Whether the first param == _address.\n function doFirstParamEqualsAddress(bytes memory data, address _address) internal pure returns (bool) {\n if (data.length < DATA_MIN_LENGTH) {\n return false;\n }\n uint256 value;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n value := mload(add(data, 36))\n }\n return value == uint256(uint160(_address));\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/mock/EndpointMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.23;\n\nimport {EndpointV2Mock} from \"@layerzerolabs/test-devtools-evm-hardhat/contracts/mocks/EndpointV2Mock.sol\";\n\ncontract EndpointMock is EndpointV2Mock {\n constructor(uint32 eid) EndpointV2Mock(eid) {}\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/oft/libraries/OFTMsgCodec.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nlibrary OFTMsgCodec {\n // Offset constants for encoding and decoding OFT messages\n uint8 private constant SEND_TO_OFFSET = 32;\n uint8 private constant SEND_AMOUNT_SD_OFFSET = 40;\n\n /**\n * @dev Encodes an OFT LayerZero message.\n * @param _sendTo The recipient address.\n * @param _amountShared The amount in shared decimals.\n * @param _composeMsg The composed message.\n * @param _sender The msg sender\n * @return _msg The encoded message.\n * @return hasCompose A boolean indicating whether the message has a composed payload.\n */\n function encode(\n bytes32 _sendTo,\n uint64 _amountShared,\n bytes memory _composeMsg,\n address _sender\n ) internal pure returns (bytes memory _msg, bool hasCompose) {\n hasCompose = _composeMsg.length > 0;\n // @dev Remote chains will want to know the composed function caller ie. msg.sender on the src.\n _msg = hasCompose\n ? abi.encodePacked(_sendTo, _amountShared, addressToBytes32(_sender), _composeMsg)\n : abi.encodePacked(_sendTo, _amountShared);\n }\n\n /**\n * @dev Checks if the OFT message is composed.\n * @param _msg The OFT message.\n * @return A boolean indicating whether the message is composed.\n */\n function isComposed(bytes calldata _msg) internal pure returns (bool) {\n return _msg.length > SEND_AMOUNT_SD_OFFSET;\n }\n\n /**\n * @dev Retrieves the recipient address from the OFT message.\n * @param _msg The OFT message.\n * @return The recipient address.\n */\n function sendTo(bytes calldata _msg) internal pure returns (bytes32) {\n return bytes32(_msg[:SEND_TO_OFFSET]);\n }\n\n /**\n * @dev Retrieves the amount in shared decimals from the OFT message.\n * @param _msg The OFT message.\n * @return The amount in shared decimals.\n */\n function amountSD(bytes calldata _msg) internal pure returns (uint64) {\n return uint64(bytes8(_msg[SEND_TO_OFFSET:SEND_AMOUNT_SD_OFFSET]));\n }\n\n /**\n * @dev Retrieves the composed message from the OFT message.\n * @param _msg The OFT message.\n * @return The composed message.\n */\n function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\n return _msg[SEND_AMOUNT_SD_OFFSET:];\n }\n\n /**\n * @dev Converts an address to bytes32.\n * @param _addr The address to convert.\n * @return The bytes32 representation of the address.\n */\n function addressToBytes32(address _addr) internal pure returns (bytes32) {\n return bytes32(uint256(uint160(_addr)));\n }\n\n /**\n * @dev Converts bytes32 to an address.\n * @param _b The bytes32 value to convert.\n * @return The address representation of bytes32.\n */\n function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\n return address(uint160(uint256(_b)));\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/oft/oapp/OApp.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\n// @dev Import the 'MessagingFee' and 'MessagingReceipt' so it's exposed to OApp implementers\n// solhint-disable-next-line no-unused-import\nimport {OAppSender, MessagingFee, MessagingReceipt} from \"./OAppSender.sol\";\n// @dev Import the 'Origin' so it's exposed to OApp implementers\n// solhint-disable-next-line no-unused-import\nimport {OAppReceiver, Origin} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppReceiver.sol\";\nimport {OAppCore} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppCore.sol\";\n\n/**\n * @title OApp\n * @dev Abstract contract serving as the base for OApp implementation, combining OAppSender and OAppReceiver functionality.\n * @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OApp.sol'\n * but has been modified to support ERC2771 compatibility.\n */\nabstract contract OApp is OAppSender, OAppReceiver {\n /**\n * @dev Constructor to initialize the OApp with the provided endpoint and owner.\n * @param _endpoint The address of the LOCAL LayerZero endpoint.\n * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n */\n constructor(address _endpoint, address _delegate) OAppCore(_endpoint, _delegate) {}\n\n /**\n * @notice Retrieves the OApp version information.\n * @return senderVersion The version of the OAppSender.sol implementation.\n * @return receiverVersion The version of the OAppReceiver.sol implementation.\n */\n function oAppVersion()\n public\n pure\n virtual\n override(OAppSender, OAppReceiver)\n returns (uint64 senderVersion, uint64 receiverVersion)\n {\n return (SENDER_VERSION, RECEIVER_VERSION);\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/oft/oapp/OAppSender.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport {SafeERC20, IERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {MessagingParams, MessagingFee, MessagingReceipt} from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport {OAppCore} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppCore.sol\";\n/**\n * @title OAppSender\n * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.\n * @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppSender.sol'\n * but has been modified to support ERC2771 compatibility.\n */\nabstract contract OAppSender is OAppCore {\n using SafeERC20 for IERC20;\n\n // Custom error messages\n error NotEnoughNative(uint256 msgValue);\n error LzTokenUnavailable();\n\n // @dev The version of the OAppSender implementation.\n // @dev Version is bumped when changes are made to this contract.\n uint64 internal constant SENDER_VERSION = 1;\n\n /**\n * @notice Retrieves the OApp version information.\n * @return senderVersion The version of the OAppSender.sol contract.\n * @return receiverVersion The version of the OAppReceiver.sol contract.\n *\n * @dev Providing 0 as the default for OAppReceiver version. Indicates that the OAppReceiver is not implemented.\n * ie. this is a SEND only OApp.\n * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions\n */\n function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\n return (SENDER_VERSION, 0);\n }\n\n /**\n * @dev Internal function to interact with the LayerZero EndpointV2.quote() for fee calculation.\n * @param _dstEid The destination endpoint ID.\n * @param _message The message payload.\n * @param _options Additional options for the message.\n * @param _payInLzToken Flag indicating whether to pay the fee in LZ tokens.\n * @return fee The calculated MessagingFee for the message.\n * - nativeFee: The native fee for the message.\n * - lzTokenFee: The LZ token fee for the message.\n */\n function _quote(\n uint32 _dstEid,\n bytes memory _message,\n bytes memory _options,\n bool _payInLzToken\n ) internal view virtual returns (MessagingFee memory fee) {\n return\n endpoint.quote(\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken),\n address(this)\n );\n }\n\n /**\n * @dev Internal function to interact with the LayerZero EndpointV2.send() for sending a message.\n * @param _dstEid The destination endpoint ID.\n * @param _message The message payload.\n * @param _options Additional options for the message.\n * @param _fee The calculated LayerZero fee for the message.\n * - nativeFee: The native fee.\n * - lzTokenFee: The lzToken fee.\n * @param _refundAddress The address to receive any excess fee values sent to the endpoint.\n * @return receipt The receipt for the sent message.\n * - guid: The unique identifier for the sent message.\n * - nonce: The nonce of the sent message.\n * - fee: The LayerZero fee incurred for the message.\n */\n function _lzSend(\n uint32 _dstEid,\n bytes memory _message,\n bytes memory _options,\n MessagingFee memory _fee,\n address _refundAddress\n ) internal virtual returns (MessagingReceipt memory receipt) {\n // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint.\n uint256 messageValue = _payNative(_fee.nativeFee);\n if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);\n\n return\n // solhint-disable-next-line check-send-result\n endpoint.send{value: messageValue}(\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0),\n _refundAddress\n );\n }\n\n /**\n * @dev Internal function to pay the native fee associated with the message.\n * @param _nativeFee The native fee to be paid.\n * @return nativeFee The amount of native currency paid.\n *\n * @dev If the OApp needs to initiate MULTIPLE LayerZero messages in a single transaction,\n * this will need to be overridden because msg.value would contain multiple lzFees.\n * @dev Should be overridden in the event the LayerZero endpoint requires a different native currency.\n * @dev Some EVMs use an ERC20 as a method for paying transactions/gasFees.\n * @dev The endpoint is EITHER/OR, ie. it will NOT support both types of native payment at a time.\n */\n function _payNative(uint256 _nativeFee) internal virtual returns (uint256 nativeFee) {\n if (msg.value != _nativeFee) revert NotEnoughNative(msg.value);\n return _nativeFee;\n }\n\n /**\n * @dev Internal function to pay the LZ token fee associated with the message.\n * @param _lzTokenFee The LZ token fee to be paid.\n *\n * @dev If the caller is trying to pay in the specified lzToken, then the lzTokenFee is passed to the endpoint.\n * @dev Any excess sent, is passed back to the specified _refundAddress in the _lzSend().\n */\n function _payLzToken(uint256 _lzTokenFee) internal virtual {\n // @dev Cannot cache the token because it is not immutable in the endpoint.\n address lzToken = endpoint.lzToken();\n if (lzToken == address(0)) revert LzTokenUnavailable();\n\n // Pay LZ token fee by sending tokens to the endpoint.\n IERC20(lzToken).safeTransferFrom(_msgSender(), address(endpoint), _lzTokenFee);\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/oft/OFTAdapter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport {IERC20Metadata, IERC20} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {OFTCore} from \"./OFTCore.sol\";\n\n/// @title OFTAdapter Contract\n/// @dev OFTAdapter is a contract that adapts an ERC-20 token to the OFT functionality.\n/// @dev For existing ERC20 tokens, this can be used to convert the token to crosschain compatibility.\n/// @dev WARNING: ONLY 1 of these should exist for a given global mesh,\n/// unless you make a NON-default implementation of OFT and needs to be done very carefully.\n/// @dev WARNING: The default OFTAdapter implementation assumes LOSSLESS transfers, ie. 1 token in, 1 token out.\n/// IF the 'innerToken' applies something like a transfer fee, the default will NOT work...\n/// a pre/post balance check will need to be done to calculate the amountSentLD/amountReceivedLD.\n/// @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFTAdapter.sol'\n/// but has been modified to support ERC2771 compatibility.\nabstract contract OFTAdapter is OFTCore {\n using SafeERC20 for IERC20;\n\n IERC20 internal immutable innerToken;\n\n /// @dev Constructor for the OFTAdapter contract.\n /// @param _token The address of the ERC-20 token to be adapted.\n /// @param _lzEndpoint The LayerZero endpoint address.\n /// @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n constructor(\n address _token,\n address _lzEndpoint,\n address _delegate\n ) OFTCore(IERC20Metadata(_token).decimals(), _lzEndpoint, _delegate) {\n innerToken = IERC20(_token);\n }\n\n /// @dev Retrieves the address of the underlying ERC20 implementation.\n /// @return The address of the adapted ERC-20 token.\n /// @dev In the case of OFTAdapter, address(this) and erc20 are NOT the same contract.\n function token() public view returns (address) {\n return address(innerToken);\n }\n\n /// @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\n /// @return requiresApproval Needs approval of the underlying token implementation.\n /// @dev In the case of default OFTAdapter, approval is required.\n /// @dev In non-default OFTAdapter contracts with something like mint and burn privileges, it would NOT need approval.\n function approvalRequired() external pure virtual returns (bool) {\n return true;\n }\n\n /// @dev Burns tokens from the sender's specified balance, ie. pull method.\n /// @param _from The address to debit from.\n /// @param _amountLD The amount of tokens to send in local decimals.\n /// @param _minAmountLD The minimum amount to send in local decimals.\n /// @param _dstEid The destination chain ID.\n /// @return amountSentLD The amount sent in local decimals.\n /// @return amountReceivedLD The amount received in local decimals on the remote.\n /// @dev msg.sender will need to approve this _amountLD of tokens to be locked inside of the contract.\n /// @dev WARNING: The default OFTAdapter implementation assumes LOSSLESS transfers, ie. 1 token in, 1 token out.\n /// IF the 'innerToken' applies something like a transfer fee, the default will NOT work...\n /// a pre/post balance check will need to be done to calculate the amountReceivedLD.\n function _debit(\n address _from,\n uint256 _amountLD,\n uint256 _minAmountLD,\n uint32 _dstEid\n ) internal virtual override returns (uint256 amountSentLD, uint256 amountReceivedLD) {\n (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid);\n // @dev Lock tokens by moving them into this contract from the caller.\n innerToken.safeTransferFrom(_from, address(this), amountSentLD);\n }\n\n /// @dev Credits tokens to the specified address.\n /// @param _to The address to credit the tokens to.\n /// @param _amountLD The amount of tokens to credit in local decimals.\n /// @dev _srcEid The source chain ID.\n /// @return amountReceivedLD The amount of tokens ACTUALLY received in local decimals.\n /// @dev WARNING: The default OFTAdapter implementation assumes LOSSLESS transfers, ie. 1 token in, 1 token out.\n /// IF the 'innerToken' applies something like a transfer fee, the default will NOT work...\n /// a pre/post balance check will need to be done to calculate the amountReceivedLD.\n function _credit(\n address _to,\n uint256 _amountLD,\n uint32 /*_srcEid*/\n ) internal virtual override returns (uint256 amountReceivedLD) {\n // @dev Unlock the tokens and transfer to the recipient.\n innerToken.safeTransfer(_to, _amountLD);\n // @dev In the case of NON-default OFTAdapter, the amountLD MIGHT not be == amountReceivedLD.\n return _amountLD;\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/oft/OFTCore.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport {OApp, Origin} from \"./oapp/OApp.sol\";\nimport {OAppOptionsType3} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OAppOptionsType3.sol\";\nimport {IOAppMsgInspector} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppMsgInspector.sol\";\n\nimport {OAppPreCrimeSimulator} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/OAppPreCrimeSimulator.sol\";\n\nimport {IOFT, SendParam, OFTLimit, OFTReceipt, OFTFeeDetail, MessagingReceipt, MessagingFee} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol\";\nimport {OFTMsgCodec} from \"./libraries/OFTMsgCodec.sol\";\nimport {OFTComposeMsgCodec} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/libs/OFTComposeMsgCodec.sol\";\n\n/// @title OFTCore\n/// @dev Abstract contract for the OftChain (OFT) token.\n/// @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFTCore.sol'\n/// but has been modified to support ERC2771 compatibility.\nabstract contract OFTCore is IOFT, OApp, OAppPreCrimeSimulator, OAppOptionsType3 {\n using OFTMsgCodec for bytes;\n using OFTMsgCodec for bytes32;\n\n // @notice Provides a conversion rate when swapping between denominations of SD and LD\n // - shareDecimals == SD == shared Decimals\n // - localDecimals == LD == local decimals\n // @dev Considers that tokens have different decimal amounts on various chains.\n // @dev eg.\n // For a token\n // - locally with 4 decimals --> 1.2345 => uint(12345)\n // - remotely with 2 decimals --> 1.23 => uint(123)\n // - The conversion rate would be 10 ** (4 - 2) = 100\n // @dev If you want to send 1.2345 -> (uint 12345), you CANNOT represent that value on the remote,\n // you can only display 1.23 -> uint(123).\n // @dev To preserve the dust that would otherwise be lost on that conversion,\n // we need to unify a denomination that can be represented on ALL chains inside of the OFT mesh\n uint256 public immutable decimalConversionRate;\n\n // @notice Msg types that are used to identify the various OFT operations.\n // @dev This can be extended in child contracts for non-default oft operations\n // @dev These values are used in things like combineOptions() in OAppOptionsType3.sol.\n uint16 public constant SEND = 1;\n uint16 public constant SEND_AND_CALL = 2;\n\n // Address of an optional contract to inspect both 'message' and 'options'\n address public msgInspector;\n event MsgInspectorSet(address inspector);\n\n /// @dev Constructor.\n /// @param _localDecimals The decimals of the token on the local chain (this chain).\n /// @param _endpoint The address of the LayerZero endpoint.\n /// @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n constructor(uint8 _localDecimals, address _endpoint, address _delegate) OApp(_endpoint, _delegate) {\n if (_localDecimals < sharedDecimals()) revert InvalidLocalDecimals();\n decimalConversionRate = 10 ** (_localDecimals - sharedDecimals());\n }\n\n /// @notice Retrieves interfaceID and the version of the OFT.\n /// @return interfaceId The interface ID.\n /// @return version The version.\n /// @dev interfaceId: This specific interface ID is '0x02e49c2c'.\n /// @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.\n /// @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.\n /// ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\n function oftVersion() external pure virtual returns (bytes4 interfaceId, uint64 version) {\n return (type(IOFT).interfaceId, 1);\n }\n\n /// @dev Retrieves the shared decimals of the OFT.\n /// @return The shared decimals of the OFT.\n /// @dev Sets an implicit cap on the amount of tokens, over uint64.max() will need some sort of outbound cap / totalSupply cap\n /// Lowest common decimal denominator between chains.\n /// Defaults to 6 decimal places to provide up to 18,446,744,073,709.551615 units (max uint64).\n /// For tokens exceeding this totalSupply(), they will need to override the sharedDecimals function with something smaller.\n /// ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615\n function sharedDecimals() public view virtual returns (uint8) {\n return 6;\n }\n\n /// @dev Sets the message inspector address for the OFT.\n /// @param _msgInspector The address of the message inspector.\n /// @dev This is an optional contract that can be used to inspect both 'message' and 'options'.\n /// @dev Set it to address(0) to disable it, or set it to a contract address to enable it.\n function setMsgInspector(address _msgInspector) public virtual onlyOwner {\n msgInspector = _msgInspector;\n emit MsgInspectorSet(_msgInspector);\n }\n\n /// @notice Provides a quote for OFT-related operations.\n /// @param _sendParam The parameters for the send operation.\n /// @return oftLimit The OFT limit information.\n /// @return oftFeeDetails The details of OFT fees.\n /// @return oftReceipt The OFT receipt information.\n function quoteOFT(\n SendParam calldata _sendParam\n )\n external\n view\n virtual\n returns (OFTLimit memory oftLimit, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory oftReceipt)\n {\n uint256 minAmountLD = 0; // Unused in the default implementation.\n uint256 maxAmountLD = type(uint64).max; // Unused in the default implementation.\n oftLimit = OFTLimit(minAmountLD, maxAmountLD);\n\n // Unused in the default implementation; reserved for future complex fee details.\n oftFeeDetails = new OFTFeeDetail[](0);\n\n // @dev This is the same as the send() operation, but without the actual send.\n // - amountSentLD is the amount in local decimals that would be sent from the sender.\n // - amountReceivedLD is the amount in local decimals that will be credited to the recipient on the remote OFT instance.\n // @dev The amountSentLD MIGHT not equal the amount the user actually receives. HOWEVER, the default does.\n (uint256 amountSentLD, uint256 amountReceivedLD) = _debitView(\n _sendParam.amountLD,\n _sendParam.minAmountLD,\n _sendParam.dstEid\n );\n oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD);\n }\n\n /// @notice Provides a quote for the send() operation.\n /// @param _sendParam The parameters for the send() operation.\n /// @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.\n /// @return msgFee The calculated LayerZero messaging fee from the send() operation.\n /// @dev MessagingFee: LayerZero msg fee\n /// - nativeFee: The native fee.\n /// - lzTokenFee: The lzToken fee.\n function quoteSend(\n SendParam calldata _sendParam,\n bool _payInLzToken\n ) external view virtual returns (MessagingFee memory msgFee) {\n // @dev mock the amount to receive, this is the same operation used in the send().\n // The quote is as similar as possible to the actual send() operation.\n (, uint256 amountReceivedLD) = _debitView(_sendParam.amountLD, _sendParam.minAmountLD, _sendParam.dstEid);\n\n // @dev Builds the options and OFT message to quote in the endpoint.\n (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD);\n\n // @dev Calculates the LayerZero fee for the send() operation.\n return _quote(_sendParam.dstEid, message, options, _payInLzToken);\n }\n\n /// @dev Executes the send operation.\n /// @param _sendParam The parameters for the send operation.\n /// @param _fee The calculated fee for the send() operation.\n /// - nativeFee: The native fee.\n /// - lzTokenFee: The lzToken fee.\n /// @param _refundAddress The address to receive any excess funds.\n /// @return msgReceipt The receipt for the send operation.\n /// @return oftReceipt The OFT receipt information.\n /// @dev MessagingReceipt: LayerZero msg receipt\n /// - guid: The unique identifier for the sent message.\n /// - nonce: The nonce of the sent message.\n /// - fee: The LayerZero fee incurred for the message.\n function send(\n SendParam calldata _sendParam,\n MessagingFee calldata _fee,\n address _refundAddress\n ) public payable virtual returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) {\n // @dev Applies the token transfers regarding this send() operation.\n // - amountSentLD is the amount in local decimals that was ACTUALLY sent/debited from the sender.\n // - amountReceivedLD is the amount in local decimals that will be received/credited to the recipient on the remote OFT instance.\n (uint256 amountSentLD, uint256 amountReceivedLD) = _debit(\n _msgSender(),\n _sendParam.amountLD,\n _sendParam.minAmountLD,\n _sendParam.dstEid\n );\n\n // @dev Builds the options and OFT message to quote in the endpoint.\n (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD);\n\n // @dev Sends the message to the LayerZero endpoint and returns the LayerZero msg receipt.\n msgReceipt = _lzSend(_sendParam.dstEid, message, options, _fee, _refundAddress);\n // @dev Formulate the OFT receipt.\n oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD);\n\n emit OFTSent(msgReceipt.guid, _sendParam.dstEid, _msgSender(), amountSentLD, amountReceivedLD);\n }\n\n /// @dev Internal function to build the message and options.\n /// @param _sendParam The parameters for the send() operation.\n /// @param _amountLD The amount in local decimals.\n /// @return message The encoded message.\n /// @return options The encoded options.\n function _buildMsgAndOptions(\n SendParam calldata _sendParam,\n uint256 _amountLD\n ) internal view virtual returns (bytes memory message, bytes memory options) {\n bool hasCompose;\n // @dev This generated message has the msg.sender encoded into the payload so the remote knows who the caller is.\n (message, hasCompose) = OFTMsgCodec.encode(\n _sendParam.to,\n _toSD(_amountLD),\n // @dev Must be include a non empty bytes if you want to compose, EVEN if you dont need it on the remote.\n // EVEN if you dont require an arbitrary payload to be sent... eg. '0x01'\n _sendParam.composeMsg,\n _msgSender()\n );\n // @dev Change the msg type depending if its composed or not.\n uint16 msgType = hasCompose ? SEND_AND_CALL : SEND;\n // @dev Combine the callers _extraOptions with the enforced options via the OAppOptionsType3.\n options = combineOptions(_sendParam.dstEid, msgType, _sendParam.extraOptions);\n\n // @dev Optionally inspect the message and options depending if the OApp owner has set a msg inspector.\n // @dev If it fails inspection, needs to revert in the implementation. ie. does not rely on return boolean\n if (msgInspector != address(0)) IOAppMsgInspector(msgInspector).inspect(message, options);\n }\n\n /// @dev Internal function to handle the receive on the LayerZero endpoint.\n /// @param _origin The origin information.\n /// - srcEid: The source chain endpoint ID.\n /// - sender: The sender address from the src chain.\n /// - nonce: The nonce of the LayerZero message.\n /// @param _guid The unique identifier for the received LayerZero message.\n /// @param _message The encoded message.\n /// @dev _executor The address of the executor.\n /// @dev _extraData Additional data.\n\n function _lzReceive(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address /*_executor*/, // @dev unused in the default implementation.\n bytes calldata /*_extraData*/ // @dev unused in the default implementation.\n ) internal virtual override {\n // @dev The src sending chain doesnt know the address length on this chain (potentially non-evm)\n // Thus everything is bytes32() encoded in flight.\n address toAddress = _message.sendTo().bytes32ToAddress();\n // @dev Credit the amountLD to the recipient and return the ACTUAL amount the recipient received in local decimals\n uint256 amountReceivedLD = _credit(toAddress, _toLD(_message.amountSD()), _origin.srcEid);\n\n if (_message.isComposed()) {\n // @dev Proprietary composeMsg format for the OFT.\n bytes memory composeMsg = OFTComposeMsgCodec.encode(\n _origin.nonce,\n _origin.srcEid,\n amountReceivedLD,\n _message.composeMsg()\n );\n\n // @dev Stores the lzCompose payload that will be executed in a separate tx.\n // Standardizes functionality for executing arbitrary contract invocation on some non-evm chains.\n // @dev The off-chain executor will listen and process the msg based on the src-chain-callers compose options passed.\n // @dev The index is used when a OApp needs to compose multiple msgs on lzReceive.\n // For default OFT implementation there is only 1 compose msg per lzReceive, thus its always 0.\n endpoint.sendCompose(toAddress, _guid, 0 /* the index of the composed message*/, composeMsg);\n }\n\n emit OFTReceived(_guid, _origin.srcEid, toAddress, amountReceivedLD);\n }\n\n /// @dev Internal function to handle the OAppPreCrimeSimulator simulated receive.\n /// @param _origin The origin information.\n /// - srcEid: The source chain endpoint ID.\n /// - sender: The sender address from the src chain.\n /// - nonce: The nonce of the LayerZero message.\n /// @param _guid The unique identifier for the received LayerZero message.\n /// @param _message The LayerZero message.\n /// @param _executor The address of the off-chain executor.\n /// @param _extraData Arbitrary data passed by the msg executor.\n /// @dev Enables the preCrime simulator to mock sending lzReceive() messages,\n /// routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver.\n function _lzReceiveSimulate(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address _executor,\n bytes calldata _extraData\n ) internal virtual override {\n _lzReceive(_origin, _guid, _message, _executor, _extraData);\n }\n\n /// @dev Check if the peer is considered 'trusted' by the OApp.\n /// @param _eid The endpoint ID to check.\n /// @param _peer The peer to check.\n /// @return Whether the peer passed is considered 'trusted' by the OApp.\n /// @dev Enables OAppPreCrimeSimulator to check whether a potential Inbound Packet is from a trusted source.\n function isPeer(uint32 _eid, bytes32 _peer) public view virtual override returns (bool) {\n return peers[_eid] == _peer;\n }\n\n /// @dev Internal function to remove dust from the given local decimal amount.\n /// @param _amountLD The amount in local decimals.\n /// @return amountLD The amount after removing dust.\n /// @dev Prevents the loss of dust when moving amounts between chains with different decimals.\n /// @dev eg. uint(123) with a conversion rate of 100 becomes uint(100).\n function _removeDust(uint256 _amountLD) internal view virtual returns (uint256 amountLD) {\n return (_amountLD / decimalConversionRate) * decimalConversionRate;\n }\n\n /// @dev Internal function to convert an amount from shared decimals into local decimals.\n /// @param _amountSD The amount in shared decimals.\n /// @return amountLD The amount in local decimals.\n function _toLD(uint64 _amountSD) internal view virtual returns (uint256 amountLD) {\n return _amountSD * decimalConversionRate;\n }\n\n /// @dev Internal function to convert an amount from local decimals into shared decimals.\n /// @param _amountLD The amount in local decimals.\n /// @return amountSD The amount in shared decimals.\n function _toSD(uint256 _amountLD) internal view virtual returns (uint64 amountSD) {\n return uint64(_amountLD / decimalConversionRate);\n }\n\n /// @dev Internal function to mock the amount mutation from a OFT debit() operation.\n /// @param _amountLD The amount to send in local decimals.\n /// @param _minAmountLD The minimum amount to send in local decimals.\n /// @dev _dstEid The destination endpoint ID.\n /// @return amountSentLD The amount sent, in local decimals.\n /// @return amountReceivedLD The amount to be received on the remote chain, in local decimals.\n /// @dev This is where things like fees would be calculated and deducted from the amount to be received on the remote.\n function _debitView(\n uint256 _amountLD,\n uint256 _minAmountLD,\n uint32 /*_dstEid*/\n ) internal view virtual returns (uint256 amountSentLD, uint256 amountReceivedLD) {\n // @dev Remove the dust so nothing is lost on the conversion between chains with different decimals for the token.\n amountSentLD = _removeDust(_amountLD);\n // @dev The amount to send is the same as amount received in the default implementation.\n amountReceivedLD = amountSentLD;\n\n // @dev Check for slippage.\n if (amountReceivedLD < _minAmountLD) {\n revert SlippageExceeded(amountReceivedLD, _minAmountLD);\n }\n }\n\n /// @dev Internal function to perform a debit operation.\n /// @param _from The address to debit.\n /// @param _amountLD The amount to send in local decimals.\n /// @param _minAmountLD The minimum amount to send in local decimals.\n /// @param _dstEid The destination endpoint ID.\n /// @return amountSentLD The amount sent in local decimals.\n /// @return amountReceivedLD The amount received in local decimals on the remote.\n /// @dev Defined here but are intended to be overriden depending on the OFT implementation.\n /// @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD.\n function _debit(\n address _from,\n uint256 _amountLD,\n uint256 _minAmountLD,\n uint32 _dstEid\n ) internal virtual returns (uint256 amountSentLD, uint256 amountReceivedLD);\n\n /// @dev Internal function to perform a credit operation.\n /// @param _to The address to credit.\n /// @param _amountLD The amount to credit in local decimals.\n /// @param _srcEid The source endpoint ID.\n /// @return amountReceivedLD The amount ACTUALLY received in local decimals.\n /// @dev Defined here but are intended to be overriden depending on the OFT implementation.\n /// @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD.\n\n function _credit(\n address _to,\n uint256 _amountLD,\n uint32 _srcEid\n ) internal virtual returns (uint256 amountReceivedLD);\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/OFTAdapterForSand.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport {SendParam, OFTReceipt, MessagingReceipt, MessagingFee} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol\";\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport {Context} from \"@openzeppelin/contracts/utils/Context.sol\";\nimport {OFTAdapter} from \"./oft/OFTAdapter.sol\";\nimport {WithAdmin} from \"./sand/WithAdmin.sol\";\nimport {ERC2771Handler} from \"./sand/ERC2771Handler.sol\";\n\n/// @title OFTAdapterForSand\n/// @author The Sandbox\n/// @dev contract to be used with non-upgradable SAND contract\ncontract OFTAdapterForSand is OFTAdapter, WithAdmin, ERC2771Handler {\n bool internal _enabled;\n\n /// @notice Emitted when the enabled state changes\n /// @param enabled The new enabled state\n event Enabled(bool enabled);\n\n /// @notice Custom error thrown when the send function is called while disabled\n error SendFunctionDisabled();\n\n /// @param sandToken SAND token address on the same network as the OFT Adapter\n /// @param layerZeroEndpoint local endpoint address\n /// @param owner owner used as a delegate in LayerZero Endpoint\n /// @param trustedForwarder trusted forwarder address\n constructor(\n address sandToken,\n address layerZeroEndpoint,\n address owner,\n address trustedForwarder,\n address admin\n ) OFTAdapter(sandToken, layerZeroEndpoint, owner) Ownable(owner) {\n __ERC2771Handler_initialize(trustedForwarder);\n _changeAdmin(admin);\n _enable(true);\n }\n\n /// @notice Change the address of the trusted forwarder for meta-TX.\n /// @param trustedForwarder The new trustedForwarder.\n function setTrustedForwarder(address trustedForwarder) external onlyOwner {\n _trustedForwarder = trustedForwarder;\n }\n\n function enable(bool enabled) external onlyAdmin {\n _enable(enabled);\n }\n\n function getEnabled() external view returns (bool) {\n return _enabled;\n }\n\n function send(\n SendParam calldata _sendParam,\n MessagingFee calldata _fee,\n address _refundAddress\n ) public payable virtual override returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) {\n if (!_enabled) {\n revert SendFunctionDisabled();\n }\n\n super.send(_sendParam, _fee, _refundAddress);\n }\n\n function _enable(bool enabled) internal {\n _enabled = enabled;\n emit Enabled(_enabled);\n }\n\n function _msgSender() internal view override(ERC2771Handler, Context) returns (address sender) {\n return ERC2771Handler._msgSender();\n }\n\n function _msgData() internal view override(ERC2771Handler, Context) returns (bytes calldata) {\n return ERC2771Handler._msgData();\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport {SendParam, OFTReceipt, MessagingReceipt, MessagingFee} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol\";\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport {Context} from \"@openzeppelin/contracts/utils/Context.sol\";\nimport {OFTCore} from \"./oft/OFTCore.sol\";\nimport {ERC2771Handler} from \"./sand/ERC2771Handler.sol\";\nimport {SandBaseToken} from \"./sand/SandBaseToken.sol\";\n\n/// @title OFTSand\n/// @author The Sandbox\n/// @dev OFTSand is a contract that combines SandBaseToken, ERC2771Handler, and OFTCore functionalities.\n/// @dev It provides a token contract implementation of Sand token with LayerZero compatibility.\ncontract OFTSand is SandBaseToken, ERC2771Handler, OFTCore {\n bool internal _enabled;\n\n /// @notice Emitted when the enabled state changes\n /// @param enabled The new enabled state\n event Enabled(bool enabled);\n\n /// @notice Custom error thrown when the send function is called while disabled\n error SendFunctionDisabled();\n\n constructor(\n address trustedForwarder,\n address sandAdmin,\n address executionAdmin,\n address layerZeroEndpoint,\n address owner\n ) SandBaseToken(sandAdmin, executionAdmin, address(0), 0) OFTCore(18, layerZeroEndpoint, owner) Ownable(owner) {\n __ERC2771Handler_initialize(trustedForwarder);\n _enable(true);\n }\n\n /// @notice Change the address of the trusted forwarder for meta-TX.\n /// @param trustedForwarder The new trustedForwarder.\n function setTrustedForwarder(address trustedForwarder) external onlyOwner {\n _trustedForwarder = trustedForwarder;\n }\n\n function enable(bool enabled) external onlyAdmin {\n _enable(enabled);\n }\n\n function getEnabled() external view returns (bool) {\n return _enabled;\n }\n\n /// @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\n /// @return requiresApproval Needs approval of the underlying token implementation.\n /// @dev In the case of OFT where the contract IS the token, approval is NOT required.\n function approvalRequired() external pure virtual returns (bool) {\n return false;\n }\n\n /// @dev Retrieves the address of the underlying ERC20 implementation.\n /// @return The address of the OFT token.\n /// @dev In the case of OFT, address(this) and erc20 are the same contract.\n function token() external view returns (address) {\n return address(this);\n }\n\n function send(\n SendParam calldata _sendParam,\n MessagingFee calldata _fee,\n address _refundAddress\n ) public payable virtual override returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) {\n if (!_enabled) {\n revert SendFunctionDisabled();\n }\n\n super.send(_sendParam, _fee, _refundAddress);\n }\n\n function _enable(bool enabled) internal {\n _enabled = enabled;\n emit Enabled(_enabled);\n }\n\n /// @dev Burns tokens from the sender's specified balance.\n /// @param _from The address to debit the tokens from.\n /// @param _amountLD The amount of tokens to send in local decimals.\n /// @param _minAmountLD The minimum amount to send in local decimals.\n /// @param _dstEid The destination chain ID.\n /// @return amountSentLD The amount sent in local decimals.\n /// @return amountReceivedLD The amount received in local decimals on the remote.\n function _debit(\n address _from,\n uint256 _amountLD,\n uint256 _minAmountLD,\n uint32 _dstEid\n ) internal virtual override returns (uint256 amountSentLD, uint256 amountReceivedLD) {\n (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid);\n\n // @dev In NON-default OFT, amountSentLD could be 100, with a 10% fee, the amountReceivedLD amount is 90,\n // therefore amountSentLD CAN differ from amountReceivedLD.\n\n // @dev Default OFT burns on src.\n _burn(_from, amountSentLD);\n }\n\n /// @dev Credits tokens to the specified address.\n /// @param _to The address to credit the tokens to.\n /// @param _amountLD The amount of tokens to credit in local decimals.\n /// @dev _srcEid The source chain ID.\n /// @return amountReceivedLD The amount of tokens ACTUALLY received in local decimals.\n function _credit(\n address _to,\n uint256 _amountLD,\n uint32 /*_srcEid*/\n ) internal virtual override returns (uint256 amountReceivedLD) {\n // @dev Default OFT mints on dst.\n _mint(_to, _amountLD);\n // @dev In the case of NON-default OFT, the _amountLD MIGHT not be == amountReceivedLD.\n return _amountLD;\n }\n\n function _msgSender() internal view override(ERC2771Handler, Context) returns (address sender) {\n return ERC2771Handler._msgSender();\n }\n\n function _msgData() internal view override(ERC2771Handler, Context) returns (bytes calldata) {\n return ERC2771Handler._msgData();\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/ERC20BaseToken.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport {Context} from \"@openzeppelin/contracts/utils/Context.sol\";\nimport {IERC20Errors} from \"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\";\nimport {ERC20Internal} from \"./ERC20Internal.sol\";\nimport {IErrors} from \"../interfaces/IErrors.sol\";\nimport {IERC20, IERC20Extended} from \"../interfaces/IERC20Extended.sol\";\nimport {WithSuperOperators} from \"./WithSuperOperators.sol\";\n\nabstract contract ERC20BaseToken is\n IErrors,\n WithSuperOperators,\n IERC20,\n IERC20Extended,\n IERC20Errors,\n ERC20Internal,\n Context\n{\n string internal _name;\n string internal _symbol;\n address internal immutable _operator;\n uint256 internal _totalSupply;\n mapping(address => uint256) internal _balances;\n mapping(address => mapping(address => uint256)) internal _allowances;\n\n constructor(string memory tokenName, string memory tokenSymbol, address admin, address operator) {\n _name = tokenName;\n _symbol = tokenSymbol;\n _admin = admin;\n _operator = operator;\n }\n\n /// @notice Transfer `amount` tokens to `to`.\n /// @param to The recipient address of the tokens being transfered.\n /// @param amount The number of tokens being transfered.\n /// @return success Whether or not the transfer succeeded.\n function transfer(address to, uint256 amount) external override returns (bool success) {\n _transfer(_msgSender(), to, amount);\n return true;\n }\n\n /// @notice Transfer `amount` tokens from `from` to `to`.\n /// @param from The origin address of the tokens being transferred.\n /// @param to The recipient address of the tokensbeing transfered.\n /// @param amount The number of tokens transfered.\n /// @return success Whether or not the transfer succeeded.\n function transferFrom(address from, address to, uint256 amount) external override returns (bool success) {\n if (_msgSender() != from && !_superOperators[_msgSender()] && _msgSender() != _operator) {\n uint256 currentAllowance = _allowances[from][_msgSender()];\n if (currentAllowance != ~uint256(0)) {\n // save gas when allowance is maximal by not reducing it (see https://github.com/ethereum/EIPs/issues/717)\n if (currentAllowance < amount) {\n revert ERC20InsufficientAllowance(_msgSender(), currentAllowance, amount);\n }\n _allowances[from][_msgSender()] = currentAllowance - amount;\n }\n }\n _transfer(from, to, amount);\n return true;\n }\n\n /// @notice Burn `amount` tokens.\n /// @param amount The number of tokens to burn.\n function burn(uint256 amount) external override {\n _burn(_msgSender(), amount);\n }\n\n /// @notice Burn `amount` tokens from `owner`.\n /// @param from The address whose token to burn.\n /// @param amount The number of tokens to burn.\n function burnFor(address from, uint256 amount) external override {\n _burn(from, amount);\n }\n\n /// @notice Approve `spender` to transfer `amount` tokens.\n /// @param spender The address to be given rights to transfer.\n /// @param amount The number of tokens allowed.\n /// @return success Whether or not the call succeeded.\n function approve(address spender, uint256 amount) external override returns (bool success) {\n _approveFor(_msgSender(), spender, amount);\n return true;\n }\n\n /// @notice Get the name of the token collection.\n /// @return The name of the token collection.\n function name() external view virtual returns (string memory) {\n //added virtual\n return _name;\n }\n\n /// @notice Get the symbol for the token collection.\n /// @return The symbol of the token collection.\n function symbol() external view virtual returns (string memory) {\n //added virtual\n return _symbol;\n }\n\n /// @notice Get the total number of tokens in existence.\n /// @return The total number of tokens in existence.\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n\n /// @notice Get the balance of `owner`.\n /// @param owner The address to query the balance of.\n /// @return The amount owned by `owner`.\n function balanceOf(address owner) external view override returns (uint256) {\n return _balances[owner];\n }\n\n /// @notice Get the allowance of `spender` for `owner`'s tokens.\n /// @param owner The address whose token is allowed.\n /// @param spender The address allowed to transfer.\n /// @return remaining The amount of token `spender` is allowed to transfer on behalf of `owner`.\n function allowance(address owner, address spender) external view override returns (uint256 remaining) {\n return _allowances[owner][spender];\n }\n\n /// @notice Get the number of decimals for the token collection.\n /// @return The number of decimals.\n function decimals() external pure virtual returns (uint8) {\n return uint8(18);\n }\n\n /// @notice Approve `spender` to transfer `amount` tokens from `owner`.\n /// @param owner The address whose token is allowed.\n /// @param spender The address to be given rights to transfer.\n /// @param amount The number of tokens allowed.\n /// @return success Whether or not the call succeeded.\n function approveFor(address owner, address spender, uint256 amount) public override returns (bool success) {\n if (!(_msgSender() == owner || _superOperators[_msgSender()] || _msgSender() == _operator)) {\n revert NotAuthorized();\n }\n _approveFor(owner, spender, amount);\n return true;\n }\n\n /// @notice Increase the allowance for the spender if needed\n /// @param owner The address of the owner of the tokens\n /// @param spender The address wanting to spend tokens\n /// @param amountNeeded The amount requested to spend\n /// @return success Whether or not the call succeeded.\n function addAllowanceIfNeeded(address owner, address spender, uint256 amountNeeded) public returns (bool success) {\n if (!(_msgSender() == owner || _superOperators[_msgSender()] || _msgSender() == _operator)) {\n revert InvalidSender();\n }\n _addAllowanceIfNeeded(owner, spender, amountNeeded);\n return true;\n }\n\n /// @dev See addAllowanceIfNeeded.\n function _addAllowanceIfNeeded(\n address owner,\n address spender,\n uint256 amountNeeded /*(ERC20Internal, ERC20ExecuteExtension, ERC20BasicApproveExtension)*/\n ) internal virtual override {\n if (amountNeeded > 0 && !isSuperOperator(spender) && spender != _operator) {\n uint256 currentAllowance = _allowances[owner][spender];\n if (currentAllowance < amountNeeded) {\n _approveFor(owner, spender, amountNeeded);\n }\n }\n }\n\n /// @dev See approveFor.\n function _approveFor(\n address owner,\n address spender,\n uint256 amount /*(ERC20BasicApproveExtension, ERC20Internal)*/\n ) internal virtual override {\n if (owner == address(0) || spender == address(0)) {\n revert InvalidOwnerOrSpender();\n }\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /// @dev See transfer.\n function _transfer(\n address from,\n address to,\n uint256 amount /*(ERC20Internal, ERC20ExecuteExtension)*/\n ) internal virtual override {\n if (to == address(0) || to == address(this)) {\n revert ERC20InvalidReceiver(to);\n }\n uint256 currentBalance = _balances[from];\n if (currentBalance < amount) {\n revert ERC20InsufficientBalance(from, currentBalance, amount);\n }\n _balances[from] = currentBalance - amount;\n _balances[to] += amount;\n emit Transfer(from, to, amount);\n }\n\n /// @dev Mint tokens for a recipient.\n /// @param to The recipient address.\n /// @param amount The number of token to mint.\n function _mint(address to, uint256 amount) internal {\n if (to == address(0)) {\n revert ERC20InvalidReceiver(to);\n }\n if (amount == 0) {\n revert InvalidAmount();\n }\n uint256 currentTotalSupply = _totalSupply;\n uint256 newTotalSupply = currentTotalSupply + amount;\n if (newTotalSupply <= currentTotalSupply) {\n revert Overflow();\n }\n _totalSupply = newTotalSupply;\n _balances[to] += amount;\n emit Transfer(address(0), to, amount);\n }\n\n /// @dev Burn tokens from an address.\n /// @param from The address whose tokens to burn.\n /// @param amount The number of token to burn.\n function _burn(address from, uint256 amount) internal {\n if (amount == 0) {\n revert InvalidAmount();\n }\n if (_msgSender() != from && !_superOperators[_msgSender()] && _msgSender() != _operator) {\n uint256 currentAllowance = _allowances[from][_msgSender()];\n if (currentAllowance != ~uint256(0)) {\n // save gas when allowance is maximal by not reducing it (see https://github.com/ethereum/EIPs/issues/717)\n if (currentAllowance < amount) {\n revert ERC20InsufficientAllowance(_msgSender(), currentAllowance, amount);\n }\n _allowances[from][_msgSender()] = currentAllowance - amount;\n }\n }\n\n uint256 currentBalance = _balances[from];\n if (currentBalance < amount) {\n revert ERC20InsufficientBalance(from, currentBalance, amount);\n }\n _balances[from] = currentBalance - amount;\n _totalSupply -= amount;\n emit Transfer(from, address(0), amount);\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/ERC20BasicApproveExtension.sol": { + "content": "//SPDX-License-Identifier: MIT\n\npragma solidity 0.8.23;\n\nimport {Context} from \"@openzeppelin/contracts/utils/Context.sol\";\nimport {ERC20Internal} from \"./ERC20Internal.sol\";\nimport {IErrors} from \"../interfaces/IErrors.sol\";\nimport {BytesUtil} from \"../libraries/BytesUtil.sol\";\n\nabstract contract ERC20BasicApproveExtension is IErrors, ERC20Internal, Context {\n /// @notice Approve `target` to spend `amount` and call it with data.\n /// @param target The address to be given rights to transfer and destination of the call.\n /// @param amount The number of tokens allowed.\n /// @param data The bytes for the call.\n /// @return The data of the call.\n function approveAndCall(\n address target,\n uint256 amount,\n bytes calldata data\n ) external payable returns (bytes memory) {\n if (!BytesUtil.doFirstParamEqualsAddress(data, _msgSender())) {\n revert FirstParamNotSender();\n }\n\n _approveFor(_msgSender(), target, amount);\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returnData) = target.call{value: msg.value}(data);\n if (!success) {\n revert CallFailed(string(returnData));\n }\n return returnData;\n }\n\n /// @notice Temporarily approve `target` to spend `amount` and call it with data.\n /// Previous approvals remains unchanged.\n /// @param target The destination of the call, allowed to spend the amount specified\n /// @param amount The number of tokens allowed to spend.\n /// @param data The bytes for the call.\n /// @return The data of the call.\n function paidCall(address target, uint256 amount, bytes calldata data) external payable returns (bytes memory) {\n if (!BytesUtil.doFirstParamEqualsAddress(data, _msgSender())) {\n revert FirstParamNotSender();\n }\n\n if (amount > 0) {\n _addAllowanceIfNeeded(_msgSender(), target, amount);\n }\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returnData) = target.call{value: msg.value}(data);\n if (!success) {\n revert CallFailed(string(returnData));\n }\n\n return returnData;\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/ERC20Internal.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nabstract contract ERC20Internal {\n function _approveFor(address owner, address target, uint256 amount) internal virtual;\n\n function _addAllowanceIfNeeded(address owner, address spender, uint256 amountNeeded) internal virtual;\n\n function _transfer(address from, address to, uint256 amount) internal virtual;\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/ERC2771Handler.sol": { + "content": "// SPDX-License-Identifier: MIT\n// solhint-disable-next-line compiler-version\npragma solidity 0.8.23;\n\n/// @title ERC2771Handler\n/// @author The Sandbox\n/// @notice Handle meta-transactions\n/// @dev minimal ERC2771 handler to keep bytecode-size down\n/// based on: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.6.0/contracts/metatx/ERC2771Context.sol\n/// with an initializer for proxies and a mutable forwarder\nabstract contract ERC2771Handler {\n address internal _trustedForwarder;\n\n event TrustedForwarderSet(address indexed newForwarder);\n\n /// @dev Initializes the contract\n /// @param forwarder trusted forwarder address\n function __ERC2771Handler_initialize(address forwarder) internal {\n _trustedForwarder = forwarder;\n emit TrustedForwarderSet(_trustedForwarder);\n }\n\n /// @notice Checks if an address is a trusted forwarder\n /// @param forwarder address to check\n /// @return is trusted\n function isTrustedForwarder(address forwarder) public view returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n /// @notice Get the current trusted forwarder\n /// @return trustedForwarder address of the trusted forwarder\n function getTrustedForwarder() external view returns (address) {\n return _trustedForwarder;\n }\n\n /// @dev if the call comes from the trusted forwarder, it gets the real sender by checking the encoded address in the data\n /// @return sender address of the real sender\n function _msgSender() internal view virtual returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return msg.sender;\n }\n }\n\n /// @dev if the call comes from the trusted forwarder, it substracts the sender address from `msg.data` to get the real `msg.data`\n /// @return the real `msg.data`\n function _msgData() internal view virtual returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return msg.data;\n }\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/SandBaseToken.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.23;\n\nimport {ERC20BasicApproveExtension} from \"./ERC20BasicApproveExtension.sol\";\nimport {ERC20BaseToken} from \"./ERC20BaseToken.sol\";\n\ncontract SandBaseToken is ERC20BaseToken, ERC20BasicApproveExtension {\n constructor(\n address sandAdmin,\n address executionAdmin,\n address beneficiary,\n uint256 amount\n ) ERC20BaseToken(\"SAND\", \"SAND\", sandAdmin, executionAdmin) {\n _changeAdmin(sandAdmin);\n if (beneficiary != address(0)) {\n uint256 initialSupply = amount * (1 ether);\n _mint(beneficiary, initialSupply);\n }\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/WithAdmin.sol": { + "content": "//SPDX-License-Identifier: MIT\n// solhint-disable-next-line compiler-version\npragma solidity 0.8.23;\n\nimport {IErrors} from \"../interfaces/IErrors.sol\";\n\ncontract WithAdmin is IErrors {\n address internal _admin;\n\n /// @dev Emits when the contract administrator is changed.\n /// @param oldAdmin The address of the previous administrator.\n /// @param newAdmin The address of the new administrator.\n event AdminChanged(address indexed oldAdmin, address indexed newAdmin);\n\n modifier onlyAdmin() {\n if (msg.sender != _admin) {\n revert OnlyAdmin();\n }\n _;\n }\n\n /// @dev Get the current administrator of this contract.\n /// @return The current administrator of this contract.\n function getAdmin() external view returns (address) {\n return _admin;\n }\n\n /// @dev Change the administrator to be `newAdmin`.\n /// @param newAdmin The address of the new administrator.\n function changeAdmin(address newAdmin) external onlyAdmin {\n _changeAdmin(newAdmin);\n }\n\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_admin, newAdmin);\n _admin = newAdmin;\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/WithSuperOperators.sol": { + "content": "//SPDX-License-Identifier: MIT\n// solhint-disable-next-line compiler-version\npragma solidity 0.8.23;\n\nimport {IErrors} from \"../interfaces/IErrors.sol\";\nimport {WithAdmin} from \"./WithAdmin.sol\";\n\ncontract WithSuperOperators is IErrors, WithAdmin {\n mapping(address => bool) internal _superOperators;\n\n event SuperOperator(address indexed superOperator, bool indexed enabled);\n\n /// @notice Enable or disable the ability of `superOperator` to transfer tokens of all (superOperator rights).\n /// @param superOperator address that will be given/removed superOperator right.\n /// @param enabled set whether the superOperator is enabled or disabled.\n function setSuperOperator(address superOperator, bool enabled) external onlyAdmin {\n _superOperators[superOperator] = enabled;\n emit SuperOperator(superOperator, enabled);\n }\n\n /// @notice check whether address `who` is given superOperator rights.\n /// @param who The address to query.\n /// @return whether the address has superOperator rights.\n function isSuperOperator(address who) public view returns (bool) {\n return _superOperators[who];\n }\n}\n" + }, + "solidity-bytes-utils/contracts/BytesLib.sol": { + "content": "// SPDX-License-Identifier: Unlicense\n/*\n * @title Solidity Bytes Arrays Utils\n * @author Gonçalo Sá \n *\n * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.\n * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.\n */\npragma solidity >=0.8.0 <0.9.0;\n\n\nlibrary BytesLib {\n function concat(\n bytes memory _preBytes,\n bytes memory _postBytes\n )\n internal\n pure\n returns (bytes memory)\n {\n bytes memory tempBytes;\n\n assembly {\n // Get a location of some free memory and store it in tempBytes as\n // Solidity does for memory variables.\n tempBytes := mload(0x40)\n\n // Store the length of the first bytes array at the beginning of\n // the memory for tempBytes.\n let length := mload(_preBytes)\n mstore(tempBytes, length)\n\n // Maintain a memory counter for the current write location in the\n // temp bytes array by adding the 32 bytes for the array length to\n // the starting location.\n let mc := add(tempBytes, 0x20)\n // Stop copying when the memory counter reaches the length of the\n // first bytes array.\n let end := add(mc, length)\n\n for {\n // Initialize a copy counter to the start of the _preBytes data,\n // 32 bytes into its memory.\n let cc := add(_preBytes, 0x20)\n } lt(mc, end) {\n // Increase both counters by 32 bytes each iteration.\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n // Write the _preBytes data into the tempBytes memory 32 bytes\n // at a time.\n mstore(mc, mload(cc))\n }\n\n // Add the length of _postBytes to the current length of tempBytes\n // and store it as the new length in the first 32 bytes of the\n // tempBytes memory.\n length := mload(_postBytes)\n mstore(tempBytes, add(length, mload(tempBytes)))\n\n // Move the memory counter back from a multiple of 0x20 to the\n // actual end of the _preBytes data.\n mc := end\n // Stop copying when the memory counter reaches the new combined\n // length of the arrays.\n end := add(mc, length)\n\n for {\n let cc := add(_postBytes, 0x20)\n } lt(mc, end) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n mstore(mc, mload(cc))\n }\n\n // Update the free-memory pointer by padding our last write location\n // to 32 bytes: add 31 bytes to the end of tempBytes to move to the\n // next 32 byte block, then round down to the nearest multiple of\n // 32. If the sum of the length of the two arrays is zero then add\n // one before rounding down to leave a blank 32 bytes (the length block with 0).\n mstore(0x40, and(\n add(add(end, iszero(add(length, mload(_preBytes)))), 31),\n not(31) // Round down to the nearest 32 bytes.\n ))\n }\n\n return tempBytes;\n }\n\n function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {\n assembly {\n // Read the first 32 bytes of _preBytes storage, which is the length\n // of the array. (We don't need to use the offset into the slot\n // because arrays use the entire slot.)\n let fslot := sload(_preBytes.slot)\n // Arrays of 31 bytes or less have an even value in their slot,\n // while longer arrays have an odd value. The actual length is\n // the slot divided by two for odd values, and the lowest order\n // byte divided by two for even values.\n // If the slot is even, bitwise and the slot with 255 and divide by\n // two to get the length. If the slot is odd, bitwise and the slot\n // with -1 and divide by two.\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\n let mlength := mload(_postBytes)\n let newlength := add(slength, mlength)\n // slength can contain both the length and contents of the array\n // if length < 32 bytes so let's prepare for that\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\n switch add(lt(slength, 32), lt(newlength, 32))\n case 2 {\n // Since the new array still fits in the slot, we just need to\n // update the contents of the slot.\n // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length\n sstore(\n _preBytes.slot,\n // all the modifications to the slot are inside this\n // next block\n add(\n // we can just add to the slot contents because the\n // bytes we want to change are the LSBs\n fslot,\n add(\n mul(\n div(\n // load the bytes from memory\n mload(add(_postBytes, 0x20)),\n // zero all bytes to the right\n exp(0x100, sub(32, mlength))\n ),\n // and now shift left the number of bytes to\n // leave space for the length in the slot\n exp(0x100, sub(32, newlength))\n ),\n // increase length by the double of the memory\n // bytes length\n mul(mlength, 2)\n )\n )\n )\n }\n case 1 {\n // The stored value fits in the slot, but the combined value\n // will exceed it.\n // get the keccak hash to get the contents of the array\n mstore(0x0, _preBytes.slot)\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\n\n // save new length\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\n\n // The contents of the _postBytes array start 32 bytes into\n // the structure. Our first read should obtain the `submod`\n // bytes that can fit into the unused space in the last word\n // of the stored array. To get this, we read 32 bytes starting\n // from `submod`, so the data we read overlaps with the array\n // contents by `submod` bytes. Masking the lowest-order\n // `submod` bytes allows us to add that value directly to the\n // stored value.\n\n let submod := sub(32, slength)\n let mc := add(_postBytes, submod)\n let end := add(_postBytes, mlength)\n let mask := sub(exp(0x100, submod), 1)\n\n sstore(\n sc,\n add(\n and(\n fslot,\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\n ),\n and(mload(mc), mask)\n )\n )\n\n for {\n mc := add(mc, 0x20)\n sc := add(sc, 1)\n } lt(mc, end) {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } {\n sstore(sc, mload(mc))\n }\n\n mask := exp(0x100, sub(mc, end))\n\n sstore(sc, mul(div(mload(mc), mask), mask))\n }\n default {\n // get the keccak hash to get the contents of the array\n mstore(0x0, _preBytes.slot)\n // Start copying to the last used word of the stored array.\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\n\n // save new length\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\n\n // Copy over the first `submod` bytes of the new data as in\n // case 1 above.\n let slengthmod := mod(slength, 32)\n let mlengthmod := mod(mlength, 32)\n let submod := sub(32, slengthmod)\n let mc := add(_postBytes, submod)\n let end := add(_postBytes, mlength)\n let mask := sub(exp(0x100, submod), 1)\n\n sstore(sc, add(sload(sc), and(mload(mc), mask)))\n\n for {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } lt(mc, end) {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } {\n sstore(sc, mload(mc))\n }\n\n mask := exp(0x100, sub(mc, end))\n\n sstore(sc, mul(div(mload(mc), mask), mask))\n }\n }\n }\n\n function slice(\n bytes memory _bytes,\n uint256 _start,\n uint256 _length\n )\n internal\n pure\n returns (bytes memory)\n {\n require(_length + 31 >= _length, \"slice_overflow\");\n require(_bytes.length >= _start + _length, \"slice_outOfBounds\");\n\n bytes memory tempBytes;\n\n assembly {\n switch iszero(_length)\n case 0 {\n // Get a location of some free memory and store it in tempBytes as\n // Solidity does for memory variables.\n tempBytes := mload(0x40)\n\n // The first word of the slice result is potentially a partial\n // word read from the original array. To read it, we calculate\n // the length of that partial word and start copying that many\n // bytes into the array. The first word we copy will start with\n // data we don't care about, but the last `lengthmod` bytes will\n // land at the beginning of the contents of the new array. When\n // we're done copying, we overwrite the full first word with\n // the actual length of the slice.\n let lengthmod := and(_length, 31)\n\n // The multiplication in the next line is necessary\n // because when slicing multiples of 32 bytes (lengthmod == 0)\n // the following copy loop was copying the origin's length\n // and then ending prematurely not copying everything it should.\n let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))\n let end := add(mc, _length)\n\n for {\n // The multiplication in the next line has the same exact purpose\n // as the one above.\n let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)\n } lt(mc, end) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n mstore(mc, mload(cc))\n }\n\n mstore(tempBytes, _length)\n\n //update free-memory pointer\n //allocating the array padded to 32 bytes like the compiler does now\n mstore(0x40, and(add(mc, 31), not(31)))\n }\n //if we want a zero-length slice let's just return a zero-length array\n default {\n tempBytes := mload(0x40)\n //zero out the 32 bytes slice we are about to return\n //we need to do it because Solidity does not garbage collect\n mstore(tempBytes, 0)\n\n mstore(0x40, add(tempBytes, 0x20))\n }\n }\n\n return tempBytes;\n }\n\n function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {\n require(_bytes.length >= _start + 20, \"toAddress_outOfBounds\");\n address tempAddress;\n\n assembly {\n tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\n }\n\n return tempAddress;\n }\n\n function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {\n require(_bytes.length >= _start + 1 , \"toUint8_outOfBounds\");\n uint8 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x1), _start))\n }\n\n return tempUint;\n }\n\n function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) {\n require(_bytes.length >= _start + 2, \"toUint16_outOfBounds\");\n uint16 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x2), _start))\n }\n\n return tempUint;\n }\n\n function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) {\n require(_bytes.length >= _start + 4, \"toUint32_outOfBounds\");\n uint32 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x4), _start))\n }\n\n return tempUint;\n }\n\n function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) {\n require(_bytes.length >= _start + 8, \"toUint64_outOfBounds\");\n uint64 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x8), _start))\n }\n\n return tempUint;\n }\n\n function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) {\n require(_bytes.length >= _start + 12, \"toUint96_outOfBounds\");\n uint96 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0xc), _start))\n }\n\n return tempUint;\n }\n\n function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {\n require(_bytes.length >= _start + 16, \"toUint128_outOfBounds\");\n uint128 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x10), _start))\n }\n\n return tempUint;\n }\n\n function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {\n require(_bytes.length >= _start + 32, \"toUint256_outOfBounds\");\n uint256 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x20), _start))\n }\n\n return tempUint;\n }\n\n function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) {\n require(_bytes.length >= _start + 32, \"toBytes32_outOfBounds\");\n bytes32 tempBytes32;\n\n assembly {\n tempBytes32 := mload(add(add(_bytes, 0x20), _start))\n }\n\n return tempBytes32;\n }\n\n function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\n bool success = true;\n\n assembly {\n let length := mload(_preBytes)\n\n // if lengths don't match the arrays are not equal\n switch eq(length, mload(_postBytes))\n case 1 {\n // cb is a circuit breaker in the for loop since there's\n // no said feature for inline assembly loops\n // cb = 1 - don't breaker\n // cb = 0 - break\n let cb := 1\n\n let mc := add(_preBytes, 0x20)\n let end := add(mc, length)\n\n for {\n let cc := add(_postBytes, 0x20)\n // the next line is the loop condition:\n // while(uint256(mc < end) + cb == 2)\n } eq(add(lt(mc, end), cb), 2) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n // if any of these checks fails then arrays are not equal\n if iszero(eq(mload(mc), mload(cc))) {\n // unsuccess:\n success := 0\n cb := 0\n }\n }\n }\n default {\n // unsuccess:\n success := 0\n }\n }\n\n return success;\n }\n\n function equal_nonAligned(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\n bool success = true;\n\n assembly {\n let length := mload(_preBytes)\n\n // if lengths don't match the arrays are not equal\n switch eq(length, mload(_postBytes))\n case 1 {\n // cb is a circuit breaker in the for loop since there's\n // no said feature for inline assembly loops\n // cb = 1 - don't breaker\n // cb = 0 - break\n let cb := 1\n\n let endMinusWord := add(_preBytes, length)\n let mc := add(_preBytes, 0x20)\n let cc := add(_postBytes, 0x20)\n\n for {\n // the next line is the loop condition:\n // while(uint256(mc < endWord) + cb == 2)\n } eq(add(lt(mc, endMinusWord), cb), 2) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n // if any of these checks fails then arrays are not equal\n if iszero(eq(mload(mc), mload(cc))) {\n // unsuccess:\n success := 0\n cb := 0\n }\n }\n\n // Only if still successful\n // For <1 word tail bytes\n if gt(success, 0) {\n // Get the remainder of length/32\n // length % 32 = AND(length, 32 - 1)\n let numTailBytes := and(length, 0x1f)\n let mcRem := mload(mc)\n let ccRem := mload(cc)\n for {\n let i := 0\n // the next line is the loop condition:\n // while(uint256(i < numTailBytes) + cb == 2)\n } eq(add(lt(i, numTailBytes), cb), 2) {\n i := add(i, 1)\n } {\n if iszero(eq(byte(i, mcRem), byte(i, ccRem))) {\n // unsuccess:\n success := 0\n cb := 0\n }\n }\n }\n }\n default {\n // unsuccess:\n success := 0\n }\n }\n\n return success;\n }\n\n function equalStorage(\n bytes storage _preBytes,\n bytes memory _postBytes\n )\n internal\n view\n returns (bool)\n {\n bool success = true;\n\n assembly {\n // we know _preBytes_offset is 0\n let fslot := sload(_preBytes.slot)\n // Decode the length of the stored array like in concatStorage().\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\n let mlength := mload(_postBytes)\n\n // if lengths don't match the arrays are not equal\n switch eq(slength, mlength)\n case 1 {\n // slength can contain both the length and contents of the array\n // if length < 32 bytes so let's prepare for that\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\n if iszero(iszero(slength)) {\n switch lt(slength, 32)\n case 1 {\n // blank the last byte which is the length\n fslot := mul(div(fslot, 0x100), 0x100)\n\n if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {\n // unsuccess:\n success := 0\n }\n }\n default {\n // cb is a circuit breaker in the for loop since there's\n // no said feature for inline assembly loops\n // cb = 1 - don't breaker\n // cb = 0 - break\n let cb := 1\n\n // get the keccak hash to get the contents of the array\n mstore(0x0, _preBytes.slot)\n let sc := keccak256(0x0, 0x20)\n\n let mc := add(_postBytes, 0x20)\n let end := add(mc, mlength)\n\n // the next line is the loop condition:\n // while(uint256(mc < end) + cb == 2)\n for {} eq(add(lt(mc, end), cb), 2) {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } {\n if iszero(eq(sload(sc), mload(mc))) {\n // unsuccess:\n success := 0\n cb := 0\n }\n }\n }\n }\n }\n default {\n // unsuccess:\n success := 0\n }\n }\n\n return success;\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 2000 + }, + "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/packages/deploy/deployments/bscMainnet/OFTSand.json b/packages/deploy/deployments/bscMainnet/OFTSand.json new file mode 100644 index 0000000000..21c3dd1460 --- /dev/null +++ b/packages/deploy/deployments/bscMainnet/OFTSand.json @@ -0,0 +1,2950 @@ +{ + "address": "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "trustedForwarder", + "type": "address" + }, + { + "internalType": "address", + "name": "sandAdmin", + "type": "address" + }, + { + "internalType": "address", + "name": "executionAdmin", + "type": "address" + }, + { + "internalType": "address", + "name": "layerZeroEndpoint", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "AddressInsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "message", + "type": "string" + } + ], + "name": "CallFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "allowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientAllowance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "approver", + "type": "address" + } + ], + "name": "ERC20InvalidApprover", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "ERC20InvalidReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ERC20InvalidSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "ERC20InvalidSpender", + "type": "error" + }, + { + "inputs": [], + "name": "FailedInnerCall", + "type": "error" + }, + { + "inputs": [], + "name": "FirstParamNotSender", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDelegate", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidEndpointCall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidLocalDecimals", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "options", + "type": "bytes" + } + ], + "name": "InvalidOptions", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidOwnerOrSpender", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidSender", + "type": "error" + }, + { + "inputs": [], + "name": "LzTokenUnavailable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + } + ], + "name": "NoPeer", + "type": "error" + }, + { + "inputs": [], + "name": "NotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "msgValue", + "type": "uint256" + } + ], + "name": "NotEnoughNative", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyAdmin", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "OnlyEndpoint", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + } + ], + "name": "OnlyPeer", + "type": "error" + }, + { + "inputs": [], + "name": "OnlySelf", + "type": "error" + }, + { + "inputs": [], + "name": "Overflow", + "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": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "inputs": [], + "name": "SendFunctionDisabled", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "result", + "type": "bytes" + } + ], + "name": "SimulationResult", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountLD", + "type": "uint256" + } + ], + "name": "SlippageExceeded", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "Enabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "internalType": "uint16", + "name": "msgType", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "options", + "type": "bytes" + } + ], + "indexed": false, + "internalType": "struct EnforcedOptionParam[]", + "name": "_enforcedOptions", + "type": "tuple[]" + } + ], + "name": "EnforcedOptionSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "inspector", + "type": "address" + } + ], + "name": "MsgInspectorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "indexed": true, + "internalType": "address", + "name": "toAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountReceivedLD", + "type": "uint256" + } + ], + "name": "OFTReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "indexed": true, + "internalType": "address", + "name": "fromAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountSentLD", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountReceivedLD", + "type": "uint256" + } + ], + "name": "OFTSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "peer", + "type": "bytes32" + } + ], + "name": "PeerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "preCrimeAddress", + "type": "address" + } + ], + "name": "PreCrimeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "superOperator", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "SuperOperator", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newForwarder", + "type": "address" + } + ], + "name": "TrustedForwarderSet", + "type": "event" + }, + { + "inputs": [], + "name": "SEND", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "SEND_AND_CALL", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountNeeded", + "type": "uint256" + } + ], + "name": "addAllowanceIfNeeded", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "origin", + "type": "tuple" + } + ], + "name": "allowInitializePath", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "remaining", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approvalRequired", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "approveAndCall", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approveFor", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "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": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnFor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "uint16", + "name": "_msgType", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_extraOptions", + "type": "bytes" + } + ], + "name": "combineOptions", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimalConversionRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "enable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "endpoint", + "outputs": [ + { + "internalType": "contract ILayerZeroEndpointV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "internalType": "uint16", + "name": "msgType", + "type": "uint16" + } + ], + "name": "enforcedOptions", + "outputs": [ + { + "internalType": "bytes", + "name": "enforcedOption", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTrustedForwarder", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_sender", + "type": "address" + } + ], + "name": "isComposeMsgSender", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_peer", + "type": "bytes32" + } + ], + "name": "isPeer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "who", + "type": "address" + } + ], + "name": "isSuperOperator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "isTrustedForwarder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_executor", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "lzReceive", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "origin", + "type": "tuple" + }, + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "address", + "name": "executor", + "type": "address" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "internalType": "struct InboundPacket[]", + "name": "_packets", + "type": "tuple[]" + } + ], + "name": "lzReceiveAndRevert", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_executor", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "lzReceiveSimulate", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "msgInspector", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "nextNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oApp", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oAppVersion", + "outputs": [ + { + "internalType": "uint64", + "name": "senderVersion", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "receiverVersion", + "type": "uint64" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "oftVersion", + "outputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + }, + { + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "paidCall", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + } + ], + "name": "peers", + "outputs": [ + { + "internalType": "bytes32", + "name": "peer", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "preCrime", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "to", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "amountLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountLD", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "extraOptions", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "composeMsg", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "oftCmd", + "type": "bytes" + } + ], + "internalType": "struct SendParam", + "name": "_sendParam", + "type": "tuple" + } + ], + "name": "quoteOFT", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "minAmountLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxAmountLD", + "type": "uint256" + } + ], + "internalType": "struct OFTLimit", + "name": "oftLimit", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "int256", + "name": "feeAmountLD", + "type": "int256" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "internalType": "struct OFTFeeDetail[]", + "name": "oftFeeDetails", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "amountSentLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountReceivedLD", + "type": "uint256" + } + ], + "internalType": "struct OFTReceipt", + "name": "oftReceipt", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "to", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "amountLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountLD", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "extraOptions", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "composeMsg", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "oftCmd", + "type": "bytes" + } + ], + "internalType": "struct SendParam", + "name": "_sendParam", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "_payInLzToken", + "type": "bool" + } + ], + "name": "quoteSend", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lzTokenFee", + "type": "uint256" + } + ], + "internalType": "struct MessagingFee", + "name": "msgFee", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "to", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "amountLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountLD", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "extraOptions", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "composeMsg", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "oftCmd", + "type": "bytes" + } + ], + "internalType": "struct SendParam", + "name": "_sendParam", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lzTokenFee", + "type": "uint256" + } + ], + "internalType": "struct MessagingFee", + "name": "_fee", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_refundAddress", + "type": "address" + } + ], + "name": "send", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lzTokenFee", + "type": "uint256" + } + ], + "internalType": "struct MessagingFee", + "name": "fee", + "type": "tuple" + } + ], + "internalType": "struct MessagingReceipt", + "name": "msgReceipt", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "amountSentLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountReceivedLD", + "type": "uint256" + } + ], + "internalType": "struct OFTReceipt", + "name": "oftReceipt", + "type": "tuple" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "internalType": "uint16", + "name": "msgType", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "options", + "type": "bytes" + } + ], + "internalType": "struct EnforcedOptionParam[]", + "name": "_enforcedOptions", + "type": "tuple[]" + } + ], + "name": "setEnforcedOptions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_msgInspector", + "type": "address" + } + ], + "name": "setMsgInspector", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_peer", + "type": "bytes32" + } + ], + "name": "setPeer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_preCrime", + "type": "address" + } + ], + "name": "setPreCrime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "superOperator", + "type": "address" + }, + { + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "setSuperOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "trustedForwarder", + "type": "address" + } + ], + "name": "setTrustedForwarder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharedDecimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xe2e732c54c0100eb201159cf09f6d0d219ec6d83ce1deda9ce59041acb607fb7", + "receipt": { + "to": null, + "from": "0xCba49d154b4Bb9a9aD7F5Dad396CB9a0a3a62ABc", + "contractAddress": "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF", + "transactionIndex": 19, + "gasUsed": "3971876", + "logsBloom": "0x00000000800000000000012000000000000000000000000000800000001000000000000020000000000008000000000000000002000000000000000200000000020000000000000000000000000000080001000000000000000000000000000000000000020000000000000000000800000000800010001020000000000000400000020000000000000000000000000000000000000000000400000000800000000000000000000000000000000000000000000000000000000000000000000400000000000000200000001000000000000000000400000000000000000020000000080000000000000000040000000000000040010000000000200000000000", + "blockHash": "0xfa1b2666ac8414edcc4a8ad7b2ba90167cb025e0acfd0c3cf9a501a04a48721a", + "transactionHash": "0xe2e732c54c0100eb201159cf09f6d0d219ec6d83ce1deda9ce59041acb607fb7", + "logs": [ + { + "transactionIndex": 19, + "blockNumber": 40897855, + "transactionHash": "0xe2e732c54c0100eb201159cf09f6d0d219ec6d83ce1deda9ce59041acb607fb7", + "address": "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f", + "0x00000000000000000000000047032f58129341b90c83e312ee22d2e74d584b4a", + "0x00000000000000000000000047032f58129341b90c83e312ee22d2e74d584b4a" + ], + "data": "0x", + "logIndex": 32, + "blockHash": "0xfa1b2666ac8414edcc4a8ad7b2ba90167cb025e0acfd0c3cf9a501a04a48721a" + }, + { + "transactionIndex": 19, + "blockNumber": 40897855, + "transactionHash": "0xe2e732c54c0100eb201159cf09f6d0d219ec6d83ce1deda9ce59041acb607fb7", + "address": "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000cba49d154b4bb9a9ad7f5dad396cb9a0a3a62abc" + ], + "data": "0x", + "logIndex": 33, + "blockHash": "0xfa1b2666ac8414edcc4a8ad7b2ba90167cb025e0acfd0c3cf9a501a04a48721a" + }, + { + "transactionIndex": 19, + "blockNumber": 40897855, + "transactionHash": "0xe2e732c54c0100eb201159cf09f6d0d219ec6d83ce1deda9ce59041acb607fb7", + "address": "0x1a44076050125825900e736c501f859c50fE728c", + "topics": [ + "0x6ee10e9ed4d6ce9742703a498707862f4b00f1396a87195eb93267b3d7983981" + ], + "data": "0x000000000000000000000000ac531eb26ca1d21b85126de8fb87e80e09002dcf000000000000000000000000cba49d154b4bb9a9ad7f5dad396cb9a0a3a62abc", + "logIndex": 34, + "blockHash": "0xfa1b2666ac8414edcc4a8ad7b2ba90167cb025e0acfd0c3cf9a501a04a48721a" + }, + { + "transactionIndex": 19, + "blockNumber": 40897855, + "transactionHash": "0xe2e732c54c0100eb201159cf09f6d0d219ec6d83ce1deda9ce59041acb607fb7", + "address": "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF", + "topics": [ + "0xd91237492a9e30cd2faf361fc103998a382ff0ec2b1b07dc1cbebb76ae2f1ea2", + "0x00000000000000000000000086c80a8aa58e0a4fa09a69624c31ab2a6cad56b8" + ], + "data": "0x", + "logIndex": 35, + "blockHash": "0xfa1b2666ac8414edcc4a8ad7b2ba90167cb025e0acfd0c3cf9a501a04a48721a" + }, + { + "transactionIndex": 19, + "blockNumber": 40897855, + "transactionHash": "0xe2e732c54c0100eb201159cf09f6d0d219ec6d83ce1deda9ce59041acb607fb7", + "address": "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF", + "topics": [ + "0x54ca1f89aee2b8d11c89b7813c6aa99caa0f8c55c8eccf8b70c3bb42029fa134" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 36, + "blockHash": "0xfa1b2666ac8414edcc4a8ad7b2ba90167cb025e0acfd0c3cf9a501a04a48721a" + } + ], + "blockNumber": 40897855, + "cumulativeGasUsed": "5208322", + "status": 1, + "byzantium": true + }, + "args": [ + "0x86C80a8aa58e0A4fa09A69624c31Ab2a6CAD56b8", + "0x47032F58129341B90c83E312eE22d2e74D584B4A", + "0x47032F58129341B90c83E312eE22d2e74D584B4A", + "0x1a44076050125825900e736c501f859c50fE728c", + "0xCba49d154b4Bb9a9aD7F5Dad396CB9a0a3a62ABc" + ], + "numDeployments": 1, + "solcInputHash": "4bade374f62f6d78bc3ea2aa3ebdd50f", + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"trustedForwarder\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sandAdmin\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"executionAdmin\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"layerZeroEndpoint\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AddressInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"CallFailed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"allowance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"ERC20InsufficientAllowance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"needed\",\"type\":\"uint256\"}],\"name\":\"ERC20InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"approver\",\"type\":\"address\"}],\"name\":\"ERC20InvalidApprover\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"ERC20InvalidReceiver\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ERC20InvalidSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"ERC20InvalidSpender\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FirstParamNotSender\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDelegate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidEndpointCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidLocalDecimals\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"options\",\"type\":\"bytes\"}],\"name\":\"InvalidOptions\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidOwnerOrSpender\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSender\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LzTokenUnavailable\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"}],\"name\":\"NoPeer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotAuthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"msgValue\",\"type\":\"uint256\"}],\"name\":\"NotEnoughNative\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyAdmin\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"OnlyEndpoint\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"}],\"name\":\"OnlyPeer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlySelf\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Overflow\",\"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\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SendFunctionDisabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"result\",\"type\":\"bytes\"}],\"name\":\"SimulationResult\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minAmountLD\",\"type\":\"uint256\"}],\"name\":\"SlippageExceeded\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"Enabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"msgType\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"options\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct EnforcedOptionParam[]\",\"name\":\"_enforcedOptions\",\"type\":\"tuple[]\"}],\"name\":\"EnforcedOptionSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"inspector\",\"type\":\"address\"}],\"name\":\"MsgInspectorSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"guid\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"srcEid\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountReceivedLD\",\"type\":\"uint256\"}],\"name\":\"OFTReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"guid\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"dstEid\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountSentLD\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountReceivedLD\",\"type\":\"uint256\"}],\"name\":\"OFTSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"peer\",\"type\":\"bytes32\"}],\"name\":\"PeerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"preCrimeAddress\",\"type\":\"address\"}],\"name\":\"PreCrimeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"superOperator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"SuperOperator\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newForwarder\",\"type\":\"address\"}],\"name\":\"TrustedForwarderSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"SEND\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SEND_AND_CALL\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountNeeded\",\"type\":\"uint256\"}],\"name\":\"addAllowanceIfNeeded\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"srcEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"struct Origin\",\"name\":\"origin\",\"type\":\"tuple\"}],\"name\":\"allowInitializePath\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"remaining\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"approvalRequired\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"approveAndCall\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approveFor\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"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\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burnFor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_eid\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_msgType\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_extraOptions\",\"type\":\"bytes\"}],\"name\":\"combineOptions\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimalConversionRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"enable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endpoint\",\"outputs\":[{\"internalType\":\"contract ILayerZeroEndpointV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"msgType\",\"type\":\"uint16\"}],\"name\":\"enforcedOptions\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"enforcedOption\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTrustedForwarder\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"srcEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"struct Origin\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"}],\"name\":\"isComposeMsgSender\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_eid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"_peer\",\"type\":\"bytes32\"}],\"name\":\"isPeer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"who\",\"type\":\"address\"}],\"name\":\"isSuperOperator\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"srcEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"struct Origin\",\"name\":\"_origin\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"_guid\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_message\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_executor\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"lzReceive\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"srcEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"struct Origin\",\"name\":\"origin\",\"type\":\"tuple\"},{\"internalType\":\"uint32\",\"name\":\"dstEid\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"guid\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct InboundPacket[]\",\"name\":\"_packets\",\"type\":\"tuple[]\"}],\"name\":\"lzReceiveAndRevert\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"srcEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"struct Origin\",\"name\":\"_origin\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"_guid\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_message\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_executor\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"lzReceiveSimulate\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"msgInspector\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"nextNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"oApp\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"oAppVersion\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"senderVersion\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"receiverVersion\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"oftVersion\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"},{\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"paidCall\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"}],\"name\":\"peers\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"peer\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"preCrime\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"dstEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"to\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"amountLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minAmountLD\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraOptions\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"composeMsg\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"oftCmd\",\"type\":\"bytes\"}],\"internalType\":\"struct SendParam\",\"name\":\"_sendParam\",\"type\":\"tuple\"}],\"name\":\"quoteOFT\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"minAmountLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxAmountLD\",\"type\":\"uint256\"}],\"internalType\":\"struct OFTLimit\",\"name\":\"oftLimit\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"int256\",\"name\":\"feeAmountLD\",\"type\":\"int256\"},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"}],\"internalType\":\"struct OFTFeeDetail[]\",\"name\":\"oftFeeDetails\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amountSentLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountReceivedLD\",\"type\":\"uint256\"}],\"internalType\":\"struct OFTReceipt\",\"name\":\"oftReceipt\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"dstEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"to\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"amountLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minAmountLD\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraOptions\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"composeMsg\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"oftCmd\",\"type\":\"bytes\"}],\"internalType\":\"struct SendParam\",\"name\":\"_sendParam\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"_payInLzToken\",\"type\":\"bool\"}],\"name\":\"quoteSend\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nativeFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lzTokenFee\",\"type\":\"uint256\"}],\"internalType\":\"struct MessagingFee\",\"name\":\"msgFee\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"dstEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"to\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"amountLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minAmountLD\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraOptions\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"composeMsg\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"oftCmd\",\"type\":\"bytes\"}],\"internalType\":\"struct SendParam\",\"name\":\"_sendParam\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nativeFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lzTokenFee\",\"type\":\"uint256\"}],\"internalType\":\"struct MessagingFee\",\"name\":\"_fee\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"_refundAddress\",\"type\":\"address\"}],\"name\":\"send\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"guid\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nativeFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lzTokenFee\",\"type\":\"uint256\"}],\"internalType\":\"struct MessagingFee\",\"name\":\"fee\",\"type\":\"tuple\"}],\"internalType\":\"struct MessagingReceipt\",\"name\":\"msgReceipt\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amountSentLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountReceivedLD\",\"type\":\"uint256\"}],\"internalType\":\"struct OFTReceipt\",\"name\":\"oftReceipt\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_delegate\",\"type\":\"address\"}],\"name\":\"setDelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"msgType\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"options\",\"type\":\"bytes\"}],\"internalType\":\"struct EnforcedOptionParam[]\",\"name\":\"_enforcedOptions\",\"type\":\"tuple[]\"}],\"name\":\"setEnforcedOptions\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_msgInspector\",\"type\":\"address\"}],\"name\":\"setMsgInspector\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_eid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"_peer\",\"type\":\"bytes32\"}],\"name\":\"setPeer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_preCrime\",\"type\":\"address\"}],\"name\":\"setPreCrime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"superOperator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"setSuperOperator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"trustedForwarder\",\"type\":\"address\"}],\"name\":\"setTrustedForwarder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sharedDecimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"The Sandbox\",\"details\":\"OFTSand is a contract that combines SandBaseToken, ERC2771Handler, and OFTCore functionalities.It provides a token contract implementation of Sand token with LayerZero compatibility.\",\"errors\":{\"AddressEmptyCode(address)\":[{\"details\":\"There's no code at `target` (it is not a contract).\"}],\"AddressInsufficientBalance(address)\":[{\"details\":\"The ETH balance of the account is not enough to perform the operation.\"}],\"CallFailed(string)\":[{\"params\":{\"message\":\"error message returned from the failed call\"}}],\"ERC20InsufficientAllowance(address,uint256,uint256)\":[{\"details\":\"Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\",\"params\":{\"allowance\":\"Amount of tokens a `spender` is allowed to operate with.\",\"needed\":\"Minimum amount required to perform a transfer.\",\"spender\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC20InsufficientBalance(address,uint256,uint256)\":[{\"details\":\"Indicates an error related to the current `balance` of a `sender`. Used in transfers.\",\"params\":{\"balance\":\"Current balance for the interacting account.\",\"needed\":\"Minimum amount required to perform a transfer.\",\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC20InvalidApprover(address)\":[{\"details\":\"Indicates a failure with the `approver` of a token to be approved. Used in approvals.\",\"params\":{\"approver\":\"Address initiating an approval operation.\"}}],\"ERC20InvalidReceiver(address)\":[{\"details\":\"Indicates a failure with the token `receiver`. Used in transfers.\",\"params\":{\"receiver\":\"Address to which tokens are being transferred.\"}}],\"ERC20InvalidSender(address)\":[{\"details\":\"Indicates a failure with the token `sender`. Used in transfers.\",\"params\":{\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC20InvalidSpender(address)\":[{\"details\":\"Indicates a failure with the `spender` to be approved. Used in approvals.\",\"params\":{\"spender\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"FailedInnerCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"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.\"}],\"SafeERC20FailedOperation(address)\":[{\"details\":\"An operation with an ERC20 token failed.\"}]},\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emits when the contract administrator is changed.\",\"params\":{\"newAdmin\":\"The address of the new administrator.\",\"oldAdmin\":\"The address of the previous administrator.\"}},\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Enabled(bool)\":{\"params\":{\"enabled\":\"The new enabled state\"}},\"PreCrimeSet(address)\":{\"details\":\"Emitted when the preCrime contract address is set.\",\"params\":{\"preCrimeAddress\":\"The address of the preCrime contract.\"}},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"addAllowanceIfNeeded(address,address,uint256)\":{\"params\":{\"amountNeeded\":\"The amount requested to spend\",\"owner\":\"The address of the owner of the tokens\",\"spender\":\"The address wanting to spend tokens\"},\"returns\":{\"success\":\"Whether or not the call succeeded.\"}},\"allowInitializePath((uint32,bytes32,uint64))\":{\"details\":\"This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received.This defaults to assuming if a peer has been set, its initialized. Can be overridden by the OApp if there is other logic to determine this.\",\"params\":{\"origin\":\"The origin information containing the source endpoint and sender address.\"},\"returns\":{\"_0\":\"Whether the path has been initialized.\"}},\"allowance(address,address)\":{\"params\":{\"owner\":\"The address whose token is allowed.\",\"spender\":\"The address allowed to transfer.\"},\"returns\":{\"remaining\":\"The amount of token `spender` is allowed to transfer on behalf of `owner`.\"}},\"approvalRequired()\":{\"details\":\"In the case of OFT where the contract IS the token, approval is NOT required.\",\"returns\":{\"_0\":\"requiresApproval Needs approval of the underlying token implementation.\"}},\"approve(address,uint256)\":{\"params\":{\"amount\":\"The number of tokens allowed.\",\"spender\":\"The address to be given rights to transfer.\"},\"returns\":{\"success\":\"Whether or not the call succeeded.\"}},\"approveAndCall(address,uint256,bytes)\":{\"params\":{\"amount\":\"The number of tokens allowed.\",\"data\":\"The bytes for the call.\",\"target\":\"The address to be given rights to transfer and destination of the call.\"},\"returns\":{\"_0\":\"The data of the call.\"}},\"approveFor(address,address,uint256)\":{\"params\":{\"amount\":\"The number of tokens allowed.\",\"owner\":\"The address whose token is allowed.\",\"spender\":\"The address to be given rights to transfer.\"},\"returns\":{\"success\":\"Whether or not the call succeeded.\"}},\"balanceOf(address)\":{\"params\":{\"owner\":\"The address to query the balance of.\"},\"returns\":{\"_0\":\"The amount owned by `owner`.\"}},\"burn(uint256)\":{\"params\":{\"amount\":\"The number of tokens to burn.\"}},\"burnFor(address,uint256)\":{\"params\":{\"amount\":\"The number of tokens to burn.\",\"from\":\"The address whose token to burn.\"}},\"changeAdmin(address)\":{\"details\":\"Change the administrator to be `newAdmin`.\",\"params\":{\"newAdmin\":\"The address of the new administrator.\"}},\"combineOptions(uint32,uint16,bytes)\":{\"details\":\"If there is an enforced lzReceive option: - {gasLimit: 200k, msg.value: 1 ether} AND a caller supplies a lzReceive option: {gasLimit: 100k, msg.value: 0.5 ether} - The resulting options will be {gasLimit: 300k, msg.value: 1.5 ether} when the message is executed on the remote lzReceive() function.This presence of duplicated options is handled off-chain in the verifier/executor.\",\"params\":{\"_eid\":\"The endpoint ID.\",\"_extraOptions\":\"Additional options passed by the caller.\",\"_msgType\":\"The OAPP message type.\"},\"returns\":{\"_0\":\"options The combination of caller specified options AND enforced options.\"}},\"decimals()\":{\"returns\":{\"_0\":\"The number of decimals.\"}},\"getAdmin()\":{\"details\":\"Get the current administrator of this contract.\",\"returns\":{\"_0\":\"The current administrator of this contract.\"}},\"getTrustedForwarder()\":{\"returns\":{\"_0\":\"trustedForwarder address of the trusted forwarder\"}},\"isComposeMsgSender((uint32,bytes32,uint64),bytes,address)\":{\"details\":\"_origin The origin information containing the source endpoint and sender address. - srcEid: The source chain endpoint ID. - sender: The sender address on the src chain. - nonce: The nonce of the message._message The lzReceive payload.Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer.The default sender IS the OAppReceiver implementer.\",\"params\":{\"_sender\":\"The sender address.\"},\"returns\":{\"_0\":\"isSender Is a valid sender.\"}},\"isPeer(uint32,bytes32)\":{\"details\":\"Check if the peer is considered 'trusted' by the OApp.Enables OAppPreCrimeSimulator to check whether a potential Inbound Packet is from a trusted source.\",\"params\":{\"_eid\":\"The endpoint ID to check.\",\"_peer\":\"The peer to check.\"},\"returns\":{\"_0\":\"Whether the peer passed is considered 'trusted' by the OApp.\"}},\"isSuperOperator(address)\":{\"params\":{\"who\":\"The address to query.\"},\"returns\":{\"_0\":\"whether the address has superOperator rights.\"}},\"isTrustedForwarder(address)\":{\"params\":{\"forwarder\":\"address to check\"},\"returns\":{\"_0\":\"is trusted\"}},\"lzReceive((uint32,bytes32,uint64),bytes32,bytes,address,bytes)\":{\"details\":\"Entry point for receiving messages or packets from the endpoint.Entry point for receiving msg/packet from the LayerZero endpoint.\",\"params\":{\"_executor\":\"The address of the executor for the received message.\",\"_extraData\":\"Additional arbitrary data provided by the corresponding executor.\",\"_guid\":\"The unique identifier for the received LayerZero message.\",\"_message\":\"The payload of the received message.\",\"_origin\":\"The origin information containing the source endpoint and sender address. - srcEid: The source chain endpoint ID. - sender: The sender address on the src chain. - nonce: The nonce of the message.\"}},\"lzReceiveAndRevert(((uint32,bytes32,uint64),uint32,address,bytes32,uint256,address,bytes,bytes)[])\":{\"details\":\"Interface for pre-crime simulations. Always reverts at the end with the simulation results.WARNING: MUST revert at the end with the simulation results.Gives the preCrime implementation the ability to mock sending packets to the lzReceive function, WITHOUT actually executing them.\",\"params\":{\"_packets\":\"An array of InboundPacket objects representing received packets to be delivered.\"}},\"lzReceiveSimulate((uint32,bytes32,uint64),bytes32,bytes,address,bytes)\":{\"details\":\"Is effectively an internal function because msg.sender must be address(this). Allows resetting the call stack for 'internal' calls.\",\"params\":{\"_executor\":\"The executor address for the packet.\",\"_extraData\":\"Additional data for the packet.\",\"_guid\":\"The unique identifier of the packet.\",\"_message\":\"The message payload of the packet.\",\"_origin\":\"The origin information containing the source endpoint and sender address. - srcEid: The source chain endpoint ID. - sender: The sender address on the src chain. - nonce: The nonce of the message.\"}},\"name()\":{\"returns\":{\"_0\":\"The name of the token collection.\"}},\"nextNonce(uint32,bytes32)\":{\"details\":\"_srcEid The source endpoint ID._sender The sender address.The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement.Is required by the off-chain executor to determine the OApp expects msg execution is ordered.This is also enforced by the OApp.By default this is NOT enabled. ie. nextNonce is hardcoded to return 0.\",\"returns\":{\"nonce\":\"The next nonce.\"}},\"oApp()\":{\"details\":\"Retrieves the address of the OApp contract.The simulator contract is the base contract for the OApp by default.If the simulator is a separate contract, override this function.\",\"returns\":{\"_0\":\"The address of the OApp contract.\"}},\"oAppVersion()\":{\"returns\":{\"receiverVersion\":\"The version of the OAppReceiver.sol implementation.\",\"senderVersion\":\"The version of the OAppSender.sol implementation.\"}},\"oftVersion()\":{\"details\":\"interfaceId: This specific interface ID is '0x02e49c2c'.version: Indicates a cross-chain compatible msg encoding with other OFTs.If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented. ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\",\"returns\":{\"interfaceId\":\"The interface ID.\",\"version\":\"The version.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"paidCall(address,uint256,bytes)\":{\"params\":{\"amount\":\"The number of tokens allowed to spend.\",\"data\":\"The bytes for the call.\",\"target\":\"The destination of the call, allowed to spend the amount specified\"},\"returns\":{\"_0\":\"The data of the call.\"}},\"quoteOFT((uint32,bytes32,uint256,uint256,bytes,bytes,bytes))\":{\"params\":{\"_sendParam\":\"The parameters for the send operation.\"},\"returns\":{\"oftFeeDetails\":\"The details of OFT fees.\",\"oftLimit\":\"The OFT limit information.\",\"oftReceipt\":\"The OFT receipt information.\"}},\"quoteSend((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),bool)\":{\"details\":\"MessagingFee: LayerZero msg fee - nativeFee: The native fee. - lzTokenFee: The lzToken fee.\",\"params\":{\"_payInLzToken\":\"Flag indicating whether the caller is paying in the LZ token.\",\"_sendParam\":\"The parameters for the send() operation.\"},\"returns\":{\"msgFee\":\"The calculated LayerZero messaging fee from the send() operation.\"}},\"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.\"},\"send((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),(uint256,uint256),address)\":{\"details\":\"Executes the send operation.MessagingReceipt: LayerZero msg receipt - guid: The unique identifier for the sent message. - nonce: The nonce of the sent message. - fee: The LayerZero fee incurred for the message.\",\"params\":{\"_fee\":\"The calculated fee for the send() operation. - nativeFee: The native fee. - lzTokenFee: The lzToken fee.\",\"_refundAddress\":\"The address to receive any excess funds.\",\"_sendParam\":\"The parameters for the send operation.\"},\"returns\":{\"msgReceipt\":\"The receipt for the send operation.\",\"oftReceipt\":\"The OFT receipt information.\"}},\"setDelegate(address)\":{\"details\":\"Only the owner/admin of the OApp can call this function.Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.\",\"params\":{\"_delegate\":\"The address of the delegate to be set.\"}},\"setEnforcedOptions((uint32,uint16,bytes)[])\":{\"details\":\"Sets the enforced options for specific endpoint and message type combinations.Only the owner/admin of the OApp can call this function.Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.These enforced options can vary as the potential options/execution on the remote may differ as per the msgType. eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().\",\"params\":{\"_enforcedOptions\":\"An array of EnforcedOptionParam structures specifying enforced options.\"}},\"setMsgInspector(address)\":{\"details\":\"Sets the message inspector address for the OFT.This is an optional contract that can be used to inspect both 'message' and 'options'.Set it to address(0) to disable it, or set it to a contract address to enable it.\",\"params\":{\"_msgInspector\":\"The address of the message inspector.\"}},\"setPeer(uint32,bytes32)\":{\"details\":\"Only the owner/admin of the OApp can call this function.Indicates that the peer is trusted to send LayerZero messages to this OApp.Set this to bytes32(0) to remove the peer address.Peer is a bytes32 to accommodate non-evm chains.\",\"params\":{\"_eid\":\"The endpoint ID.\",\"_peer\":\"The address of the peer to be associated with the corresponding endpoint.\"}},\"setPreCrime(address)\":{\"details\":\"Sets the preCrime contract address.\",\"params\":{\"_preCrime\":\"The address of the preCrime contract.\"}},\"setSuperOperator(address,bool)\":{\"params\":{\"enabled\":\"set whether the superOperator is enabled or disabled.\",\"superOperator\":\"address that will be given/removed superOperator right.\"}},\"setTrustedForwarder(address)\":{\"params\":{\"trustedForwarder\":\"The new trustedForwarder.\"}},\"sharedDecimals()\":{\"details\":\"Retrieves the shared decimals of the OFT.Sets an implicit cap on the amount of tokens, over uint64.max() will need some sort of outbound cap / totalSupply cap Lowest common decimal denominator between chains. Defaults to 6 decimal places to provide up to 18,446,744,073,709.551615 units (max uint64). For tokens exceeding this totalSupply(), they will need to override the sharedDecimals function with something smaller. ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615\",\"returns\":{\"_0\":\"The shared decimals of the OFT.\"}},\"symbol()\":{\"returns\":{\"_0\":\"The symbol of the token collection.\"}},\"token()\":{\"details\":\"Retrieves the address of the underlying ERC20 implementation.In the case of OFT, address(this) and erc20 are the same contract.\",\"returns\":{\"_0\":\"The address of the OFT token.\"}},\"totalSupply()\":{\"returns\":{\"_0\":\"The total number of tokens in existence.\"}},\"transfer(address,uint256)\":{\"params\":{\"amount\":\"The number of tokens being transfered.\",\"to\":\"The recipient address of the tokens being transfered.\"},\"returns\":{\"success\":\"Whether or not the transfer succeeded.\"}},\"transferFrom(address,address,uint256)\":{\"params\":{\"amount\":\"The number of tokens transfered.\",\"from\":\"The origin address of the tokens being transferred.\",\"to\":\"The recipient address of the tokensbeing transfered.\"},\"returns\":{\"success\":\"Whether or not the transfer succeeded.\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"OFTSand\",\"version\":1},\"userdoc\":{\"errors\":{\"CallFailed(string)\":[{\"notice\":\"Error for failed calls, containing the error message\"}],\"FirstParamNotSender()\":[{\"notice\":\"Error for mismatched first parameter and sender address\"}],\"InvalidAmount()\":[{\"notice\":\"Error for invalid amount\"}],\"InvalidOwnerOrSpender()\":[{\"notice\":\"Error for invalid owner or spender\"}],\"InvalidSender()\":[{\"notice\":\"Error for invalid sender\"}],\"NotAuthorized()\":[{\"notice\":\"Error for unauthorized access\"}],\"OnlyAdmin()\":[{\"notice\":\"Error for admin-only access\"}],\"Overflow()\":[{\"notice\":\"Error for overflow conditions\"}],\"SendFunctionDisabled()\":[{\"notice\":\"Custom error thrown when the send function is called while disabled\"}]},\"events\":{\"Enabled(bool)\":{\"notice\":\"Emitted when the enabled state changes\"}},\"kind\":\"user\",\"methods\":{\"addAllowanceIfNeeded(address,address,uint256)\":{\"notice\":\"Increase the allowance for the spender if needed\"},\"allowInitializePath((uint32,bytes32,uint64))\":{\"notice\":\"Checks if the path initialization is allowed based on the provided origin.\"},\"allowance(address,address)\":{\"notice\":\"Get the allowance of `spender` for `owner`'s tokens.\"},\"approvalRequired()\":{\"notice\":\"Indicates whether the OFT contract requires approval of the 'token()' to send.\"},\"approve(address,uint256)\":{\"notice\":\"Approve `spender` to transfer `amount` tokens.\"},\"approveAndCall(address,uint256,bytes)\":{\"notice\":\"Approve `target` to spend `amount` and call it with data.\"},\"approveFor(address,address,uint256)\":{\"notice\":\"Approve `spender` to transfer `amount` tokens from `owner`.\"},\"balanceOf(address)\":{\"notice\":\"Get the balance of `owner`.\"},\"burn(uint256)\":{\"notice\":\"Burn `amount` tokens.\"},\"burnFor(address,uint256)\":{\"notice\":\"Burn `amount` tokens from `owner`.\"},\"combineOptions(uint32,uint16,bytes)\":{\"notice\":\"Combines options for a given endpoint and message type.\"},\"decimals()\":{\"notice\":\"Get the number of decimals for the token collection.\"},\"endpoint()\":{\"notice\":\"Retrieves the LayerZero endpoint associated with the OApp.\"},\"getTrustedForwarder()\":{\"notice\":\"Get the current trusted forwarder\"},\"isComposeMsgSender((uint32,bytes32,uint64),bytes,address)\":{\"notice\":\"Indicates whether an address is an approved composeMsg sender to the Endpoint.\"},\"isSuperOperator(address)\":{\"notice\":\"check whether address `who` is given superOperator rights.\"},\"isTrustedForwarder(address)\":{\"notice\":\"Checks if an address is a trusted forwarder\"},\"name()\":{\"notice\":\"Get the name of the token collection.\"},\"nextNonce(uint32,bytes32)\":{\"notice\":\"Retrieves the next nonce for a given source endpoint and sender address.\"},\"oAppVersion()\":{\"notice\":\"Retrieves the OApp version information.\"},\"oftVersion()\":{\"notice\":\"Retrieves interfaceID and the version of the OFT.\"},\"paidCall(address,uint256,bytes)\":{\"notice\":\"Temporarily approve `target` to spend `amount` and call it with data. Previous approvals remains unchanged.\"},\"peers(uint32)\":{\"notice\":\"Retrieves the peer (OApp) associated with a corresponding endpoint.\"},\"quoteOFT((uint32,bytes32,uint256,uint256,bytes,bytes,bytes))\":{\"notice\":\"Provides a quote for OFT-related operations.\"},\"quoteSend((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),bool)\":{\"notice\":\"Provides a quote for the send() operation.\"},\"setDelegate(address)\":{\"notice\":\"Sets the delegate address for the OApp.\"},\"setPeer(uint32,bytes32)\":{\"notice\":\"Sets the peer address (OApp instance) for a corresponding endpoint.\"},\"setSuperOperator(address,bool)\":{\"notice\":\"Enable or disable the ability of `superOperator` to transfer tokens of all (superOperator rights).\"},\"setTrustedForwarder(address)\":{\"notice\":\"Change the address of the trusted forwarder for meta-TX.\"},\"symbol()\":{\"notice\":\"Get the symbol for the token collection.\"},\"totalSupply()\":{\"notice\":\"Get the total number of tokens in existence.\"},\"transfer(address,uint256)\":{\"notice\":\"Transfer `amount` tokens to `to`.\"},\"transferFrom(address,address,uint256)\":{\"notice\":\"Transfer `amount` tokens from `from` to `to`.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol\":\"OFTSand\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":2000},\"remappings\":[]},\"sources\":{\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport { IOAppCore, ILayerZeroEndpointV2 } from \\\"./interfaces/IOAppCore.sol\\\";\\n\\n/**\\n * @title OAppCore\\n * @dev Abstract contract implementing the IOAppCore interface with basic OApp configurations.\\n */\\nabstract contract OAppCore is IOAppCore, Ownable {\\n // The LayerZero endpoint associated with the given OApp\\n ILayerZeroEndpointV2 public immutable endpoint;\\n\\n // Mapping to store peers associated with corresponding endpoints\\n mapping(uint32 eid => bytes32 peer) public peers;\\n\\n /**\\n * @dev Constructor to initialize the OAppCore with the provided endpoint and delegate.\\n * @param _endpoint The address of the LOCAL Layer Zero endpoint.\\n * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\\n *\\n * @dev The delegate typically should be set as the owner of the contract.\\n */\\n constructor(address _endpoint, address _delegate) {\\n endpoint = ILayerZeroEndpointV2(_endpoint);\\n\\n if (_delegate == address(0)) revert InvalidDelegate();\\n endpoint.setDelegate(_delegate);\\n }\\n\\n /**\\n * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\\n * @param _eid The endpoint ID.\\n * @param _peer The address of the peer to be associated with the corresponding endpoint.\\n *\\n * @dev Only the owner/admin of the OApp can call this function.\\n * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.\\n * @dev Set this to bytes32(0) to remove the peer address.\\n * @dev Peer is a bytes32 to accommodate non-evm chains.\\n */\\n function setPeer(uint32 _eid, bytes32 _peer) public virtual onlyOwner {\\n _setPeer(_eid, _peer);\\n }\\n\\n /**\\n * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\\n * @param _eid The endpoint ID.\\n * @param _peer The address of the peer to be associated with the corresponding endpoint.\\n *\\n * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.\\n * @dev Set this to bytes32(0) to remove the peer address.\\n * @dev Peer is a bytes32 to accommodate non-evm chains.\\n */\\n function _setPeer(uint32 _eid, bytes32 _peer) internal virtual {\\n peers[_eid] = _peer;\\n emit PeerSet(_eid, _peer);\\n }\\n\\n /**\\n * @notice Internal function to get the peer address associated with a specific endpoint; reverts if NOT set.\\n * ie. the peer is set to bytes32(0).\\n * @param _eid The endpoint ID.\\n * @return peer The address of the peer associated with the specified endpoint.\\n */\\n function _getPeerOrRevert(uint32 _eid) internal view virtual returns (bytes32) {\\n bytes32 peer = peers[_eid];\\n if (peer == bytes32(0)) revert NoPeer(_eid);\\n return peer;\\n }\\n\\n /**\\n * @notice Sets the delegate address for the OApp.\\n * @param _delegate The address of the delegate to be set.\\n *\\n * @dev Only the owner/admin of the OApp can call this function.\\n * @dev Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.\\n */\\n function setDelegate(address _delegate) public onlyOwner {\\n endpoint.setDelegate(_delegate);\\n }\\n}\\n\",\"keccak256\":\"0x13a9c2d1d2c1f086b8624f2e84c4a4702212daae36f701d92bb915b535cbe4cc\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { IOAppReceiver, Origin } from \\\"./interfaces/IOAppReceiver.sol\\\";\\nimport { OAppCore } from \\\"./OAppCore.sol\\\";\\n\\n/**\\n * @title OAppReceiver\\n * @dev Abstract contract implementing the ILayerZeroReceiver interface and extending OAppCore for OApp receivers.\\n */\\nabstract contract OAppReceiver is IOAppReceiver, OAppCore {\\n // Custom error message for when the caller is not the registered endpoint/\\n error OnlyEndpoint(address addr);\\n\\n // @dev The version of the OAppReceiver implementation.\\n // @dev Version is bumped when changes are made to this contract.\\n uint64 internal constant RECEIVER_VERSION = 2;\\n\\n /**\\n * @notice Retrieves the OApp version information.\\n * @return senderVersion The version of the OAppSender.sol contract.\\n * @return receiverVersion The version of the OAppReceiver.sol contract.\\n *\\n * @dev Providing 0 as the default for OAppSender version. Indicates that the OAppSender is not implemented.\\n * ie. this is a RECEIVE only OApp.\\n * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions.\\n */\\n function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\\n return (0, RECEIVER_VERSION);\\n }\\n\\n /**\\n * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint.\\n * @dev _origin The origin information containing the source endpoint and sender address.\\n * - srcEid: The source chain endpoint ID.\\n * - sender: The sender address on the src chain.\\n * - nonce: The nonce of the message.\\n * @dev _message The lzReceive payload.\\n * @param _sender The sender address.\\n * @return isSender Is a valid sender.\\n *\\n * @dev Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer.\\n * @dev The default sender IS the OAppReceiver implementer.\\n */\\n function isComposeMsgSender(\\n Origin calldata /*_origin*/,\\n bytes calldata /*_message*/,\\n address _sender\\n ) public view virtual returns (bool) {\\n return _sender == address(this);\\n }\\n\\n /**\\n * @notice Checks if the path initialization is allowed based on the provided origin.\\n * @param origin The origin information containing the source endpoint and sender address.\\n * @return Whether the path has been initialized.\\n *\\n * @dev This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received.\\n * @dev This defaults to assuming if a peer has been set, its initialized.\\n * Can be overridden by the OApp if there is other logic to determine this.\\n */\\n function allowInitializePath(Origin calldata origin) public view virtual returns (bool) {\\n return peers[origin.srcEid] == origin.sender;\\n }\\n\\n /**\\n * @notice Retrieves the next nonce for a given source endpoint and sender address.\\n * @dev _srcEid The source endpoint ID.\\n * @dev _sender The sender address.\\n * @return nonce The next nonce.\\n *\\n * @dev The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement.\\n * @dev Is required by the off-chain executor to determine the OApp expects msg execution is ordered.\\n * @dev This is also enforced by the OApp.\\n * @dev By default this is NOT enabled. ie. nextNonce is hardcoded to return 0.\\n */\\n function nextNonce(uint32 /*_srcEid*/, bytes32 /*_sender*/) public view virtual returns (uint64 nonce) {\\n return 0;\\n }\\n\\n /**\\n * @dev Entry point for receiving messages or packets from the endpoint.\\n * @param _origin The origin information containing the source endpoint and sender address.\\n * - srcEid: The source chain endpoint ID.\\n * - sender: The sender address on the src chain.\\n * - nonce: The nonce of the message.\\n * @param _guid The unique identifier for the received LayerZero message.\\n * @param _message The payload of the received message.\\n * @param _executor The address of the executor for the received message.\\n * @param _extraData Additional arbitrary data provided by the corresponding executor.\\n *\\n * @dev Entry point for receiving msg/packet from the LayerZero endpoint.\\n */\\n function lzReceive(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address _executor,\\n bytes calldata _extraData\\n ) public payable virtual {\\n // Ensures that only the endpoint can attempt to lzReceive() messages to this OApp.\\n if (address(endpoint) != msg.sender) revert OnlyEndpoint(msg.sender);\\n\\n // Ensure that the sender matches the expected peer for the source endpoint.\\n if (_getPeerOrRevert(_origin.srcEid) != _origin.sender) revert OnlyPeer(_origin.srcEid, _origin.sender);\\n\\n // Call the internal OApp implementation of lzReceive.\\n _lzReceive(_origin, _guid, _message, _executor, _extraData);\\n }\\n\\n /**\\n * @dev Internal function to implement lzReceive logic without needing to copy the basic parameter validation.\\n */\\n function _lzReceive(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address _executor,\\n bytes calldata _extraData\\n ) internal virtual;\\n}\\n\",\"keccak256\":\"0x0174e9f1ec4cefe4b5adc26c392269c699b9ff75965364e5b7264426a462c70b\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppSender.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { SafeERC20, IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport { MessagingParams, MessagingFee, MessagingReceipt } from \\\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\\\";\\nimport { OAppCore } from \\\"./OAppCore.sol\\\";\\n\\n/**\\n * @title OAppSender\\n * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.\\n */\\nabstract contract OAppSender is OAppCore {\\n using SafeERC20 for IERC20;\\n\\n // Custom error messages\\n error NotEnoughNative(uint256 msgValue);\\n error LzTokenUnavailable();\\n\\n // @dev The version of the OAppSender implementation.\\n // @dev Version is bumped when changes are made to this contract.\\n uint64 internal constant SENDER_VERSION = 1;\\n\\n /**\\n * @notice Retrieves the OApp version information.\\n * @return senderVersion The version of the OAppSender.sol contract.\\n * @return receiverVersion The version of the OAppReceiver.sol contract.\\n *\\n * @dev Providing 0 as the default for OAppReceiver version. Indicates that the OAppReceiver is not implemented.\\n * ie. this is a SEND only OApp.\\n * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions\\n */\\n function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\\n return (SENDER_VERSION, 0);\\n }\\n\\n /**\\n * @dev Internal function to interact with the LayerZero EndpointV2.quote() for fee calculation.\\n * @param _dstEid The destination endpoint ID.\\n * @param _message The message payload.\\n * @param _options Additional options for the message.\\n * @param _payInLzToken Flag indicating whether to pay the fee in LZ tokens.\\n * @return fee The calculated MessagingFee for the message.\\n * - nativeFee: The native fee for the message.\\n * - lzTokenFee: The LZ token fee for the message.\\n */\\n function _quote(\\n uint32 _dstEid,\\n bytes memory _message,\\n bytes memory _options,\\n bool _payInLzToken\\n ) internal view virtual returns (MessagingFee memory fee) {\\n return\\n endpoint.quote(\\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken),\\n address(this)\\n );\\n }\\n\\n /**\\n * @dev Internal function to interact with the LayerZero EndpointV2.send() for sending a message.\\n * @param _dstEid The destination endpoint ID.\\n * @param _message The message payload.\\n * @param _options Additional options for the message.\\n * @param _fee The calculated LayerZero fee for the message.\\n * - nativeFee: The native fee.\\n * - lzTokenFee: The lzToken fee.\\n * @param _refundAddress The address to receive any excess fee values sent to the endpoint.\\n * @return receipt The receipt for the sent message.\\n * - guid: The unique identifier for the sent message.\\n * - nonce: The nonce of the sent message.\\n * - fee: The LayerZero fee incurred for the message.\\n */\\n function _lzSend(\\n uint32 _dstEid,\\n bytes memory _message,\\n bytes memory _options,\\n MessagingFee memory _fee,\\n address _refundAddress\\n ) internal virtual returns (MessagingReceipt memory receipt) {\\n // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint.\\n uint256 messageValue = _payNative(_fee.nativeFee);\\n if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);\\n\\n return\\n // solhint-disable-next-line check-send-result\\n endpoint.send{ value: messageValue }(\\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0),\\n _refundAddress\\n );\\n }\\n\\n /**\\n * @dev Internal function to pay the native fee associated with the message.\\n * @param _nativeFee The native fee to be paid.\\n * @return nativeFee The amount of native currency paid.\\n *\\n * @dev If the OApp needs to initiate MULTIPLE LayerZero messages in a single transaction,\\n * this will need to be overridden because msg.value would contain multiple lzFees.\\n * @dev Should be overridden in the event the LayerZero endpoint requires a different native currency.\\n * @dev Some EVMs use an ERC20 as a method for paying transactions/gasFees.\\n * @dev The endpoint is EITHER/OR, ie. it will NOT support both types of native payment at a time.\\n */\\n function _payNative(uint256 _nativeFee) internal virtual returns (uint256 nativeFee) {\\n if (msg.value != _nativeFee) revert NotEnoughNative(msg.value);\\n return _nativeFee;\\n }\\n\\n /**\\n * @dev Internal function to pay the LZ token fee associated with the message.\\n * @param _lzTokenFee The LZ token fee to be paid.\\n *\\n * @dev If the caller is trying to pay in the specified lzToken, then the lzTokenFee is passed to the endpoint.\\n * @dev Any excess sent, is passed back to the specified _refundAddress in the _lzSend().\\n */\\n function _payLzToken(uint256 _lzTokenFee) internal virtual {\\n // @dev Cannot cache the token because it is not immutable in the endpoint.\\n address lzToken = endpoint.lzToken();\\n if (lzToken == address(0)) revert LzTokenUnavailable();\\n\\n // Pay LZ token fee by sending tokens to the endpoint.\\n IERC20(lzToken).safeTransferFrom(msg.sender, address(endpoint), _lzTokenFee);\\n }\\n}\\n\",\"keccak256\":\"0x518cf4adca601923ed4baa6619846a253ea32b8d8775f8bc1faa3dfac7f67c20\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { ILayerZeroEndpointV2 } from \\\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\\\";\\n\\n/**\\n * @title IOAppCore\\n */\\ninterface IOAppCore {\\n // Custom error messages\\n error OnlyPeer(uint32 eid, bytes32 sender);\\n error NoPeer(uint32 eid);\\n error InvalidEndpointCall();\\n error InvalidDelegate();\\n\\n // Event emitted when a peer (OApp) is set for a corresponding endpoint\\n event PeerSet(uint32 eid, bytes32 peer);\\n\\n /**\\n * @notice Retrieves the OApp version information.\\n * @return senderVersion The version of the OAppSender.sol contract.\\n * @return receiverVersion The version of the OAppReceiver.sol contract.\\n */\\n function oAppVersion() external view returns (uint64 senderVersion, uint64 receiverVersion);\\n\\n /**\\n * @notice Retrieves the LayerZero endpoint associated with the OApp.\\n * @return iEndpoint The LayerZero endpoint as an interface.\\n */\\n function endpoint() external view returns (ILayerZeroEndpointV2 iEndpoint);\\n\\n /**\\n * @notice Retrieves the peer (OApp) associated with a corresponding endpoint.\\n * @param _eid The endpoint ID.\\n * @return peer The peer address (OApp instance) associated with the corresponding endpoint.\\n */\\n function peers(uint32 _eid) external view returns (bytes32 peer);\\n\\n /**\\n * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\\n * @param _eid The endpoint ID.\\n * @param _peer The address of the peer to be associated with the corresponding endpoint.\\n */\\n function setPeer(uint32 _eid, bytes32 _peer) external;\\n\\n /**\\n * @notice Sets the delegate address for the OApp Core.\\n * @param _delegate The address of the delegate to be set.\\n */\\n function setDelegate(address _delegate) external;\\n}\\n\",\"keccak256\":\"0x40e49f2de74506e1da5dcaed53a39853f691647f4ceb0fccc8f49a68d3f47c58\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppMsgInspector.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title IOAppMsgInspector\\n * @dev Interface for the OApp Message Inspector, allowing examination of message and options contents.\\n */\\ninterface IOAppMsgInspector {\\n // Custom error message for inspection failure\\n error InspectionFailed(bytes message, bytes options);\\n\\n /**\\n * @notice Allows the inspector to examine LayerZero message contents and optionally throw a revert if invalid.\\n * @param _message The message payload to be inspected.\\n * @param _options Additional options or parameters for inspection.\\n * @return valid A boolean indicating whether the inspection passed (true) or failed (false).\\n *\\n * @dev Optionally done as a revert, OR use the boolean provided to handle the failure.\\n */\\n function inspect(bytes calldata _message, bytes calldata _options) external view returns (bool valid);\\n}\\n\",\"keccak256\":\"0x339654e699043c400cad92de209aa23855ce10211c31cf4114042cc5224d3b7c\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppOptionsType3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Struct representing enforced option parameters.\\n */\\nstruct EnforcedOptionParam {\\n uint32 eid; // Endpoint ID\\n uint16 msgType; // Message Type\\n bytes options; // Additional options\\n}\\n\\n/**\\n * @title IOAppOptionsType3\\n * @dev Interface for the OApp with Type 3 Options, allowing the setting and combining of enforced options.\\n */\\ninterface IOAppOptionsType3 {\\n // Custom error message for invalid options\\n error InvalidOptions(bytes options);\\n\\n // Event emitted when enforced options are set\\n event EnforcedOptionSet(EnforcedOptionParam[] _enforcedOptions);\\n\\n /**\\n * @notice Sets enforced options for specific endpoint and message type combinations.\\n * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\\n */\\n function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) external;\\n\\n /**\\n * @notice Combines options for a given endpoint and message type.\\n * @param _eid The endpoint ID.\\n * @param _msgType The OApp message type.\\n * @param _extraOptions Additional options passed by the caller.\\n * @return options The combination of caller specified options AND enforced options.\\n */\\n function combineOptions(\\n uint32 _eid,\\n uint16 _msgType,\\n bytes calldata _extraOptions\\n ) external view returns (bytes memory options);\\n}\\n\",\"keccak256\":\"0x9fc08a51e9d7c9c710c4eb26f84fe77228305ad7da63fa486ff24ebf2f3bc461\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.20;\\n\\nimport { ILayerZeroReceiver, Origin } from \\\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol\\\";\\n\\ninterface IOAppReceiver is ILayerZeroReceiver {\\n /**\\n * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint.\\n * @param _origin The origin information containing the source endpoint and sender address.\\n * - srcEid: The source chain endpoint ID.\\n * - sender: The sender address on the src chain.\\n * - nonce: The nonce of the message.\\n * @param _message The lzReceive payload.\\n * @param _sender The sender address.\\n * @return isSender Is a valid sender.\\n *\\n * @dev Applications can optionally choose to implement a separate composeMsg sender that is NOT the bridging layer.\\n * @dev The default sender IS the OAppReceiver implementer.\\n */\\n function isComposeMsgSender(\\n Origin calldata _origin,\\n bytes calldata _message,\\n address _sender\\n ) external view returns (bool isSender);\\n}\\n\",\"keccak256\":\"0xd26135185e19b3732746d4a9e2923e896f28dec8664bab161faea2ee26fcdc3d\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OAppOptionsType3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport { IOAppOptionsType3, EnforcedOptionParam } from \\\"../interfaces/IOAppOptionsType3.sol\\\";\\n\\n/**\\n * @title OAppOptionsType3\\n * @dev Abstract contract implementing the IOAppOptionsType3 interface with type 3 options.\\n */\\nabstract contract OAppOptionsType3 is IOAppOptionsType3, Ownable {\\n uint16 internal constant OPTION_TYPE_3 = 3;\\n\\n // @dev The \\\"msgType\\\" should be defined in the child contract.\\n mapping(uint32 eid => mapping(uint16 msgType => bytes enforcedOption)) public enforcedOptions;\\n\\n /**\\n * @dev Sets the enforced options for specific endpoint and message type combinations.\\n * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\\n *\\n * @dev Only the owner/admin of the OApp can call this function.\\n * @dev Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.\\n * @dev These enforced options can vary as the potential options/execution on the remote may differ as per the msgType.\\n * eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay\\n * if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().\\n */\\n function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) public virtual onlyOwner {\\n _setEnforcedOptions(_enforcedOptions);\\n }\\n\\n /**\\n * @dev Sets the enforced options for specific endpoint and message type combinations.\\n * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\\n *\\n * @dev Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.\\n * @dev These enforced options can vary as the potential options/execution on the remote may differ as per the msgType.\\n * eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay\\n * if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().\\n */\\n function _setEnforcedOptions(EnforcedOptionParam[] memory _enforcedOptions) internal virtual {\\n for (uint256 i = 0; i < _enforcedOptions.length; i++) {\\n // @dev Enforced options are only available for optionType 3, as type 1 and 2 dont support combining.\\n _assertOptionsType3(_enforcedOptions[i].options);\\n enforcedOptions[_enforcedOptions[i].eid][_enforcedOptions[i].msgType] = _enforcedOptions[i].options;\\n }\\n\\n emit EnforcedOptionSet(_enforcedOptions);\\n }\\n\\n /**\\n * @notice Combines options for a given endpoint and message type.\\n * @param _eid The endpoint ID.\\n * @param _msgType The OAPP message type.\\n * @param _extraOptions Additional options passed by the caller.\\n * @return options The combination of caller specified options AND enforced options.\\n *\\n * @dev If there is an enforced lzReceive option:\\n * - {gasLimit: 200k, msg.value: 1 ether} AND a caller supplies a lzReceive option: {gasLimit: 100k, msg.value: 0.5 ether}\\n * - The resulting options will be {gasLimit: 300k, msg.value: 1.5 ether} when the message is executed on the remote lzReceive() function.\\n * @dev This presence of duplicated options is handled off-chain in the verifier/executor.\\n */\\n function combineOptions(\\n uint32 _eid,\\n uint16 _msgType,\\n bytes calldata _extraOptions\\n ) public view virtual returns (bytes memory) {\\n bytes memory enforced = enforcedOptions[_eid][_msgType];\\n\\n // No enforced options, pass whatever the caller supplied, even if it's empty or legacy type 1/2 options.\\n if (enforced.length == 0) return _extraOptions;\\n\\n // No caller options, return enforced\\n if (_extraOptions.length == 0) return enforced;\\n\\n // @dev If caller provided _extraOptions, must be type 3 as its the ONLY type that can be combined.\\n if (_extraOptions.length >= 2) {\\n _assertOptionsType3(_extraOptions);\\n // @dev Remove the first 2 bytes containing the type from the _extraOptions and combine with enforced.\\n return bytes.concat(enforced, _extraOptions[2:]);\\n }\\n\\n // No valid set of options was found.\\n revert InvalidOptions(_extraOptions);\\n }\\n\\n /**\\n * @dev Internal function to assert that options are of type 3.\\n * @param _options The options to be checked.\\n */\\n function _assertOptionsType3(bytes memory _options) internal pure virtual {\\n uint16 optionsType;\\n assembly {\\n optionsType := mload(add(_options, 2))\\n }\\n if (optionsType != OPTION_TYPE_3) revert InvalidOptions(_options);\\n }\\n}\\n\",\"keccak256\":\"0x5275636cd47e660a2fdf6c7fe9d41ff3cc866b785cc8a9d88c1b8ca983509f01\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { MessagingReceipt, MessagingFee } from \\\"../../oapp/OAppSender.sol\\\";\\n\\n/**\\n * @dev Struct representing token parameters for the OFT send() operation.\\n */\\nstruct SendParam {\\n uint32 dstEid; // Destination endpoint ID.\\n bytes32 to; // Recipient address.\\n uint256 amountLD; // Amount to send in local decimals.\\n uint256 minAmountLD; // Minimum amount to send in local decimals.\\n bytes extraOptions; // Additional options supplied by the caller to be used in the LayerZero message.\\n bytes composeMsg; // The composed message for the send() operation.\\n bytes oftCmd; // The OFT command to be executed, unused in default OFT implementations.\\n}\\n\\n/**\\n * @dev Struct representing OFT limit information.\\n * @dev These amounts can change dynamically and are up the the specific oft implementation.\\n */\\nstruct OFTLimit {\\n uint256 minAmountLD; // Minimum amount in local decimals that can be sent to the recipient.\\n uint256 maxAmountLD; // Maximum amount in local decimals that can be sent to the recipient.\\n}\\n\\n/**\\n * @dev Struct representing OFT receipt information.\\n */\\nstruct OFTReceipt {\\n uint256 amountSentLD; // Amount of tokens ACTUALLY debited from the sender in local decimals.\\n // @dev In non-default implementations, the amountReceivedLD COULD differ from this value.\\n uint256 amountReceivedLD; // Amount of tokens to be received on the remote side.\\n}\\n\\n/**\\n * @dev Struct representing OFT fee details.\\n * @dev Future proof mechanism to provide a standardized way to communicate fees to things like a UI.\\n */\\nstruct OFTFeeDetail {\\n int256 feeAmountLD; // Amount of the fee in local decimals.\\n string description; // Description of the fee.\\n}\\n\\n/**\\n * @title IOFT\\n * @dev Interface for the OftChain (OFT) token.\\n * @dev Does not inherit ERC20 to accommodate usage by OFTAdapter as well.\\n * @dev This specific interface ID is '0x02e49c2c'.\\n */\\ninterface IOFT {\\n // Custom error messages\\n error InvalidLocalDecimals();\\n error SlippageExceeded(uint256 amountLD, uint256 minAmountLD);\\n\\n // Events\\n event OFTSent(\\n bytes32 indexed guid, // GUID of the OFT message.\\n uint32 dstEid, // Destination Endpoint ID.\\n address indexed fromAddress, // Address of the sender on the src chain.\\n uint256 amountSentLD, // Amount of tokens sent in local decimals.\\n uint256 amountReceivedLD // Amount of tokens received in local decimals.\\n );\\n event OFTReceived(\\n bytes32 indexed guid, // GUID of the OFT message.\\n uint32 srcEid, // Source Endpoint ID.\\n address indexed toAddress, // Address of the recipient on the dst chain.\\n uint256 amountReceivedLD // Amount of tokens received in local decimals.\\n );\\n\\n /**\\n * @notice Retrieves interfaceID and the version of the OFT.\\n * @return interfaceId The interface ID.\\n * @return version The version.\\n *\\n * @dev interfaceId: This specific interface ID is '0x02e49c2c'.\\n * @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.\\n * @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.\\n * ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\\n */\\n function oftVersion() external view returns (bytes4 interfaceId, uint64 version);\\n\\n /**\\n * @notice Retrieves the address of the token associated with the OFT.\\n * @return token The address of the ERC20 token implementation.\\n */\\n function token() external view returns (address);\\n\\n /**\\n * @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\\n * @return requiresApproval Needs approval of the underlying token implementation.\\n *\\n * @dev Allows things like wallet implementers to determine integration requirements,\\n * without understanding the underlying token implementation.\\n */\\n function approvalRequired() external view returns (bool);\\n\\n /**\\n * @notice Retrieves the shared decimals of the OFT.\\n * @return sharedDecimals The shared decimals of the OFT.\\n */\\n function sharedDecimals() external view returns (uint8);\\n\\n /**\\n * @notice Provides a quote for OFT-related operations.\\n * @param _sendParam The parameters for the send operation.\\n * @return limit The OFT limit information.\\n * @return oftFeeDetails The details of OFT fees.\\n * @return receipt The OFT receipt information.\\n */\\n function quoteOFT(\\n SendParam calldata _sendParam\\n ) external view returns (OFTLimit memory, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory);\\n\\n /**\\n * @notice Provides a quote for the send() operation.\\n * @param _sendParam The parameters for the send() operation.\\n * @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.\\n * @return fee The calculated LayerZero messaging fee from the send() operation.\\n *\\n * @dev MessagingFee: LayerZero msg fee\\n * - nativeFee: The native fee.\\n * - lzTokenFee: The lzToken fee.\\n */\\n function quoteSend(SendParam calldata _sendParam, bool _payInLzToken) external view returns (MessagingFee memory);\\n\\n /**\\n * @notice Executes the send() operation.\\n * @param _sendParam The parameters for the send operation.\\n * @param _fee The fee information supplied by the caller.\\n * - nativeFee: The native fee.\\n * - lzTokenFee: The lzToken fee.\\n * @param _refundAddress The address to receive any excess funds from fees etc. on the src.\\n * @return receipt The LayerZero messaging receipt from the send() operation.\\n * @return oftReceipt The OFT receipt information.\\n *\\n * @dev MessagingReceipt: LayerZero msg receipt\\n * - guid: The unique identifier for the sent message.\\n * - nonce: The nonce of the sent message.\\n * - fee: The LayerZero fee incurred for the message.\\n */\\n function send(\\n SendParam calldata _sendParam,\\n MessagingFee calldata _fee,\\n address _refundAddress\\n ) external payable returns (MessagingReceipt memory, OFTReceipt memory);\\n}\\n\",\"keccak256\":\"0x42431bdbe135f7cfefd0be6cd345a6a1045124f6ea707a06756ef2322140eef5\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/libs/OFTComposeMsgCodec.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nlibrary OFTComposeMsgCodec {\\n // Offset constants for decoding composed messages\\n uint8 private constant NONCE_OFFSET = 8;\\n uint8 private constant SRC_EID_OFFSET = 12;\\n uint8 private constant AMOUNT_LD_OFFSET = 44;\\n uint8 private constant COMPOSE_FROM_OFFSET = 76;\\n\\n /**\\n * @dev Encodes a OFT composed message.\\n * @param _nonce The nonce value.\\n * @param _srcEid The source endpoint ID.\\n * @param _amountLD The amount in local decimals.\\n * @param _composeMsg The composed message.\\n * @return _msg The encoded Composed message.\\n */\\n function encode(\\n uint64 _nonce,\\n uint32 _srcEid,\\n uint256 _amountLD,\\n bytes memory _composeMsg // 0x[composeFrom][composeMsg]\\n ) internal pure returns (bytes memory _msg) {\\n _msg = abi.encodePacked(_nonce, _srcEid, _amountLD, _composeMsg);\\n }\\n\\n /**\\n * @dev Retrieves the nonce from the composed message.\\n * @param _msg The message.\\n * @return The nonce value.\\n */\\n function nonce(bytes calldata _msg) internal pure returns (uint64) {\\n return uint64(bytes8(_msg[:NONCE_OFFSET]));\\n }\\n\\n /**\\n * @dev Retrieves the source endpoint ID from the composed message.\\n * @param _msg The message.\\n * @return The source endpoint ID.\\n */\\n function srcEid(bytes calldata _msg) internal pure returns (uint32) {\\n return uint32(bytes4(_msg[NONCE_OFFSET:SRC_EID_OFFSET]));\\n }\\n\\n /**\\n * @dev Retrieves the amount in local decimals from the composed message.\\n * @param _msg The message.\\n * @return The amount in local decimals.\\n */\\n function amountLD(bytes calldata _msg) internal pure returns (uint256) {\\n return uint256(bytes32(_msg[SRC_EID_OFFSET:AMOUNT_LD_OFFSET]));\\n }\\n\\n /**\\n * @dev Retrieves the composeFrom value from the composed message.\\n * @param _msg The message.\\n * @return The composeFrom value.\\n */\\n function composeFrom(bytes calldata _msg) internal pure returns (bytes32) {\\n return bytes32(_msg[AMOUNT_LD_OFFSET:COMPOSE_FROM_OFFSET]);\\n }\\n\\n /**\\n * @dev Retrieves the composed message.\\n * @param _msg The message.\\n * @return The composed message.\\n */\\n function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\\n return _msg[COMPOSE_FROM_OFFSET:];\\n }\\n\\n /**\\n * @dev Converts an address to bytes32.\\n * @param _addr The address to convert.\\n * @return The bytes32 representation of the address.\\n */\\n function addressToBytes32(address _addr) internal pure returns (bytes32) {\\n return bytes32(uint256(uint160(_addr)));\\n }\\n\\n /**\\n * @dev Converts bytes32 to an address.\\n * @param _b The bytes32 value to convert.\\n * @return The address representation of bytes32.\\n */\\n function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\\n return address(uint160(uint256(_b)));\\n }\\n}\\n\",\"keccak256\":\"0xfbdaf41743232e6ff64cd00b495ee854d0225e2bb73a66fe9b413d2780359902\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/OAppPreCrimeSimulator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport { IPreCrime } from \\\"./interfaces/IPreCrime.sol\\\";\\nimport { IOAppPreCrimeSimulator, InboundPacket, Origin } from \\\"./interfaces/IOAppPreCrimeSimulator.sol\\\";\\n\\n/**\\n * @title OAppPreCrimeSimulator\\n * @dev Abstract contract serving as the base for preCrime simulation functionality in an OApp.\\n */\\nabstract contract OAppPreCrimeSimulator is IOAppPreCrimeSimulator, Ownable {\\n // The address of the preCrime implementation.\\n address public preCrime;\\n\\n /**\\n * @dev Retrieves the address of the OApp contract.\\n * @return The address of the OApp contract.\\n *\\n * @dev The simulator contract is the base contract for the OApp by default.\\n * @dev If the simulator is a separate contract, override this function.\\n */\\n function oApp() external view virtual returns (address) {\\n return address(this);\\n }\\n\\n /**\\n * @dev Sets the preCrime contract address.\\n * @param _preCrime The address of the preCrime contract.\\n */\\n function setPreCrime(address _preCrime) public virtual onlyOwner {\\n preCrime = _preCrime;\\n emit PreCrimeSet(_preCrime);\\n }\\n\\n /**\\n * @dev Interface for pre-crime simulations. Always reverts at the end with the simulation results.\\n * @param _packets An array of InboundPacket objects representing received packets to be delivered.\\n *\\n * @dev WARNING: MUST revert at the end with the simulation results.\\n * @dev Gives the preCrime implementation the ability to mock sending packets to the lzReceive function,\\n * WITHOUT actually executing them.\\n */\\n function lzReceiveAndRevert(InboundPacket[] calldata _packets) public payable virtual {\\n for (uint256 i = 0; i < _packets.length; i++) {\\n InboundPacket calldata packet = _packets[i];\\n\\n // Ignore packets that are not from trusted peers.\\n if (!isPeer(packet.origin.srcEid, packet.origin.sender)) continue;\\n\\n // @dev Because a verifier is calling this function, it doesnt have access to executor params:\\n // - address _executor\\n // - bytes calldata _extraData\\n // preCrime will NOT work for OApps that rely on these two parameters inside of their _lzReceive().\\n // They are instead stubbed to default values, address(0) and bytes(\\\"\\\")\\n // @dev Calling this.lzReceiveSimulate removes ability for assembly return 0 callstack exit,\\n // which would cause the revert to be ignored.\\n this.lzReceiveSimulate{ value: packet.value }(\\n packet.origin,\\n packet.guid,\\n packet.message,\\n packet.executor,\\n packet.extraData\\n );\\n }\\n\\n // @dev Revert with the simulation results. msg.sender must implement IPreCrime.buildSimulationResult().\\n revert SimulationResult(IPreCrime(msg.sender).buildSimulationResult());\\n }\\n\\n /**\\n * @dev Is effectively an internal function because msg.sender must be address(this).\\n * Allows resetting the call stack for 'internal' calls.\\n * @param _origin The origin information containing the source endpoint and sender address.\\n * - srcEid: The source chain endpoint ID.\\n * - sender: The sender address on the src chain.\\n * - nonce: The nonce of the message.\\n * @param _guid The unique identifier of the packet.\\n * @param _message The message payload of the packet.\\n * @param _executor The executor address for the packet.\\n * @param _extraData Additional data for the packet.\\n */\\n function lzReceiveSimulate(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address _executor,\\n bytes calldata _extraData\\n ) external payable virtual {\\n // @dev Ensure ONLY can be called 'internally'.\\n if (msg.sender != address(this)) revert OnlySelf();\\n _lzReceiveSimulate(_origin, _guid, _message, _executor, _extraData);\\n }\\n\\n /**\\n * @dev Internal function to handle the OAppPreCrimeSimulator simulated receive.\\n * @param _origin The origin information.\\n * - srcEid: The source chain endpoint ID.\\n * - sender: The sender address from the src chain.\\n * - nonce: The nonce of the LayerZero message.\\n * @param _guid The GUID of the LayerZero message.\\n * @param _message The LayerZero message.\\n * @param _executor The address of the off-chain executor.\\n * @param _extraData Arbitrary data passed by the msg executor.\\n *\\n * @dev Enables the preCrime simulator to mock sending lzReceive() messages,\\n * routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver.\\n */\\n function _lzReceiveSimulate(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address _executor,\\n bytes calldata _extraData\\n ) internal virtual;\\n\\n /**\\n * @dev checks if the specified peer is considered 'trusted' by the OApp.\\n * @param _eid The endpoint Id to check.\\n * @param _peer The peer to check.\\n * @return Whether the peer passed is considered 'trusted' by the OApp.\\n */\\n function isPeer(uint32 _eid, bytes32 _peer) public view virtual returns (bool);\\n}\\n\",\"keccak256\":\"0x205a0abfd8b3c9af2740769f251381b84999b8e9347f3cd50de3ef8290a17750\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/interfaces/IOAppPreCrimeSimulator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\n// @dev Import the Origin so it's exposed to OAppPreCrimeSimulator implementers.\\n// solhint-disable-next-line no-unused-import\\nimport { InboundPacket, Origin } from \\\"../libs/Packet.sol\\\";\\n\\n/**\\n * @title IOAppPreCrimeSimulator Interface\\n * @dev Interface for the preCrime simulation functionality in an OApp.\\n */\\ninterface IOAppPreCrimeSimulator {\\n // @dev simulation result used in PreCrime implementation\\n error SimulationResult(bytes result);\\n error OnlySelf();\\n\\n /**\\n * @dev Emitted when the preCrime contract address is set.\\n * @param preCrimeAddress The address of the preCrime contract.\\n */\\n event PreCrimeSet(address preCrimeAddress);\\n\\n /**\\n * @dev Retrieves the address of the preCrime contract implementation.\\n * @return The address of the preCrime contract.\\n */\\n function preCrime() external view returns (address);\\n\\n /**\\n * @dev Retrieves the address of the OApp contract.\\n * @return The address of the OApp contract.\\n */\\n function oApp() external view returns (address);\\n\\n /**\\n * @dev Sets the preCrime contract address.\\n * @param _preCrime The address of the preCrime contract.\\n */\\n function setPreCrime(address _preCrime) external;\\n\\n /**\\n * @dev Mocks receiving a packet, then reverts with a series of data to infer the state/result.\\n * @param _packets An array of LayerZero InboundPacket objects representing received packets.\\n */\\n function lzReceiveAndRevert(InboundPacket[] calldata _packets) external payable;\\n\\n /**\\n * @dev checks if the specified peer is considered 'trusted' by the OApp.\\n * @param _eid The endpoint Id to check.\\n * @param _peer The peer to check.\\n * @return Whether the peer passed is considered 'trusted' by the OApp.\\n */\\n function isPeer(uint32 _eid, bytes32 _peer) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5d24db150949ea8e6437178e65a942e8c8b7f332e5daf32750f56b23b35b5bb2\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/interfaces/IPreCrime.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\nstruct PreCrimePeer {\\n uint32 eid;\\n bytes32 preCrime;\\n bytes32 oApp;\\n}\\n\\n// TODO not done yet\\ninterface IPreCrime {\\n error OnlyOffChain();\\n\\n // for simulate()\\n error PacketOversize(uint256 max, uint256 actual);\\n error PacketUnsorted();\\n error SimulationFailed(bytes reason);\\n\\n // for preCrime()\\n error SimulationResultNotFound(uint32 eid);\\n error InvalidSimulationResult(uint32 eid, bytes reason);\\n error CrimeFound(bytes crime);\\n\\n function getConfig(bytes[] calldata _packets, uint256[] calldata _packetMsgValues) external returns (bytes memory);\\n\\n function simulate(\\n bytes[] calldata _packets,\\n uint256[] calldata _packetMsgValues\\n ) external payable returns (bytes memory);\\n\\n function buildSimulationResult() external view returns (bytes memory);\\n\\n function preCrime(\\n bytes[] calldata _packets,\\n uint256[] calldata _packetMsgValues,\\n bytes[] calldata _simulations\\n ) external;\\n\\n function version() external view returns (uint64 major, uint8 minor);\\n}\\n\",\"keccak256\":\"0xc8d869f27ef8ceb2e13fdf6a70682fd4dee3f90c4924eb8e125bc1e66cb6af84\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/libs/Packet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { Origin } from \\\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\\\";\\nimport { PacketV1Codec } from \\\"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol\\\";\\n\\n/**\\n * @title InboundPacket\\n * @dev Structure representing an inbound packet received by the contract.\\n */\\nstruct InboundPacket {\\n Origin origin; // Origin information of the packet.\\n uint32 dstEid; // Destination endpointId of the packet.\\n address receiver; // Receiver address for the packet.\\n bytes32 guid; // Unique identifier of the packet.\\n uint256 value; // msg.value of the packet.\\n address executor; // Executor address for the packet.\\n bytes message; // Message payload of the packet.\\n bytes extraData; // Additional arbitrary data for the packet.\\n}\\n\\n/**\\n * @title PacketDecoder\\n * @dev Library for decoding LayerZero packets.\\n */\\nlibrary PacketDecoder {\\n using PacketV1Codec for bytes;\\n\\n /**\\n * @dev Decode an inbound packet from the given packet data.\\n * @param _packet The packet data to decode.\\n * @return packet An InboundPacket struct representing the decoded packet.\\n */\\n function decode(bytes calldata _packet) internal pure returns (InboundPacket memory packet) {\\n packet.origin = Origin(_packet.srcEid(), _packet.sender(), _packet.nonce());\\n packet.dstEid = _packet.dstEid();\\n packet.receiver = _packet.receiverB20();\\n packet.guid = _packet.guid();\\n packet.message = _packet.message();\\n }\\n\\n /**\\n * @dev Decode multiple inbound packets from the given packet data and associated message values.\\n * @param _packets An array of packet data to decode.\\n * @param _packetMsgValues An array of associated message values for each packet.\\n * @return packets An array of InboundPacket structs representing the decoded packets.\\n */\\n function decode(\\n bytes[] calldata _packets,\\n uint256[] memory _packetMsgValues\\n ) internal pure returns (InboundPacket[] memory packets) {\\n packets = new InboundPacket[](_packets.length);\\n for (uint256 i = 0; i < _packets.length; i++) {\\n bytes calldata packet = _packets[i];\\n packets[i] = PacketDecoder.decode(packet);\\n // @dev Allows the verifier to specify the msg.value that gets passed in lzReceive.\\n packets[i].value = _packetMsgValues[i];\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcb2fb1c5b2eb3731de78b479b9c2ab3bba326fe0b0b3a008590f18e881e457a6\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\nimport { IMessageLibManager } from \\\"./IMessageLibManager.sol\\\";\\nimport { IMessagingComposer } from \\\"./IMessagingComposer.sol\\\";\\nimport { IMessagingChannel } from \\\"./IMessagingChannel.sol\\\";\\nimport { IMessagingContext } from \\\"./IMessagingContext.sol\\\";\\n\\nstruct MessagingParams {\\n uint32 dstEid;\\n bytes32 receiver;\\n bytes message;\\n bytes options;\\n bool payInLzToken;\\n}\\n\\nstruct MessagingReceipt {\\n bytes32 guid;\\n uint64 nonce;\\n MessagingFee fee;\\n}\\n\\nstruct MessagingFee {\\n uint256 nativeFee;\\n uint256 lzTokenFee;\\n}\\n\\nstruct Origin {\\n uint32 srcEid;\\n bytes32 sender;\\n uint64 nonce;\\n}\\n\\ninterface ILayerZeroEndpointV2 is IMessageLibManager, IMessagingComposer, IMessagingChannel, IMessagingContext {\\n event PacketSent(bytes encodedPayload, bytes options, address sendLibrary);\\n\\n event PacketVerified(Origin origin, address receiver, bytes32 payloadHash);\\n\\n event PacketDelivered(Origin origin, address receiver);\\n\\n event LzReceiveAlert(\\n address indexed receiver,\\n address indexed executor,\\n Origin origin,\\n bytes32 guid,\\n uint256 gas,\\n uint256 value,\\n bytes message,\\n bytes extraData,\\n bytes reason\\n );\\n\\n event LzTokenSet(address token);\\n\\n event DelegateSet(address sender, address delegate);\\n\\n function quote(MessagingParams calldata _params, address _sender) external view returns (MessagingFee memory);\\n\\n function send(\\n MessagingParams calldata _params,\\n address _refundAddress\\n ) external payable returns (MessagingReceipt memory);\\n\\n function verify(Origin calldata _origin, address _receiver, bytes32 _payloadHash) external;\\n\\n function verifiable(Origin calldata _origin, address _receiver) external view returns (bool);\\n\\n function initializable(Origin calldata _origin, address _receiver) external view returns (bool);\\n\\n function lzReceive(\\n Origin calldata _origin,\\n address _receiver,\\n bytes32 _guid,\\n bytes calldata _message,\\n bytes calldata _extraData\\n ) external payable;\\n\\n // oapp can burn messages partially by calling this function with its own business logic if messages are verified in order\\n function clear(address _oapp, Origin calldata _origin, bytes32 _guid, bytes calldata _message) external;\\n\\n function setLzToken(address _lzToken) external;\\n\\n function lzToken() external view returns (address);\\n\\n function nativeToken() external view returns (address);\\n\\n function setDelegate(address _delegate) external;\\n}\\n\",\"keccak256\":\"0xf7f941bee89ea6369950fe54e8ac476ae6478b958b20fc0e8a83e8ff1364eac3\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\nimport { Origin } from \\\"./ILayerZeroEndpointV2.sol\\\";\\n\\ninterface ILayerZeroReceiver {\\n function allowInitializePath(Origin calldata _origin) external view returns (bool);\\n\\n function nextNonce(uint32 _eid, bytes32 _sender) external view returns (uint64);\\n\\n function lzReceive(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address _executor,\\n bytes calldata _extraData\\n ) external payable;\\n}\\n\",\"keccak256\":\"0x9641abba8d53b08bb517d1b74801dd15ea7b84d77a6719085bd96c8ea94e3ca0\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\n\\nimport { SetConfigParam } from \\\"./IMessageLibManager.sol\\\";\\n\\nenum MessageLibType {\\n Send,\\n Receive,\\n SendAndReceive\\n}\\n\\ninterface IMessageLib is IERC165 {\\n function setConfig(address _oapp, SetConfigParam[] calldata _config) external;\\n\\n function getConfig(uint32 _eid, address _oapp, uint32 _configType) external view returns (bytes memory config);\\n\\n function isSupportedEid(uint32 _eid) external view returns (bool);\\n\\n // message libs of same major version are compatible\\n function version() external view returns (uint64 major, uint8 minor, uint8 endpointVersion);\\n\\n function messageLibType() external view returns (MessageLibType);\\n}\\n\",\"keccak256\":\"0x5cf5f24751b4e3ea1c9c5ded07cedfdfd62566b6daaffcc0144733859c9dba0c\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\nstruct SetConfigParam {\\n uint32 eid;\\n uint32 configType;\\n bytes config;\\n}\\n\\ninterface IMessageLibManager {\\n struct Timeout {\\n address lib;\\n uint256 expiry;\\n }\\n\\n event LibraryRegistered(address newLib);\\n event DefaultSendLibrarySet(uint32 eid, address newLib);\\n event DefaultReceiveLibrarySet(uint32 eid, address newLib);\\n event DefaultReceiveLibraryTimeoutSet(uint32 eid, address oldLib, uint256 expiry);\\n event SendLibrarySet(address sender, uint32 eid, address newLib);\\n event ReceiveLibrarySet(address receiver, uint32 eid, address newLib);\\n event ReceiveLibraryTimeoutSet(address receiver, uint32 eid, address oldLib, uint256 timeout);\\n\\n function registerLibrary(address _lib) external;\\n\\n function isRegisteredLibrary(address _lib) external view returns (bool);\\n\\n function getRegisteredLibraries() external view returns (address[] memory);\\n\\n function setDefaultSendLibrary(uint32 _eid, address _newLib) external;\\n\\n function defaultSendLibrary(uint32 _eid) external view returns (address);\\n\\n function setDefaultReceiveLibrary(uint32 _eid, address _newLib, uint256 _gracePeriod) external;\\n\\n function defaultReceiveLibrary(uint32 _eid) external view returns (address);\\n\\n function setDefaultReceiveLibraryTimeout(uint32 _eid, address _lib, uint256 _expiry) external;\\n\\n function defaultReceiveLibraryTimeout(uint32 _eid) external view returns (address lib, uint256 expiry);\\n\\n function isSupportedEid(uint32 _eid) external view returns (bool);\\n\\n function isValidReceiveLibrary(address _receiver, uint32 _eid, address _lib) external view returns (bool);\\n\\n /// ------------------- OApp interfaces -------------------\\n function setSendLibrary(address _oapp, uint32 _eid, address _newLib) external;\\n\\n function getSendLibrary(address _sender, uint32 _eid) external view returns (address lib);\\n\\n function isDefaultSendLibrary(address _sender, uint32 _eid) external view returns (bool);\\n\\n function setReceiveLibrary(address _oapp, uint32 _eid, address _newLib, uint256 _gracePeriod) external;\\n\\n function getReceiveLibrary(address _receiver, uint32 _eid) external view returns (address lib, bool isDefault);\\n\\n function setReceiveLibraryTimeout(address _oapp, uint32 _eid, address _lib, uint256 _expiry) external;\\n\\n function receiveLibraryTimeout(address _receiver, uint32 _eid) external view returns (address lib, uint256 expiry);\\n\\n function setConfig(address _oapp, address _lib, SetConfigParam[] calldata _params) external;\\n\\n function getConfig(\\n address _oapp,\\n address _lib,\\n uint32 _eid,\\n uint32 _configType\\n ) external view returns (bytes memory config);\\n}\\n\",\"keccak256\":\"0x919b37133adff4dc528e3061deb2789c3149971b530c61e556fb3d09ab315dfc\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingChannel.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\ninterface IMessagingChannel {\\n event InboundNonceSkipped(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce);\\n event PacketNilified(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);\\n event PacketBurnt(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);\\n\\n function eid() external view returns (uint32);\\n\\n // this is an emergency function if a message cannot be verified for some reasons\\n // required to provide _nextNonce to avoid race condition\\n function skip(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce) external;\\n\\n function nilify(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;\\n\\n function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;\\n\\n function nextGuid(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (bytes32);\\n\\n function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);\\n\\n function outboundNonce(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (uint64);\\n\\n function inboundPayloadHash(\\n address _receiver,\\n uint32 _srcEid,\\n bytes32 _sender,\\n uint64 _nonce\\n ) external view returns (bytes32);\\n\\n function lazyInboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);\\n}\\n\",\"keccak256\":\"0x0878f64dffebf58c4165569416372f40860fab546b88cd926eba0d5cb6d8d972\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingComposer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\ninterface IMessagingComposer {\\n event ComposeSent(address from, address to, bytes32 guid, uint16 index, bytes message);\\n event ComposeDelivered(address from, address to, bytes32 guid, uint16 index);\\n event LzComposeAlert(\\n address indexed from,\\n address indexed to,\\n address indexed executor,\\n bytes32 guid,\\n uint16 index,\\n uint256 gas,\\n uint256 value,\\n bytes message,\\n bytes extraData,\\n bytes reason\\n );\\n\\n function composeQueue(\\n address _from,\\n address _to,\\n bytes32 _guid,\\n uint16 _index\\n ) external view returns (bytes32 messageHash);\\n\\n function sendCompose(address _to, bytes32 _guid, uint16 _index, bytes calldata _message) external;\\n\\n function lzCompose(\\n address _from,\\n address _to,\\n bytes32 _guid,\\n uint16 _index,\\n bytes calldata _message,\\n bytes calldata _extraData\\n ) external payable;\\n}\\n\",\"keccak256\":\"0x85bc7090134529ec474866dc4bb1c48692d518c756eb0a961c82574829c51901\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingContext.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\ninterface IMessagingContext {\\n function isSendingMessage() external view returns (bool);\\n\\n function getSendContext() external view returns (uint32 dstEid, address sender);\\n}\\n\",\"keccak256\":\"0xff0c546c2813dae3e440882f46b377375f7461b0714efd80bd3f0c6e5cb8da4e\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\nimport { MessagingFee } from \\\"./ILayerZeroEndpointV2.sol\\\";\\nimport { IMessageLib } from \\\"./IMessageLib.sol\\\";\\n\\nstruct Packet {\\n uint64 nonce;\\n uint32 srcEid;\\n address sender;\\n uint32 dstEid;\\n bytes32 receiver;\\n bytes32 guid;\\n bytes message;\\n}\\n\\ninterface ISendLib is IMessageLib {\\n function send(\\n Packet calldata _packet,\\n bytes calldata _options,\\n bool _payInLzToken\\n ) external returns (MessagingFee memory, bytes memory encodedPacket);\\n\\n function quote(\\n Packet calldata _packet,\\n bytes calldata _options,\\n bool _payInLzToken\\n ) external view returns (MessagingFee memory);\\n\\n function setTreasury(address _treasury) external;\\n\\n function withdrawFee(address _to, uint256 _amount) external;\\n\\n function withdrawLzTokenFee(address _lzToken, address _to, uint256 _amount) external;\\n}\\n\",\"keccak256\":\"0xf1c07bc61e7b1dce195ed12d50f87980fbf2d63cac1326fd28287f55fe0ba625\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/AddressCast.sol\":{\"content\":\"// SPDX-License-Identifier: LZBL-1.2\\n\\npragma solidity ^0.8.20;\\n\\nlibrary AddressCast {\\n error AddressCast_InvalidSizeForAddress();\\n error AddressCast_InvalidAddress();\\n\\n function toBytes32(bytes calldata _addressBytes) internal pure returns (bytes32 result) {\\n if (_addressBytes.length > 32) revert AddressCast_InvalidAddress();\\n result = bytes32(_addressBytes);\\n unchecked {\\n uint256 offset = 32 - _addressBytes.length;\\n result = result >> (offset * 8);\\n }\\n }\\n\\n function toBytes32(address _address) internal pure returns (bytes32 result) {\\n result = bytes32(uint256(uint160(_address)));\\n }\\n\\n function toBytes(bytes32 _addressBytes32, uint256 _size) internal pure returns (bytes memory result) {\\n if (_size == 0 || _size > 32) revert AddressCast_InvalidSizeForAddress();\\n result = new bytes(_size);\\n unchecked {\\n uint256 offset = 256 - _size * 8;\\n assembly {\\n mstore(add(result, 32), shl(offset, _addressBytes32))\\n }\\n }\\n }\\n\\n function toAddress(bytes32 _addressBytes32) internal pure returns (address result) {\\n result = address(uint160(uint256(_addressBytes32)));\\n }\\n\\n function toAddress(bytes calldata _addressBytes) internal pure returns (address result) {\\n if (_addressBytes.length != 20) revert AddressCast_InvalidAddress();\\n result = address(bytes20(_addressBytes));\\n }\\n}\\n\",\"keccak256\":\"0x2ebbcaaab3554edcd41b581f1a72ac1806afbfb8047d0d47ff098f9af30d6deb\",\"license\":\"LZBL-1.2\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol\":{\"content\":\"// SPDX-License-Identifier: LZBL-1.2\\n\\npragma solidity ^0.8.20;\\n\\nimport { Packet } from \\\"../../interfaces/ISendLib.sol\\\";\\nimport { AddressCast } from \\\"../../libs/AddressCast.sol\\\";\\n\\nlibrary PacketV1Codec {\\n using AddressCast for address;\\n using AddressCast for bytes32;\\n\\n uint8 internal constant PACKET_VERSION = 1;\\n\\n // header (version + nonce + path)\\n // version\\n uint256 private constant PACKET_VERSION_OFFSET = 0;\\n // nonce\\n uint256 private constant NONCE_OFFSET = 1;\\n // path\\n uint256 private constant SRC_EID_OFFSET = 9;\\n uint256 private constant SENDER_OFFSET = 13;\\n uint256 private constant DST_EID_OFFSET = 45;\\n uint256 private constant RECEIVER_OFFSET = 49;\\n // payload (guid + message)\\n uint256 private constant GUID_OFFSET = 81; // keccak256(nonce + path)\\n uint256 private constant MESSAGE_OFFSET = 113;\\n\\n function encode(Packet memory _packet) internal pure returns (bytes memory encodedPacket) {\\n encodedPacket = abi.encodePacked(\\n PACKET_VERSION,\\n _packet.nonce,\\n _packet.srcEid,\\n _packet.sender.toBytes32(),\\n _packet.dstEid,\\n _packet.receiver,\\n _packet.guid,\\n _packet.message\\n );\\n }\\n\\n function encodePacketHeader(Packet memory _packet) internal pure returns (bytes memory) {\\n return\\n abi.encodePacked(\\n PACKET_VERSION,\\n _packet.nonce,\\n _packet.srcEid,\\n _packet.sender.toBytes32(),\\n _packet.dstEid,\\n _packet.receiver\\n );\\n }\\n\\n function encodePayload(Packet memory _packet) internal pure returns (bytes memory) {\\n return abi.encodePacked(_packet.guid, _packet.message);\\n }\\n\\n function header(bytes calldata _packet) internal pure returns (bytes calldata) {\\n return _packet[0:GUID_OFFSET];\\n }\\n\\n function version(bytes calldata _packet) internal pure returns (uint8) {\\n return uint8(bytes1(_packet[PACKET_VERSION_OFFSET:NONCE_OFFSET]));\\n }\\n\\n function nonce(bytes calldata _packet) internal pure returns (uint64) {\\n return uint64(bytes8(_packet[NONCE_OFFSET:SRC_EID_OFFSET]));\\n }\\n\\n function srcEid(bytes calldata _packet) internal pure returns (uint32) {\\n return uint32(bytes4(_packet[SRC_EID_OFFSET:SENDER_OFFSET]));\\n }\\n\\n function sender(bytes calldata _packet) internal pure returns (bytes32) {\\n return bytes32(_packet[SENDER_OFFSET:DST_EID_OFFSET]);\\n }\\n\\n function senderAddressB20(bytes calldata _packet) internal pure returns (address) {\\n return sender(_packet).toAddress();\\n }\\n\\n function dstEid(bytes calldata _packet) internal pure returns (uint32) {\\n return uint32(bytes4(_packet[DST_EID_OFFSET:RECEIVER_OFFSET]));\\n }\\n\\n function receiver(bytes calldata _packet) internal pure returns (bytes32) {\\n return bytes32(_packet[RECEIVER_OFFSET:GUID_OFFSET]);\\n }\\n\\n function receiverB20(bytes calldata _packet) internal pure returns (address) {\\n return receiver(_packet).toAddress();\\n }\\n\\n function guid(bytes calldata _packet) internal pure returns (bytes32) {\\n return bytes32(_packet[GUID_OFFSET:MESSAGE_OFFSET]);\\n }\\n\\n function message(bytes calldata _packet) internal pure returns (bytes calldata) {\\n return bytes(_packet[MESSAGE_OFFSET:]);\\n }\\n\\n function payload(bytes calldata _packet) internal pure returns (bytes calldata) {\\n return bytes(_packet[GUID_OFFSET:]);\\n }\\n\\n function payloadHash(bytes calldata _packet) internal pure returns (bytes32) {\\n return keccak256(payload(_packet));\\n }\\n}\\n\",\"keccak256\":\"0xc84cf1bf785977fe1fbe7566eef902c2db68d0e163813ebe6c34921754802680\",\"license\":\"LZBL-1.2\"},\"@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/interfaces/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../token/ERC20/IERC20.sol\\\";\\n\",\"keccak256\":\"0xce41876e78d1badc0512229b4d14e4daf83bc1003d7f83978d18e0e56f965b9c\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard ERC20 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 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 ERC721 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 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 EIP-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 ERC1155 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 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\":\"0x60c65f701957fdd6faea1acb0bb45825791d473693ed9ecb34726fdfaa849dd7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xc6a8ff0ea489379b61faa647490411b80102578440ab9d84e9a957cc12164e70\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * ==== Security Considerations\\n *\\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\\n * generally recommended is:\\n *\\n * ```solidity\\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\\n * doThing(..., value);\\n * }\\n *\\n * function doThing(..., uint256 value) public {\\n * token.safeTransferFrom(msg.sender, address(this), value);\\n * ...\\n * }\\n * ```\\n *\\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\\n * {SafeERC20-safeTransferFrom}).\\n *\\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\\n * contracts should have entry points that don't rely on permit.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n *\\n * CAUTION: See Security Considerations above.\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x6008dabfe393240d73d7dd7688033f72740d570aa422254d29a7dce8568f3aff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\nimport {IERC20Permit} from \\\"../extensions/IERC20Permit.sol\\\";\\nimport {Address} from \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n /**\\n * @dev An operation with an ERC20 token failed.\\n */\\n error SafeERC20FailedOperation(address token);\\n\\n /**\\n * @dev Indicates a failed `decreaseAllowance` request.\\n */\\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n forceApprove(token, spender, oldAllowance + value);\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\\n * value, non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\\n unchecked {\\n uint256 currentAllowance = token.allowance(address(this), spender);\\n if (currentAllowance < requestedDecrease) {\\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\\n }\\n forceApprove(token, spender, currentAllowance - requestedDecrease);\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data);\\n if (returndata.length != 0 && !abi.decode(returndata, (bool))) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;\\n }\\n}\\n\",\"keccak256\":\"0x37bb49513c49c87c4642a891b13b63571bc87013dde806617aa1efb54605f386\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error AddressInsufficientBalance(address account);\\n\\n /**\\n * @dev There's no code at `target` (it is not a contract).\\n */\\n error AddressEmptyCode(address target);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedInnerCall();\\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 AddressInsufficientBalance(address(this));\\n }\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n if (!success) {\\n revert FailedInnerCall();\\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 * {FailedInnerCall} 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 AddressInsufficientBalance(address(this));\\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 {FailedInnerCall}) in case of an\\n * 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 {FailedInnerCall} 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 {FailedInnerCall}.\\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 /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert FailedInnerCall();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaf28a975a78550e45f65e559a3ad6a5ad43b9b8a37366999abd1b7084eb70721\",\"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/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\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[EIP 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\":\"0x4296879f55019b23e135000eb36896057e7101fb7fb859c5ef690cf14643757b\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nimport {SendParam, OFTReceipt, MessagingReceipt, MessagingFee} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol\\\";\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport {Context} from \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport {OFTCore} from \\\"./oft/OFTCore.sol\\\";\\nimport {ERC2771Handler} from \\\"./sand/ERC2771Handler.sol\\\";\\nimport {SandBaseToken} from \\\"./sand/SandBaseToken.sol\\\";\\n\\n/// @title OFTSand\\n/// @author The Sandbox\\n/// @dev OFTSand is a contract that combines SandBaseToken, ERC2771Handler, and OFTCore functionalities.\\n/// @dev It provides a token contract implementation of Sand token with LayerZero compatibility.\\ncontract OFTSand is SandBaseToken, ERC2771Handler, OFTCore {\\n bool internal _enabled;\\n\\n /// @notice Emitted when the enabled state changes\\n /// @param enabled The new enabled state\\n event Enabled(bool enabled);\\n\\n /// @notice Custom error thrown when the send function is called while disabled\\n error SendFunctionDisabled();\\n\\n constructor(\\n address trustedForwarder,\\n address sandAdmin,\\n address executionAdmin,\\n address layerZeroEndpoint,\\n address owner\\n ) SandBaseToken(sandAdmin, executionAdmin, address(0), 0) OFTCore(18, layerZeroEndpoint, owner) Ownable(owner) {\\n __ERC2771Handler_initialize(trustedForwarder);\\n _enable(true);\\n }\\n\\n /// @notice Change the address of the trusted forwarder for meta-TX.\\n /// @param trustedForwarder The new trustedForwarder.\\n function setTrustedForwarder(address trustedForwarder) external onlyOwner {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function enable(bool enabled) external onlyAdmin {\\n _enable(enabled);\\n }\\n\\n function getEnabled() external view returns (bool) {\\n return _enabled;\\n }\\n\\n /// @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\\n /// @return requiresApproval Needs approval of the underlying token implementation.\\n /// @dev In the case of OFT where the contract IS the token, approval is NOT required.\\n function approvalRequired() external pure virtual returns (bool) {\\n return false;\\n }\\n\\n /// @dev Retrieves the address of the underlying ERC20 implementation.\\n /// @return The address of the OFT token.\\n /// @dev In the case of OFT, address(this) and erc20 are the same contract.\\n function token() external view returns (address) {\\n return address(this);\\n }\\n\\n function send(\\n SendParam calldata _sendParam,\\n MessagingFee calldata _fee,\\n address _refundAddress\\n ) public payable virtual override returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) {\\n if (!_enabled) {\\n revert SendFunctionDisabled();\\n }\\n\\n super.send(_sendParam, _fee, _refundAddress);\\n }\\n\\n function _enable(bool enabled) internal {\\n _enabled = enabled;\\n emit Enabled(_enabled);\\n }\\n\\n /// @dev Burns tokens from the sender's specified balance.\\n /// @param _from The address to debit the tokens from.\\n /// @param _amountLD The amount of tokens to send in local decimals.\\n /// @param _minAmountLD The minimum amount to send in local decimals.\\n /// @param _dstEid The destination chain ID.\\n /// @return amountSentLD The amount sent in local decimals.\\n /// @return amountReceivedLD The amount received in local decimals on the remote.\\n function _debit(\\n address _from,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n uint32 _dstEid\\n ) internal virtual override returns (uint256 amountSentLD, uint256 amountReceivedLD) {\\n (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid);\\n\\n // @dev In NON-default OFT, amountSentLD could be 100, with a 10% fee, the amountReceivedLD amount is 90,\\n // therefore amountSentLD CAN differ from amountReceivedLD.\\n\\n // @dev Default OFT burns on src.\\n _burn(_from, amountSentLD);\\n }\\n\\n /// @dev Credits tokens to the specified address.\\n /// @param _to The address to credit the tokens to.\\n /// @param _amountLD The amount of tokens to credit in local decimals.\\n /// @dev _srcEid The source chain ID.\\n /// @return amountReceivedLD The amount of tokens ACTUALLY received in local decimals.\\n function _credit(\\n address _to,\\n uint256 _amountLD,\\n uint32 /*_srcEid*/\\n ) internal virtual override returns (uint256 amountReceivedLD) {\\n // @dev Default OFT mints on dst.\\n _mint(_to, _amountLD);\\n // @dev In the case of NON-default OFT, the _amountLD MIGHT not be == amountReceivedLD.\\n return _amountLD;\\n }\\n\\n function _msgSender() internal view override(ERC2771Handler, Context) returns (address sender) {\\n return ERC2771Handler._msgSender();\\n }\\n\\n function _msgData() internal view override(ERC2771Handler, Context) returns (bytes calldata) {\\n return ERC2771Handler._msgData();\\n }\\n}\\n\",\"keccak256\":\"0x906a95e61308a1f9882f0cdaa7c0a92e90548139807d6858b0ae892bab109d38\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/interfaces/IERC20Extended.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport {IERC20} from \\\"@openzeppelin/contracts/interfaces/IERC20.sol\\\";\\n\\ninterface IERC20Extended is IERC20 {\\n function burnFor(address from, uint256 amount) external;\\n\\n function burn(uint256 amount) external;\\n\\n function approveFor(address owner, address spender, uint256 amount) external returns (bool success);\\n}\\n\",\"keccak256\":\"0x8732e387712417ba58adca32a39bba00ca6591220b7373b2e15f3a5f2a02357c\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/interfaces/IErrors.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\n/// @title Errors\\n/// @author The Sandbox\\n/// @custom:security-contact contact-blockchain@sandbox.game\\n/// @notice Common errors\\ninterface IErrors {\\n /// @notice Error for overflow conditions\\n error Overflow();\\n\\n /// @notice Error for unauthorized access\\n error NotAuthorized();\\n\\n /// @notice Error for invalid sender\\n error InvalidSender();\\n\\n /// @notice Error for invalid amount\\n error InvalidAmount();\\n\\n /// @notice Error for invalid owner or spender\\n error InvalidOwnerOrSpender();\\n\\n /// @notice Error for mismatched first parameter and sender address\\n error FirstParamNotSender();\\n\\n /// @notice Error for failed calls, containing the error message\\n /// @param message error message returned from the failed call\\n error CallFailed(string message);\\n\\n /// @notice Error for admin-only access\\n error OnlyAdmin();\\n}\\n\",\"keccak256\":\"0x73a0517d65a567aaf6181ab1d3c68b6e7fdc20b098e013826db83bc8620fb635\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/libraries/BytesUtil.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nlibrary BytesUtil {\\n uint256 private constant DATA_MIN_LENGTH = 68;\\n\\n /// @dev Check if the data == _address.\\n /// @param data The bytes passed to the function.\\n /// @param _address The address to compare to.\\n /// @return Whether the first param == _address.\\n function doFirstParamEqualsAddress(bytes memory data, address _address) internal pure returns (bool) {\\n if (data.length < DATA_MIN_LENGTH) {\\n return false;\\n }\\n uint256 value;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n value := mload(add(data, 36))\\n }\\n return value == uint256(uint160(_address));\\n }\\n}\\n\",\"keccak256\":\"0xaf46fb2fdd191a593f1c1563b9c27675cdc06689f3cb9ab1a1eb7d09c2b3a9a5\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/oft/OFTCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nimport {OApp, Origin} from \\\"./oapp/OApp.sol\\\";\\nimport {OAppOptionsType3} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OAppOptionsType3.sol\\\";\\nimport {IOAppMsgInspector} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppMsgInspector.sol\\\";\\n\\nimport {OAppPreCrimeSimulator} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/OAppPreCrimeSimulator.sol\\\";\\n\\nimport {IOFT, SendParam, OFTLimit, OFTReceipt, OFTFeeDetail, MessagingReceipt, MessagingFee} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol\\\";\\nimport {OFTMsgCodec} from \\\"./libraries/OFTMsgCodec.sol\\\";\\nimport {OFTComposeMsgCodec} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/libs/OFTComposeMsgCodec.sol\\\";\\n\\n/// @title OFTCore\\n/// @dev Abstract contract for the OftChain (OFT) token.\\n/// @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFTCore.sol'\\n/// but has been modified to support ERC2771 compatibility.\\nabstract contract OFTCore is IOFT, OApp, OAppPreCrimeSimulator, OAppOptionsType3 {\\n using OFTMsgCodec for bytes;\\n using OFTMsgCodec for bytes32;\\n\\n // @notice Provides a conversion rate when swapping between denominations of SD and LD\\n // - shareDecimals == SD == shared Decimals\\n // - localDecimals == LD == local decimals\\n // @dev Considers that tokens have different decimal amounts on various chains.\\n // @dev eg.\\n // For a token\\n // - locally with 4 decimals --> 1.2345 => uint(12345)\\n // - remotely with 2 decimals --> 1.23 => uint(123)\\n // - The conversion rate would be 10 ** (4 - 2) = 100\\n // @dev If you want to send 1.2345 -> (uint 12345), you CANNOT represent that value on the remote,\\n // you can only display 1.23 -> uint(123).\\n // @dev To preserve the dust that would otherwise be lost on that conversion,\\n // we need to unify a denomination that can be represented on ALL chains inside of the OFT mesh\\n uint256 public immutable decimalConversionRate;\\n\\n // @notice Msg types that are used to identify the various OFT operations.\\n // @dev This can be extended in child contracts for non-default oft operations\\n // @dev These values are used in things like combineOptions() in OAppOptionsType3.sol.\\n uint16 public constant SEND = 1;\\n uint16 public constant SEND_AND_CALL = 2;\\n\\n // Address of an optional contract to inspect both 'message' and 'options'\\n address public msgInspector;\\n event MsgInspectorSet(address inspector);\\n\\n /// @dev Constructor.\\n /// @param _localDecimals The decimals of the token on the local chain (this chain).\\n /// @param _endpoint The address of the LayerZero endpoint.\\n /// @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\\n constructor(uint8 _localDecimals, address _endpoint, address _delegate) OApp(_endpoint, _delegate) {\\n if (_localDecimals < sharedDecimals()) revert InvalidLocalDecimals();\\n decimalConversionRate = 10 ** (_localDecimals - sharedDecimals());\\n }\\n\\n /// @notice Retrieves interfaceID and the version of the OFT.\\n /// @return interfaceId The interface ID.\\n /// @return version The version.\\n /// @dev interfaceId: This specific interface ID is '0x02e49c2c'.\\n /// @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.\\n /// @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.\\n /// ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\\n function oftVersion() external pure virtual returns (bytes4 interfaceId, uint64 version) {\\n return (type(IOFT).interfaceId, 1);\\n }\\n\\n /// @dev Retrieves the shared decimals of the OFT.\\n /// @return The shared decimals of the OFT.\\n /// @dev Sets an implicit cap on the amount of tokens, over uint64.max() will need some sort of outbound cap / totalSupply cap\\n /// Lowest common decimal denominator between chains.\\n /// Defaults to 6 decimal places to provide up to 18,446,744,073,709.551615 units (max uint64).\\n /// For tokens exceeding this totalSupply(), they will need to override the sharedDecimals function with something smaller.\\n /// ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615\\n function sharedDecimals() public view virtual returns (uint8) {\\n return 6;\\n }\\n\\n /// @dev Sets the message inspector address for the OFT.\\n /// @param _msgInspector The address of the message inspector.\\n /// @dev This is an optional contract that can be used to inspect both 'message' and 'options'.\\n /// @dev Set it to address(0) to disable it, or set it to a contract address to enable it.\\n function setMsgInspector(address _msgInspector) public virtual onlyOwner {\\n msgInspector = _msgInspector;\\n emit MsgInspectorSet(_msgInspector);\\n }\\n\\n /// @notice Provides a quote for OFT-related operations.\\n /// @param _sendParam The parameters for the send operation.\\n /// @return oftLimit The OFT limit information.\\n /// @return oftFeeDetails The details of OFT fees.\\n /// @return oftReceipt The OFT receipt information.\\n function quoteOFT(\\n SendParam calldata _sendParam\\n )\\n external\\n view\\n virtual\\n returns (OFTLimit memory oftLimit, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory oftReceipt)\\n {\\n uint256 minAmountLD = 0; // Unused in the default implementation.\\n uint256 maxAmountLD = type(uint64).max; // Unused in the default implementation.\\n oftLimit = OFTLimit(minAmountLD, maxAmountLD);\\n\\n // Unused in the default implementation; reserved for future complex fee details.\\n oftFeeDetails = new OFTFeeDetail[](0);\\n\\n // @dev This is the same as the send() operation, but without the actual send.\\n // - amountSentLD is the amount in local decimals that would be sent from the sender.\\n // - amountReceivedLD is the amount in local decimals that will be credited to the recipient on the remote OFT instance.\\n // @dev The amountSentLD MIGHT not equal the amount the user actually receives. HOWEVER, the default does.\\n (uint256 amountSentLD, uint256 amountReceivedLD) = _debitView(\\n _sendParam.amountLD,\\n _sendParam.minAmountLD,\\n _sendParam.dstEid\\n );\\n oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD);\\n }\\n\\n /// @notice Provides a quote for the send() operation.\\n /// @param _sendParam The parameters for the send() operation.\\n /// @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.\\n /// @return msgFee The calculated LayerZero messaging fee from the send() operation.\\n /// @dev MessagingFee: LayerZero msg fee\\n /// - nativeFee: The native fee.\\n /// - lzTokenFee: The lzToken fee.\\n function quoteSend(\\n SendParam calldata _sendParam,\\n bool _payInLzToken\\n ) external view virtual returns (MessagingFee memory msgFee) {\\n // @dev mock the amount to receive, this is the same operation used in the send().\\n // The quote is as similar as possible to the actual send() operation.\\n (, uint256 amountReceivedLD) = _debitView(_sendParam.amountLD, _sendParam.minAmountLD, _sendParam.dstEid);\\n\\n // @dev Builds the options and OFT message to quote in the endpoint.\\n (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD);\\n\\n // @dev Calculates the LayerZero fee for the send() operation.\\n return _quote(_sendParam.dstEid, message, options, _payInLzToken);\\n }\\n\\n /// @dev Executes the send operation.\\n /// @param _sendParam The parameters for the send operation.\\n /// @param _fee The calculated fee for the send() operation.\\n /// - nativeFee: The native fee.\\n /// - lzTokenFee: The lzToken fee.\\n /// @param _refundAddress The address to receive any excess funds.\\n /// @return msgReceipt The receipt for the send operation.\\n /// @return oftReceipt The OFT receipt information.\\n /// @dev MessagingReceipt: LayerZero msg receipt\\n /// - guid: The unique identifier for the sent message.\\n /// - nonce: The nonce of the sent message.\\n /// - fee: The LayerZero fee incurred for the message.\\n function send(\\n SendParam calldata _sendParam,\\n MessagingFee calldata _fee,\\n address _refundAddress\\n ) public payable virtual returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) {\\n // @dev Applies the token transfers regarding this send() operation.\\n // - amountSentLD is the amount in local decimals that was ACTUALLY sent/debited from the sender.\\n // - amountReceivedLD is the amount in local decimals that will be received/credited to the recipient on the remote OFT instance.\\n (uint256 amountSentLD, uint256 amountReceivedLD) = _debit(\\n _msgSender(),\\n _sendParam.amountLD,\\n _sendParam.minAmountLD,\\n _sendParam.dstEid\\n );\\n\\n // @dev Builds the options and OFT message to quote in the endpoint.\\n (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD);\\n\\n // @dev Sends the message to the LayerZero endpoint and returns the LayerZero msg receipt.\\n msgReceipt = _lzSend(_sendParam.dstEid, message, options, _fee, _refundAddress);\\n // @dev Formulate the OFT receipt.\\n oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD);\\n\\n emit OFTSent(msgReceipt.guid, _sendParam.dstEid, _msgSender(), amountSentLD, amountReceivedLD);\\n }\\n\\n /// @dev Internal function to build the message and options.\\n /// @param _sendParam The parameters for the send() operation.\\n /// @param _amountLD The amount in local decimals.\\n /// @return message The encoded message.\\n /// @return options The encoded options.\\n function _buildMsgAndOptions(\\n SendParam calldata _sendParam,\\n uint256 _amountLD\\n ) internal view virtual returns (bytes memory message, bytes memory options) {\\n bool hasCompose;\\n // @dev This generated message has the msg.sender encoded into the payload so the remote knows who the caller is.\\n (message, hasCompose) = OFTMsgCodec.encode(\\n _sendParam.to,\\n _toSD(_amountLD),\\n // @dev Must be include a non empty bytes if you want to compose, EVEN if you dont need it on the remote.\\n // EVEN if you dont require an arbitrary payload to be sent... eg. '0x01'\\n _sendParam.composeMsg,\\n _msgSender()\\n );\\n // @dev Change the msg type depending if its composed or not.\\n uint16 msgType = hasCompose ? SEND_AND_CALL : SEND;\\n // @dev Combine the callers _extraOptions with the enforced options via the OAppOptionsType3.\\n options = combineOptions(_sendParam.dstEid, msgType, _sendParam.extraOptions);\\n\\n // @dev Optionally inspect the message and options depending if the OApp owner has set a msg inspector.\\n // @dev If it fails inspection, needs to revert in the implementation. ie. does not rely on return boolean\\n if (msgInspector != address(0)) IOAppMsgInspector(msgInspector).inspect(message, options);\\n }\\n\\n /// @dev Internal function to handle the receive on the LayerZero endpoint.\\n /// @param _origin The origin information.\\n /// - srcEid: The source chain endpoint ID.\\n /// - sender: The sender address from the src chain.\\n /// - nonce: The nonce of the LayerZero message.\\n /// @param _guid The unique identifier for the received LayerZero message.\\n /// @param _message The encoded message.\\n /// @dev _executor The address of the executor.\\n /// @dev _extraData Additional data.\\n\\n function _lzReceive(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address /*_executor*/, // @dev unused in the default implementation.\\n bytes calldata /*_extraData*/ // @dev unused in the default implementation.\\n ) internal virtual override {\\n // @dev The src sending chain doesnt know the address length on this chain (potentially non-evm)\\n // Thus everything is bytes32() encoded in flight.\\n address toAddress = _message.sendTo().bytes32ToAddress();\\n // @dev Credit the amountLD to the recipient and return the ACTUAL amount the recipient received in local decimals\\n uint256 amountReceivedLD = _credit(toAddress, _toLD(_message.amountSD()), _origin.srcEid);\\n\\n if (_message.isComposed()) {\\n // @dev Proprietary composeMsg format for the OFT.\\n bytes memory composeMsg = OFTComposeMsgCodec.encode(\\n _origin.nonce,\\n _origin.srcEid,\\n amountReceivedLD,\\n _message.composeMsg()\\n );\\n\\n // @dev Stores the lzCompose payload that will be executed in a separate tx.\\n // Standardizes functionality for executing arbitrary contract invocation on some non-evm chains.\\n // @dev The off-chain executor will listen and process the msg based on the src-chain-callers compose options passed.\\n // @dev The index is used when a OApp needs to compose multiple msgs on lzReceive.\\n // For default OFT implementation there is only 1 compose msg per lzReceive, thus its always 0.\\n endpoint.sendCompose(toAddress, _guid, 0 /* the index of the composed message*/, composeMsg);\\n }\\n\\n emit OFTReceived(_guid, _origin.srcEid, toAddress, amountReceivedLD);\\n }\\n\\n /// @dev Internal function to handle the OAppPreCrimeSimulator simulated receive.\\n /// @param _origin The origin information.\\n /// - srcEid: The source chain endpoint ID.\\n /// - sender: The sender address from the src chain.\\n /// - nonce: The nonce of the LayerZero message.\\n /// @param _guid The unique identifier for the received LayerZero message.\\n /// @param _message The LayerZero message.\\n /// @param _executor The address of the off-chain executor.\\n /// @param _extraData Arbitrary data passed by the msg executor.\\n /// @dev Enables the preCrime simulator to mock sending lzReceive() messages,\\n /// routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver.\\n function _lzReceiveSimulate(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address _executor,\\n bytes calldata _extraData\\n ) internal virtual override {\\n _lzReceive(_origin, _guid, _message, _executor, _extraData);\\n }\\n\\n /// @dev Check if the peer is considered 'trusted' by the OApp.\\n /// @param _eid The endpoint ID to check.\\n /// @param _peer The peer to check.\\n /// @return Whether the peer passed is considered 'trusted' by the OApp.\\n /// @dev Enables OAppPreCrimeSimulator to check whether a potential Inbound Packet is from a trusted source.\\n function isPeer(uint32 _eid, bytes32 _peer) public view virtual override returns (bool) {\\n return peers[_eid] == _peer;\\n }\\n\\n /// @dev Internal function to remove dust from the given local decimal amount.\\n /// @param _amountLD The amount in local decimals.\\n /// @return amountLD The amount after removing dust.\\n /// @dev Prevents the loss of dust when moving amounts between chains with different decimals.\\n /// @dev eg. uint(123) with a conversion rate of 100 becomes uint(100).\\n function _removeDust(uint256 _amountLD) internal view virtual returns (uint256 amountLD) {\\n return (_amountLD / decimalConversionRate) * decimalConversionRate;\\n }\\n\\n /// @dev Internal function to convert an amount from shared decimals into local decimals.\\n /// @param _amountSD The amount in shared decimals.\\n /// @return amountLD The amount in local decimals.\\n function _toLD(uint64 _amountSD) internal view virtual returns (uint256 amountLD) {\\n return _amountSD * decimalConversionRate;\\n }\\n\\n /// @dev Internal function to convert an amount from local decimals into shared decimals.\\n /// @param _amountLD The amount in local decimals.\\n /// @return amountSD The amount in shared decimals.\\n function _toSD(uint256 _amountLD) internal view virtual returns (uint64 amountSD) {\\n return uint64(_amountLD / decimalConversionRate);\\n }\\n\\n /// @dev Internal function to mock the amount mutation from a OFT debit() operation.\\n /// @param _amountLD The amount to send in local decimals.\\n /// @param _minAmountLD The minimum amount to send in local decimals.\\n /// @dev _dstEid The destination endpoint ID.\\n /// @return amountSentLD The amount sent, in local decimals.\\n /// @return amountReceivedLD The amount to be received on the remote chain, in local decimals.\\n /// @dev This is where things like fees would be calculated and deducted from the amount to be received on the remote.\\n function _debitView(\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n uint32 /*_dstEid*/\\n ) internal view virtual returns (uint256 amountSentLD, uint256 amountReceivedLD) {\\n // @dev Remove the dust so nothing is lost on the conversion between chains with different decimals for the token.\\n amountSentLD = _removeDust(_amountLD);\\n // @dev The amount to send is the same as amount received in the default implementation.\\n amountReceivedLD = amountSentLD;\\n\\n // @dev Check for slippage.\\n if (amountReceivedLD < _minAmountLD) {\\n revert SlippageExceeded(amountReceivedLD, _minAmountLD);\\n }\\n }\\n\\n /// @dev Internal function to perform a debit operation.\\n /// @param _from The address to debit.\\n /// @param _amountLD The amount to send in local decimals.\\n /// @param _minAmountLD The minimum amount to send in local decimals.\\n /// @param _dstEid The destination endpoint ID.\\n /// @return amountSentLD The amount sent in local decimals.\\n /// @return amountReceivedLD The amount received in local decimals on the remote.\\n /// @dev Defined here but are intended to be overriden depending on the OFT implementation.\\n /// @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD.\\n function _debit(\\n address _from,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n uint32 _dstEid\\n ) internal virtual returns (uint256 amountSentLD, uint256 amountReceivedLD);\\n\\n /// @dev Internal function to perform a credit operation.\\n /// @param _to The address to credit.\\n /// @param _amountLD The amount to credit in local decimals.\\n /// @param _srcEid The source endpoint ID.\\n /// @return amountReceivedLD The amount ACTUALLY received in local decimals.\\n /// @dev Defined here but are intended to be overriden depending on the OFT implementation.\\n /// @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD.\\n\\n function _credit(\\n address _to,\\n uint256 _amountLD,\\n uint32 _srcEid\\n ) internal virtual returns (uint256 amountReceivedLD);\\n}\\n\",\"keccak256\":\"0x9e0e9be45f8ce68f9230febff5feaee523023799797083396253d000204babdc\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/oft/libraries/OFTMsgCodec.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nlibrary OFTMsgCodec {\\n // Offset constants for encoding and decoding OFT messages\\n uint8 private constant SEND_TO_OFFSET = 32;\\n uint8 private constant SEND_AMOUNT_SD_OFFSET = 40;\\n\\n /**\\n * @dev Encodes an OFT LayerZero message.\\n * @param _sendTo The recipient address.\\n * @param _amountShared The amount in shared decimals.\\n * @param _composeMsg The composed message.\\n * @param _sender The msg sender\\n * @return _msg The encoded message.\\n * @return hasCompose A boolean indicating whether the message has a composed payload.\\n */\\n function encode(\\n bytes32 _sendTo,\\n uint64 _amountShared,\\n bytes memory _composeMsg,\\n address _sender\\n ) internal pure returns (bytes memory _msg, bool hasCompose) {\\n hasCompose = _composeMsg.length > 0;\\n // @dev Remote chains will want to know the composed function caller ie. msg.sender on the src.\\n _msg = hasCompose\\n ? abi.encodePacked(_sendTo, _amountShared, addressToBytes32(_sender), _composeMsg)\\n : abi.encodePacked(_sendTo, _amountShared);\\n }\\n\\n /**\\n * @dev Checks if the OFT message is composed.\\n * @param _msg The OFT message.\\n * @return A boolean indicating whether the message is composed.\\n */\\n function isComposed(bytes calldata _msg) internal pure returns (bool) {\\n return _msg.length > SEND_AMOUNT_SD_OFFSET;\\n }\\n\\n /**\\n * @dev Retrieves the recipient address from the OFT message.\\n * @param _msg The OFT message.\\n * @return The recipient address.\\n */\\n function sendTo(bytes calldata _msg) internal pure returns (bytes32) {\\n return bytes32(_msg[:SEND_TO_OFFSET]);\\n }\\n\\n /**\\n * @dev Retrieves the amount in shared decimals from the OFT message.\\n * @param _msg The OFT message.\\n * @return The amount in shared decimals.\\n */\\n function amountSD(bytes calldata _msg) internal pure returns (uint64) {\\n return uint64(bytes8(_msg[SEND_TO_OFFSET:SEND_AMOUNT_SD_OFFSET]));\\n }\\n\\n /**\\n * @dev Retrieves the composed message from the OFT message.\\n * @param _msg The OFT message.\\n * @return The composed message.\\n */\\n function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\\n return _msg[SEND_AMOUNT_SD_OFFSET:];\\n }\\n\\n /**\\n * @dev Converts an address to bytes32.\\n * @param _addr The address to convert.\\n * @return The bytes32 representation of the address.\\n */\\n function addressToBytes32(address _addr) internal pure returns (bytes32) {\\n return bytes32(uint256(uint160(_addr)));\\n }\\n\\n /**\\n * @dev Converts bytes32 to an address.\\n * @param _b The bytes32 value to convert.\\n * @return The address representation of bytes32.\\n */\\n function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\\n return address(uint160(uint256(_b)));\\n }\\n}\\n\",\"keccak256\":\"0xf706ea7e0523d956e2a9d479690c7f455533d20c49ae4473fb10dfc3c9221faa\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/oft/oapp/OApp.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\n// @dev Import the 'MessagingFee' and 'MessagingReceipt' so it's exposed to OApp implementers\\n// solhint-disable-next-line no-unused-import\\nimport {OAppSender, MessagingFee, MessagingReceipt} from \\\"./OAppSender.sol\\\";\\n// @dev Import the 'Origin' so it's exposed to OApp implementers\\n// solhint-disable-next-line no-unused-import\\nimport {OAppReceiver, Origin} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppReceiver.sol\\\";\\nimport {OAppCore} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppCore.sol\\\";\\n\\n/**\\n * @title OApp\\n * @dev Abstract contract serving as the base for OApp implementation, combining OAppSender and OAppReceiver functionality.\\n * @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OApp.sol'\\n * but has been modified to support ERC2771 compatibility.\\n */\\nabstract contract OApp is OAppSender, OAppReceiver {\\n /**\\n * @dev Constructor to initialize the OApp with the provided endpoint and owner.\\n * @param _endpoint The address of the LOCAL LayerZero endpoint.\\n * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\\n */\\n constructor(address _endpoint, address _delegate) OAppCore(_endpoint, _delegate) {}\\n\\n /**\\n * @notice Retrieves the OApp version information.\\n * @return senderVersion The version of the OAppSender.sol implementation.\\n * @return receiverVersion The version of the OAppReceiver.sol implementation.\\n */\\n function oAppVersion()\\n public\\n pure\\n virtual\\n override(OAppSender, OAppReceiver)\\n returns (uint64 senderVersion, uint64 receiverVersion)\\n {\\n return (SENDER_VERSION, RECEIVER_VERSION);\\n }\\n}\\n\",\"keccak256\":\"0x0ba47a702d1d5689b38a055a72110529225cfa0570e3f102a5de45af70dcee82\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/oft/oapp/OAppSender.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nimport {SafeERC20, IERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {MessagingParams, MessagingFee, MessagingReceipt} from \\\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\\\";\\nimport {OAppCore} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppCore.sol\\\";\\n/**\\n * @title OAppSender\\n * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.\\n * @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppSender.sol'\\n * but has been modified to support ERC2771 compatibility.\\n */\\nabstract contract OAppSender is OAppCore {\\n using SafeERC20 for IERC20;\\n\\n // Custom error messages\\n error NotEnoughNative(uint256 msgValue);\\n error LzTokenUnavailable();\\n\\n // @dev The version of the OAppSender implementation.\\n // @dev Version is bumped when changes are made to this contract.\\n uint64 internal constant SENDER_VERSION = 1;\\n\\n /**\\n * @notice Retrieves the OApp version information.\\n * @return senderVersion The version of the OAppSender.sol contract.\\n * @return receiverVersion The version of the OAppReceiver.sol contract.\\n *\\n * @dev Providing 0 as the default for OAppReceiver version. Indicates that the OAppReceiver is not implemented.\\n * ie. this is a SEND only OApp.\\n * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions\\n */\\n function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\\n return (SENDER_VERSION, 0);\\n }\\n\\n /**\\n * @dev Internal function to interact with the LayerZero EndpointV2.quote() for fee calculation.\\n * @param _dstEid The destination endpoint ID.\\n * @param _message The message payload.\\n * @param _options Additional options for the message.\\n * @param _payInLzToken Flag indicating whether to pay the fee in LZ tokens.\\n * @return fee The calculated MessagingFee for the message.\\n * - nativeFee: The native fee for the message.\\n * - lzTokenFee: The LZ token fee for the message.\\n */\\n function _quote(\\n uint32 _dstEid,\\n bytes memory _message,\\n bytes memory _options,\\n bool _payInLzToken\\n ) internal view virtual returns (MessagingFee memory fee) {\\n return\\n endpoint.quote(\\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken),\\n address(this)\\n );\\n }\\n\\n /**\\n * @dev Internal function to interact with the LayerZero EndpointV2.send() for sending a message.\\n * @param _dstEid The destination endpoint ID.\\n * @param _message The message payload.\\n * @param _options Additional options for the message.\\n * @param _fee The calculated LayerZero fee for the message.\\n * - nativeFee: The native fee.\\n * - lzTokenFee: The lzToken fee.\\n * @param _refundAddress The address to receive any excess fee values sent to the endpoint.\\n * @return receipt The receipt for the sent message.\\n * - guid: The unique identifier for the sent message.\\n * - nonce: The nonce of the sent message.\\n * - fee: The LayerZero fee incurred for the message.\\n */\\n function _lzSend(\\n uint32 _dstEid,\\n bytes memory _message,\\n bytes memory _options,\\n MessagingFee memory _fee,\\n address _refundAddress\\n ) internal virtual returns (MessagingReceipt memory receipt) {\\n // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint.\\n uint256 messageValue = _payNative(_fee.nativeFee);\\n if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);\\n\\n return\\n // solhint-disable-next-line check-send-result\\n endpoint.send{value: messageValue}(\\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0),\\n _refundAddress\\n );\\n }\\n\\n /**\\n * @dev Internal function to pay the native fee associated with the message.\\n * @param _nativeFee The native fee to be paid.\\n * @return nativeFee The amount of native currency paid.\\n *\\n * @dev If the OApp needs to initiate MULTIPLE LayerZero messages in a single transaction,\\n * this will need to be overridden because msg.value would contain multiple lzFees.\\n * @dev Should be overridden in the event the LayerZero endpoint requires a different native currency.\\n * @dev Some EVMs use an ERC20 as a method for paying transactions/gasFees.\\n * @dev The endpoint is EITHER/OR, ie. it will NOT support both types of native payment at a time.\\n */\\n function _payNative(uint256 _nativeFee) internal virtual returns (uint256 nativeFee) {\\n if (msg.value != _nativeFee) revert NotEnoughNative(msg.value);\\n return _nativeFee;\\n }\\n\\n /**\\n * @dev Internal function to pay the LZ token fee associated with the message.\\n * @param _lzTokenFee The LZ token fee to be paid.\\n *\\n * @dev If the caller is trying to pay in the specified lzToken, then the lzTokenFee is passed to the endpoint.\\n * @dev Any excess sent, is passed back to the specified _refundAddress in the _lzSend().\\n */\\n function _payLzToken(uint256 _lzTokenFee) internal virtual {\\n // @dev Cannot cache the token because it is not immutable in the endpoint.\\n address lzToken = endpoint.lzToken();\\n if (lzToken == address(0)) revert LzTokenUnavailable();\\n\\n // Pay LZ token fee by sending tokens to the endpoint.\\n IERC20(lzToken).safeTransferFrom(_msgSender(), address(endpoint), _lzTokenFee);\\n }\\n}\\n\",\"keccak256\":\"0x4f4a30772bee7afac6945cdfb978202470722aa244c614efb245d2e4cd205bf3\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/sand/ERC20BaseToken.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nimport {Context} from \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport {IERC20Errors} from \\\"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\\\";\\nimport {ERC20Internal} from \\\"./ERC20Internal.sol\\\";\\nimport {IErrors} from \\\"../interfaces/IErrors.sol\\\";\\nimport {IERC20, IERC20Extended} from \\\"../interfaces/IERC20Extended.sol\\\";\\nimport {WithSuperOperators} from \\\"./WithSuperOperators.sol\\\";\\n\\nabstract contract ERC20BaseToken is\\n IErrors,\\n WithSuperOperators,\\n IERC20,\\n IERC20Extended,\\n IERC20Errors,\\n ERC20Internal,\\n Context\\n{\\n string internal _name;\\n string internal _symbol;\\n address internal immutable _operator;\\n uint256 internal _totalSupply;\\n mapping(address => uint256) internal _balances;\\n mapping(address => mapping(address => uint256)) internal _allowances;\\n\\n constructor(string memory tokenName, string memory tokenSymbol, address admin, address operator) {\\n _name = tokenName;\\n _symbol = tokenSymbol;\\n _admin = admin;\\n _operator = operator;\\n }\\n\\n /// @notice Transfer `amount` tokens to `to`.\\n /// @param to The recipient address of the tokens being transfered.\\n /// @param amount The number of tokens being transfered.\\n /// @return success Whether or not the transfer succeeded.\\n function transfer(address to, uint256 amount) external override returns (bool success) {\\n _transfer(_msgSender(), to, amount);\\n return true;\\n }\\n\\n /// @notice Transfer `amount` tokens from `from` to `to`.\\n /// @param from The origin address of the tokens being transferred.\\n /// @param to The recipient address of the tokensbeing transfered.\\n /// @param amount The number of tokens transfered.\\n /// @return success Whether or not the transfer succeeded.\\n function transferFrom(address from, address to, uint256 amount) external override returns (bool success) {\\n if (_msgSender() != from && !_superOperators[_msgSender()] && _msgSender() != _operator) {\\n uint256 currentAllowance = _allowances[from][_msgSender()];\\n if (currentAllowance != ~uint256(0)) {\\n // save gas when allowance is maximal by not reducing it (see https://github.com/ethereum/EIPs/issues/717)\\n if (currentAllowance < amount) {\\n revert ERC20InsufficientAllowance(_msgSender(), currentAllowance, amount);\\n }\\n _allowances[from][_msgSender()] = currentAllowance - amount;\\n }\\n }\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /// @notice Burn `amount` tokens.\\n /// @param amount The number of tokens to burn.\\n function burn(uint256 amount) external override {\\n _burn(_msgSender(), amount);\\n }\\n\\n /// @notice Burn `amount` tokens from `owner`.\\n /// @param from The address whose token to burn.\\n /// @param amount The number of tokens to burn.\\n function burnFor(address from, uint256 amount) external override {\\n _burn(from, amount);\\n }\\n\\n /// @notice Approve `spender` to transfer `amount` tokens.\\n /// @param spender The address to be given rights to transfer.\\n /// @param amount The number of tokens allowed.\\n /// @return success Whether or not the call succeeded.\\n function approve(address spender, uint256 amount) external override returns (bool success) {\\n _approveFor(_msgSender(), spender, amount);\\n return true;\\n }\\n\\n /// @notice Get the name of the token collection.\\n /// @return The name of the token collection.\\n function name() external view virtual returns (string memory) {\\n //added virtual\\n return _name;\\n }\\n\\n /// @notice Get the symbol for the token collection.\\n /// @return The symbol of the token collection.\\n function symbol() external view virtual returns (string memory) {\\n //added virtual\\n return _symbol;\\n }\\n\\n /// @notice Get the total number of tokens in existence.\\n /// @return The total number of tokens in existence.\\n function totalSupply() external view override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /// @notice Get the balance of `owner`.\\n /// @param owner The address to query the balance of.\\n /// @return The amount owned by `owner`.\\n function balanceOf(address owner) external view override returns (uint256) {\\n return _balances[owner];\\n }\\n\\n /// @notice Get the allowance of `spender` for `owner`'s tokens.\\n /// @param owner The address whose token is allowed.\\n /// @param spender The address allowed to transfer.\\n /// @return remaining The amount of token `spender` is allowed to transfer on behalf of `owner`.\\n function allowance(address owner, address spender) external view override returns (uint256 remaining) {\\n return _allowances[owner][spender];\\n }\\n\\n /// @notice Get the number of decimals for the token collection.\\n /// @return The number of decimals.\\n function decimals() external pure virtual returns (uint8) {\\n return uint8(18);\\n }\\n\\n /// @notice Approve `spender` to transfer `amount` tokens from `owner`.\\n /// @param owner The address whose token is allowed.\\n /// @param spender The address to be given rights to transfer.\\n /// @param amount The number of tokens allowed.\\n /// @return success Whether or not the call succeeded.\\n function approveFor(address owner, address spender, uint256 amount) public override returns (bool success) {\\n if (!(_msgSender() == owner || _superOperators[_msgSender()] || _msgSender() == _operator)) {\\n revert NotAuthorized();\\n }\\n _approveFor(owner, spender, amount);\\n return true;\\n }\\n\\n /// @notice Increase the allowance for the spender if needed\\n /// @param owner The address of the owner of the tokens\\n /// @param spender The address wanting to spend tokens\\n /// @param amountNeeded The amount requested to spend\\n /// @return success Whether or not the call succeeded.\\n function addAllowanceIfNeeded(address owner, address spender, uint256 amountNeeded) public returns (bool success) {\\n if (!(_msgSender() == owner || _superOperators[_msgSender()] || _msgSender() == _operator)) {\\n revert InvalidSender();\\n }\\n _addAllowanceIfNeeded(owner, spender, amountNeeded);\\n return true;\\n }\\n\\n /// @dev See addAllowanceIfNeeded.\\n function _addAllowanceIfNeeded(\\n address owner,\\n address spender,\\n uint256 amountNeeded /*(ERC20Internal, ERC20ExecuteExtension, ERC20BasicApproveExtension)*/\\n ) internal virtual override {\\n if (amountNeeded > 0 && !isSuperOperator(spender) && spender != _operator) {\\n uint256 currentAllowance = _allowances[owner][spender];\\n if (currentAllowance < amountNeeded) {\\n _approveFor(owner, spender, amountNeeded);\\n }\\n }\\n }\\n\\n /// @dev See approveFor.\\n function _approveFor(\\n address owner,\\n address spender,\\n uint256 amount /*(ERC20BasicApproveExtension, ERC20Internal)*/\\n ) internal virtual override {\\n if (owner == address(0) || spender == address(0)) {\\n revert InvalidOwnerOrSpender();\\n }\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /// @dev See transfer.\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount /*(ERC20Internal, ERC20ExecuteExtension)*/\\n ) internal virtual override {\\n if (to == address(0) || to == address(this)) {\\n revert ERC20InvalidReceiver(to);\\n }\\n uint256 currentBalance = _balances[from];\\n if (currentBalance < amount) {\\n revert ERC20InsufficientBalance(from, currentBalance, amount);\\n }\\n _balances[from] = currentBalance - amount;\\n _balances[to] += amount;\\n emit Transfer(from, to, amount);\\n }\\n\\n /// @dev Mint tokens for a recipient.\\n /// @param to The recipient address.\\n /// @param amount The number of token to mint.\\n function _mint(address to, uint256 amount) internal {\\n if (to == address(0)) {\\n revert ERC20InvalidReceiver(to);\\n }\\n if (amount == 0) {\\n revert InvalidAmount();\\n }\\n uint256 currentTotalSupply = _totalSupply;\\n uint256 newTotalSupply = currentTotalSupply + amount;\\n if (newTotalSupply <= currentTotalSupply) {\\n revert Overflow();\\n }\\n _totalSupply = newTotalSupply;\\n _balances[to] += amount;\\n emit Transfer(address(0), to, amount);\\n }\\n\\n /// @dev Burn tokens from an address.\\n /// @param from The address whose tokens to burn.\\n /// @param amount The number of token to burn.\\n function _burn(address from, uint256 amount) internal {\\n if (amount == 0) {\\n revert InvalidAmount();\\n }\\n if (_msgSender() != from && !_superOperators[_msgSender()] && _msgSender() != _operator) {\\n uint256 currentAllowance = _allowances[from][_msgSender()];\\n if (currentAllowance != ~uint256(0)) {\\n // save gas when allowance is maximal by not reducing it (see https://github.com/ethereum/EIPs/issues/717)\\n if (currentAllowance < amount) {\\n revert ERC20InsufficientAllowance(_msgSender(), currentAllowance, amount);\\n }\\n _allowances[from][_msgSender()] = currentAllowance - amount;\\n }\\n }\\n\\n uint256 currentBalance = _balances[from];\\n if (currentBalance < amount) {\\n revert ERC20InsufficientBalance(from, currentBalance, amount);\\n }\\n _balances[from] = currentBalance - amount;\\n _totalSupply -= amount;\\n emit Transfer(from, address(0), amount);\\n }\\n}\\n\",\"keccak256\":\"0xe59413e1d9248cb497327b3801ca43900fc1b480ab7b03c83c6d86dc09e2bb44\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/sand/ERC20BasicApproveExtension.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport {Context} from \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport {ERC20Internal} from \\\"./ERC20Internal.sol\\\";\\nimport {IErrors} from \\\"../interfaces/IErrors.sol\\\";\\nimport {BytesUtil} from \\\"../libraries/BytesUtil.sol\\\";\\n\\nabstract contract ERC20BasicApproveExtension is IErrors, ERC20Internal, Context {\\n /// @notice Approve `target` to spend `amount` and call it with data.\\n /// @param target The address to be given rights to transfer and destination of the call.\\n /// @param amount The number of tokens allowed.\\n /// @param data The bytes for the call.\\n /// @return The data of the call.\\n function approveAndCall(\\n address target,\\n uint256 amount,\\n bytes calldata data\\n ) external payable returns (bytes memory) {\\n if (!BytesUtil.doFirstParamEqualsAddress(data, _msgSender())) {\\n revert FirstParamNotSender();\\n }\\n\\n _approveFor(_msgSender(), target, amount);\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returnData) = target.call{value: msg.value}(data);\\n if (!success) {\\n revert CallFailed(string(returnData));\\n }\\n return returnData;\\n }\\n\\n /// @notice Temporarily approve `target` to spend `amount` and call it with data.\\n /// Previous approvals remains unchanged.\\n /// @param target The destination of the call, allowed to spend the amount specified\\n /// @param amount The number of tokens allowed to spend.\\n /// @param data The bytes for the call.\\n /// @return The data of the call.\\n function paidCall(address target, uint256 amount, bytes calldata data) external payable returns (bytes memory) {\\n if (!BytesUtil.doFirstParamEqualsAddress(data, _msgSender())) {\\n revert FirstParamNotSender();\\n }\\n\\n if (amount > 0) {\\n _addAllowanceIfNeeded(_msgSender(), target, amount);\\n }\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returnData) = target.call{value: msg.value}(data);\\n if (!success) {\\n revert CallFailed(string(returnData));\\n }\\n\\n return returnData;\\n }\\n}\\n\",\"keccak256\":\"0x08439cbd5ce3b567804d278d85ee1a93340ad26b9555e198059318b2e4cc0f88\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/sand/ERC20Internal.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nabstract contract ERC20Internal {\\n function _approveFor(address owner, address target, uint256 amount) internal virtual;\\n\\n function _addAllowanceIfNeeded(address owner, address spender, uint256 amountNeeded) internal virtual;\\n\\n function _transfer(address from, address to, uint256 amount) internal virtual;\\n}\\n\",\"keccak256\":\"0x48bf018193074544e657b431eed0e6128c28d5d3c2655c98c9c89965e7729653\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/sand/ERC2771Handler.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// solhint-disable-next-line compiler-version\\npragma solidity 0.8.23;\\n\\n/// @title ERC2771Handler\\n/// @author The Sandbox\\n/// @notice Handle meta-transactions\\n/// @dev minimal ERC2771 handler to keep bytecode-size down\\n/// based on: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.6.0/contracts/metatx/ERC2771Context.sol\\n/// with an initializer for proxies and a mutable forwarder\\nabstract contract ERC2771Handler {\\n address internal _trustedForwarder;\\n\\n event TrustedForwarderSet(address indexed newForwarder);\\n\\n /// @dev Initializes the contract\\n /// @param forwarder trusted forwarder address\\n function __ERC2771Handler_initialize(address forwarder) internal {\\n _trustedForwarder = forwarder;\\n emit TrustedForwarderSet(_trustedForwarder);\\n }\\n\\n /// @notice Checks if an address is a trusted forwarder\\n /// @param forwarder address to check\\n /// @return is trusted\\n function isTrustedForwarder(address forwarder) public view returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n /// @notice Get the current trusted forwarder\\n /// @return trustedForwarder address of the trusted forwarder\\n function getTrustedForwarder() external view returns (address) {\\n return _trustedForwarder;\\n }\\n\\n /// @dev if the call comes from the trusted forwarder, it gets the real sender by checking the encoded address in the data\\n /// @return sender address of the real sender\\n function _msgSender() internal view virtual returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return msg.sender;\\n }\\n }\\n\\n /// @dev if the call comes from the trusted forwarder, it substracts the sender address from `msg.data` to get the real `msg.data`\\n /// @return the real `msg.data`\\n function _msgData() internal view virtual returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return msg.data;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x740d1ad5b4dea0a78c29422d27ad22bc649505221bda874599a0370843c9dcad\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/sand/SandBaseToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\nimport {ERC20BasicApproveExtension} from \\\"./ERC20BasicApproveExtension.sol\\\";\\nimport {ERC20BaseToken} from \\\"./ERC20BaseToken.sol\\\";\\n\\ncontract SandBaseToken is ERC20BaseToken, ERC20BasicApproveExtension {\\n constructor(\\n address sandAdmin,\\n address executionAdmin,\\n address beneficiary,\\n uint256 amount\\n ) ERC20BaseToken(\\\"SAND\\\", \\\"SAND\\\", sandAdmin, executionAdmin) {\\n _changeAdmin(sandAdmin);\\n if (beneficiary != address(0)) {\\n uint256 initialSupply = amount * (1 ether);\\n _mint(beneficiary, initialSupply);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x8254a5881123a631ca9cc035e8d54667e5081ccd51971974eee43ac2b82bda78\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/sand/WithAdmin.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// solhint-disable-next-line compiler-version\\npragma solidity 0.8.23;\\n\\nimport {IErrors} from \\\"../interfaces/IErrors.sol\\\";\\n\\ncontract WithAdmin is IErrors {\\n address internal _admin;\\n\\n /// @dev Emits when the contract administrator is changed.\\n /// @param oldAdmin The address of the previous administrator.\\n /// @param newAdmin The address of the new administrator.\\n event AdminChanged(address indexed oldAdmin, address indexed newAdmin);\\n\\n modifier onlyAdmin() {\\n if (msg.sender != _admin) {\\n revert OnlyAdmin();\\n }\\n _;\\n }\\n\\n /// @dev Get the current administrator of this contract.\\n /// @return The current administrator of this contract.\\n function getAdmin() external view returns (address) {\\n return _admin;\\n }\\n\\n /// @dev Change the administrator to be `newAdmin`.\\n /// @param newAdmin The address of the new administrator.\\n function changeAdmin(address newAdmin) external onlyAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_admin, newAdmin);\\n _admin = newAdmin;\\n }\\n}\\n\",\"keccak256\":\"0x1e31132c4458d4d9206e04ffd9ff718ce214885619d17817a23ed1e71a09b7c5\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/sand/WithSuperOperators.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// solhint-disable-next-line compiler-version\\npragma solidity 0.8.23;\\n\\nimport {IErrors} from \\\"../interfaces/IErrors.sol\\\";\\nimport {WithAdmin} from \\\"./WithAdmin.sol\\\";\\n\\ncontract WithSuperOperators is IErrors, WithAdmin {\\n mapping(address => bool) internal _superOperators;\\n\\n event SuperOperator(address indexed superOperator, bool indexed enabled);\\n\\n /// @notice Enable or disable the ability of `superOperator` to transfer tokens of all (superOperator rights).\\n /// @param superOperator address that will be given/removed superOperator right.\\n /// @param enabled set whether the superOperator is enabled or disabled.\\n function setSuperOperator(address superOperator, bool enabled) external onlyAdmin {\\n _superOperators[superOperator] = enabled;\\n emit SuperOperator(superOperator, enabled);\\n }\\n\\n /// @notice check whether address `who` is given superOperator rights.\\n /// @param who The address to query.\\n /// @return whether the address has superOperator rights.\\n function isSuperOperator(address who) public view returns (bool) {\\n return _superOperators[who];\\n }\\n}\\n\",\"keccak256\":\"0x1ce81eb500d864992267e6c86e1fe01262efaa5707eb33cc1f8c7d01a3d4c207\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60e06040523480156200001157600080fd5b5060405162004c4c38038062004c4c8339810160408190526200003491620004cb565b6012828281818181878b8b6000806040518060400160405280600481526020016314d0539160e21b8152506040518060400160405280600481526020016314d0539160e21b815250858583600290816200008f9190620005e2565b5060036200009e8482620005e2565b50600080546001600160a01b0319166001600160a01b039384161790551660805250620000cd90508462000252565b6001600160a01b0382161562000103576000620000f382670de0b6b3a7640000620006c4565b9050620001018382620002ad565b505b5050506001600160a01b03821690506200013857604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6200014381620003b2565b506001600160a01b0380831660a05281166200017257604051632d618d8160e21b815260040160405180910390fd5b60a05160405163ca5eb5e160e01b81526001600160a01b0383811660048301529091169063ca5eb5e190602401600060405180830381600087803b158015620001ba57600080fd5b505af1158015620001cf573d6000803e3d6000fd5b5050505050505050620001e76200040460201b60201c565b60ff168360ff1610156200020e576040516301e9714b60e41b815260040160405180910390fd5b6200021b600684620006e4565b6200022890600a620007fd565b60c052506200023b915086905062000409565b62000247600162000453565b50505050506200082b565b600080546040516001600160a01b03808516939216917f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f91a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038216620002e15760405163ec442f0560e01b81526001600160a01b03831660048201526024016200012f565b80600003620003035760405163162908e360e11b815260040160405180910390fd5b600454600062000314838362000815565b90508181116200033757604051631a93c68960e11b815260040160405180910390fd5b60048190556001600160a01b038416600090815260056020526040812080548592906200036690849062000815565b90915550506040518381526001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a350505050565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600690565b600780546001600160a01b0319166001600160a01b0383169081179091556040517fd91237492a9e30cd2faf361fc103998a382ff0ec2b1b07dc1cbebb76ae2f1ea290600090a250565b600c805460ff60a01b1916600160a01b8315158102919091179182905560405160ff9190920416151581527f54ca1f89aee2b8d11c89b7813c6aa99caa0f8c55c8eccf8b70c3bb42029fa1349060200160405180910390a150565b80516001600160a01b0381168114620004c657600080fd5b919050565b600080600080600060a08688031215620004e457600080fd5b620004ef86620004ae565b9450620004ff60208701620004ae565b93506200050f60408701620004ae565b92506200051f60608701620004ae565b91506200052f60808701620004ae565b90509295509295909350565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200056657607f821691505b6020821081036200058757634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620005dd576000816000526020600020601f850160051c81016020861015620005b85750805b601f850160051c820191505b81811015620005d957828155600101620005c4565b5050505b505050565b81516001600160401b03811115620005fe57620005fe6200053b565b62000616816200060f845462000551565b846200058d565b602080601f8311600181146200064e5760008415620006355750858301515b600019600386901b1c1916600185901b178555620005d9565b600085815260208120601f198616915b828110156200067f578886015182559484019460019091019084016200065e565b50858210156200069e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417620006de57620006de620006ae565b92915050565b60ff8281168282160390811115620006de57620006de620006ae565b600181815b8085111562000741578160001904821115620007255762000725620006ae565b808516156200073357918102915b93841c939080029062000705565b509250929050565b6000826200075a57506001620006de565b816200076957506000620006de565b81600181146200078257600281146200078d57620007ad565b6001915050620006de565b60ff841115620007a157620007a1620006ae565b50506001821b620006de565b5060208310610133831016604e8410600b8410161715620007d2575081810a620006de565b620007de838362000700565b8060001904821115620007f557620007f5620006ae565b029392505050565b60006200080e60ff84168362000749565b9392505050565b80820180821115620006de57620006de620006ae565b60805160a05160c05161438f620008bd600039600081816108d401528181612a8201528181612af70152612bbe01526000818161071b01528181610ccc0152818161196f01528181611dec015281816124f101528181612cd801528181612f340152613017015260008181610e2401528181610fbb0152818161110601528181611f5001526125ee015261438f6000f3fe6080604052600436106103765760003560e01c806370a08231116101d1578063bb0b6a5311610102578063ce1b815f116100a0578063dd62ed3e1161006f578063dd62ed3e14610ac2578063f2fde38b14610b08578063fc0c546a14610670578063ff7bd03d14610b2857600080fd5b8063ce1b815f14610a51578063d045a0dc14610a6f578063d424388514610a82578063da74222814610aa257600080fd5b8063bd815db0116100dc578063bd815db0146109ea578063c7c7f5b3146109fd578063ca5eb5e114610a1e578063cae9ca5114610a3e57600080fd5b8063bb0b6a531461098a578063bb1e23cb146109b7578063bc70b354146109ca57600080fd5b806395d89b411161016f578063a9059cbb11610149578063a9059cbb1461090a578063ac9fe4211461092a578063b731ea0a1461094a578063b98bd0701461096a57600080fd5b806395d89b41146108ad578063963efcaa146108c25780639f68b964146108f657600080fd5b806382413eac116101ab57806382413eac1461083b578063857749b01461085b5780638da5cb5b1461086f5780638f2839701461088d57600080fd5b806370a08231146107b4578063715018a6146107ea5780637d25a05e146107ff57600080fd5b8063313ce567116102ab5780635535d461116102495780635e280f11116102235780635e280f1114610709578063654b748a1461073d5780636e9960c3146107765780636fc1b31e1461079457600080fd5b80635535d46114610683578063572b6c05146106a35780635a0dfe4d146106d257600080fd5b80633b7b5a16116102855780633b7b5a161461061057806342966c68146106305780634df68ada1461065057806352ae28791461067057600080fd5b8063313ce567146105a15780633400288b146105c35780633b6f743b146105e357600080fd5b806317442b70116103185780631dd319cb116102f25780631dd319cb1461052c5780631f5e13341461054c57806323b872dd146105615780632b9917461461058157600080fd5b806317442b70146104bb57806318160ddd146104dd57806318de0afd146104fc57600080fd5b8063111ecdad11610354578063111ecdad1461040557806313137d651461043d578063134d4f2514610452578063156a0d0f1461047a57600080fd5b806306fdde031461037b578063095ea7b3146103a65780630d35b415146103d6575b600080fd5b34801561038757600080fd5b50610390610b48565b60405161039d91906132e2565b60405180910390f35b3480156103b257600080fd5b506103c66103c136600461330a565b610bda565b604051901515815260200161039d565b3480156103e257600080fd5b506103f66103f136600461334e565b610bf8565b60405161039d93929190613383565b34801561041157600080fd5b50600c54610425906001600160a01b031681565b6040516001600160a01b03909116815260200161039d565b61045061044b366004613495565b610cca565b005b34801561045e57600080fd5b50610467600281565b60405161ffff909116815260200161039d565b34801561048657600080fd5b50604080517f02e49c2c000000000000000000000000000000000000000000000000000000008152600160208201520161039d565b3480156104c757600080fd5b506040805160018152600260208201520161039d565b3480156104e957600080fd5b506004545b60405190815260200161039d565b34801561050857600080fd5b50600c5474010000000000000000000000000000000000000000900460ff166103c6565b34801561053857600080fd5b5061045061054736600461330a565b610dbc565b34801561055857600080fd5b50610467600181565b34801561056d57600080fd5b506103c661057c366004613535565b610dca565b34801561058d57600080fd5b506103c661059c366004613535565b610f65565b3480156105ad57600080fd5b5060125b60405160ff909116815260200161039d565b3480156105cf57600080fd5b506104506105de36600461358f565b611037565b3480156105ef57600080fd5b506106036105fe3660046135b9565b611049565b60405161039d919061360b565b34801561061c57600080fd5b506103c661062b366004613535565b6110b0565b34801561063c57600080fd5b5061045061064b366004613622565b611182565b34801561065c57600080fd5b5061045061066b36600461363b565b611196565b34801561067c57600080fd5b5030610425565b34801561068f57600080fd5b5061039061069e36600461366a565b6111ca565b3480156106af57600080fd5b506103c66106be36600461369d565b6007546001600160a01b0391821691161490565b3480156106de57600080fd5b506103c66106ed36600461358f565b63ffffffff919091166000908152600960205260409020541490565b34801561071557600080fd5b506104257f000000000000000000000000000000000000000000000000000000000000000081565b34801561074957600080fd5b506103c661075836600461369d565b6001600160a01b031660009081526001602052604090205460ff1690565b34801561078257600080fd5b506000546001600160a01b0316610425565b3480156107a057600080fd5b506104506107af36600461369d565b61126f565b3480156107c057600080fd5b506104ee6107cf36600461369d565b6001600160a01b031660009081526005602052604090205490565b3480156107f657600080fd5b506104506112d9565b34801561080b57600080fd5b5061082261081a36600461358f565b600092915050565b60405167ffffffffffffffff909116815260200161039d565b34801561084757600080fd5b506103c66108563660046136ba565b6112ed565b34801561086757600080fd5b5060066105b1565b34801561087b57600080fd5b506008546001600160a01b0316610425565b34801561089957600080fd5b506104506108a836600461369d565b611302565b3480156108b957600080fd5b50610390611336565b3480156108ce57600080fd5b506104ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561090257600080fd5b5060006103c6565b34801561091657600080fd5b506103c661092536600461330a565b611345565b34801561093657600080fd5b50610450610945366004613721565b611359565b34801561095657600080fd5b50600a54610425906001600160a01b031681565b34801561097657600080fd5b50610450610985366004613794565b6113f6565b34801561099657600080fd5b506104ee6109a53660046137d6565b60096020526000908152604090205481565b6103906109c53660046137f1565b611410565b3480156109d657600080fd5b506103906109e536600461384d565b611546565b6104506109f8366004613794565b611707565b610a10610a0b366004613896565b6118aa565b60405161039d929190613904565b348015610a2a57600080fd5b50610450610a3936600461369d565b61192f565b610390610a4c3660046137f1565b6119ce565b348015610a5d57600080fd5b506007546001600160a01b0316610425565b610450610a7d366004613495565b611a5b565b348015610a8e57600080fd5b50610450610a9d36600461369d565b611aa3565b348015610aae57600080fd5b50610450610abd36600461369d565b611b06565b348015610ace57600080fd5b506104ee610add366004613957565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b348015610b1457600080fd5b50610450610b2336600461369d565b611b3d565b348015610b3457600080fd5b506103c6610b43366004613985565b611b91565b606060028054610b57906139a1565b80601f0160208091040260200160405190810160405280929190818152602001828054610b83906139a1565b8015610bd05780601f10610ba557610100808354040283529160200191610bd0565b820191906000526020600020905b815481529060010190602001808311610bb357829003601f168201915b5050505050905090565b6000610bee610be7611bc7565b8484611bd6565b5060015b92915050565b60408051808201909152600080825260208201526060610c2b604051806040016040528060008152602001600081525090565b604080518082018252600080825267ffffffffffffffff602080840182905284518381529081019094529195509182610c87565b604080518082019091526000815260606020820152815260200190600190039081610c5f5790505b509350600080610cac604089013560608a0135610ca760208c018c6137d6565b611c8c565b60408051808201909152918252602082015296989597505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163314610d33576040517f91ac5e4f0000000000000000000000000000000000000000000000000000000081523360048201526024015b60405180910390fd5b60208701803590610d4d90610d48908a6137d6565b611ce9565b14610da457610d5f60208801886137d6565b6040517fc26bebcc00000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015260208801356024820152604401610d2a565b610db387878787878787611d3e565b50505050505050565b610dc68282611ebe565b5050565b6000836001600160a01b0316610dde611bc7565b6001600160a01b031614158015610e1b575060016000610dfc611bc7565b6001600160a01b0316815260208101919091526040016000205460ff16155b8015610e6057507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610e54611bc7565b6001600160a01b031614155b15610f4f576001600160a01b038416600090815260066020526040812081610e86611bc7565b6001600160a01b0316815260208101919091526040016000205490506000198114610f4d5782811015610f0757610ebb611bc7565b6040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024810182905260448101849052606401610d2a565b610f118382613a01565b6001600160a01b038616600090815260066020526040812090610f32611bc7565b6001600160a01b031681526020810191909152604001600020555b505b610f5a848484612162565b5060015b9392505050565b6000836001600160a01b0316610f79611bc7565b6001600160a01b03161480610fb3575060016000610f95611bc7565b6001600160a01b0316815260208101919091526040016000205460ff165b80610ff657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610feb611bc7565b6001600160a01b0316145b61102c576040517fea8e4eb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f5a848484611bd6565b61103f6122c8565b610dc6828261233f565b6040805180820190915260008082526020820152600061107960408501356060860135610ca760208801886137d6565b9150506000806110898684612394565b90925090506110a661109e60208801886137d6565b8383886124db565b9695505050505050565b6000836001600160a01b03166110c4611bc7565b6001600160a01b031614806110fe5750600160006110e0611bc7565b6001600160a01b0316815260208101919091526040016000205460ff165b8061114157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611136611bc7565b6001600160a01b0316145b611177576040517fddb5de5e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f5a8484846125bc565b61119361118d611bc7565b82611ebe565b50565b6000546001600160a01b031633146111c157604051634755657960e01b815260040160405180910390fd5b61119381612668565b600b602090815260009283526040808420909152908252902080546111ee906139a1565b80601f016020809104026020016040519081016040528092919081815260200182805461121a906139a1565b80156112675780601f1061123c57610100808354040283529160200191611267565b820191906000526020600020905b81548152906001019060200180831161124a57829003601f168201915b505050505081565b6112776122c8565b600c805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527ff0be4f1e87349231d80c36b33f9e8639658eeaf474014dee15a3e6a4d4414197906020015b60405180910390a150565b6112e16122c8565b6112eb60006126e9565b565b6001600160a01b03811630145b949350505050565b6000546001600160a01b0316331461132d57604051634755657960e01b815260040160405180910390fd5b61119381612748565b606060038054610b57906139a1565b6000610bee611352611bc7565b8484612162565b6000546001600160a01b0316331461138457604051634755657960e01b815260040160405180910390fd5b6001600160a01b03821660008181526001602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915590519092917f44f92d27abdf4cfb6a7d712c3af68f3be086d4ca747ab802c36f67d6790060d891a35050565b6113fe6122c8565b610dc661140b8284613ab9565b6127b0565b606061145a83838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506114559250611bc7915050565b6128b7565b611490576040517fb42a7caa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83156114a8576114a86114a1611bc7565b86866125bc565b600080866001600160a01b03163486866040516114c6929190613bcf565b60006040518083038185875af1925050503d8060008114611503576040519150601f19603f3d011682016040523d82523d6000602084013e611508565b606091505b5091509150816110a657806040517fb5e1dc2d000000000000000000000000000000000000000000000000000000008152600401610d2a91906132e2565b63ffffffff84166000908152600b6020908152604080832061ffff8716845290915281208054606092919061157a906139a1565b80601f01602080910402602001604051908101604052809291908181526020018280546115a6906139a1565b80156115f35780601f106115c8576101008083540402835291602001916115f3565b820191906000526020600020905b8154815290600101906020018083116115d657829003601f168201915b5050505050905080516000036116435783838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294506112fa9350505050565b60008390036116535790506112fa565b600283106116d15761169a84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506128e292505050565b806116a88460028188613bdf565b6040516020016116ba93929190613c09565b6040516020818303038152906040529150506112fa565b83836040517f9a6d49cd000000000000000000000000000000000000000000000000000000008152600401610d2a929190613c5c565b60005b81811015611810573683838381811061172557611725613c70565b90506020028101906117379190613c86565b905061176a61174960208301836137d6565b602083013563ffffffff919091166000908152600960205260409020541490565b6117745750611808565b3063d045a0dc60c08301358360a0810135611793610100830183613cc4565b6117a4610100890160e08a0161369d565b6117b26101208a018a613cc4565b6040518963ffffffff1660e01b81526004016117d49796959493929190613d3f565b6000604051808303818588803b1580156117ed57600080fd5b505af1158015611801573d6000803e3d6000fd5b5050505050505b60010161170a565b50336001600160a01b0316638e9e70996040518163ffffffff1660e01b8152600401600060405180830381865afa15801561184f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526118779190810190613dc6565b6040517f8351eea7000000000000000000000000000000000000000000000000000000008152600401610d2a91906132e2565b6118b261324a565b6040805180820190915260008082526020820152600c5474010000000000000000000000000000000000000000900460ff1661191a576040517f3a4155f600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611925858585612927565b5050935093915050565b6119376122c8565b6040517fca5eb5e10000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063ca5eb5e190602401600060405180830381600087803b1580156119b357600080fd5b505af11580156119c7573d6000803e3d6000fd5b5050505050565b6060611a1383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506114559250611bc7915050565b611a49576040517fb42a7caa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114a8611a54611bc7565b8686611bd6565b333014611a94576040517f14d4a4e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610db387878787878787610da4565b611aab6122c8565b600a805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fd48d879cef83a1c0bdda516f27b13ddb1b3f8bbac1c9e1511bb2a659c2427760906020016112ce565b611b0e6122c8565b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b611b456122c8565b6001600160a01b038116611b88576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610d2a565b611193816126e9565b6000602082018035906009908390611ba990866137d6565b63ffffffff1681526020810191909152604001600020541492915050565b6000611bd1612a39565b905090565b6001600160a01b0383161580611bf357506001600160a01b038216155b15611c2a576040517f0cbe44ec00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0383811660008181526006602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b600080611c9885612a7e565b915081905083811015611ce1576040517f71c4efed0000000000000000000000000000000000000000000000000000000081526004810182905260248101859052604401610d2a565b935093915050565b63ffffffff811660009081526009602052604081205480610bf2576040517ff6ff4fb700000000000000000000000000000000000000000000000000000000815263ffffffff84166004820152602401610d2a565b6000611d50611d4d8787612ab5565b90565b90506000611d7c82611d6a611d658a8a612acd565b612af0565b611d7760208d018d6137d6565b612b26565b90506028861115611e5c576000611db9611d9c60608c0160408d01613e34565b611da960208d018d6137d6565b84611db48c8c612b3a565b612b85565b6040517f7cb590120000000000000000000000000000000000000000000000000000000081529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690637cb5901290611e289086908d906000908790600401613e51565b600060405180830381600087803b158015611e4257600080fd5b505af1158015611e56573d6000803e3d6000fd5b50505050505b6001600160a01b038216887fefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c611e9560208d018d6137d6565b6040805163ffffffff9092168252602082018690520160405180910390a3505050505050505050565b80600003611ef8576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816001600160a01b0316611f0a611bc7565b6001600160a01b031614158015611f47575060016000611f28611bc7565b6001600160a01b0316815260208101919091526040016000205460ff16155b8015611f8c57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611f80611bc7565b6001600160a01b031614155b1561207b576001600160a01b038216600090815260066020526040812081611fb2611bc7565b6001600160a01b0316815260208101919091526040016000205490506000198114612079578181101561203357611fe7611bc7565b6040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024810182905260448101839052606401610d2a565b61203d8282613a01565b6001600160a01b03841660009081526006602052604081209061205e611bc7565b6001600160a01b031681526020810191909152604001600020555b505b6001600160a01b038216600090815260056020526040902054818110156120e7576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401610d2a565b6120f18282613a01565b6001600160a01b0384166000908152600560205260408120919091556004805484929061211f908490613a01565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001611c7f565b6001600160a01b038216158061218057506001600160a01b03821630145b156121c2576040517fec442f050000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610d2a565b6001600160a01b0383166000908152600560205260409020548181101561222e576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401610d2a565b6122388282613a01565b6001600160a01b03808616600090815260056020526040808220939093559085168152908120805484929061226e908490613e83565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516122ba91815260200190565b60405180910390a350505050565b6122d0611bc7565b6001600160a01b03166122eb6008546001600160a01b031690565b6001600160a01b0316146112eb57612301611bc7565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526001600160a01b039091166004820152602401610d2a565b63ffffffff8216600081815260096020908152604091829020849055815192835282018390527f238399d427b947898edb290f5ff0f9109849b1c3ba196a42e35f00c50a54b98b910160405180910390a15050565b60608060006123fa85602001356123aa86612bb7565b6123b760a0890189613cc4565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506123f59250611bc7915050565b612be3565b909350905060008161240d576001612410565b60025b905061243061242260208801886137d6565b826109e560808a018a613cc4565b600c549093506001600160a01b0316156124d257600c546040517f043a78eb0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063043a78eb9061248f9087908790600401613e96565b602060405180830381865afa1580156124ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124d09190613ebb565b505b50509250929050565b60408051808201909152600080825260208201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ddc28c586040518060a001604052808863ffffffff16815260200161253e89611ce9565b8152602001878152602001868152602001851515815250306040518363ffffffff1660e01b8152600401612573929190613ed8565b6040805180830381865afa15801561258f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125b39190613f81565b95945050505050565b6000811180156125e557506001600160a01b03821660009081526001602052604090205460ff16155b801561262357507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614155b15612663576001600160a01b038084166000908152600660209081526040808320938616835292905220548181101561266157612661848484611bd6565b505b505050565b600c80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000008315158102919091179182905560405160ff9190920416151581527f54ca1f89aee2b8d11c89b7813c6aa99caa0f8c55c8eccf8b70c3bb42029fa134906020016112ce565b600880546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080546040516001600160a01b03808516939216917f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f91a36000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60005b8151811015612887576127e28282815181106127d1576127d1613c70565b6020026020010151604001516128e2565b8181815181106127f4576127f4613c70565b602002602001015160400151600b600084848151811061281657612816613c70565b60200260200101516000015163ffffffff1663ffffffff168152602001908152602001600020600084848151811061285057612850613c70565b60200260200101516020015161ffff1661ffff168152602001908152602001600020908161287e9190613fed565b506001016127b3565b507fbe4864a8e820971c0247f5992e2da559595f7bf076a21cb5928d443d2a13b674816040516112ce91906140ad565b60006044835110156128cb57506000610bf2565b5060248201516001600160a01b0382161492915050565b600281015161ffff8116600314610dc657816040517f9a6d49cd000000000000000000000000000000000000000000000000000000008152600401610d2a91906132e2565b61292f61324a565b604080518082019091526000808252602082015260008061296d612951611bc7565b604089013560608a013561296860208c018c6137d6565b612c7f565b9150915060008061297e8984612394565b90925090506129aa61299360208b018b6137d6565b83836129a4368d90038d018d614138565b8b612ca5565b955060405180604001604052808581526020018481525094506129cb611bc7565b86516001600160a01b0391909116907f85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a612a0860208d018d6137d6565b6040805163ffffffff909216825260208201899052810187905260600160405180910390a350505050935093915050565b6007546000906001600160a01b03163303612a7957507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c90565b503390565b60007f0000000000000000000000000000000000000000000000000000000000000000612aab818461416a565b610bf2919061418c565b6000612ac46020828486613bdf565b610f5e916141a3565b6000612add602860208486613bdf565b612ae6916141c1565b60c01c9392505050565b6000610bf27f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff841661418c565b6000612b328484612db0565b509092915050565b6060612b498260288186613bdf565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929695505050505050565b606084848484604051602001612b9e9493929190614209565b6040516020818303038152906040529050949350505050565b6000610bf27f00000000000000000000000000000000000000000000000000000000000000008361416a565b8151606090151580612c44578585604051602001612c3092919091825260c01b7fffffffffffffffff00000000000000000000000000000000000000000000000016602082015260280190565b604051602081830303815290604052612c74565b85856001600160a01b03851686604051602001612c649493929190614287565b6040516020818303038152906040525b915094509492505050565b600080612c8d858585611c8c565b9092509050612c9c8683611ebe565b94509492505050565b612cad61324a565b6000612cbc8460000151612eef565b602085015190915015612cd657612cd68460200151612f30565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632637a450826040518060a001604052808b63ffffffff168152602001612d268c611ce9565b81526020018a815260200189815260200160008960200151111515815250866040518463ffffffff1660e01b8152600401612d62929190613ed8565b60806040518083038185885af1158015612d80573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612da591906142e0565b979650505050505050565b6001600160a01b038216612dfb576040517fec442f050000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610d2a565b80600003612e35576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004546000612e448383613e83565b9050818111612e7f576040517f35278d1200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60048190556001600160a01b03841660009081526005602052604081208054859290612eac908490613e83565b90915550506040518381526001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016122ba565b6000813414612f2c576040517f9f704120000000000000000000000000000000000000000000000000000000008152346004820152602401610d2a565b5090565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e4fe1d946040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fb4919061432a565b90506001600160a01b038116612ff6576040517f5373352a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610dc6613001611bc7565b604080516001600160a01b0383811660248301527f0000000000000000000000000000000000000000000000000000000000000000808216604484015260648084018990528451808503909101815260849093019093526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790528516929190869061266190859060006130b98383613120565b905080516000141580156130de5750808060200190518101906130dc9190613ebb565b155b15612663576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610d2a565b6060610f5e8383600084600080856001600160a01b031684866040516131469190614347565b60006040518083038185875af1925050503d8060008114613183576040519150601f19603f3d011682016040523d82523d6000602084013e613188565b606091505b50915091506110a68683836060826131a8576131a382613208565b610f5e565b81511580156131bf57506001600160a01b0384163b155b15613201576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401610d2a565b5080610f5e565b8051156132185780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604051806060016040528060008019168152602001600067ffffffffffffffff16815260200161328d604051806040016040528060008152602001600081525090565b905290565b60005b838110156132ad578181015183820152602001613295565b50506000910152565b600081518084526132ce816020860160208601613292565b601f01601f19169290920160200192915050565b602081526000610f5e60208301846132b6565b6001600160a01b038116811461119357600080fd5b6000806040838503121561331d57600080fd5b8235613328816132f5565b946020939093013593505050565b600060e0828403121561334857600080fd5b50919050565b60006020828403121561336057600080fd5b813567ffffffffffffffff81111561337757600080fd5b6112fa84828501613336565b8351815260208085015190820152600060a08201604060a0604085015281865180845260c08601915060c08160051b8701019350602080890160005b8381101561341c578887037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff40018552815180518852830151838801879052613409878901826132b6565b97505093820193908201906001016133bf565b505087516060880152505050602085015160808501525090506112fa565b60006060828403121561334857600080fd5b60008083601f84011261345e57600080fd5b50813567ffffffffffffffff81111561347657600080fd5b60208301915083602082850101111561348e57600080fd5b9250929050565b600080600080600080600060e0888a0312156134b057600080fd5b6134ba898961343a565b965060608801359550608088013567ffffffffffffffff808211156134de57600080fd5b6134ea8b838c0161344c565b909750955060a08a013591506134ff826132f5565b90935060c0890135908082111561351557600080fd5b506135228a828b0161344c565b989b979a50959850939692959293505050565b60008060006060848603121561354a57600080fd5b8335613555816132f5565b92506020840135613565816132f5565b929592945050506040919091013590565b803563ffffffff8116811461358a57600080fd5b919050565b600080604083850312156135a257600080fd5b61332883613576565b801515811461119357600080fd5b600080604083850312156135cc57600080fd5b823567ffffffffffffffff8111156135e357600080fd5b6135ef85828601613336565b9250506020830135613600816135ab565b809150509250929050565b815181526020808301519082015260408101610bf2565b60006020828403121561363457600080fd5b5035919050565b60006020828403121561364d57600080fd5b8135610f5e816135ab565b803561ffff8116811461358a57600080fd5b6000806040838503121561367d57600080fd5b61368683613576565b915061369460208401613658565b90509250929050565b6000602082840312156136af57600080fd5b8135610f5e816132f5565b60008060008060a085870312156136d057600080fd5b6136da868661343a565b9350606085013567ffffffffffffffff8111156136f657600080fd5b6137028782880161344c565b9094509250506080850135613716816132f5565b939692955090935050565b6000806040838503121561373457600080fd5b823561373f816132f5565b91506020830135613600816135ab565b60008083601f84011261376157600080fd5b50813567ffffffffffffffff81111561377957600080fd5b6020830191508360208260051b850101111561348e57600080fd5b600080602083850312156137a757600080fd5b823567ffffffffffffffff8111156137be57600080fd5b6137ca8582860161374f565b90969095509350505050565b6000602082840312156137e857600080fd5b610f5e82613576565b6000806000806060858703121561380757600080fd5b8435613812816132f5565b935060208501359250604085013567ffffffffffffffff81111561383557600080fd5b6138418782880161344c565b95989497509550505050565b6000806000806060858703121561386357600080fd5b61386c85613576565b935061387a60208601613658565b9250604085013567ffffffffffffffff81111561383557600080fd5b600080600083850360808112156138ac57600080fd5b843567ffffffffffffffff8111156138c357600080fd5b6138cf87828801613336565b9450506040601f19820112156138e457600080fd5b5060208401915060608401356138f9816132f5565b809150509250925092565b600060c0820190508351825267ffffffffffffffff60208501511660208301526040840151613940604084018280518252602090810151910152565b5082516080830152602083015160a0830152610f5e565b6000806040838503121561396a57600080fd5b8235613975816132f5565b91506020830135613600816132f5565b60006060828403121561399757600080fd5b610f5e838361343a565b600181811c908216806139b557607f821691505b60208210810361334857634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610bf257610bf26139eb565b6040516060810167ffffffffffffffff81118282101715613a3757613a376139d5565b60405290565b6040805190810167ffffffffffffffff81118282101715613a3757613a376139d5565b604051601f8201601f1916810167ffffffffffffffff81118282101715613a8957613a896139d5565b604052919050565b600067ffffffffffffffff821115613aab57613aab6139d5565b50601f01601f191660200190565b600067ffffffffffffffff80841115613ad457613ad46139d5565b8360051b6020613ae5818301613a60565b868152918501918181019036841115613afd57600080fd5b865b84811015613bc357803586811115613b175760008081fd5b88016060368290031215613b2b5760008081fd5b613b33613a14565b613b3c82613576565b8152613b49868301613658565b8682015260408083013589811115613b615760008081fd5b929092019136601f840112613b765760008081fd5b8235613b89613b8482613a91565b613a60565b8181523689838701011115613b9e5760008081fd5b818986018a830137600091810189019190915290820152845250918301918301613aff565b50979650505050505050565b8183823760009101908152919050565b60008085851115613bef57600080fd5b83861115613bfc57600080fd5b5050820193919092039150565b60008451613c1b818460208901613292565b8201838582376000930192835250909392505050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b6020815260006112fa602083018486613c31565b634e487b7160e01b600052603260045260246000fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec1833603018112613cba57600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613cf957600080fd5b83018035915067ffffffffffffffff821115613d1457600080fd5b60200191503681900382131561348e57600080fd5b67ffffffffffffffff8116811461119357600080fd5b63ffffffff613d4d89613576565b1681526020880135602082015260006040890135613d6a81613d29565b67ffffffffffffffff811660408401525087606083015260e06080830152613d9660e083018789613c31565b6001600160a01b03861660a084015282810360c0840152613db8818587613c31565b9a9950505050505050505050565b600060208284031215613dd857600080fd5b815167ffffffffffffffff811115613def57600080fd5b8201601f81018413613e0057600080fd5b8051613e0e613b8482613a91565b818152856020838501011115613e2357600080fd5b6125b3826020830160208601613292565b600060208284031215613e4657600080fd5b8135610f5e81613d29565b6001600160a01b038516815283602082015261ffff831660408201526080606082015260006110a660808301846132b6565b80820180821115610bf257610bf26139eb565b604081526000613ea960408301856132b6565b82810360208401526125b381856132b6565b600060208284031215613ecd57600080fd5b8151610f5e816135ab565b6040815263ffffffff8351166040820152602083015160608201526000604084015160a06080840152613f0e60e08401826132b6565b90506060850151603f198483030160a0850152613f2b82826132b6565b60809690960151151560c08501525050506001600160a01b039190911660209091015290565b600060408284031215613f6357600080fd5b613f6b613a3d565b9050815181526020820151602082015292915050565b600060408284031215613f9357600080fd5b610f5e8383613f51565b601f821115612663576000816000526020600020601f850160051c81016020861015613fc65750805b601f850160051c820191505b81811015613fe557828155600101613fd2565b505050505050565b815167ffffffffffffffff811115614007576140076139d5565b61401b8161401584546139a1565b84613f9d565b602080601f83116001811461405057600084156140385750858301515b600019600386901b1c1916600185901b178555613fe5565b600085815260208120601f198616915b8281101561407f57888601518255948401946001909101908401614060565b508582101561409d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b8381101561412a57888303603f190185528151805163ffffffff1684528781015161ffff16888501528601516060878501819052614116818601836132b6565b9689019694505050908601906001016140d6565b509098975050505050505050565b60006040828403121561414a57600080fd5b614152613a3d565b82358152602083013560208201528091505092915050565b60008261418757634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610bf257610bf26139eb565b80356020831015610bf257600019602084900360031b1b1692915050565b7fffffffffffffffff00000000000000000000000000000000000000000000000081358181169160088510156142015780818660080360031b1b83161692505b505092915050565b7fffffffffffffffff0000000000000000000000000000000000000000000000008560c01b1681527fffffffff000000000000000000000000000000000000000000000000000000008460e01b16600882015282600c8201526000825161427781602c850160208701613292565b91909101602c0195945050505050565b8481527fffffffffffffffff0000000000000000000000000000000000000000000000008460c01b166020820152826028820152600082516142d0816048850160208701613292565b9190910160480195945050505050565b6000608082840312156142f257600080fd5b6142fa613a14565b82518152602083015161430c81613d29565b602082015261431e8460408501613f51565b60408201529392505050565b60006020828403121561433c57600080fd5b8151610f5e816132f5565b60008251613cba81846020870161329256fea26469706673582212205d8189a387e58495723f0d49c0b4599049735f611a555fdb290fde04ed49f9a964736f6c63430008170033", + "deployedBytecode": "0x6080604052600436106103765760003560e01c806370a08231116101d1578063bb0b6a5311610102578063ce1b815f116100a0578063dd62ed3e1161006f578063dd62ed3e14610ac2578063f2fde38b14610b08578063fc0c546a14610670578063ff7bd03d14610b2857600080fd5b8063ce1b815f14610a51578063d045a0dc14610a6f578063d424388514610a82578063da74222814610aa257600080fd5b8063bd815db0116100dc578063bd815db0146109ea578063c7c7f5b3146109fd578063ca5eb5e114610a1e578063cae9ca5114610a3e57600080fd5b8063bb0b6a531461098a578063bb1e23cb146109b7578063bc70b354146109ca57600080fd5b806395d89b411161016f578063a9059cbb11610149578063a9059cbb1461090a578063ac9fe4211461092a578063b731ea0a1461094a578063b98bd0701461096a57600080fd5b806395d89b41146108ad578063963efcaa146108c25780639f68b964146108f657600080fd5b806382413eac116101ab57806382413eac1461083b578063857749b01461085b5780638da5cb5b1461086f5780638f2839701461088d57600080fd5b806370a08231146107b4578063715018a6146107ea5780637d25a05e146107ff57600080fd5b8063313ce567116102ab5780635535d461116102495780635e280f11116102235780635e280f1114610709578063654b748a1461073d5780636e9960c3146107765780636fc1b31e1461079457600080fd5b80635535d46114610683578063572b6c05146106a35780635a0dfe4d146106d257600080fd5b80633b7b5a16116102855780633b7b5a161461061057806342966c68146106305780634df68ada1461065057806352ae28791461067057600080fd5b8063313ce567146105a15780633400288b146105c35780633b6f743b146105e357600080fd5b806317442b70116103185780631dd319cb116102f25780631dd319cb1461052c5780631f5e13341461054c57806323b872dd146105615780632b9917461461058157600080fd5b806317442b70146104bb57806318160ddd146104dd57806318de0afd146104fc57600080fd5b8063111ecdad11610354578063111ecdad1461040557806313137d651461043d578063134d4f2514610452578063156a0d0f1461047a57600080fd5b806306fdde031461037b578063095ea7b3146103a65780630d35b415146103d6575b600080fd5b34801561038757600080fd5b50610390610b48565b60405161039d91906132e2565b60405180910390f35b3480156103b257600080fd5b506103c66103c136600461330a565b610bda565b604051901515815260200161039d565b3480156103e257600080fd5b506103f66103f136600461334e565b610bf8565b60405161039d93929190613383565b34801561041157600080fd5b50600c54610425906001600160a01b031681565b6040516001600160a01b03909116815260200161039d565b61045061044b366004613495565b610cca565b005b34801561045e57600080fd5b50610467600281565b60405161ffff909116815260200161039d565b34801561048657600080fd5b50604080517f02e49c2c000000000000000000000000000000000000000000000000000000008152600160208201520161039d565b3480156104c757600080fd5b506040805160018152600260208201520161039d565b3480156104e957600080fd5b506004545b60405190815260200161039d565b34801561050857600080fd5b50600c5474010000000000000000000000000000000000000000900460ff166103c6565b34801561053857600080fd5b5061045061054736600461330a565b610dbc565b34801561055857600080fd5b50610467600181565b34801561056d57600080fd5b506103c661057c366004613535565b610dca565b34801561058d57600080fd5b506103c661059c366004613535565b610f65565b3480156105ad57600080fd5b5060125b60405160ff909116815260200161039d565b3480156105cf57600080fd5b506104506105de36600461358f565b611037565b3480156105ef57600080fd5b506106036105fe3660046135b9565b611049565b60405161039d919061360b565b34801561061c57600080fd5b506103c661062b366004613535565b6110b0565b34801561063c57600080fd5b5061045061064b366004613622565b611182565b34801561065c57600080fd5b5061045061066b36600461363b565b611196565b34801561067c57600080fd5b5030610425565b34801561068f57600080fd5b5061039061069e36600461366a565b6111ca565b3480156106af57600080fd5b506103c66106be36600461369d565b6007546001600160a01b0391821691161490565b3480156106de57600080fd5b506103c66106ed36600461358f565b63ffffffff919091166000908152600960205260409020541490565b34801561071557600080fd5b506104257f000000000000000000000000000000000000000000000000000000000000000081565b34801561074957600080fd5b506103c661075836600461369d565b6001600160a01b031660009081526001602052604090205460ff1690565b34801561078257600080fd5b506000546001600160a01b0316610425565b3480156107a057600080fd5b506104506107af36600461369d565b61126f565b3480156107c057600080fd5b506104ee6107cf36600461369d565b6001600160a01b031660009081526005602052604090205490565b3480156107f657600080fd5b506104506112d9565b34801561080b57600080fd5b5061082261081a36600461358f565b600092915050565b60405167ffffffffffffffff909116815260200161039d565b34801561084757600080fd5b506103c66108563660046136ba565b6112ed565b34801561086757600080fd5b5060066105b1565b34801561087b57600080fd5b506008546001600160a01b0316610425565b34801561089957600080fd5b506104506108a836600461369d565b611302565b3480156108b957600080fd5b50610390611336565b3480156108ce57600080fd5b506104ee7f000000000000000000000000000000000000000000000000000000000000000081565b34801561090257600080fd5b5060006103c6565b34801561091657600080fd5b506103c661092536600461330a565b611345565b34801561093657600080fd5b50610450610945366004613721565b611359565b34801561095657600080fd5b50600a54610425906001600160a01b031681565b34801561097657600080fd5b50610450610985366004613794565b6113f6565b34801561099657600080fd5b506104ee6109a53660046137d6565b60096020526000908152604090205481565b6103906109c53660046137f1565b611410565b3480156109d657600080fd5b506103906109e536600461384d565b611546565b6104506109f8366004613794565b611707565b610a10610a0b366004613896565b6118aa565b60405161039d929190613904565b348015610a2a57600080fd5b50610450610a3936600461369d565b61192f565b610390610a4c3660046137f1565b6119ce565b348015610a5d57600080fd5b506007546001600160a01b0316610425565b610450610a7d366004613495565b611a5b565b348015610a8e57600080fd5b50610450610a9d36600461369d565b611aa3565b348015610aae57600080fd5b50610450610abd36600461369d565b611b06565b348015610ace57600080fd5b506104ee610add366004613957565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b348015610b1457600080fd5b50610450610b2336600461369d565b611b3d565b348015610b3457600080fd5b506103c6610b43366004613985565b611b91565b606060028054610b57906139a1565b80601f0160208091040260200160405190810160405280929190818152602001828054610b83906139a1565b8015610bd05780601f10610ba557610100808354040283529160200191610bd0565b820191906000526020600020905b815481529060010190602001808311610bb357829003601f168201915b5050505050905090565b6000610bee610be7611bc7565b8484611bd6565b5060015b92915050565b60408051808201909152600080825260208201526060610c2b604051806040016040528060008152602001600081525090565b604080518082018252600080825267ffffffffffffffff602080840182905284518381529081019094529195509182610c87565b604080518082019091526000815260606020820152815260200190600190039081610c5f5790505b509350600080610cac604089013560608a0135610ca760208c018c6137d6565b611c8c565b60408051808201909152918252602082015296989597505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163314610d33576040517f91ac5e4f0000000000000000000000000000000000000000000000000000000081523360048201526024015b60405180910390fd5b60208701803590610d4d90610d48908a6137d6565b611ce9565b14610da457610d5f60208801886137d6565b6040517fc26bebcc00000000000000000000000000000000000000000000000000000000815263ffffffff909116600482015260208801356024820152604401610d2a565b610db387878787878787611d3e565b50505050505050565b610dc68282611ebe565b5050565b6000836001600160a01b0316610dde611bc7565b6001600160a01b031614158015610e1b575060016000610dfc611bc7565b6001600160a01b0316815260208101919091526040016000205460ff16155b8015610e6057507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610e54611bc7565b6001600160a01b031614155b15610f4f576001600160a01b038416600090815260066020526040812081610e86611bc7565b6001600160a01b0316815260208101919091526040016000205490506000198114610f4d5782811015610f0757610ebb611bc7565b6040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024810182905260448101849052606401610d2a565b610f118382613a01565b6001600160a01b038616600090815260066020526040812090610f32611bc7565b6001600160a01b031681526020810191909152604001600020555b505b610f5a848484612162565b5060015b9392505050565b6000836001600160a01b0316610f79611bc7565b6001600160a01b03161480610fb3575060016000610f95611bc7565b6001600160a01b0316815260208101919091526040016000205460ff165b80610ff657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610feb611bc7565b6001600160a01b0316145b61102c576040517fea8e4eb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f5a848484611bd6565b61103f6122c8565b610dc6828261233f565b6040805180820190915260008082526020820152600061107960408501356060860135610ca760208801886137d6565b9150506000806110898684612394565b90925090506110a661109e60208801886137d6565b8383886124db565b9695505050505050565b6000836001600160a01b03166110c4611bc7565b6001600160a01b031614806110fe5750600160006110e0611bc7565b6001600160a01b0316815260208101919091526040016000205460ff165b8061114157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611136611bc7565b6001600160a01b0316145b611177576040517fddb5de5e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f5a8484846125bc565b61119361118d611bc7565b82611ebe565b50565b6000546001600160a01b031633146111c157604051634755657960e01b815260040160405180910390fd5b61119381612668565b600b602090815260009283526040808420909152908252902080546111ee906139a1565b80601f016020809104026020016040519081016040528092919081815260200182805461121a906139a1565b80156112675780601f1061123c57610100808354040283529160200191611267565b820191906000526020600020905b81548152906001019060200180831161124a57829003601f168201915b505050505081565b6112776122c8565b600c805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527ff0be4f1e87349231d80c36b33f9e8639658eeaf474014dee15a3e6a4d4414197906020015b60405180910390a150565b6112e16122c8565b6112eb60006126e9565b565b6001600160a01b03811630145b949350505050565b6000546001600160a01b0316331461132d57604051634755657960e01b815260040160405180910390fd5b61119381612748565b606060038054610b57906139a1565b6000610bee611352611bc7565b8484612162565b6000546001600160a01b0316331461138457604051634755657960e01b815260040160405180910390fd5b6001600160a01b03821660008181526001602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915590519092917f44f92d27abdf4cfb6a7d712c3af68f3be086d4ca747ab802c36f67d6790060d891a35050565b6113fe6122c8565b610dc661140b8284613ab9565b6127b0565b606061145a83838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506114559250611bc7915050565b6128b7565b611490576040517fb42a7caa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83156114a8576114a86114a1611bc7565b86866125bc565b600080866001600160a01b03163486866040516114c6929190613bcf565b60006040518083038185875af1925050503d8060008114611503576040519150601f19603f3d011682016040523d82523d6000602084013e611508565b606091505b5091509150816110a657806040517fb5e1dc2d000000000000000000000000000000000000000000000000000000008152600401610d2a91906132e2565b63ffffffff84166000908152600b6020908152604080832061ffff8716845290915281208054606092919061157a906139a1565b80601f01602080910402602001604051908101604052809291908181526020018280546115a6906139a1565b80156115f35780601f106115c8576101008083540402835291602001916115f3565b820191906000526020600020905b8154815290600101906020018083116115d657829003601f168201915b5050505050905080516000036116435783838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294506112fa9350505050565b60008390036116535790506112fa565b600283106116d15761169a84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506128e292505050565b806116a88460028188613bdf565b6040516020016116ba93929190613c09565b6040516020818303038152906040529150506112fa565b83836040517f9a6d49cd000000000000000000000000000000000000000000000000000000008152600401610d2a929190613c5c565b60005b81811015611810573683838381811061172557611725613c70565b90506020028101906117379190613c86565b905061176a61174960208301836137d6565b602083013563ffffffff919091166000908152600960205260409020541490565b6117745750611808565b3063d045a0dc60c08301358360a0810135611793610100830183613cc4565b6117a4610100890160e08a0161369d565b6117b26101208a018a613cc4565b6040518963ffffffff1660e01b81526004016117d49796959493929190613d3f565b6000604051808303818588803b1580156117ed57600080fd5b505af1158015611801573d6000803e3d6000fd5b5050505050505b60010161170a565b50336001600160a01b0316638e9e70996040518163ffffffff1660e01b8152600401600060405180830381865afa15801561184f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526118779190810190613dc6565b6040517f8351eea7000000000000000000000000000000000000000000000000000000008152600401610d2a91906132e2565b6118b261324a565b6040805180820190915260008082526020820152600c5474010000000000000000000000000000000000000000900460ff1661191a576040517f3a4155f600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611925858585612927565b5050935093915050565b6119376122c8565b6040517fca5eb5e10000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063ca5eb5e190602401600060405180830381600087803b1580156119b357600080fd5b505af11580156119c7573d6000803e3d6000fd5b5050505050565b6060611a1383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506114559250611bc7915050565b611a49576040517fb42a7caa00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114a8611a54611bc7565b8686611bd6565b333014611a94576040517f14d4a4e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610db387878787878787610da4565b611aab6122c8565b600a805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fd48d879cef83a1c0bdda516f27b13ddb1b3f8bbac1c9e1511bb2a659c2427760906020016112ce565b611b0e6122c8565b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b611b456122c8565b6001600160a01b038116611b88576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610d2a565b611193816126e9565b6000602082018035906009908390611ba990866137d6565b63ffffffff1681526020810191909152604001600020541492915050565b6000611bd1612a39565b905090565b6001600160a01b0383161580611bf357506001600160a01b038216155b15611c2a576040517f0cbe44ec00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0383811660008181526006602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b600080611c9885612a7e565b915081905083811015611ce1576040517f71c4efed0000000000000000000000000000000000000000000000000000000081526004810182905260248101859052604401610d2a565b935093915050565b63ffffffff811660009081526009602052604081205480610bf2576040517ff6ff4fb700000000000000000000000000000000000000000000000000000000815263ffffffff84166004820152602401610d2a565b6000611d50611d4d8787612ab5565b90565b90506000611d7c82611d6a611d658a8a612acd565b612af0565b611d7760208d018d6137d6565b612b26565b90506028861115611e5c576000611db9611d9c60608c0160408d01613e34565b611da960208d018d6137d6565b84611db48c8c612b3a565b612b85565b6040517f7cb590120000000000000000000000000000000000000000000000000000000081529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690637cb5901290611e289086908d906000908790600401613e51565b600060405180830381600087803b158015611e4257600080fd5b505af1158015611e56573d6000803e3d6000fd5b50505050505b6001600160a01b038216887fefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c611e9560208d018d6137d6565b6040805163ffffffff9092168252602082018690520160405180910390a3505050505050505050565b80600003611ef8576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b816001600160a01b0316611f0a611bc7565b6001600160a01b031614158015611f47575060016000611f28611bc7565b6001600160a01b0316815260208101919091526040016000205460ff16155b8015611f8c57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316611f80611bc7565b6001600160a01b031614155b1561207b576001600160a01b038216600090815260066020526040812081611fb2611bc7565b6001600160a01b0316815260208101919091526040016000205490506000198114612079578181101561203357611fe7611bc7565b6040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024810182905260448101839052606401610d2a565b61203d8282613a01565b6001600160a01b03841660009081526006602052604081209061205e611bc7565b6001600160a01b031681526020810191909152604001600020555b505b6001600160a01b038216600090815260056020526040902054818110156120e7576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401610d2a565b6120f18282613a01565b6001600160a01b0384166000908152600560205260408120919091556004805484929061211f908490613a01565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001611c7f565b6001600160a01b038216158061218057506001600160a01b03821630145b156121c2576040517fec442f050000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610d2a565b6001600160a01b0383166000908152600560205260409020548181101561222e576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401610d2a565b6122388282613a01565b6001600160a01b03808616600090815260056020526040808220939093559085168152908120805484929061226e908490613e83565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516122ba91815260200190565b60405180910390a350505050565b6122d0611bc7565b6001600160a01b03166122eb6008546001600160a01b031690565b6001600160a01b0316146112eb57612301611bc7565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526001600160a01b039091166004820152602401610d2a565b63ffffffff8216600081815260096020908152604091829020849055815192835282018390527f238399d427b947898edb290f5ff0f9109849b1c3ba196a42e35f00c50a54b98b910160405180910390a15050565b60608060006123fa85602001356123aa86612bb7565b6123b760a0890189613cc4565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506123f59250611bc7915050565b612be3565b909350905060008161240d576001612410565b60025b905061243061242260208801886137d6565b826109e560808a018a613cc4565b600c549093506001600160a01b0316156124d257600c546040517f043a78eb0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063043a78eb9061248f9087908790600401613e96565b602060405180830381865afa1580156124ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124d09190613ebb565b505b50509250929050565b60408051808201909152600080825260208201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ddc28c586040518060a001604052808863ffffffff16815260200161253e89611ce9565b8152602001878152602001868152602001851515815250306040518363ffffffff1660e01b8152600401612573929190613ed8565b6040805180830381865afa15801561258f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125b39190613f81565b95945050505050565b6000811180156125e557506001600160a01b03821660009081526001602052604090205460ff16155b801561262357507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614155b15612663576001600160a01b038084166000908152600660209081526040808320938616835292905220548181101561266157612661848484611bd6565b505b505050565b600c80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000008315158102919091179182905560405160ff9190920416151581527f54ca1f89aee2b8d11c89b7813c6aa99caa0f8c55c8eccf8b70c3bb42029fa134906020016112ce565b600880546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080546040516001600160a01b03808516939216917f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f91a36000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60005b8151811015612887576127e28282815181106127d1576127d1613c70565b6020026020010151604001516128e2565b8181815181106127f4576127f4613c70565b602002602001015160400151600b600084848151811061281657612816613c70565b60200260200101516000015163ffffffff1663ffffffff168152602001908152602001600020600084848151811061285057612850613c70565b60200260200101516020015161ffff1661ffff168152602001908152602001600020908161287e9190613fed565b506001016127b3565b507fbe4864a8e820971c0247f5992e2da559595f7bf076a21cb5928d443d2a13b674816040516112ce91906140ad565b60006044835110156128cb57506000610bf2565b5060248201516001600160a01b0382161492915050565b600281015161ffff8116600314610dc657816040517f9a6d49cd000000000000000000000000000000000000000000000000000000008152600401610d2a91906132e2565b61292f61324a565b604080518082019091526000808252602082015260008061296d612951611bc7565b604089013560608a013561296860208c018c6137d6565b612c7f565b9150915060008061297e8984612394565b90925090506129aa61299360208b018b6137d6565b83836129a4368d90038d018d614138565b8b612ca5565b955060405180604001604052808581526020018481525094506129cb611bc7565b86516001600160a01b0391909116907f85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a612a0860208d018d6137d6565b6040805163ffffffff909216825260208201899052810187905260600160405180910390a350505050935093915050565b6007546000906001600160a01b03163303612a7957507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c90565b503390565b60007f0000000000000000000000000000000000000000000000000000000000000000612aab818461416a565b610bf2919061418c565b6000612ac46020828486613bdf565b610f5e916141a3565b6000612add602860208486613bdf565b612ae6916141c1565b60c01c9392505050565b6000610bf27f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff841661418c565b6000612b328484612db0565b509092915050565b6060612b498260288186613bdf565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929695505050505050565b606084848484604051602001612b9e9493929190614209565b6040516020818303038152906040529050949350505050565b6000610bf27f00000000000000000000000000000000000000000000000000000000000000008361416a565b8151606090151580612c44578585604051602001612c3092919091825260c01b7fffffffffffffffff00000000000000000000000000000000000000000000000016602082015260280190565b604051602081830303815290604052612c74565b85856001600160a01b03851686604051602001612c649493929190614287565b6040516020818303038152906040525b915094509492505050565b600080612c8d858585611c8c565b9092509050612c9c8683611ebe565b94509492505050565b612cad61324a565b6000612cbc8460000151612eef565b602085015190915015612cd657612cd68460200151612f30565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632637a450826040518060a001604052808b63ffffffff168152602001612d268c611ce9565b81526020018a815260200189815260200160008960200151111515815250866040518463ffffffff1660e01b8152600401612d62929190613ed8565b60806040518083038185885af1158015612d80573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612da591906142e0565b979650505050505050565b6001600160a01b038216612dfb576040517fec442f050000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610d2a565b80600003612e35576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004546000612e448383613e83565b9050818111612e7f576040517f35278d1200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60048190556001600160a01b03841660009081526005602052604081208054859290612eac908490613e83565b90915550506040518381526001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016122ba565b6000813414612f2c576040517f9f704120000000000000000000000000000000000000000000000000000000008152346004820152602401610d2a565b5090565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e4fe1d946040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fb4919061432a565b90506001600160a01b038116612ff6576040517f5373352a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610dc6613001611bc7565b604080516001600160a01b0383811660248301527f0000000000000000000000000000000000000000000000000000000000000000808216604484015260648084018990528451808503909101815260849093019093526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790528516929190869061266190859060006130b98383613120565b905080516000141580156130de5750808060200190518101906130dc9190613ebb565b155b15612663576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610d2a565b6060610f5e8383600084600080856001600160a01b031684866040516131469190614347565b60006040518083038185875af1925050503d8060008114613183576040519150601f19603f3d011682016040523d82523d6000602084013e613188565b606091505b50915091506110a68683836060826131a8576131a382613208565b610f5e565b81511580156131bf57506001600160a01b0384163b155b15613201576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401610d2a565b5080610f5e565b8051156132185780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604051806060016040528060008019168152602001600067ffffffffffffffff16815260200161328d604051806040016040528060008152602001600081525090565b905290565b60005b838110156132ad578181015183820152602001613295565b50506000910152565b600081518084526132ce816020860160208601613292565b601f01601f19169290920160200192915050565b602081526000610f5e60208301846132b6565b6001600160a01b038116811461119357600080fd5b6000806040838503121561331d57600080fd5b8235613328816132f5565b946020939093013593505050565b600060e0828403121561334857600080fd5b50919050565b60006020828403121561336057600080fd5b813567ffffffffffffffff81111561337757600080fd5b6112fa84828501613336565b8351815260208085015190820152600060a08201604060a0604085015281865180845260c08601915060c08160051b8701019350602080890160005b8381101561341c578887037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff40018552815180518852830151838801879052613409878901826132b6565b97505093820193908201906001016133bf565b505087516060880152505050602085015160808501525090506112fa565b60006060828403121561334857600080fd5b60008083601f84011261345e57600080fd5b50813567ffffffffffffffff81111561347657600080fd5b60208301915083602082850101111561348e57600080fd5b9250929050565b600080600080600080600060e0888a0312156134b057600080fd5b6134ba898961343a565b965060608801359550608088013567ffffffffffffffff808211156134de57600080fd5b6134ea8b838c0161344c565b909750955060a08a013591506134ff826132f5565b90935060c0890135908082111561351557600080fd5b506135228a828b0161344c565b989b979a50959850939692959293505050565b60008060006060848603121561354a57600080fd5b8335613555816132f5565b92506020840135613565816132f5565b929592945050506040919091013590565b803563ffffffff8116811461358a57600080fd5b919050565b600080604083850312156135a257600080fd5b61332883613576565b801515811461119357600080fd5b600080604083850312156135cc57600080fd5b823567ffffffffffffffff8111156135e357600080fd5b6135ef85828601613336565b9250506020830135613600816135ab565b809150509250929050565b815181526020808301519082015260408101610bf2565b60006020828403121561363457600080fd5b5035919050565b60006020828403121561364d57600080fd5b8135610f5e816135ab565b803561ffff8116811461358a57600080fd5b6000806040838503121561367d57600080fd5b61368683613576565b915061369460208401613658565b90509250929050565b6000602082840312156136af57600080fd5b8135610f5e816132f5565b60008060008060a085870312156136d057600080fd5b6136da868661343a565b9350606085013567ffffffffffffffff8111156136f657600080fd5b6137028782880161344c565b9094509250506080850135613716816132f5565b939692955090935050565b6000806040838503121561373457600080fd5b823561373f816132f5565b91506020830135613600816135ab565b60008083601f84011261376157600080fd5b50813567ffffffffffffffff81111561377957600080fd5b6020830191508360208260051b850101111561348e57600080fd5b600080602083850312156137a757600080fd5b823567ffffffffffffffff8111156137be57600080fd5b6137ca8582860161374f565b90969095509350505050565b6000602082840312156137e857600080fd5b610f5e82613576565b6000806000806060858703121561380757600080fd5b8435613812816132f5565b935060208501359250604085013567ffffffffffffffff81111561383557600080fd5b6138418782880161344c565b95989497509550505050565b6000806000806060858703121561386357600080fd5b61386c85613576565b935061387a60208601613658565b9250604085013567ffffffffffffffff81111561383557600080fd5b600080600083850360808112156138ac57600080fd5b843567ffffffffffffffff8111156138c357600080fd5b6138cf87828801613336565b9450506040601f19820112156138e457600080fd5b5060208401915060608401356138f9816132f5565b809150509250925092565b600060c0820190508351825267ffffffffffffffff60208501511660208301526040840151613940604084018280518252602090810151910152565b5082516080830152602083015160a0830152610f5e565b6000806040838503121561396a57600080fd5b8235613975816132f5565b91506020830135613600816132f5565b60006060828403121561399757600080fd5b610f5e838361343a565b600181811c908216806139b557607f821691505b60208210810361334857634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115610bf257610bf26139eb565b6040516060810167ffffffffffffffff81118282101715613a3757613a376139d5565b60405290565b6040805190810167ffffffffffffffff81118282101715613a3757613a376139d5565b604051601f8201601f1916810167ffffffffffffffff81118282101715613a8957613a896139d5565b604052919050565b600067ffffffffffffffff821115613aab57613aab6139d5565b50601f01601f191660200190565b600067ffffffffffffffff80841115613ad457613ad46139d5565b8360051b6020613ae5818301613a60565b868152918501918181019036841115613afd57600080fd5b865b84811015613bc357803586811115613b175760008081fd5b88016060368290031215613b2b5760008081fd5b613b33613a14565b613b3c82613576565b8152613b49868301613658565b8682015260408083013589811115613b615760008081fd5b929092019136601f840112613b765760008081fd5b8235613b89613b8482613a91565b613a60565b8181523689838701011115613b9e5760008081fd5b818986018a830137600091810189019190915290820152845250918301918301613aff565b50979650505050505050565b8183823760009101908152919050565b60008085851115613bef57600080fd5b83861115613bfc57600080fd5b5050820193919092039150565b60008451613c1b818460208901613292565b8201838582376000930192835250909392505050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b6020815260006112fa602083018486613c31565b634e487b7160e01b600052603260045260246000fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec1833603018112613cba57600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613cf957600080fd5b83018035915067ffffffffffffffff821115613d1457600080fd5b60200191503681900382131561348e57600080fd5b67ffffffffffffffff8116811461119357600080fd5b63ffffffff613d4d89613576565b1681526020880135602082015260006040890135613d6a81613d29565b67ffffffffffffffff811660408401525087606083015260e06080830152613d9660e083018789613c31565b6001600160a01b03861660a084015282810360c0840152613db8818587613c31565b9a9950505050505050505050565b600060208284031215613dd857600080fd5b815167ffffffffffffffff811115613def57600080fd5b8201601f81018413613e0057600080fd5b8051613e0e613b8482613a91565b818152856020838501011115613e2357600080fd5b6125b3826020830160208601613292565b600060208284031215613e4657600080fd5b8135610f5e81613d29565b6001600160a01b038516815283602082015261ffff831660408201526080606082015260006110a660808301846132b6565b80820180821115610bf257610bf26139eb565b604081526000613ea960408301856132b6565b82810360208401526125b381856132b6565b600060208284031215613ecd57600080fd5b8151610f5e816135ab565b6040815263ffffffff8351166040820152602083015160608201526000604084015160a06080840152613f0e60e08401826132b6565b90506060850151603f198483030160a0850152613f2b82826132b6565b60809690960151151560c08501525050506001600160a01b039190911660209091015290565b600060408284031215613f6357600080fd5b613f6b613a3d565b9050815181526020820151602082015292915050565b600060408284031215613f9357600080fd5b610f5e8383613f51565b601f821115612663576000816000526020600020601f850160051c81016020861015613fc65750805b601f850160051c820191505b81811015613fe557828155600101613fd2565b505050505050565b815167ffffffffffffffff811115614007576140076139d5565b61401b8161401584546139a1565b84613f9d565b602080601f83116001811461405057600084156140385750858301515b600019600386901b1c1916600185901b178555613fe5565b600085815260208120601f198616915b8281101561407f57888601518255948401946001909101908401614060565b508582101561409d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b8381101561412a57888303603f190185528151805163ffffffff1684528781015161ffff16888501528601516060878501819052614116818601836132b6565b9689019694505050908601906001016140d6565b509098975050505050505050565b60006040828403121561414a57600080fd5b614152613a3d565b82358152602083013560208201528091505092915050565b60008261418757634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610bf257610bf26139eb565b80356020831015610bf257600019602084900360031b1b1692915050565b7fffffffffffffffff00000000000000000000000000000000000000000000000081358181169160088510156142015780818660080360031b1b83161692505b505092915050565b7fffffffffffffffff0000000000000000000000000000000000000000000000008560c01b1681527fffffffff000000000000000000000000000000000000000000000000000000008460e01b16600882015282600c8201526000825161427781602c850160208701613292565b91909101602c0195945050505050565b8481527fffffffffffffffff0000000000000000000000000000000000000000000000008460c01b166020820152826028820152600082516142d0816048850160208701613292565b9190910160480195945050505050565b6000608082840312156142f257600080fd5b6142fa613a14565b82518152602083015161430c81613d29565b602082015261431e8460408501613f51565b60408201529392505050565b60006020828403121561433c57600080fd5b8151610f5e816132f5565b60008251613cba81846020870161329256fea26469706673582212205d8189a387e58495723f0d49c0b4599049735f611a555fdb290fde04ed49f9a964736f6c63430008170033", + "devdoc": { + "author": "The Sandbox", + "details": "OFTSand is a contract that combines SandBaseToken, ERC2771Handler, and OFTCore functionalities.It provides a token contract implementation of Sand token with LayerZero compatibility.", + "errors": { + "AddressEmptyCode(address)": [ + { + "details": "There's no code at `target` (it is not a contract)." + } + ], + "AddressInsufficientBalance(address)": [ + { + "details": "The ETH balance of the account is not enough to perform the operation." + } + ], + "CallFailed(string)": [ + { + "params": { + "message": "error message returned from the failed call" + } + } + ], + "ERC20InsufficientAllowance(address,uint256,uint256)": [ + { + "details": "Indicates a failure with the `spender`’s `allowance`. Used in transfers.", + "params": { + "allowance": "Amount of tokens a `spender` is allowed to operate with.", + "needed": "Minimum amount required to perform a transfer.", + "spender": "Address that may be allowed to operate on tokens without being their owner." + } + } + ], + "ERC20InsufficientBalance(address,uint256,uint256)": [ + { + "details": "Indicates an error related to the current `balance` of a `sender`. Used in transfers.", + "params": { + "balance": "Current balance for the interacting account.", + "needed": "Minimum amount required to perform a transfer.", + "sender": "Address whose tokens are being transferred." + } + } + ], + "ERC20InvalidApprover(address)": [ + { + "details": "Indicates a failure with the `approver` of a token to be approved. Used in approvals.", + "params": { + "approver": "Address initiating an approval operation." + } + } + ], + "ERC20InvalidReceiver(address)": [ + { + "details": "Indicates a failure with the token `receiver`. Used in transfers.", + "params": { + "receiver": "Address to which tokens are being transferred." + } + } + ], + "ERC20InvalidSender(address)": [ + { + "details": "Indicates a failure with the token `sender`. Used in transfers.", + "params": { + "sender": "Address whose tokens are being transferred." + } + } + ], + "ERC20InvalidSpender(address)": [ + { + "details": "Indicates a failure with the `spender` to be approved. Used in approvals.", + "params": { + "spender": "Address that may be allowed to operate on tokens without being their owner." + } + } + ], + "FailedInnerCall()": [ + { + "details": "A call to an address target failed. The target may have reverted." + } + ], + "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." + } + ], + "SafeERC20FailedOperation(address)": [ + { + "details": "An operation with an ERC20 token failed." + } + ] + }, + "events": { + "AdminChanged(address,address)": { + "details": "Emits when the contract administrator is changed.", + "params": { + "newAdmin": "The address of the new administrator.", + "oldAdmin": "The address of the previous administrator." + } + }, + "Approval(address,address,uint256)": { + "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." + }, + "Enabled(bool)": { + "params": { + "enabled": "The new enabled state" + } + }, + "PreCrimeSet(address)": { + "details": "Emitted when the preCrime contract address is set.", + "params": { + "preCrimeAddress": "The address of the preCrime contract." + } + }, + "Transfer(address,address,uint256)": { + "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." + } + }, + "kind": "dev", + "methods": { + "addAllowanceIfNeeded(address,address,uint256)": { + "params": { + "amountNeeded": "The amount requested to spend", + "owner": "The address of the owner of the tokens", + "spender": "The address wanting to spend tokens" + }, + "returns": { + "success": "Whether or not the call succeeded." + } + }, + "allowInitializePath((uint32,bytes32,uint64))": { + "details": "This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received.This defaults to assuming if a peer has been set, its initialized. Can be overridden by the OApp if there is other logic to determine this.", + "params": { + "origin": "The origin information containing the source endpoint and sender address." + }, + "returns": { + "_0": "Whether the path has been initialized." + } + }, + "allowance(address,address)": { + "params": { + "owner": "The address whose token is allowed.", + "spender": "The address allowed to transfer." + }, + "returns": { + "remaining": "The amount of token `spender` is allowed to transfer on behalf of `owner`." + } + }, + "approvalRequired()": { + "details": "In the case of OFT where the contract IS the token, approval is NOT required.", + "returns": { + "_0": "requiresApproval Needs approval of the underlying token implementation." + } + }, + "approve(address,uint256)": { + "params": { + "amount": "The number of tokens allowed.", + "spender": "The address to be given rights to transfer." + }, + "returns": { + "success": "Whether or not the call succeeded." + } + }, + "approveAndCall(address,uint256,bytes)": { + "params": { + "amount": "The number of tokens allowed.", + "data": "The bytes for the call.", + "target": "The address to be given rights to transfer and destination of the call." + }, + "returns": { + "_0": "The data of the call." + } + }, + "approveFor(address,address,uint256)": { + "params": { + "amount": "The number of tokens allowed.", + "owner": "The address whose token is allowed.", + "spender": "The address to be given rights to transfer." + }, + "returns": { + "success": "Whether or not the call succeeded." + } + }, + "balanceOf(address)": { + "params": { + "owner": "The address to query the balance of." + }, + "returns": { + "_0": "The amount owned by `owner`." + } + }, + "burn(uint256)": { + "params": { + "amount": "The number of tokens to burn." + } + }, + "burnFor(address,uint256)": { + "params": { + "amount": "The number of tokens to burn.", + "from": "The address whose token to burn." + } + }, + "changeAdmin(address)": { + "details": "Change the administrator to be `newAdmin`.", + "params": { + "newAdmin": "The address of the new administrator." + } + }, + "combineOptions(uint32,uint16,bytes)": { + "details": "If there is an enforced lzReceive option: - {gasLimit: 200k, msg.value: 1 ether} AND a caller supplies a lzReceive option: {gasLimit: 100k, msg.value: 0.5 ether} - The resulting options will be {gasLimit: 300k, msg.value: 1.5 ether} when the message is executed on the remote lzReceive() function.This presence of duplicated options is handled off-chain in the verifier/executor.", + "params": { + "_eid": "The endpoint ID.", + "_extraOptions": "Additional options passed by the caller.", + "_msgType": "The OAPP message type." + }, + "returns": { + "_0": "options The combination of caller specified options AND enforced options." + } + }, + "decimals()": { + "returns": { + "_0": "The number of decimals." + } + }, + "getAdmin()": { + "details": "Get the current administrator of this contract.", + "returns": { + "_0": "The current administrator of this contract." + } + }, + "getTrustedForwarder()": { + "returns": { + "_0": "trustedForwarder address of the trusted forwarder" + } + }, + "isComposeMsgSender((uint32,bytes32,uint64),bytes,address)": { + "details": "_origin The origin information containing the source endpoint and sender address. - srcEid: The source chain endpoint ID. - sender: The sender address on the src chain. - nonce: The nonce of the message._message The lzReceive payload.Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer.The default sender IS the OAppReceiver implementer.", + "params": { + "_sender": "The sender address." + }, + "returns": { + "_0": "isSender Is a valid sender." + } + }, + "isPeer(uint32,bytes32)": { + "details": "Check if the peer is considered 'trusted' by the OApp.Enables OAppPreCrimeSimulator to check whether a potential Inbound Packet is from a trusted source.", + "params": { + "_eid": "The endpoint ID to check.", + "_peer": "The peer to check." + }, + "returns": { + "_0": "Whether the peer passed is considered 'trusted' by the OApp." + } + }, + "isSuperOperator(address)": { + "params": { + "who": "The address to query." + }, + "returns": { + "_0": "whether the address has superOperator rights." + } + }, + "isTrustedForwarder(address)": { + "params": { + "forwarder": "address to check" + }, + "returns": { + "_0": "is trusted" + } + }, + "lzReceive((uint32,bytes32,uint64),bytes32,bytes,address,bytes)": { + "details": "Entry point for receiving messages or packets from the endpoint.Entry point for receiving msg/packet from the LayerZero endpoint.", + "params": { + "_executor": "The address of the executor for the received message.", + "_extraData": "Additional arbitrary data provided by the corresponding executor.", + "_guid": "The unique identifier for the received LayerZero message.", + "_message": "The payload of the received message.", + "_origin": "The origin information containing the source endpoint and sender address. - srcEid: The source chain endpoint ID. - sender: The sender address on the src chain. - nonce: The nonce of the message." + } + }, + "lzReceiveAndRevert(((uint32,bytes32,uint64),uint32,address,bytes32,uint256,address,bytes,bytes)[])": { + "details": "Interface for pre-crime simulations. Always reverts at the end with the simulation results.WARNING: MUST revert at the end with the simulation results.Gives the preCrime implementation the ability to mock sending packets to the lzReceive function, WITHOUT actually executing them.", + "params": { + "_packets": "An array of InboundPacket objects representing received packets to be delivered." + } + }, + "lzReceiveSimulate((uint32,bytes32,uint64),bytes32,bytes,address,bytes)": { + "details": "Is effectively an internal function because msg.sender must be address(this). Allows resetting the call stack for 'internal' calls.", + "params": { + "_executor": "The executor address for the packet.", + "_extraData": "Additional data for the packet.", + "_guid": "The unique identifier of the packet.", + "_message": "The message payload of the packet.", + "_origin": "The origin information containing the source endpoint and sender address. - srcEid: The source chain endpoint ID. - sender: The sender address on the src chain. - nonce: The nonce of the message." + } + }, + "name()": { + "returns": { + "_0": "The name of the token collection." + } + }, + "nextNonce(uint32,bytes32)": { + "details": "_srcEid The source endpoint ID._sender The sender address.The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement.Is required by the off-chain executor to determine the OApp expects msg execution is ordered.This is also enforced by the OApp.By default this is NOT enabled. ie. nextNonce is hardcoded to return 0.", + "returns": { + "nonce": "The next nonce." + } + }, + "oApp()": { + "details": "Retrieves the address of the OApp contract.The simulator contract is the base contract for the OApp by default.If the simulator is a separate contract, override this function.", + "returns": { + "_0": "The address of the OApp contract." + } + }, + "oAppVersion()": { + "returns": { + "receiverVersion": "The version of the OAppReceiver.sol implementation.", + "senderVersion": "The version of the OAppSender.sol implementation." + } + }, + "oftVersion()": { + "details": "interfaceId: This specific interface ID is '0x02e49c2c'.version: Indicates a cross-chain compatible msg encoding with other OFTs.If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented. ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)", + "returns": { + "interfaceId": "The interface ID.", + "version": "The version." + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "paidCall(address,uint256,bytes)": { + "params": { + "amount": "The number of tokens allowed to spend.", + "data": "The bytes for the call.", + "target": "The destination of the call, allowed to spend the amount specified" + }, + "returns": { + "_0": "The data of the call." + } + }, + "quoteOFT((uint32,bytes32,uint256,uint256,bytes,bytes,bytes))": { + "params": { + "_sendParam": "The parameters for the send operation." + }, + "returns": { + "oftFeeDetails": "The details of OFT fees.", + "oftLimit": "The OFT limit information.", + "oftReceipt": "The OFT receipt information." + } + }, + "quoteSend((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),bool)": { + "details": "MessagingFee: LayerZero msg fee - nativeFee: The native fee. - lzTokenFee: The lzToken fee.", + "params": { + "_payInLzToken": "Flag indicating whether the caller is paying in the LZ token.", + "_sendParam": "The parameters for the send() operation." + }, + "returns": { + "msgFee": "The calculated LayerZero messaging fee from the send() operation." + } + }, + "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." + }, + "send((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),(uint256,uint256),address)": { + "details": "Executes the send operation.MessagingReceipt: LayerZero msg receipt - guid: The unique identifier for the sent message. - nonce: The nonce of the sent message. - fee: The LayerZero fee incurred for the message.", + "params": { + "_fee": "The calculated fee for the send() operation. - nativeFee: The native fee. - lzTokenFee: The lzToken fee.", + "_refundAddress": "The address to receive any excess funds.", + "_sendParam": "The parameters for the send operation." + }, + "returns": { + "msgReceipt": "The receipt for the send operation.", + "oftReceipt": "The OFT receipt information." + } + }, + "setDelegate(address)": { + "details": "Only the owner/admin of the OApp can call this function.Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.", + "params": { + "_delegate": "The address of the delegate to be set." + } + }, + "setEnforcedOptions((uint32,uint16,bytes)[])": { + "details": "Sets the enforced options for specific endpoint and message type combinations.Only the owner/admin of the OApp can call this function.Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.These enforced options can vary as the potential options/execution on the remote may differ as per the msgType. eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().", + "params": { + "_enforcedOptions": "An array of EnforcedOptionParam structures specifying enforced options." + } + }, + "setMsgInspector(address)": { + "details": "Sets the message inspector address for the OFT.This is an optional contract that can be used to inspect both 'message' and 'options'.Set it to address(0) to disable it, or set it to a contract address to enable it.", + "params": { + "_msgInspector": "The address of the message inspector." + } + }, + "setPeer(uint32,bytes32)": { + "details": "Only the owner/admin of the OApp can call this function.Indicates that the peer is trusted to send LayerZero messages to this OApp.Set this to bytes32(0) to remove the peer address.Peer is a bytes32 to accommodate non-evm chains.", + "params": { + "_eid": "The endpoint ID.", + "_peer": "The address of the peer to be associated with the corresponding endpoint." + } + }, + "setPreCrime(address)": { + "details": "Sets the preCrime contract address.", + "params": { + "_preCrime": "The address of the preCrime contract." + } + }, + "setSuperOperator(address,bool)": { + "params": { + "enabled": "set whether the superOperator is enabled or disabled.", + "superOperator": "address that will be given/removed superOperator right." + } + }, + "setTrustedForwarder(address)": { + "params": { + "trustedForwarder": "The new trustedForwarder." + } + }, + "sharedDecimals()": { + "details": "Retrieves the shared decimals of the OFT.Sets an implicit cap on the amount of tokens, over uint64.max() will need some sort of outbound cap / totalSupply cap Lowest common decimal denominator between chains. Defaults to 6 decimal places to provide up to 18,446,744,073,709.551615 units (max uint64). For tokens exceeding this totalSupply(), they will need to override the sharedDecimals function with something smaller. ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615", + "returns": { + "_0": "The shared decimals of the OFT." + } + }, + "symbol()": { + "returns": { + "_0": "The symbol of the token collection." + } + }, + "token()": { + "details": "Retrieves the address of the underlying ERC20 implementation.In the case of OFT, address(this) and erc20 are the same contract.", + "returns": { + "_0": "The address of the OFT token." + } + }, + "totalSupply()": { + "returns": { + "_0": "The total number of tokens in existence." + } + }, + "transfer(address,uint256)": { + "params": { + "amount": "The number of tokens being transfered.", + "to": "The recipient address of the tokens being transfered." + }, + "returns": { + "success": "Whether or not the transfer succeeded." + } + }, + "transferFrom(address,address,uint256)": { + "params": { + "amount": "The number of tokens transfered.", + "from": "The origin address of the tokens being transferred.", + "to": "The recipient address of the tokensbeing transfered." + }, + "returns": { + "success": "Whether or not the transfer succeeded." + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "title": "OFTSand", + "version": 1 + }, + "userdoc": { + "errors": { + "CallFailed(string)": [ + { + "notice": "Error for failed calls, containing the error message" + } + ], + "FirstParamNotSender()": [ + { + "notice": "Error for mismatched first parameter and sender address" + } + ], + "InvalidAmount()": [ + { + "notice": "Error for invalid amount" + } + ], + "InvalidOwnerOrSpender()": [ + { + "notice": "Error for invalid owner or spender" + } + ], + "InvalidSender()": [ + { + "notice": "Error for invalid sender" + } + ], + "NotAuthorized()": [ + { + "notice": "Error for unauthorized access" + } + ], + "OnlyAdmin()": [ + { + "notice": "Error for admin-only access" + } + ], + "Overflow()": [ + { + "notice": "Error for overflow conditions" + } + ], + "SendFunctionDisabled()": [ + { + "notice": "Custom error thrown when the send function is called while disabled" + } + ] + }, + "events": { + "Enabled(bool)": { + "notice": "Emitted when the enabled state changes" + } + }, + "kind": "user", + "methods": { + "addAllowanceIfNeeded(address,address,uint256)": { + "notice": "Increase the allowance for the spender if needed" + }, + "allowInitializePath((uint32,bytes32,uint64))": { + "notice": "Checks if the path initialization is allowed based on the provided origin." + }, + "allowance(address,address)": { + "notice": "Get the allowance of `spender` for `owner`'s tokens." + }, + "approvalRequired()": { + "notice": "Indicates whether the OFT contract requires approval of the 'token()' to send." + }, + "approve(address,uint256)": { + "notice": "Approve `spender` to transfer `amount` tokens." + }, + "approveAndCall(address,uint256,bytes)": { + "notice": "Approve `target` to spend `amount` and call it with data." + }, + "approveFor(address,address,uint256)": { + "notice": "Approve `spender` to transfer `amount` tokens from `owner`." + }, + "balanceOf(address)": { + "notice": "Get the balance of `owner`." + }, + "burn(uint256)": { + "notice": "Burn `amount` tokens." + }, + "burnFor(address,uint256)": { + "notice": "Burn `amount` tokens from `owner`." + }, + "combineOptions(uint32,uint16,bytes)": { + "notice": "Combines options for a given endpoint and message type." + }, + "decimals()": { + "notice": "Get the number of decimals for the token collection." + }, + "endpoint()": { + "notice": "Retrieves the LayerZero endpoint associated with the OApp." + }, + "getTrustedForwarder()": { + "notice": "Get the current trusted forwarder" + }, + "isComposeMsgSender((uint32,bytes32,uint64),bytes,address)": { + "notice": "Indicates whether an address is an approved composeMsg sender to the Endpoint." + }, + "isSuperOperator(address)": { + "notice": "check whether address `who` is given superOperator rights." + }, + "isTrustedForwarder(address)": { + "notice": "Checks if an address is a trusted forwarder" + }, + "name()": { + "notice": "Get the name of the token collection." + }, + "nextNonce(uint32,bytes32)": { + "notice": "Retrieves the next nonce for a given source endpoint and sender address." + }, + "oAppVersion()": { + "notice": "Retrieves the OApp version information." + }, + "oftVersion()": { + "notice": "Retrieves interfaceID and the version of the OFT." + }, + "paidCall(address,uint256,bytes)": { + "notice": "Temporarily approve `target` to spend `amount` and call it with data. Previous approvals remains unchanged." + }, + "peers(uint32)": { + "notice": "Retrieves the peer (OApp) associated with a corresponding endpoint." + }, + "quoteOFT((uint32,bytes32,uint256,uint256,bytes,bytes,bytes))": { + "notice": "Provides a quote for OFT-related operations." + }, + "quoteSend((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),bool)": { + "notice": "Provides a quote for the send() operation." + }, + "setDelegate(address)": { + "notice": "Sets the delegate address for the OApp." + }, + "setPeer(uint32,bytes32)": { + "notice": "Sets the peer address (OApp instance) for a corresponding endpoint." + }, + "setSuperOperator(address,bool)": { + "notice": "Enable or disable the ability of `superOperator` to transfer tokens of all (superOperator rights)." + }, + "setTrustedForwarder(address)": { + "notice": "Change the address of the trusted forwarder for meta-TX." + }, + "symbol()": { + "notice": "Get the symbol for the token collection." + }, + "totalSupply()": { + "notice": "Get the total number of tokens in existence." + }, + "transfer(address,uint256)": { + "notice": "Transfer `amount` tokens to `to`." + }, + "transferFrom(address,address,uint256)": { + "notice": "Transfer `amount` tokens from `from` to `to`." + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 14049, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_admin", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 14121, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_superOperators", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 13042, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_name", + "offset": 0, + "slot": "2", + "type": "t_string_storage" + }, + { + "astId": 13044, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_symbol", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + }, + { + "astId": 13048, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_totalSupply", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 13052, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_balances", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 13058, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_allowances", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" + }, + { + "astId": 13902, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_trustedForwarder", + "offset": 0, + "slot": "7", + "type": "t_address" + }, + { + "astId": 8589, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_owner", + "offset": 0, + "slot": "8", + "type": "t_address" + }, + { + "astId": 2127, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "peers", + "offset": 0, + "slot": "9", + "type": "t_mapping(t_uint32,t_bytes32)" + }, + { + "astId": 3370, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "preCrime", + "offset": 0, + "slot": "10", + "type": "t_address" + }, + { + "astId": 2743, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "enforcedOptions", + "offset": 0, + "slot": "11", + "type": "t_mapping(t_uint32,t_mapping(t_uint16,t_bytes_storage))" + }, + { + "astId": 12074, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "msgInspector", + "offset": 0, + "slot": "12", + "type": "t_address" + }, + { + "astId": 11552, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol:OFTSand", + "label": "_enabled", + "offset": 20, + "slot": "12", + "type": "t_bool" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint256)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint16,t_bytes_storage)": { + "encoding": "mapping", + "key": "t_uint16", + "label": "mapping(uint16 => bytes)", + "numberOfBytes": "32", + "value": "t_bytes_storage" + }, + "t_mapping(t_uint32,t_bytes32)": { + "encoding": "mapping", + "key": "t_uint32", + "label": "mapping(uint32 => bytes32)", + "numberOfBytes": "32", + "value": "t_bytes32" + }, + "t_mapping(t_uint32,t_mapping(t_uint16,t_bytes_storage))": { + "encoding": "mapping", + "key": "t_uint32", + "label": "mapping(uint32 => mapping(uint16 => bytes))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint16,t_bytes_storage)" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_uint16": { + "encoding": "inplace", + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + } + } + } +} \ No newline at end of file diff --git a/packages/deploy/deployments/bscMainnet/solcInputs/4bade374f62f6d78bc3ea2aa3ebdd50f.json b/packages/deploy/deployments/bscMainnet/solcInputs/4bade374f62f6d78bc3ea2aa3ebdd50f.json new file mode 100644 index 0000000000..a766e97989 --- /dev/null +++ b/packages/deploy/deployments/bscMainnet/solcInputs/4bade374f62f6d78bc3ea2aa3ebdd50f.json @@ -0,0 +1,258 @@ +{ + "language": "Solidity", + "sources": { + "@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/IExecutor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { Origin } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\n\nimport { IWorker } from \"./IWorker.sol\";\nimport { ILayerZeroExecutor } from \"./ILayerZeroExecutor.sol\";\n\ninterface IExecutor is IWorker, ILayerZeroExecutor {\n struct DstConfigParam {\n uint32 dstEid;\n uint64 lzReceiveBaseGas;\n uint64 lzComposeBaseGas;\n uint16 multiplierBps;\n uint128 floorMarginUSD;\n uint128 nativeCap;\n }\n\n struct DstConfig {\n uint64 lzReceiveBaseGas;\n uint16 multiplierBps;\n uint128 floorMarginUSD; // uses priceFeed PRICE_RATIO_DENOMINATOR\n uint128 nativeCap;\n uint64 lzComposeBaseGas;\n }\n\n struct ExecutionParams {\n address receiver;\n Origin origin;\n bytes32 guid;\n bytes message;\n bytes extraData;\n uint256 gasLimit;\n }\n\n struct NativeDropParams {\n address receiver;\n uint256 amount;\n }\n\n event DstConfigSet(DstConfigParam[] params);\n event NativeDropApplied(Origin origin, uint32 dstEid, address oapp, NativeDropParams[] params, bool[] success);\n\n function dstConfig(uint32 _dstEid) external view returns (uint64, uint16, uint128, uint128, uint64);\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/IExecutorFeeLib.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { IExecutor } from \"./IExecutor.sol\";\n\ninterface IExecutorFeeLib {\n struct FeeParams {\n address priceFeed;\n uint32 dstEid;\n address sender;\n uint256 calldataSize;\n uint16 defaultMultiplierBps;\n }\n\n error Executor_NoOptions();\n error Executor_NativeAmountExceedsCap(uint256 amount, uint256 cap);\n error Executor_UnsupportedOptionType(uint8 optionType);\n error Executor_InvalidExecutorOptions(uint256 cursor);\n error Executor_ZeroLzReceiveGasProvided();\n error Executor_ZeroLzComposeGasProvided();\n error Executor_EidNotSupported(uint32 eid);\n\n function getFeeOnSend(\n FeeParams calldata _params,\n IExecutor.DstConfig calldata _dstConfig,\n bytes calldata _options\n ) external returns (uint256 fee);\n\n function getFee(\n FeeParams calldata _params,\n IExecutor.DstConfig calldata _dstConfig,\n bytes calldata _options\n ) external view returns (uint256 fee);\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/ILayerZeroExecutor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface ILayerZeroExecutor {\n // @notice query price and assign jobs at the same time\n // @param _dstEid - the destination endpoint identifier\n // @param _sender - the source sending contract address. executors may apply price discrimination to senders\n // @param _calldataSize - dynamic data size of message + caller params\n // @param _options - optional parameters for extra service plugins, e.g. sending dust tokens at the destination chain\n function assignJob(\n uint32 _dstEid,\n address _sender,\n uint256 _calldataSize,\n bytes calldata _options\n ) external returns (uint256 price);\n\n // @notice query the executor price for relaying the payload and its proof to the destination chain\n // @param _dstEid - the destination endpoint identifier\n // @param _sender - the source sending contract address. executors may apply price discrimination to senders\n // @param _calldataSize - dynamic data size of message + caller params\n // @param _options - optional parameters for extra service plugins, e.g. sending dust tokens at the destination chain\n function getFee(\n uint32 _dstEid,\n address _sender,\n uint256 _calldataSize,\n bytes calldata _options\n ) external view returns (uint256 price);\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/ILayerZeroTreasury.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface ILayerZeroTreasury {\n function getFee(\n address _sender,\n uint32 _dstEid,\n uint256 _totalNativeFee,\n bool _payInLzToken\n ) external view returns (uint256 fee);\n\n function payFee(\n address _sender,\n uint32 _dstEid,\n uint256 _totalNativeFee,\n bool _payInLzToken\n ) external payable returns (uint256 fee);\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/IWorker.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IWorker {\n event SetWorkerLib(address workerLib);\n event SetPriceFeed(address priceFeed);\n event SetDefaultMultiplierBps(uint16 multiplierBps);\n event SetSupportedOptionTypes(uint32 dstEid, uint8[] optionTypes);\n event Withdraw(address lib, address to, uint256 amount);\n\n error Worker_NotAllowed();\n error Worker_OnlyMessageLib();\n error Worker_RoleRenouncingDisabled();\n\n function setPriceFeed(address _priceFeed) external;\n\n function priceFeed() external view returns (address);\n\n function setDefaultMultiplierBps(uint16 _multiplierBps) external;\n\n function defaultMultiplierBps() external view returns (uint16);\n\n function withdrawFee(address _lib, address _to, uint256 _amount) external;\n\n function setSupportedOptionTypes(uint32 _eid, uint8[] calldata _optionTypes) external;\n\n function getSupportedOptionTypes(uint32 _eid) external view returns (uint8[] memory);\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/libs/SafeCall.sol": { + "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\n\npragma solidity ^0.8.20;\n\n/// @dev copied from https://github.com/nomad-xyz/ExcessivelySafeCall/blob/main/src/ExcessivelySafeCall.sol.\nlibrary SafeCall {\n /// @notice calls a contract with a specified gas limit and value and captures the return data\n /// @param _target The address to call\n /// @param _gas The amount of gas to forward to the remote contract\n /// @param _value The value in wei to send to the remote contract\n /// to memory.\n /// @param _maxCopy The maximum number of bytes of returndata to copy\n /// to memory.\n /// @param _calldata The data to send to the remote contract\n /// @return success and returndata, as `.call()`. Returndata is capped to\n /// `_maxCopy` bytes.\n function safeCall(\n address _target,\n uint256 _gas,\n uint256 _value,\n uint16 _maxCopy,\n bytes memory _calldata\n ) internal returns (bool, bytes memory) {\n // check that target has code\n uint size;\n assembly {\n size := extcodesize(_target)\n }\n if (size == 0) {\n return (false, new bytes(0));\n }\n\n // set up for assembly call\n uint256 _toCopy;\n bool _success;\n bytes memory _returnData = new bytes(_maxCopy);\n // dispatch message to recipient\n // by assembly calling \"handle\" function\n // we call via assembly to avoid memcopying a very large returndata\n // returned by a malicious contract\n assembly {\n _success := call(\n _gas, // gas\n _target, // recipient\n _value, // ether value\n add(_calldata, 0x20), // inloc\n mload(_calldata), // inlen\n 0, // outloc\n 0 // outlen\n )\n // limit our copy to 100 bytes\n _toCopy := returndatasize()\n if gt(_toCopy, _maxCopy) {\n _toCopy := _maxCopy\n }\n // Store the length of the copied bytes\n mstore(_returnData, _toCopy)\n // copy the bytes from returndata[0:_toCopy]\n returndatacopy(add(_returnData, 0x20), 0, _toCopy)\n }\n return (_success, _returnData);\n }\n\n /// @notice Use when you _really_ really _really_ don't trust the called\n /// contract. This prevents the called contract from causing reversion of\n /// the caller in as many ways as we can.\n /// @dev The main difference between this and a solidity low-level call is\n /// that we limit the number of bytes that the callee can cause to be\n /// copied to caller memory. This prevents stupid things like malicious\n /// contracts returning 10,000,000 bytes causing a local OOG when copying\n /// to memory.\n /// @param _target The address to call\n /// @param _gas The amount of gas to forward to the remote contract\n /// @param _maxCopy The maximum number of bytes of returndata to copy\n /// to memory.\n /// @param _calldata The data to send to the remote contract\n /// @return success and returndata, as `.call()`. Returndata is capped to\n /// `_maxCopy` bytes.\n function safeStaticCall(\n address _target,\n uint256 _gas,\n uint16 _maxCopy,\n bytes memory _calldata\n ) internal view returns (bool, bytes memory) {\n // check that target has code\n uint size;\n assembly {\n size := extcodesize(_target)\n }\n if (size == 0) {\n return (false, new bytes(0));\n }\n\n // set up for assembly call\n uint256 _toCopy;\n bool _success;\n bytes memory _returnData = new bytes(_maxCopy);\n // dispatch message to recipient\n // by assembly calling \"handle\" function\n // we call via assembly to avoid memcopying a very large returndata\n // returned by a malicious contract\n assembly {\n _success := staticcall(\n _gas, // gas\n _target, // recipient\n add(_calldata, 0x20), // inloc\n mload(_calldata), // inlen\n 0, // outloc\n 0 // outlen\n )\n // limit our copy to 256 bytes\n _toCopy := returndatasize()\n if gt(_toCopy, _maxCopy) {\n _toCopy := _maxCopy\n }\n // Store the length of the copied bytes\n mstore(_returnData, _toCopy)\n // copy the bytes from returndata[0:_toCopy]\n returndatacopy(add(_returnData, 0x20), 0, _toCopy)\n }\n return (_success, _returnData);\n }\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/MessageLibBase.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\n/// @dev simply a container of endpoint address and local eid\nabstract contract MessageLibBase {\n address internal immutable endpoint;\n uint32 internal immutable localEid;\n\n error LZ_MessageLib_OnlyEndpoint();\n\n modifier onlyEndpoint() {\n if (endpoint != msg.sender) revert LZ_MessageLib_OnlyEndpoint();\n _;\n }\n\n constructor(address _endpoint, uint32 _localEid) {\n endpoint = _endpoint;\n localEid = _localEid;\n }\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/SendLibBase.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { Transfer } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Transfer.sol\";\n\nimport { ILayerZeroExecutor } from \"./interfaces/ILayerZeroExecutor.sol\";\nimport { ILayerZeroTreasury } from \"./interfaces/ILayerZeroTreasury.sol\";\nimport { SafeCall } from \"./libs/SafeCall.sol\";\nimport { MessageLibBase } from \"./MessageLibBase.sol\";\n\nstruct WorkerOptions {\n uint8 workerId;\n bytes options;\n}\n\nstruct SetDefaultExecutorConfigParam {\n uint32 eid;\n ExecutorConfig config;\n}\n\nstruct ExecutorConfig {\n uint32 maxMessageSize;\n address executor;\n}\n\n/// @dev base contract for both SendLibBaseE1 and SendLibBaseE2\nabstract contract SendLibBase is MessageLibBase, Ownable {\n using SafeCall for address;\n\n address private constant DEFAULT_CONFIG = address(0);\n uint16 internal constant TREASURY_MAX_COPY = 32;\n\n uint256 internal immutable treasuryGasLimit;\n uint256 internal treasuryNativeFeeCap;\n\n // config\n address public treasury;\n mapping(address oapp => mapping(uint32 eid => ExecutorConfig)) public executorConfigs;\n\n // accumulated fees for workers and treasury\n mapping(address worker => uint256) public fees;\n\n event ExecutorFeePaid(address executor, uint256 fee);\n event TreasurySet(address treasury);\n event DefaultExecutorConfigsSet(SetDefaultExecutorConfigParam[] params);\n event ExecutorConfigSet(address oapp, uint32 eid, ExecutorConfig config);\n event TreasuryNativeFeeCapSet(uint256 newTreasuryNativeFeeCap);\n\n error LZ_MessageLib_InvalidMessageSize(uint256 actual, uint256 max);\n error LZ_MessageLib_InvalidAmount(uint256 requested, uint256 available);\n error LZ_MessageLib_TransferFailed();\n error LZ_MessageLib_InvalidExecutor();\n error LZ_MessageLib_ZeroMessageSize();\n\n constructor(\n address _endpoint,\n uint32 _localEid,\n uint256 _treasuryGasLimit,\n uint256 _treasuryNativeFeeCap\n ) MessageLibBase(_endpoint, _localEid) {\n treasuryGasLimit = _treasuryGasLimit;\n treasuryNativeFeeCap = _treasuryNativeFeeCap;\n }\n\n function setDefaultExecutorConfigs(SetDefaultExecutorConfigParam[] calldata _params) external onlyOwner {\n for (uint256 i = 0; i < _params.length; ++i) {\n SetDefaultExecutorConfigParam calldata param = _params[i];\n\n if (param.config.executor == address(0x0)) revert LZ_MessageLib_InvalidExecutor();\n if (param.config.maxMessageSize == 0) revert LZ_MessageLib_ZeroMessageSize();\n\n executorConfigs[DEFAULT_CONFIG][param.eid] = param.config;\n }\n emit DefaultExecutorConfigsSet(_params);\n }\n\n /// @dev the new value can not be greater than the old value, i.e. down only\n function setTreasuryNativeFeeCap(uint256 _newTreasuryNativeFeeCap) external onlyOwner {\n // assert the new value is no greater than the old value\n if (_newTreasuryNativeFeeCap > treasuryNativeFeeCap)\n revert LZ_MessageLib_InvalidAmount(_newTreasuryNativeFeeCap, treasuryNativeFeeCap);\n treasuryNativeFeeCap = _newTreasuryNativeFeeCap;\n emit TreasuryNativeFeeCapSet(_newTreasuryNativeFeeCap);\n }\n\n // ============================ View ===================================\n // @dev get the executor config and if not set, return the default config\n function getExecutorConfig(address _oapp, uint32 _remoteEid) public view returns (ExecutorConfig memory rtnConfig) {\n ExecutorConfig storage defaultConfig = executorConfigs[DEFAULT_CONFIG][_remoteEid];\n ExecutorConfig storage customConfig = executorConfigs[_oapp][_remoteEid];\n\n uint32 maxMessageSize = customConfig.maxMessageSize;\n rtnConfig.maxMessageSize = maxMessageSize != 0 ? maxMessageSize : defaultConfig.maxMessageSize;\n\n address executor = customConfig.executor;\n rtnConfig.executor = executor != address(0x0) ? executor : defaultConfig.executor;\n }\n\n // ======================= Internal =======================\n function _assertMessageSize(uint256 _actual, uint256 _max) internal pure {\n if (_actual > _max) revert LZ_MessageLib_InvalidMessageSize(_actual, _max);\n }\n\n function _payExecutor(\n address _executor,\n uint32 _dstEid,\n address _sender,\n uint256 _msgSize,\n bytes memory _executorOptions\n ) internal returns (uint256 executorFee) {\n executorFee = ILayerZeroExecutor(_executor).assignJob(_dstEid, _sender, _msgSize, _executorOptions);\n if (executorFee > 0) {\n fees[_executor] += executorFee;\n }\n emit ExecutorFeePaid(_executor, executorFee);\n }\n\n function _payTreasury(\n address _sender,\n uint32 _dstEid,\n uint256 _totalNativeFee,\n bool _payInLzToken\n ) internal returns (uint256 treasuryNativeFee, uint256 lzTokenFee) {\n if (treasury != address(0x0)) {\n bytes memory callData = abi.encodeCall(\n ILayerZeroTreasury.payFee,\n (_sender, _dstEid, _totalNativeFee, _payInLzToken)\n );\n (bool success, bytes memory result) = treasury.safeCall(treasuryGasLimit, 0, TREASURY_MAX_COPY, callData);\n\n (treasuryNativeFee, lzTokenFee) = _parseTreasuryResult(_totalNativeFee, _payInLzToken, success, result);\n // fee should be in lzTokenFee if payInLzToken, otherwise in native\n if (treasuryNativeFee > 0) {\n fees[treasury] += treasuryNativeFee;\n }\n }\n }\n\n /// @dev the abstract process for quote() is:\n /// 0/ split out the executor options and options of other workers\n /// 1/ quote workers\n /// 2/ quote executor\n /// 3/ quote treasury\n /// @return nativeFee, lzTokenFee\n function _quote(\n address _sender,\n uint32 _dstEid,\n uint256 _msgSize,\n bool _payInLzToken,\n bytes calldata _options\n ) internal view returns (uint256, uint256) {\n (bytes memory executorOptions, WorkerOptions[] memory validationOptions) = _splitOptions(_options);\n\n // quote the verifier used in the library. for ULN, it is a list of DVNs\n uint256 nativeFee = _quoteVerifier(_sender, _dstEid, validationOptions);\n\n // quote executor\n ExecutorConfig memory config = getExecutorConfig(_sender, _dstEid);\n // assert msg size\n _assertMessageSize(_msgSize, config.maxMessageSize);\n\n nativeFee += ILayerZeroExecutor(config.executor).getFee(_dstEid, _sender, _msgSize, executorOptions);\n\n // quote treasury\n (uint256 treasuryNativeFee, uint256 lzTokenFee) = _quoteTreasury(_sender, _dstEid, nativeFee, _payInLzToken);\n nativeFee += treasuryNativeFee;\n\n return (nativeFee, lzTokenFee);\n }\n\n /// @dev this interface should be DoS-free if the user is paying with native. properties\n /// 1/ treasury can return an overly high lzToken fee\n /// 2/ if treasury returns an overly high native fee, it will be capped by maxNativeFee,\n /// which can be reasoned with the configurations\n /// 3/ the owner can not configure the treasury in a way that force this function to revert\n function _quoteTreasury(\n address _sender,\n uint32 _dstEid,\n uint256 _totalNativeFee,\n bool _payInLzToken\n ) internal view returns (uint256 nativeFee, uint256 lzTokenFee) {\n // treasury must be set, and it has to be a contract\n if (treasury != address(0x0)) {\n bytes memory callData = abi.encodeCall(\n ILayerZeroTreasury.getFee,\n (_sender, _dstEid, _totalNativeFee, _payInLzToken)\n );\n (bool success, bytes memory result) = treasury.safeStaticCall(\n treasuryGasLimit,\n TREASURY_MAX_COPY,\n callData\n );\n\n return _parseTreasuryResult(_totalNativeFee, _payInLzToken, success, result);\n }\n }\n\n function _parseTreasuryResult(\n uint256 _totalNativeFee,\n bool _payInLzToken,\n bool _success,\n bytes memory _result\n ) internal view returns (uint256 nativeFee, uint256 lzTokenFee) {\n // failure, charges nothing\n if (!_success || _result.length < TREASURY_MAX_COPY) return (0, 0);\n\n // parse the result\n uint256 treasureFeeQuote = abi.decode(_result, (uint256));\n if (_payInLzToken) {\n lzTokenFee = treasureFeeQuote;\n } else {\n // pay in native\n // we must prevent high-treasuryFee Dos attack\n // nativeFee = min(treasureFeeQuote, maxNativeFee)\n // opportunistically raise the maxNativeFee to be the same as _totalNativeFee\n // can't use the _totalNativeFee alone because the oapp can use custom workers to force the fee to 0.\n // maxNativeFee = max (_totalNativeFee, treasuryNativeFeeCap)\n uint256 maxNativeFee = _totalNativeFee > treasuryNativeFeeCap ? _totalNativeFee : treasuryNativeFeeCap;\n\n // min (treasureFeeQuote, nativeFeeCap)\n nativeFee = treasureFeeQuote > maxNativeFee ? maxNativeFee : treasureFeeQuote;\n }\n }\n\n /// @dev authenticated by msg.sender only\n function _debitFee(uint256 _amount) internal {\n uint256 fee = fees[msg.sender];\n if (_amount > fee) revert LZ_MessageLib_InvalidAmount(_amount, fee);\n unchecked {\n fees[msg.sender] = fee - _amount;\n }\n }\n\n function _setTreasury(address _treasury) internal {\n treasury = _treasury;\n emit TreasurySet(_treasury);\n }\n\n function _setExecutorConfig(uint32 _remoteEid, address _oapp, ExecutorConfig memory _config) internal {\n executorConfigs[_oapp][_remoteEid] = _config;\n emit ExecutorConfigSet(_oapp, _remoteEid, _config);\n }\n\n // ======================= Virtual =======================\n /// @dev these two functions will be overridden with specific logics of the library function\n function _quoteVerifier(\n address _oapp,\n uint32 _eid,\n WorkerOptions[] memory _options\n ) internal view virtual returns (uint256 nativeFee);\n\n /// @dev this function will split the options into executorOptions and validationOptions\n function _splitOptions(\n bytes calldata _options\n ) internal view virtual returns (bytes memory executorOptions, WorkerOptions[] memory validationOptions);\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/libs/DVNOptions.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { BytesLib } from \"solidity-bytes-utils/contracts/BytesLib.sol\";\n\nimport { BitMap256 } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/BitMaps.sol\";\nimport { CalldataBytesLib } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/CalldataBytesLib.sol\";\n\nlibrary DVNOptions {\n using CalldataBytesLib for bytes;\n using BytesLib for bytes;\n\n uint8 internal constant WORKER_ID = 2;\n uint8 internal constant OPTION_TYPE_PRECRIME = 1;\n\n error DVN_InvalidDVNIdx();\n error DVN_InvalidDVNOptions(uint256 cursor);\n\n /// @dev group dvn options by its idx\n /// @param _options [dvn_id][dvn_option][dvn_id][dvn_option]...\n /// dvn_option = [option_size][dvn_idx][option_type][option]\n /// option_size = len(dvn_idx) + len(option_type) + len(option)\n /// dvn_id: uint8, dvn_idx: uint8, option_size: uint16, option_type: uint8, option: bytes\n /// @return dvnOptions the grouped options, still share the same format of _options\n /// @return dvnIndices the dvn indices\n function groupDVNOptionsByIdx(\n bytes memory _options\n ) internal pure returns (bytes[] memory dvnOptions, uint8[] memory dvnIndices) {\n if (_options.length == 0) return (dvnOptions, dvnIndices);\n\n uint8 numDVNs = getNumDVNs(_options);\n\n // if there is only 1 dvn, we can just return the whole options\n if (numDVNs == 1) {\n dvnOptions = new bytes[](1);\n dvnOptions[0] = _options;\n\n dvnIndices = new uint8[](1);\n dvnIndices[0] = _options.toUint8(3); // dvn idx\n return (dvnOptions, dvnIndices);\n }\n\n // otherwise, we need to group the options by dvn_idx\n dvnIndices = new uint8[](numDVNs);\n dvnOptions = new bytes[](numDVNs);\n unchecked {\n uint256 cursor = 0;\n uint256 start = 0;\n uint8 lastDVNIdx = 255; // 255 is an invalid dvn_idx\n\n while (cursor < _options.length) {\n ++cursor; // skip worker_id\n\n // optionLength asserted in getNumDVNs (skip check)\n uint16 optionLength = _options.toUint16(cursor);\n cursor += 2;\n\n // dvnIdx asserted in getNumDVNs (skip check)\n uint8 dvnIdx = _options.toUint8(cursor);\n\n // dvnIdx must equal to the lastDVNIdx for the first option\n // so it is always skipped in the first option\n // this operation slices out options whenever the scan finds a different lastDVNIdx\n if (lastDVNIdx == 255) {\n lastDVNIdx = dvnIdx;\n } else if (dvnIdx != lastDVNIdx) {\n uint256 len = cursor - start - 3; // 3 is for worker_id and option_length\n bytes memory opt = _options.slice(start, len);\n _insertDVNOptions(dvnOptions, dvnIndices, lastDVNIdx, opt);\n\n // reset the start and lastDVNIdx\n start += len;\n lastDVNIdx = dvnIdx;\n }\n\n cursor += optionLength;\n }\n\n // skip check the cursor here because the cursor is asserted in getNumDVNs\n // if we have reached the end of the options, we need to process the last dvn\n uint256 size = cursor - start;\n bytes memory op = _options.slice(start, size);\n _insertDVNOptions(dvnOptions, dvnIndices, lastDVNIdx, op);\n\n // revert dvnIndices to start from 0\n for (uint8 i = 0; i < numDVNs; ++i) {\n --dvnIndices[i];\n }\n }\n }\n\n function _insertDVNOptions(\n bytes[] memory _dvnOptions,\n uint8[] memory _dvnIndices,\n uint8 _dvnIdx,\n bytes memory _newOptions\n ) internal pure {\n // dvnIdx starts from 0 but default value of dvnIndices is 0,\n // so we tell if the slot is empty by adding 1 to dvnIdx\n if (_dvnIdx == 255) revert DVN_InvalidDVNIdx();\n uint8 dvnIdxAdj = _dvnIdx + 1;\n\n for (uint256 j = 0; j < _dvnIndices.length; ++j) {\n uint8 index = _dvnIndices[j];\n if (dvnIdxAdj == index) {\n _dvnOptions[j] = abi.encodePacked(_dvnOptions[j], _newOptions);\n break;\n } else if (index == 0) {\n // empty slot, that means it is the first time we see this dvn\n _dvnIndices[j] = dvnIdxAdj;\n _dvnOptions[j] = _newOptions;\n break;\n }\n }\n }\n\n /// @dev get the number of unique dvns\n /// @param _options the format is the same as groupDVNOptionsByIdx\n function getNumDVNs(bytes memory _options) internal pure returns (uint8 numDVNs) {\n uint256 cursor = 0;\n BitMap256 bitmap;\n\n // find number of unique dvn_idx\n unchecked {\n while (cursor < _options.length) {\n ++cursor; // skip worker_id\n\n uint16 optionLength = _options.toUint16(cursor);\n cursor += 2;\n if (optionLength < 2) revert DVN_InvalidDVNOptions(cursor); // at least 1 byte for dvn_idx and 1 byte for option_type\n\n uint8 dvnIdx = _options.toUint8(cursor);\n\n // if dvnIdx is not set, increment numDVNs\n // max num of dvns is 255, 255 is an invalid dvn_idx\n // The order of the dvnIdx is not required to be sequential, as enforcing the order may weaken\n // the composability of the options. e.g. if we refrain from enforcing the order, an OApp that has\n // already enforced certain options can append additional options to the end of the enforced\n // ones without restrictions.\n if (dvnIdx == 255) revert DVN_InvalidDVNIdx();\n if (!bitmap.get(dvnIdx)) {\n ++numDVNs;\n bitmap = bitmap.set(dvnIdx);\n }\n\n cursor += optionLength;\n }\n }\n if (cursor != _options.length) revert DVN_InvalidDVNOptions(cursor);\n }\n\n /// @dev decode the next dvn option from _options starting from the specified cursor\n /// @param _options the format is the same as groupDVNOptionsByIdx\n /// @param _cursor the cursor to start decoding\n /// @return optionType the type of the option\n /// @return option the option\n /// @return cursor the cursor to start decoding the next option\n function nextDVNOption(\n bytes calldata _options,\n uint256 _cursor\n ) internal pure returns (uint8 optionType, bytes calldata option, uint256 cursor) {\n unchecked {\n // skip worker id\n cursor = _cursor + 1;\n\n // read option size\n uint16 size = _options.toU16(cursor);\n cursor += 2;\n\n // read option type\n optionType = _options.toU8(cursor + 1); // skip dvn_idx\n\n // startCursor and endCursor are used to slice the option from _options\n uint256 startCursor = cursor + 2; // skip option type and dvn_idx\n uint256 endCursor = cursor + size;\n option = _options[startCursor:endCursor];\n cursor += size;\n }\n }\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/libs/UlnOptions.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { SafeCast } from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\n\nimport { ExecutorOptions } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/ExecutorOptions.sol\";\n\nimport { DVNOptions } from \"./DVNOptions.sol\";\n\nlibrary UlnOptions {\n using SafeCast for uint256;\n\n uint16 internal constant TYPE_1 = 1; // legacy options type 1\n uint16 internal constant TYPE_2 = 2; // legacy options type 2\n uint16 internal constant TYPE_3 = 3;\n\n error LZ_ULN_InvalidWorkerOptions(uint256 cursor);\n error LZ_ULN_InvalidWorkerId(uint8 workerId);\n error LZ_ULN_InvalidLegacyType1Option();\n error LZ_ULN_InvalidLegacyType2Option();\n error LZ_ULN_UnsupportedOptionType(uint16 optionType);\n\n /// @dev decode the options into executorOptions and dvnOptions\n /// @param _options the options can be either legacy options (type 1 or 2) or type 3 options\n /// @return executorOptions the executor options, share the same format of type 3 options\n /// @return dvnOptions the dvn options, share the same format of type 3 options\n function decode(\n bytes calldata _options\n ) internal pure returns (bytes memory executorOptions, bytes memory dvnOptions) {\n // at least 2 bytes for the option type, but can have no options\n if (_options.length < 2) revert LZ_ULN_InvalidWorkerOptions(0);\n\n uint16 optionsType = uint16(bytes2(_options[0:2]));\n uint256 cursor = 2;\n\n // type3 options: [worker_option][worker_option]...\n // worker_option: [worker_id][option_size][option]\n // worker_id: uint8, option_size: uint16, option: bytes\n if (optionsType == TYPE_3) {\n unchecked {\n uint256 start = cursor;\n uint8 lastWorkerId; // worker_id starts from 1, so 0 is an invalid worker_id\n\n // heuristic: we assume that the options are mostly EXECUTOR options only\n // checking the workerID can reduce gas usage for most cases\n while (cursor < _options.length) {\n uint8 workerId = uint8(bytes1(_options[cursor:cursor + 1]));\n if (workerId == 0) revert LZ_ULN_InvalidWorkerId(0);\n\n // workerId must equal to the lastWorkerId for the first option\n // so it is always skipped in the first option\n // this operation slices out options whenever the the scan finds a different workerId\n if (lastWorkerId == 0) {\n lastWorkerId = workerId;\n } else if (workerId != lastWorkerId) {\n bytes calldata op = _options[start:cursor]; // slice out the last worker's options\n (executorOptions, dvnOptions) = _insertWorkerOptions(\n executorOptions,\n dvnOptions,\n lastWorkerId,\n op\n );\n\n // reset the start cursor and lastWorkerId\n start = cursor;\n lastWorkerId = workerId;\n }\n\n ++cursor; // for workerId\n\n uint16 size = uint16(bytes2(_options[cursor:cursor + 2]));\n if (size == 0) revert LZ_ULN_InvalidWorkerOptions(cursor);\n cursor += size + 2;\n }\n\n // the options length must be the same as the cursor at the end\n if (cursor != _options.length) revert LZ_ULN_InvalidWorkerOptions(cursor);\n\n // if we have reached the end of the options and the options are not empty\n // we need to process the last worker's options\n if (_options.length > 2) {\n bytes calldata op = _options[start:cursor];\n (executorOptions, dvnOptions) = _insertWorkerOptions(executorOptions, dvnOptions, lastWorkerId, op);\n }\n }\n } else {\n executorOptions = decodeLegacyOptions(optionsType, _options);\n }\n }\n\n function _insertWorkerOptions(\n bytes memory _executorOptions,\n bytes memory _dvnOptions,\n uint8 _workerId,\n bytes calldata _newOptions\n ) private pure returns (bytes memory, bytes memory) {\n if (_workerId == ExecutorOptions.WORKER_ID) {\n _executorOptions = _executorOptions.length == 0\n ? _newOptions\n : abi.encodePacked(_executorOptions, _newOptions);\n } else if (_workerId == DVNOptions.WORKER_ID) {\n _dvnOptions = _dvnOptions.length == 0 ? _newOptions : abi.encodePacked(_dvnOptions, _newOptions);\n } else {\n revert LZ_ULN_InvalidWorkerId(_workerId);\n }\n return (_executorOptions, _dvnOptions);\n }\n\n /// @dev decode the legacy options (type 1 or 2) into executorOptions\n /// @param _optionType the legacy option type\n /// @param _options the legacy options, which still has the option type in the first 2 bytes\n /// @return executorOptions the executor options, share the same format of type 3 options\n /// Data format:\n /// legacy type 1: [extraGas]\n /// legacy type 2: [extraGas][dstNativeAmt][dstNativeAddress]\n /// extraGas: uint256, dstNativeAmt: uint256, dstNativeAddress: bytes\n function decodeLegacyOptions(\n uint16 _optionType,\n bytes calldata _options\n ) internal pure returns (bytes memory executorOptions) {\n if (_optionType == TYPE_1) {\n if (_options.length != 34) revert LZ_ULN_InvalidLegacyType1Option();\n\n // execution gas\n uint128 executionGas = uint256(bytes32(_options[2:2 + 32])).toUint128();\n\n // dont use the encode function in the ExecutorOptions lib for saving gas by calling abi.encodePacked once\n // the result is a lzReceive option: [executor_id][option_size][option_type][execution_gas]\n // option_type: uint8, execution_gas: uint128\n // option_size = len(option_type) + len(execution_gas) = 1 + 16 = 17\n executorOptions = abi.encodePacked(\n ExecutorOptions.WORKER_ID,\n uint16(17), // 16 + 1, 16 for option_length, + 1 for option_type\n ExecutorOptions.OPTION_TYPE_LZRECEIVE,\n executionGas\n );\n } else if (_optionType == TYPE_2) {\n // receiver size <= 32\n if (_options.length <= 66 || _options.length > 98) revert LZ_ULN_InvalidLegacyType2Option();\n\n // execution gas\n uint128 executionGas = uint256(bytes32(_options[2:2 + 32])).toUint128();\n\n // nativeDrop (amount + receiver)\n uint128 amount = uint256(bytes32(_options[34:34 + 32])).toUint128(); // offset 2 + 32\n bytes32 receiver;\n unchecked {\n uint256 receiverLen = _options.length - 66; // offset 2 + 32 + 32\n receiver = bytes32(_options[66:]);\n receiver = receiver >> (8 * (32 - receiverLen)); // padding 0 to the left\n }\n\n // dont use the encode function in the ExecutorOptions lib for saving gas by calling abi.encodePacked once\n // the result has one lzReceive option and one nativeDrop option:\n // [executor_id][lzReceive_option_size][option_type][execution_gas] +\n // [executor_id][nativeDrop_option_size][option_type][nativeDrop_amount][receiver]\n // option_type: uint8, execution_gas: uint128, nativeDrop_amount: uint128, receiver: bytes32\n // lzReceive_option_size = len(option_type) + len(execution_gas) = 1 + 16 = 17\n // nativeDrop_option_size = len(option_type) + len(nativeDrop_amount) + len(receiver) = 1 + 16 + 32 = 49\n executorOptions = abi.encodePacked(\n ExecutorOptions.WORKER_ID,\n uint16(17), // 16 + 1, 16 for option_length, + 1 for option_type\n ExecutorOptions.OPTION_TYPE_LZRECEIVE,\n executionGas,\n ExecutorOptions.WORKER_ID,\n uint16(49), // 48 + 1, 32 + 16 for option_length, + 1 for option_type\n ExecutorOptions.OPTION_TYPE_NATIVE_DROP,\n amount,\n receiver\n );\n } else {\n revert LZ_ULN_UnsupportedOptionType(_optionType);\n }\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppCore.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { ILayerZeroEndpointV2 } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\n\n/**\n * @title IOAppCore\n */\ninterface IOAppCore {\n // Custom error messages\n error OnlyPeer(uint32 eid, bytes32 sender);\n error NoPeer(uint32 eid);\n error InvalidEndpointCall();\n error InvalidDelegate();\n\n // Event emitted when a peer (OApp) is set for a corresponding endpoint\n event PeerSet(uint32 eid, bytes32 peer);\n\n /**\n * @notice Retrieves the OApp version information.\n * @return senderVersion The version of the OAppSender.sol contract.\n * @return receiverVersion The version of the OAppReceiver.sol contract.\n */\n function oAppVersion() external view returns (uint64 senderVersion, uint64 receiverVersion);\n\n /**\n * @notice Retrieves the LayerZero endpoint associated with the OApp.\n * @return iEndpoint The LayerZero endpoint as an interface.\n */\n function endpoint() external view returns (ILayerZeroEndpointV2 iEndpoint);\n\n /**\n * @notice Retrieves the peer (OApp) associated with a corresponding endpoint.\n * @param _eid The endpoint ID.\n * @return peer The peer address (OApp instance) associated with the corresponding endpoint.\n */\n function peers(uint32 _eid) external view returns (bytes32 peer);\n\n /**\n * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\n * @param _eid The endpoint ID.\n * @param _peer The address of the peer to be associated with the corresponding endpoint.\n */\n function setPeer(uint32 _eid, bytes32 _peer) external;\n\n /**\n * @notice Sets the delegate address for the OApp Core.\n * @param _delegate The address of the delegate to be set.\n */\n function setDelegate(address _delegate) external;\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppMsgInspector.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\n/**\n * @title IOAppMsgInspector\n * @dev Interface for the OApp Message Inspector, allowing examination of message and options contents.\n */\ninterface IOAppMsgInspector {\n // Custom error message for inspection failure\n error InspectionFailed(bytes message, bytes options);\n\n /**\n * @notice Allows the inspector to examine LayerZero message contents and optionally throw a revert if invalid.\n * @param _message The message payload to be inspected.\n * @param _options Additional options or parameters for inspection.\n * @return valid A boolean indicating whether the inspection passed (true) or failed (false).\n *\n * @dev Optionally done as a revert, OR use the boolean provided to handle the failure.\n */\n function inspect(bytes calldata _message, bytes calldata _options) external view returns (bool valid);\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppOptionsType3.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Struct representing enforced option parameters.\n */\nstruct EnforcedOptionParam {\n uint32 eid; // Endpoint ID\n uint16 msgType; // Message Type\n bytes options; // Additional options\n}\n\n/**\n * @title IOAppOptionsType3\n * @dev Interface for the OApp with Type 3 Options, allowing the setting and combining of enforced options.\n */\ninterface IOAppOptionsType3 {\n // Custom error message for invalid options\n error InvalidOptions(bytes options);\n\n // Event emitted when enforced options are set\n event EnforcedOptionSet(EnforcedOptionParam[] _enforcedOptions);\n\n /**\n * @notice Sets enforced options for specific endpoint and message type combinations.\n * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\n */\n function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) external;\n\n /**\n * @notice Combines options for a given endpoint and message type.\n * @param _eid The endpoint ID.\n * @param _msgType The OApp message type.\n * @param _extraOptions Additional options passed by the caller.\n * @return options The combination of caller specified options AND enforced options.\n */\n function combineOptions(\n uint32 _eid,\n uint16 _msgType,\n bytes calldata _extraOptions\n ) external view returns (bytes memory options);\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppReceiver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport { ILayerZeroReceiver, Origin } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol\";\n\ninterface IOAppReceiver is ILayerZeroReceiver {\n /**\n * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint.\n * @param _origin The origin information containing the source endpoint and sender address.\n * - srcEid: The source chain endpoint ID.\n * - sender: The sender address on the src chain.\n * - nonce: The nonce of the message.\n * @param _message The lzReceive payload.\n * @param _sender The sender address.\n * @return isSender Is a valid sender.\n *\n * @dev Applications can optionally choose to implement a separate composeMsg sender that is NOT the bridging layer.\n * @dev The default sender IS the OAppReceiver implementer.\n */\n function isComposeMsgSender(\n Origin calldata _origin,\n bytes calldata _message,\n address _sender\n ) external view returns (bool isSender);\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OAppOptionsType3.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { IOAppOptionsType3, EnforcedOptionParam } from \"../interfaces/IOAppOptionsType3.sol\";\n\n/**\n * @title OAppOptionsType3\n * @dev Abstract contract implementing the IOAppOptionsType3 interface with type 3 options.\n */\nabstract contract OAppOptionsType3 is IOAppOptionsType3, Ownable {\n uint16 internal constant OPTION_TYPE_3 = 3;\n\n // @dev The \"msgType\" should be defined in the child contract.\n mapping(uint32 eid => mapping(uint16 msgType => bytes enforcedOption)) public enforcedOptions;\n\n /**\n * @dev Sets the enforced options for specific endpoint and message type combinations.\n * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\n *\n * @dev Only the owner/admin of the OApp can call this function.\n * @dev Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.\n * @dev These enforced options can vary as the potential options/execution on the remote may differ as per the msgType.\n * eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay\n * if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().\n */\n function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) public virtual onlyOwner {\n _setEnforcedOptions(_enforcedOptions);\n }\n\n /**\n * @dev Sets the enforced options for specific endpoint and message type combinations.\n * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\n *\n * @dev Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.\n * @dev These enforced options can vary as the potential options/execution on the remote may differ as per the msgType.\n * eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay\n * if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().\n */\n function _setEnforcedOptions(EnforcedOptionParam[] memory _enforcedOptions) internal virtual {\n for (uint256 i = 0; i < _enforcedOptions.length; i++) {\n // @dev Enforced options are only available for optionType 3, as type 1 and 2 dont support combining.\n _assertOptionsType3(_enforcedOptions[i].options);\n enforcedOptions[_enforcedOptions[i].eid][_enforcedOptions[i].msgType] = _enforcedOptions[i].options;\n }\n\n emit EnforcedOptionSet(_enforcedOptions);\n }\n\n /**\n * @notice Combines options for a given endpoint and message type.\n * @param _eid The endpoint ID.\n * @param _msgType The OAPP message type.\n * @param _extraOptions Additional options passed by the caller.\n * @return options The combination of caller specified options AND enforced options.\n *\n * @dev If there is an enforced lzReceive option:\n * - {gasLimit: 200k, msg.value: 1 ether} AND a caller supplies a lzReceive option: {gasLimit: 100k, msg.value: 0.5 ether}\n * - The resulting options will be {gasLimit: 300k, msg.value: 1.5 ether} when the message is executed on the remote lzReceive() function.\n * @dev This presence of duplicated options is handled off-chain in the verifier/executor.\n */\n function combineOptions(\n uint32 _eid,\n uint16 _msgType,\n bytes calldata _extraOptions\n ) public view virtual returns (bytes memory) {\n bytes memory enforced = enforcedOptions[_eid][_msgType];\n\n // No enforced options, pass whatever the caller supplied, even if it's empty or legacy type 1/2 options.\n if (enforced.length == 0) return _extraOptions;\n\n // No caller options, return enforced\n if (_extraOptions.length == 0) return enforced;\n\n // @dev If caller provided _extraOptions, must be type 3 as its the ONLY type that can be combined.\n if (_extraOptions.length >= 2) {\n _assertOptionsType3(_extraOptions);\n // @dev Remove the first 2 bytes containing the type from the _extraOptions and combine with enforced.\n return bytes.concat(enforced, _extraOptions[2:]);\n }\n\n // No valid set of options was found.\n revert InvalidOptions(_extraOptions);\n }\n\n /**\n * @dev Internal function to assert that options are of type 3.\n * @param _options The options to be checked.\n */\n function _assertOptionsType3(bytes memory _options) internal pure virtual {\n uint16 optionsType;\n assembly {\n optionsType := mload(add(_options, 2))\n }\n if (optionsType != OPTION_TYPE_3) revert InvalidOptions(_options);\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppCore.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { IOAppCore, ILayerZeroEndpointV2 } from \"./interfaces/IOAppCore.sol\";\n\n/**\n * @title OAppCore\n * @dev Abstract contract implementing the IOAppCore interface with basic OApp configurations.\n */\nabstract contract OAppCore is IOAppCore, Ownable {\n // The LayerZero endpoint associated with the given OApp\n ILayerZeroEndpointV2 public immutable endpoint;\n\n // Mapping to store peers associated with corresponding endpoints\n mapping(uint32 eid => bytes32 peer) public peers;\n\n /**\n * @dev Constructor to initialize the OAppCore with the provided endpoint and delegate.\n * @param _endpoint The address of the LOCAL Layer Zero endpoint.\n * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n *\n * @dev The delegate typically should be set as the owner of the contract.\n */\n constructor(address _endpoint, address _delegate) {\n endpoint = ILayerZeroEndpointV2(_endpoint);\n\n if (_delegate == address(0)) revert InvalidDelegate();\n endpoint.setDelegate(_delegate);\n }\n\n /**\n * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\n * @param _eid The endpoint ID.\n * @param _peer The address of the peer to be associated with the corresponding endpoint.\n *\n * @dev Only the owner/admin of the OApp can call this function.\n * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.\n * @dev Set this to bytes32(0) to remove the peer address.\n * @dev Peer is a bytes32 to accommodate non-evm chains.\n */\n function setPeer(uint32 _eid, bytes32 _peer) public virtual onlyOwner {\n _setPeer(_eid, _peer);\n }\n\n /**\n * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\n * @param _eid The endpoint ID.\n * @param _peer The address of the peer to be associated with the corresponding endpoint.\n *\n * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.\n * @dev Set this to bytes32(0) to remove the peer address.\n * @dev Peer is a bytes32 to accommodate non-evm chains.\n */\n function _setPeer(uint32 _eid, bytes32 _peer) internal virtual {\n peers[_eid] = _peer;\n emit PeerSet(_eid, _peer);\n }\n\n /**\n * @notice Internal function to get the peer address associated with a specific endpoint; reverts if NOT set.\n * ie. the peer is set to bytes32(0).\n * @param _eid The endpoint ID.\n * @return peer The address of the peer associated with the specified endpoint.\n */\n function _getPeerOrRevert(uint32 _eid) internal view virtual returns (bytes32) {\n bytes32 peer = peers[_eid];\n if (peer == bytes32(0)) revert NoPeer(_eid);\n return peer;\n }\n\n /**\n * @notice Sets the delegate address for the OApp.\n * @param _delegate The address of the delegate to be set.\n *\n * @dev Only the owner/admin of the OApp can call this function.\n * @dev Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.\n */\n function setDelegate(address _delegate) public onlyOwner {\n endpoint.setDelegate(_delegate);\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppReceiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { IOAppReceiver, Origin } from \"./interfaces/IOAppReceiver.sol\";\nimport { OAppCore } from \"./OAppCore.sol\";\n\n/**\n * @title OAppReceiver\n * @dev Abstract contract implementing the ILayerZeroReceiver interface and extending OAppCore for OApp receivers.\n */\nabstract contract OAppReceiver is IOAppReceiver, OAppCore {\n // Custom error message for when the caller is not the registered endpoint/\n error OnlyEndpoint(address addr);\n\n // @dev The version of the OAppReceiver implementation.\n // @dev Version is bumped when changes are made to this contract.\n uint64 internal constant RECEIVER_VERSION = 2;\n\n /**\n * @notice Retrieves the OApp version information.\n * @return senderVersion The version of the OAppSender.sol contract.\n * @return receiverVersion The version of the OAppReceiver.sol contract.\n *\n * @dev Providing 0 as the default for OAppSender version. Indicates that the OAppSender is not implemented.\n * ie. this is a RECEIVE only OApp.\n * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions.\n */\n function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\n return (0, RECEIVER_VERSION);\n }\n\n /**\n * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint.\n * @dev _origin The origin information containing the source endpoint and sender address.\n * - srcEid: The source chain endpoint ID.\n * - sender: The sender address on the src chain.\n * - nonce: The nonce of the message.\n * @dev _message The lzReceive payload.\n * @param _sender The sender address.\n * @return isSender Is a valid sender.\n *\n * @dev Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer.\n * @dev The default sender IS the OAppReceiver implementer.\n */\n function isComposeMsgSender(\n Origin calldata /*_origin*/,\n bytes calldata /*_message*/,\n address _sender\n ) public view virtual returns (bool) {\n return _sender == address(this);\n }\n\n /**\n * @notice Checks if the path initialization is allowed based on the provided origin.\n * @param origin The origin information containing the source endpoint and sender address.\n * @return Whether the path has been initialized.\n *\n * @dev This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received.\n * @dev This defaults to assuming if a peer has been set, its initialized.\n * Can be overridden by the OApp if there is other logic to determine this.\n */\n function allowInitializePath(Origin calldata origin) public view virtual returns (bool) {\n return peers[origin.srcEid] == origin.sender;\n }\n\n /**\n * @notice Retrieves the next nonce for a given source endpoint and sender address.\n * @dev _srcEid The source endpoint ID.\n * @dev _sender The sender address.\n * @return nonce The next nonce.\n *\n * @dev The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement.\n * @dev Is required by the off-chain executor to determine the OApp expects msg execution is ordered.\n * @dev This is also enforced by the OApp.\n * @dev By default this is NOT enabled. ie. nextNonce is hardcoded to return 0.\n */\n function nextNonce(uint32 /*_srcEid*/, bytes32 /*_sender*/) public view virtual returns (uint64 nonce) {\n return 0;\n }\n\n /**\n * @dev Entry point for receiving messages or packets from the endpoint.\n * @param _origin The origin information containing the source endpoint and sender address.\n * - srcEid: The source chain endpoint ID.\n * - sender: The sender address on the src chain.\n * - nonce: The nonce of the message.\n * @param _guid The unique identifier for the received LayerZero message.\n * @param _message The payload of the received message.\n * @param _executor The address of the executor for the received message.\n * @param _extraData Additional arbitrary data provided by the corresponding executor.\n *\n * @dev Entry point for receiving msg/packet from the LayerZero endpoint.\n */\n function lzReceive(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address _executor,\n bytes calldata _extraData\n ) public payable virtual {\n // Ensures that only the endpoint can attempt to lzReceive() messages to this OApp.\n if (address(endpoint) != msg.sender) revert OnlyEndpoint(msg.sender);\n\n // Ensure that the sender matches the expected peer for the source endpoint.\n if (_getPeerOrRevert(_origin.srcEid) != _origin.sender) revert OnlyPeer(_origin.srcEid, _origin.sender);\n\n // Call the internal OApp implementation of lzReceive.\n _lzReceive(_origin, _guid, _message, _executor, _extraData);\n }\n\n /**\n * @dev Internal function to implement lzReceive logic without needing to copy the basic parameter validation.\n */\n function _lzReceive(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address _executor,\n bytes calldata _extraData\n ) internal virtual;\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppSender.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { SafeERC20, IERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { MessagingParams, MessagingFee, MessagingReceipt } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport { OAppCore } from \"./OAppCore.sol\";\n\n/**\n * @title OAppSender\n * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.\n */\nabstract contract OAppSender is OAppCore {\n using SafeERC20 for IERC20;\n\n // Custom error messages\n error NotEnoughNative(uint256 msgValue);\n error LzTokenUnavailable();\n\n // @dev The version of the OAppSender implementation.\n // @dev Version is bumped when changes are made to this contract.\n uint64 internal constant SENDER_VERSION = 1;\n\n /**\n * @notice Retrieves the OApp version information.\n * @return senderVersion The version of the OAppSender.sol contract.\n * @return receiverVersion The version of the OAppReceiver.sol contract.\n *\n * @dev Providing 0 as the default for OAppReceiver version. Indicates that the OAppReceiver is not implemented.\n * ie. this is a SEND only OApp.\n * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions\n */\n function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\n return (SENDER_VERSION, 0);\n }\n\n /**\n * @dev Internal function to interact with the LayerZero EndpointV2.quote() for fee calculation.\n * @param _dstEid The destination endpoint ID.\n * @param _message The message payload.\n * @param _options Additional options for the message.\n * @param _payInLzToken Flag indicating whether to pay the fee in LZ tokens.\n * @return fee The calculated MessagingFee for the message.\n * - nativeFee: The native fee for the message.\n * - lzTokenFee: The LZ token fee for the message.\n */\n function _quote(\n uint32 _dstEid,\n bytes memory _message,\n bytes memory _options,\n bool _payInLzToken\n ) internal view virtual returns (MessagingFee memory fee) {\n return\n endpoint.quote(\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken),\n address(this)\n );\n }\n\n /**\n * @dev Internal function to interact with the LayerZero EndpointV2.send() for sending a message.\n * @param _dstEid The destination endpoint ID.\n * @param _message The message payload.\n * @param _options Additional options for the message.\n * @param _fee The calculated LayerZero fee for the message.\n * - nativeFee: The native fee.\n * - lzTokenFee: The lzToken fee.\n * @param _refundAddress The address to receive any excess fee values sent to the endpoint.\n * @return receipt The receipt for the sent message.\n * - guid: The unique identifier for the sent message.\n * - nonce: The nonce of the sent message.\n * - fee: The LayerZero fee incurred for the message.\n */\n function _lzSend(\n uint32 _dstEid,\n bytes memory _message,\n bytes memory _options,\n MessagingFee memory _fee,\n address _refundAddress\n ) internal virtual returns (MessagingReceipt memory receipt) {\n // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint.\n uint256 messageValue = _payNative(_fee.nativeFee);\n if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);\n\n return\n // solhint-disable-next-line check-send-result\n endpoint.send{ value: messageValue }(\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0),\n _refundAddress\n );\n }\n\n /**\n * @dev Internal function to pay the native fee associated with the message.\n * @param _nativeFee The native fee to be paid.\n * @return nativeFee The amount of native currency paid.\n *\n * @dev If the OApp needs to initiate MULTIPLE LayerZero messages in a single transaction,\n * this will need to be overridden because msg.value would contain multiple lzFees.\n * @dev Should be overridden in the event the LayerZero endpoint requires a different native currency.\n * @dev Some EVMs use an ERC20 as a method for paying transactions/gasFees.\n * @dev The endpoint is EITHER/OR, ie. it will NOT support both types of native payment at a time.\n */\n function _payNative(uint256 _nativeFee) internal virtual returns (uint256 nativeFee) {\n if (msg.value != _nativeFee) revert NotEnoughNative(msg.value);\n return _nativeFee;\n }\n\n /**\n * @dev Internal function to pay the LZ token fee associated with the message.\n * @param _lzTokenFee The LZ token fee to be paid.\n *\n * @dev If the caller is trying to pay in the specified lzToken, then the lzTokenFee is passed to the endpoint.\n * @dev Any excess sent, is passed back to the specified _refundAddress in the _lzSend().\n */\n function _payLzToken(uint256 _lzTokenFee) internal virtual {\n // @dev Cannot cache the token because it is not immutable in the endpoint.\n address lzToken = endpoint.lzToken();\n if (lzToken == address(0)) revert LzTokenUnavailable();\n\n // Pay LZ token fee by sending tokens to the endpoint.\n IERC20(lzToken).safeTransferFrom(msg.sender, address(endpoint), _lzTokenFee);\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { MessagingReceipt, MessagingFee } from \"../../oapp/OAppSender.sol\";\n\n/**\n * @dev Struct representing token parameters for the OFT send() operation.\n */\nstruct SendParam {\n uint32 dstEid; // Destination endpoint ID.\n bytes32 to; // Recipient address.\n uint256 amountLD; // Amount to send in local decimals.\n uint256 minAmountLD; // Minimum amount to send in local decimals.\n bytes extraOptions; // Additional options supplied by the caller to be used in the LayerZero message.\n bytes composeMsg; // The composed message for the send() operation.\n bytes oftCmd; // The OFT command to be executed, unused in default OFT implementations.\n}\n\n/**\n * @dev Struct representing OFT limit information.\n * @dev These amounts can change dynamically and are up the the specific oft implementation.\n */\nstruct OFTLimit {\n uint256 minAmountLD; // Minimum amount in local decimals that can be sent to the recipient.\n uint256 maxAmountLD; // Maximum amount in local decimals that can be sent to the recipient.\n}\n\n/**\n * @dev Struct representing OFT receipt information.\n */\nstruct OFTReceipt {\n uint256 amountSentLD; // Amount of tokens ACTUALLY debited from the sender in local decimals.\n // @dev In non-default implementations, the amountReceivedLD COULD differ from this value.\n uint256 amountReceivedLD; // Amount of tokens to be received on the remote side.\n}\n\n/**\n * @dev Struct representing OFT fee details.\n * @dev Future proof mechanism to provide a standardized way to communicate fees to things like a UI.\n */\nstruct OFTFeeDetail {\n int256 feeAmountLD; // Amount of the fee in local decimals.\n string description; // Description of the fee.\n}\n\n/**\n * @title IOFT\n * @dev Interface for the OftChain (OFT) token.\n * @dev Does not inherit ERC20 to accommodate usage by OFTAdapter as well.\n * @dev This specific interface ID is '0x02e49c2c'.\n */\ninterface IOFT {\n // Custom error messages\n error InvalidLocalDecimals();\n error SlippageExceeded(uint256 amountLD, uint256 minAmountLD);\n\n // Events\n event OFTSent(\n bytes32 indexed guid, // GUID of the OFT message.\n uint32 dstEid, // Destination Endpoint ID.\n address indexed fromAddress, // Address of the sender on the src chain.\n uint256 amountSentLD, // Amount of tokens sent in local decimals.\n uint256 amountReceivedLD // Amount of tokens received in local decimals.\n );\n event OFTReceived(\n bytes32 indexed guid, // GUID of the OFT message.\n uint32 srcEid, // Source Endpoint ID.\n address indexed toAddress, // Address of the recipient on the dst chain.\n uint256 amountReceivedLD // Amount of tokens received in local decimals.\n );\n\n /**\n * @notice Retrieves interfaceID and the version of the OFT.\n * @return interfaceId The interface ID.\n * @return version The version.\n *\n * @dev interfaceId: This specific interface ID is '0x02e49c2c'.\n * @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.\n * @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.\n * ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\n */\n function oftVersion() external view returns (bytes4 interfaceId, uint64 version);\n\n /**\n * @notice Retrieves the address of the token associated with the OFT.\n * @return token The address of the ERC20 token implementation.\n */\n function token() external view returns (address);\n\n /**\n * @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\n * @return requiresApproval Needs approval of the underlying token implementation.\n *\n * @dev Allows things like wallet implementers to determine integration requirements,\n * without understanding the underlying token implementation.\n */\n function approvalRequired() external view returns (bool);\n\n /**\n * @notice Retrieves the shared decimals of the OFT.\n * @return sharedDecimals The shared decimals of the OFT.\n */\n function sharedDecimals() external view returns (uint8);\n\n /**\n * @notice Provides a quote for OFT-related operations.\n * @param _sendParam The parameters for the send operation.\n * @return limit The OFT limit information.\n * @return oftFeeDetails The details of OFT fees.\n * @return receipt The OFT receipt information.\n */\n function quoteOFT(\n SendParam calldata _sendParam\n ) external view returns (OFTLimit memory, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory);\n\n /**\n * @notice Provides a quote for the send() operation.\n * @param _sendParam The parameters for the send() operation.\n * @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.\n * @return fee The calculated LayerZero messaging fee from the send() operation.\n *\n * @dev MessagingFee: LayerZero msg fee\n * - nativeFee: The native fee.\n * - lzTokenFee: The lzToken fee.\n */\n function quoteSend(SendParam calldata _sendParam, bool _payInLzToken) external view returns (MessagingFee memory);\n\n /**\n * @notice Executes the send() operation.\n * @param _sendParam The parameters for the send operation.\n * @param _fee The fee information supplied by the caller.\n * - nativeFee: The native fee.\n * - lzTokenFee: The lzToken fee.\n * @param _refundAddress The address to receive any excess funds from fees etc. on the src.\n * @return receipt The LayerZero messaging receipt from the send() operation.\n * @return oftReceipt The OFT receipt information.\n *\n * @dev MessagingReceipt: LayerZero msg receipt\n * - guid: The unique identifier for the sent message.\n * - nonce: The nonce of the sent message.\n * - fee: The LayerZero fee incurred for the message.\n */\n function send(\n SendParam calldata _sendParam,\n MessagingFee calldata _fee,\n address _refundAddress\n ) external payable returns (MessagingReceipt memory, OFTReceipt memory);\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/libs/OFTComposeMsgCodec.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nlibrary OFTComposeMsgCodec {\n // Offset constants for decoding composed messages\n uint8 private constant NONCE_OFFSET = 8;\n uint8 private constant SRC_EID_OFFSET = 12;\n uint8 private constant AMOUNT_LD_OFFSET = 44;\n uint8 private constant COMPOSE_FROM_OFFSET = 76;\n\n /**\n * @dev Encodes a OFT composed message.\n * @param _nonce The nonce value.\n * @param _srcEid The source endpoint ID.\n * @param _amountLD The amount in local decimals.\n * @param _composeMsg The composed message.\n * @return _msg The encoded Composed message.\n */\n function encode(\n uint64 _nonce,\n uint32 _srcEid,\n uint256 _amountLD,\n bytes memory _composeMsg // 0x[composeFrom][composeMsg]\n ) internal pure returns (bytes memory _msg) {\n _msg = abi.encodePacked(_nonce, _srcEid, _amountLD, _composeMsg);\n }\n\n /**\n * @dev Retrieves the nonce from the composed message.\n * @param _msg The message.\n * @return The nonce value.\n */\n function nonce(bytes calldata _msg) internal pure returns (uint64) {\n return uint64(bytes8(_msg[:NONCE_OFFSET]));\n }\n\n /**\n * @dev Retrieves the source endpoint ID from the composed message.\n * @param _msg The message.\n * @return The source endpoint ID.\n */\n function srcEid(bytes calldata _msg) internal pure returns (uint32) {\n return uint32(bytes4(_msg[NONCE_OFFSET:SRC_EID_OFFSET]));\n }\n\n /**\n * @dev Retrieves the amount in local decimals from the composed message.\n * @param _msg The message.\n * @return The amount in local decimals.\n */\n function amountLD(bytes calldata _msg) internal pure returns (uint256) {\n return uint256(bytes32(_msg[SRC_EID_OFFSET:AMOUNT_LD_OFFSET]));\n }\n\n /**\n * @dev Retrieves the composeFrom value from the composed message.\n * @param _msg The message.\n * @return The composeFrom value.\n */\n function composeFrom(bytes calldata _msg) internal pure returns (bytes32) {\n return bytes32(_msg[AMOUNT_LD_OFFSET:COMPOSE_FROM_OFFSET]);\n }\n\n /**\n * @dev Retrieves the composed message.\n * @param _msg The message.\n * @return The composed message.\n */\n function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\n return _msg[COMPOSE_FROM_OFFSET:];\n }\n\n /**\n * @dev Converts an address to bytes32.\n * @param _addr The address to convert.\n * @return The bytes32 representation of the address.\n */\n function addressToBytes32(address _addr) internal pure returns (bytes32) {\n return bytes32(uint256(uint160(_addr)));\n }\n\n /**\n * @dev Converts bytes32 to an address.\n * @param _b The bytes32 value to convert.\n * @return The address representation of bytes32.\n */\n function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\n return address(uint160(uint256(_b)));\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/libs/OFTMsgCodec.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nlibrary OFTMsgCodec {\n // Offset constants for encoding and decoding OFT messages\n uint8 private constant SEND_TO_OFFSET = 32;\n uint8 private constant SEND_AMOUNT_SD_OFFSET = 40;\n\n /**\n * @dev Encodes an OFT LayerZero message.\n * @param _sendTo The recipient address.\n * @param _amountShared The amount in shared decimals.\n * @param _composeMsg The composed message.\n * @return _msg The encoded message.\n * @return hasCompose A boolean indicating whether the message has a composed payload.\n */\n function encode(\n bytes32 _sendTo,\n uint64 _amountShared,\n bytes memory _composeMsg\n ) internal view returns (bytes memory _msg, bool hasCompose) {\n hasCompose = _composeMsg.length > 0;\n // @dev Remote chains will want to know the composed function caller ie. msg.sender on the src.\n _msg = hasCompose\n ? abi.encodePacked(_sendTo, _amountShared, addressToBytes32(msg.sender), _composeMsg)\n : abi.encodePacked(_sendTo, _amountShared);\n }\n\n /**\n * @dev Checks if the OFT message is composed.\n * @param _msg The OFT message.\n * @return A boolean indicating whether the message is composed.\n */\n function isComposed(bytes calldata _msg) internal pure returns (bool) {\n return _msg.length > SEND_AMOUNT_SD_OFFSET;\n }\n\n /**\n * @dev Retrieves the recipient address from the OFT message.\n * @param _msg The OFT message.\n * @return The recipient address.\n */\n function sendTo(bytes calldata _msg) internal pure returns (bytes32) {\n return bytes32(_msg[:SEND_TO_OFFSET]);\n }\n\n /**\n * @dev Retrieves the amount in shared decimals from the OFT message.\n * @param _msg The OFT message.\n * @return The amount in shared decimals.\n */\n function amountSD(bytes calldata _msg) internal pure returns (uint64) {\n return uint64(bytes8(_msg[SEND_TO_OFFSET:SEND_AMOUNT_SD_OFFSET]));\n }\n\n /**\n * @dev Retrieves the composed message from the OFT message.\n * @param _msg The OFT message.\n * @return The composed message.\n */\n function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\n return _msg[SEND_AMOUNT_SD_OFFSET:];\n }\n\n /**\n * @dev Converts an address to bytes32.\n * @param _addr The address to convert.\n * @return The bytes32 representation of the address.\n */\n function addressToBytes32(address _addr) internal pure returns (bytes32) {\n return bytes32(uint256(uint160(_addr)));\n }\n\n /**\n * @dev Converts bytes32 to an address.\n * @param _b The bytes32 value to convert.\n * @return The address representation of bytes32.\n */\n function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\n return address(uint160(uint256(_b)));\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/interfaces/IOAppPreCrimeSimulator.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\n// @dev Import the Origin so it's exposed to OAppPreCrimeSimulator implementers.\n// solhint-disable-next-line no-unused-import\nimport { InboundPacket, Origin } from \"../libs/Packet.sol\";\n\n/**\n * @title IOAppPreCrimeSimulator Interface\n * @dev Interface for the preCrime simulation functionality in an OApp.\n */\ninterface IOAppPreCrimeSimulator {\n // @dev simulation result used in PreCrime implementation\n error SimulationResult(bytes result);\n error OnlySelf();\n\n /**\n * @dev Emitted when the preCrime contract address is set.\n * @param preCrimeAddress The address of the preCrime contract.\n */\n event PreCrimeSet(address preCrimeAddress);\n\n /**\n * @dev Retrieves the address of the preCrime contract implementation.\n * @return The address of the preCrime contract.\n */\n function preCrime() external view returns (address);\n\n /**\n * @dev Retrieves the address of the OApp contract.\n * @return The address of the OApp contract.\n */\n function oApp() external view returns (address);\n\n /**\n * @dev Sets the preCrime contract address.\n * @param _preCrime The address of the preCrime contract.\n */\n function setPreCrime(address _preCrime) external;\n\n /**\n * @dev Mocks receiving a packet, then reverts with a series of data to infer the state/result.\n * @param _packets An array of LayerZero InboundPacket objects representing received packets.\n */\n function lzReceiveAndRevert(InboundPacket[] calldata _packets) external payable;\n\n /**\n * @dev checks if the specified peer is considered 'trusted' by the OApp.\n * @param _eid The endpoint Id to check.\n * @param _peer The peer to check.\n * @return Whether the peer passed is considered 'trusted' by the OApp.\n */\n function isPeer(uint32 _eid, bytes32 _peer) external view returns (bool);\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/interfaces/IPreCrime.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\nstruct PreCrimePeer {\n uint32 eid;\n bytes32 preCrime;\n bytes32 oApp;\n}\n\n// TODO not done yet\ninterface IPreCrime {\n error OnlyOffChain();\n\n // for simulate()\n error PacketOversize(uint256 max, uint256 actual);\n error PacketUnsorted();\n error SimulationFailed(bytes reason);\n\n // for preCrime()\n error SimulationResultNotFound(uint32 eid);\n error InvalidSimulationResult(uint32 eid, bytes reason);\n error CrimeFound(bytes crime);\n\n function getConfig(bytes[] calldata _packets, uint256[] calldata _packetMsgValues) external returns (bytes memory);\n\n function simulate(\n bytes[] calldata _packets,\n uint256[] calldata _packetMsgValues\n ) external payable returns (bytes memory);\n\n function buildSimulationResult() external view returns (bytes memory);\n\n function preCrime(\n bytes[] calldata _packets,\n uint256[] calldata _packetMsgValues,\n bytes[] calldata _simulations\n ) external;\n\n function version() external view returns (uint64 major, uint8 minor);\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/libs/Packet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { Origin } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport { PacketV1Codec } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol\";\n\n/**\n * @title InboundPacket\n * @dev Structure representing an inbound packet received by the contract.\n */\nstruct InboundPacket {\n Origin origin; // Origin information of the packet.\n uint32 dstEid; // Destination endpointId of the packet.\n address receiver; // Receiver address for the packet.\n bytes32 guid; // Unique identifier of the packet.\n uint256 value; // msg.value of the packet.\n address executor; // Executor address for the packet.\n bytes message; // Message payload of the packet.\n bytes extraData; // Additional arbitrary data for the packet.\n}\n\n/**\n * @title PacketDecoder\n * @dev Library for decoding LayerZero packets.\n */\nlibrary PacketDecoder {\n using PacketV1Codec for bytes;\n\n /**\n * @dev Decode an inbound packet from the given packet data.\n * @param _packet The packet data to decode.\n * @return packet An InboundPacket struct representing the decoded packet.\n */\n function decode(bytes calldata _packet) internal pure returns (InboundPacket memory packet) {\n packet.origin = Origin(_packet.srcEid(), _packet.sender(), _packet.nonce());\n packet.dstEid = _packet.dstEid();\n packet.receiver = _packet.receiverB20();\n packet.guid = _packet.guid();\n packet.message = _packet.message();\n }\n\n /**\n * @dev Decode multiple inbound packets from the given packet data and associated message values.\n * @param _packets An array of packet data to decode.\n * @param _packetMsgValues An array of associated message values for each packet.\n * @return packets An array of InboundPacket structs representing the decoded packets.\n */\n function decode(\n bytes[] calldata _packets,\n uint256[] memory _packetMsgValues\n ) internal pure returns (InboundPacket[] memory packets) {\n packets = new InboundPacket[](_packets.length);\n for (uint256 i = 0; i < _packets.length; i++) {\n bytes calldata packet = _packets[i];\n packets[i] = PacketDecoder.decode(packet);\n // @dev Allows the verifier to specify the msg.value that gets passed in lzReceive.\n packets[i].value = _packetMsgValues[i];\n }\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/OAppPreCrimeSimulator.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { IPreCrime } from \"./interfaces/IPreCrime.sol\";\nimport { IOAppPreCrimeSimulator, InboundPacket, Origin } from \"./interfaces/IOAppPreCrimeSimulator.sol\";\n\n/**\n * @title OAppPreCrimeSimulator\n * @dev Abstract contract serving as the base for preCrime simulation functionality in an OApp.\n */\nabstract contract OAppPreCrimeSimulator is IOAppPreCrimeSimulator, Ownable {\n // The address of the preCrime implementation.\n address public preCrime;\n\n /**\n * @dev Retrieves the address of the OApp contract.\n * @return The address of the OApp contract.\n *\n * @dev The simulator contract is the base contract for the OApp by default.\n * @dev If the simulator is a separate contract, override this function.\n */\n function oApp() external view virtual returns (address) {\n return address(this);\n }\n\n /**\n * @dev Sets the preCrime contract address.\n * @param _preCrime The address of the preCrime contract.\n */\n function setPreCrime(address _preCrime) public virtual onlyOwner {\n preCrime = _preCrime;\n emit PreCrimeSet(_preCrime);\n }\n\n /**\n * @dev Interface for pre-crime simulations. Always reverts at the end with the simulation results.\n * @param _packets An array of InboundPacket objects representing received packets to be delivered.\n *\n * @dev WARNING: MUST revert at the end with the simulation results.\n * @dev Gives the preCrime implementation the ability to mock sending packets to the lzReceive function,\n * WITHOUT actually executing them.\n */\n function lzReceiveAndRevert(InboundPacket[] calldata _packets) public payable virtual {\n for (uint256 i = 0; i < _packets.length; i++) {\n InboundPacket calldata packet = _packets[i];\n\n // Ignore packets that are not from trusted peers.\n if (!isPeer(packet.origin.srcEid, packet.origin.sender)) continue;\n\n // @dev Because a verifier is calling this function, it doesnt have access to executor params:\n // - address _executor\n // - bytes calldata _extraData\n // preCrime will NOT work for OApps that rely on these two parameters inside of their _lzReceive().\n // They are instead stubbed to default values, address(0) and bytes(\"\")\n // @dev Calling this.lzReceiveSimulate removes ability for assembly return 0 callstack exit,\n // which would cause the revert to be ignored.\n this.lzReceiveSimulate{ value: packet.value }(\n packet.origin,\n packet.guid,\n packet.message,\n packet.executor,\n packet.extraData\n );\n }\n\n // @dev Revert with the simulation results. msg.sender must implement IPreCrime.buildSimulationResult().\n revert SimulationResult(IPreCrime(msg.sender).buildSimulationResult());\n }\n\n /**\n * @dev Is effectively an internal function because msg.sender must be address(this).\n * Allows resetting the call stack for 'internal' calls.\n * @param _origin The origin information containing the source endpoint and sender address.\n * - srcEid: The source chain endpoint ID.\n * - sender: The sender address on the src chain.\n * - nonce: The nonce of the message.\n * @param _guid The unique identifier of the packet.\n * @param _message The message payload of the packet.\n * @param _executor The executor address for the packet.\n * @param _extraData Additional data for the packet.\n */\n function lzReceiveSimulate(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address _executor,\n bytes calldata _extraData\n ) external payable virtual {\n // @dev Ensure ONLY can be called 'internally'.\n if (msg.sender != address(this)) revert OnlySelf();\n _lzReceiveSimulate(_origin, _guid, _message, _executor, _extraData);\n }\n\n /**\n * @dev Internal function to handle the OAppPreCrimeSimulator simulated receive.\n * @param _origin The origin information.\n * - srcEid: The source chain endpoint ID.\n * - sender: The sender address from the src chain.\n * - nonce: The nonce of the LayerZero message.\n * @param _guid The GUID of the LayerZero message.\n * @param _message The LayerZero message.\n * @param _executor The address of the off-chain executor.\n * @param _extraData Arbitrary data passed by the msg executor.\n *\n * @dev Enables the preCrime simulator to mock sending lzReceive() messages,\n * routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver.\n */\n function _lzReceiveSimulate(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address _executor,\n bytes calldata _extraData\n ) internal virtual;\n\n /**\n * @dev checks if the specified peer is considered 'trusted' by the OApp.\n * @param _eid The endpoint Id to check.\n * @param _peer The peer to check.\n * @return Whether the peer passed is considered 'trusted' by the OApp.\n */\n function isPeer(uint32 _eid, bytes32 _peer) public view virtual returns (bool);\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/EndpointV2ViewUpgradeable.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\nimport \"./interfaces/ILayerZeroEndpointV2.sol\";\n\nenum ExecutionState {\n NotExecutable, // executor: waits for PayloadVerified event and starts polling for executable\n VerifiedButNotExecutable, // executor: starts active polling for executable\n Executable,\n Executed\n}\n\ncontract EndpointV2ViewUpgradeable is Initializable {\n bytes32 public constant EMPTY_PAYLOAD_HASH = bytes32(0);\n bytes32 public constant NIL_PAYLOAD_HASH = bytes32(type(uint256).max);\n\n ILayerZeroEndpointV2 public endpoint;\n\n function __EndpointV2View_init(address _endpoint) internal onlyInitializing {\n __EndpointV2View_init_unchained(_endpoint);\n }\n\n function __EndpointV2View_init_unchained(address _endpoint) internal onlyInitializing {\n endpoint = ILayerZeroEndpointV2(_endpoint);\n }\n\n function initializable(Origin memory _origin, address _receiver) public view returns (bool) {\n try endpoint.initializable(_origin, _receiver) returns (bool _initializable) {\n return _initializable;\n } catch {\n return false;\n }\n }\n\n /// @dev check if a message is verifiable.\n function verifiable(\n Origin memory _origin,\n address _receiver,\n address _receiveLib,\n bytes32 _payloadHash\n ) public view returns (bool) {\n if (!endpoint.isValidReceiveLibrary(_receiver, _origin.srcEid, _receiveLib)) return false;\n\n if (!endpoint.verifiable(_origin, _receiver)) return false;\n\n // checked in _inbound for verify\n if (_payloadHash == EMPTY_PAYLOAD_HASH) return false;\n\n return true;\n }\n\n /// @dev check if a message is executable.\n /// @return ExecutionState of Executed, Executable, or NotExecutable\n function executable(Origin memory _origin, address _receiver) public view returns (ExecutionState) {\n bytes32 payloadHash = endpoint.inboundPayloadHash(_receiver, _origin.srcEid, _origin.sender, _origin.nonce);\n\n // executed if the payload hash has been cleared and the nonce is less than or equal to lazyInboundNonce\n if (\n payloadHash == EMPTY_PAYLOAD_HASH &&\n _origin.nonce <= endpoint.lazyInboundNonce(_receiver, _origin.srcEid, _origin.sender)\n ) {\n return ExecutionState.Executed;\n }\n\n // executable if nonce has not been executed and has not been nilified and nonce is less than or equal to inboundNonce\n if (\n payloadHash != NIL_PAYLOAD_HASH &&\n _origin.nonce <= endpoint.inboundNonce(_receiver, _origin.srcEid, _origin.sender)\n ) {\n return ExecutionState.Executable;\n }\n\n // only start active executable polling if payload hash is not empty nor nil\n if (payloadHash != EMPTY_PAYLOAD_HASH && payloadHash != NIL_PAYLOAD_HASH) {\n return ExecutionState.VerifiedButNotExecutable;\n }\n\n // return NotExecutable as a catch-all\n return ExecutionState.NotExecutable;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { IMessageLibManager } from \"./IMessageLibManager.sol\";\nimport { IMessagingComposer } from \"./IMessagingComposer.sol\";\nimport { IMessagingChannel } from \"./IMessagingChannel.sol\";\nimport { IMessagingContext } from \"./IMessagingContext.sol\";\n\nstruct MessagingParams {\n uint32 dstEid;\n bytes32 receiver;\n bytes message;\n bytes options;\n bool payInLzToken;\n}\n\nstruct MessagingReceipt {\n bytes32 guid;\n uint64 nonce;\n MessagingFee fee;\n}\n\nstruct MessagingFee {\n uint256 nativeFee;\n uint256 lzTokenFee;\n}\n\nstruct Origin {\n uint32 srcEid;\n bytes32 sender;\n uint64 nonce;\n}\n\ninterface ILayerZeroEndpointV2 is IMessageLibManager, IMessagingComposer, IMessagingChannel, IMessagingContext {\n event PacketSent(bytes encodedPayload, bytes options, address sendLibrary);\n\n event PacketVerified(Origin origin, address receiver, bytes32 payloadHash);\n\n event PacketDelivered(Origin origin, address receiver);\n\n event LzReceiveAlert(\n address indexed receiver,\n address indexed executor,\n Origin origin,\n bytes32 guid,\n uint256 gas,\n uint256 value,\n bytes message,\n bytes extraData,\n bytes reason\n );\n\n event LzTokenSet(address token);\n\n event DelegateSet(address sender, address delegate);\n\n function quote(MessagingParams calldata _params, address _sender) external view returns (MessagingFee memory);\n\n function send(\n MessagingParams calldata _params,\n address _refundAddress\n ) external payable returns (MessagingReceipt memory);\n\n function verify(Origin calldata _origin, address _receiver, bytes32 _payloadHash) external;\n\n function verifiable(Origin calldata _origin, address _receiver) external view returns (bool);\n\n function initializable(Origin calldata _origin, address _receiver) external view returns (bool);\n\n function lzReceive(\n Origin calldata _origin,\n address _receiver,\n bytes32 _guid,\n bytes calldata _message,\n bytes calldata _extraData\n ) external payable;\n\n // oapp can burn messages partially by calling this function with its own business logic if messages are verified in order\n function clear(address _oapp, Origin calldata _origin, bytes32 _guid, bytes calldata _message) external;\n\n function setLzToken(address _lzToken) external;\n\n function lzToken() external view returns (address);\n\n function nativeToken() external view returns (address);\n\n function setDelegate(address _delegate) external;\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { Origin } from \"./ILayerZeroEndpointV2.sol\";\n\ninterface ILayerZeroReceiver {\n function allowInitializePath(Origin calldata _origin) external view returns (bool);\n\n function nextNonce(uint32 _eid, bytes32 _sender) external view returns (uint64);\n\n function lzReceive(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address _executor,\n bytes calldata _extraData\n ) external payable;\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLib.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { IERC165 } from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\nimport { SetConfigParam } from \"./IMessageLibManager.sol\";\n\nenum MessageLibType {\n Send,\n Receive,\n SendAndReceive\n}\n\ninterface IMessageLib is IERC165 {\n function setConfig(address _oapp, SetConfigParam[] calldata _config) external;\n\n function getConfig(uint32 _eid, address _oapp, uint32 _configType) external view returns (bytes memory config);\n\n function isSupportedEid(uint32 _eid) external view returns (bool);\n\n // message libs of same major version are compatible\n function version() external view returns (uint64 major, uint8 minor, uint8 endpointVersion);\n\n function messageLibType() external view returns (MessageLibType);\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nstruct SetConfigParam {\n uint32 eid;\n uint32 configType;\n bytes config;\n}\n\ninterface IMessageLibManager {\n struct Timeout {\n address lib;\n uint256 expiry;\n }\n\n event LibraryRegistered(address newLib);\n event DefaultSendLibrarySet(uint32 eid, address newLib);\n event DefaultReceiveLibrarySet(uint32 eid, address newLib);\n event DefaultReceiveLibraryTimeoutSet(uint32 eid, address oldLib, uint256 expiry);\n event SendLibrarySet(address sender, uint32 eid, address newLib);\n event ReceiveLibrarySet(address receiver, uint32 eid, address newLib);\n event ReceiveLibraryTimeoutSet(address receiver, uint32 eid, address oldLib, uint256 timeout);\n\n function registerLibrary(address _lib) external;\n\n function isRegisteredLibrary(address _lib) external view returns (bool);\n\n function getRegisteredLibraries() external view returns (address[] memory);\n\n function setDefaultSendLibrary(uint32 _eid, address _newLib) external;\n\n function defaultSendLibrary(uint32 _eid) external view returns (address);\n\n function setDefaultReceiveLibrary(uint32 _eid, address _newLib, uint256 _gracePeriod) external;\n\n function defaultReceiveLibrary(uint32 _eid) external view returns (address);\n\n function setDefaultReceiveLibraryTimeout(uint32 _eid, address _lib, uint256 _expiry) external;\n\n function defaultReceiveLibraryTimeout(uint32 _eid) external view returns (address lib, uint256 expiry);\n\n function isSupportedEid(uint32 _eid) external view returns (bool);\n\n function isValidReceiveLibrary(address _receiver, uint32 _eid, address _lib) external view returns (bool);\n\n /// ------------------- OApp interfaces -------------------\n function setSendLibrary(address _oapp, uint32 _eid, address _newLib) external;\n\n function getSendLibrary(address _sender, uint32 _eid) external view returns (address lib);\n\n function isDefaultSendLibrary(address _sender, uint32 _eid) external view returns (bool);\n\n function setReceiveLibrary(address _oapp, uint32 _eid, address _newLib, uint256 _gracePeriod) external;\n\n function getReceiveLibrary(address _receiver, uint32 _eid) external view returns (address lib, bool isDefault);\n\n function setReceiveLibraryTimeout(address _oapp, uint32 _eid, address _lib, uint256 _expiry) external;\n\n function receiveLibraryTimeout(address _receiver, uint32 _eid) external view returns (address lib, uint256 expiry);\n\n function setConfig(address _oapp, address _lib, SetConfigParam[] calldata _params) external;\n\n function getConfig(\n address _oapp,\n address _lib,\n uint32 _eid,\n uint32 _configType\n ) external view returns (bytes memory config);\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingChannel.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IMessagingChannel {\n event InboundNonceSkipped(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce);\n event PacketNilified(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);\n event PacketBurnt(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);\n\n function eid() external view returns (uint32);\n\n // this is an emergency function if a message cannot be verified for some reasons\n // required to provide _nextNonce to avoid race condition\n function skip(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce) external;\n\n function nilify(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;\n\n function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;\n\n function nextGuid(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (bytes32);\n\n function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);\n\n function outboundNonce(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (uint64);\n\n function inboundPayloadHash(\n address _receiver,\n uint32 _srcEid,\n bytes32 _sender,\n uint64 _nonce\n ) external view returns (bytes32);\n\n function lazyInboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingComposer.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IMessagingComposer {\n event ComposeSent(address from, address to, bytes32 guid, uint16 index, bytes message);\n event ComposeDelivered(address from, address to, bytes32 guid, uint16 index);\n event LzComposeAlert(\n address indexed from,\n address indexed to,\n address indexed executor,\n bytes32 guid,\n uint16 index,\n uint256 gas,\n uint256 value,\n bytes message,\n bytes extraData,\n bytes reason\n );\n\n function composeQueue(\n address _from,\n address _to,\n bytes32 _guid,\n uint16 _index\n ) external view returns (bytes32 messageHash);\n\n function sendCompose(address _to, bytes32 _guid, uint16 _index, bytes calldata _message) external;\n\n function lzCompose(\n address _from,\n address _to,\n bytes32 _guid,\n uint16 _index,\n bytes calldata _message,\n bytes calldata _extraData\n ) external payable;\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingContext.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IMessagingContext {\n function isSendingMessage() external view returns (bool);\n\n function getSendContext() external view returns (uint32 dstEid, address sender);\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { MessagingFee } from \"./ILayerZeroEndpointV2.sol\";\nimport { IMessageLib } from \"./IMessageLib.sol\";\n\nstruct Packet {\n uint64 nonce;\n uint32 srcEid;\n address sender;\n uint32 dstEid;\n bytes32 receiver;\n bytes32 guid;\n bytes message;\n}\n\ninterface ISendLib is IMessageLib {\n function send(\n Packet calldata _packet,\n bytes calldata _options,\n bool _payInLzToken\n ) external returns (MessagingFee memory, bytes memory encodedPacket);\n\n function quote(\n Packet calldata _packet,\n bytes calldata _options,\n bool _payInLzToken\n ) external view returns (MessagingFee memory);\n\n function setTreasury(address _treasury) external;\n\n function withdrawFee(address _to, uint256 _amount) external;\n\n function withdrawLzTokenFee(address _lzToken, address _to, uint256 _amount) external;\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/AddressCast.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nlibrary AddressCast {\n error AddressCast_InvalidSizeForAddress();\n error AddressCast_InvalidAddress();\n\n function toBytes32(bytes calldata _addressBytes) internal pure returns (bytes32 result) {\n if (_addressBytes.length > 32) revert AddressCast_InvalidAddress();\n result = bytes32(_addressBytes);\n unchecked {\n uint256 offset = 32 - _addressBytes.length;\n result = result >> (offset * 8);\n }\n }\n\n function toBytes32(address _address) internal pure returns (bytes32 result) {\n result = bytes32(uint256(uint160(_address)));\n }\n\n function toBytes(bytes32 _addressBytes32, uint256 _size) internal pure returns (bytes memory result) {\n if (_size == 0 || _size > 32) revert AddressCast_InvalidSizeForAddress();\n result = new bytes(_size);\n unchecked {\n uint256 offset = 256 - _size * 8;\n assembly {\n mstore(add(result, 32), shl(offset, _addressBytes32))\n }\n }\n }\n\n function toAddress(bytes32 _addressBytes32) internal pure returns (address result) {\n result = address(uint160(uint256(_addressBytes32)));\n }\n\n function toAddress(bytes calldata _addressBytes) internal pure returns (address result) {\n if (_addressBytes.length != 20) revert AddressCast_InvalidAddress();\n result = address(bytes20(_addressBytes));\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/CalldataBytesLib.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nlibrary CalldataBytesLib {\n function toU8(bytes calldata _bytes, uint256 _start) internal pure returns (uint8) {\n return uint8(_bytes[_start]);\n }\n\n function toU16(bytes calldata _bytes, uint256 _start) internal pure returns (uint16) {\n unchecked {\n uint256 end = _start + 2;\n return uint16(bytes2(_bytes[_start:end]));\n }\n }\n\n function toU32(bytes calldata _bytes, uint256 _start) internal pure returns (uint32) {\n unchecked {\n uint256 end = _start + 4;\n return uint32(bytes4(_bytes[_start:end]));\n }\n }\n\n function toU64(bytes calldata _bytes, uint256 _start) internal pure returns (uint64) {\n unchecked {\n uint256 end = _start + 8;\n return uint64(bytes8(_bytes[_start:end]));\n }\n }\n\n function toU128(bytes calldata _bytes, uint256 _start) internal pure returns (uint128) {\n unchecked {\n uint256 end = _start + 16;\n return uint128(bytes16(_bytes[_start:end]));\n }\n }\n\n function toU256(bytes calldata _bytes, uint256 _start) internal pure returns (uint256) {\n unchecked {\n uint256 end = _start + 32;\n return uint256(bytes32(_bytes[_start:end]));\n }\n }\n\n function toAddr(bytes calldata _bytes, uint256 _start) internal pure returns (address) {\n unchecked {\n uint256 end = _start + 20;\n return address(bytes20(_bytes[_start:end]));\n }\n }\n\n function toB32(bytes calldata _bytes, uint256 _start) internal pure returns (bytes32) {\n unchecked {\n uint256 end = _start + 32;\n return bytes32(_bytes[_start:end]);\n }\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Errors.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nlibrary Errors {\n error LZ_LzTokenUnavailable();\n error LZ_InvalidReceiveLibrary();\n error LZ_InvalidNonce(uint64 nonce);\n error LZ_InvalidArgument();\n error LZ_InvalidExpiry();\n error LZ_InvalidAmount(uint256 required, uint256 supplied);\n error LZ_OnlyRegisteredOrDefaultLib();\n error LZ_OnlyRegisteredLib();\n error LZ_OnlyNonDefaultLib();\n error LZ_Unauthorized();\n error LZ_DefaultSendLibUnavailable();\n error LZ_DefaultReceiveLibUnavailable();\n error LZ_PathNotInitializable();\n error LZ_PathNotVerifiable();\n error LZ_OnlySendLib();\n error LZ_OnlyReceiveLib();\n error LZ_UnsupportedEid();\n error LZ_UnsupportedInterface();\n error LZ_AlreadyRegistered();\n error LZ_SameValue();\n error LZ_InvalidPayloadHash();\n error LZ_PayloadHashNotFound(bytes32 expected, bytes32 actual);\n error LZ_ComposeNotFound(bytes32 expected, bytes32 actual);\n error LZ_ComposeExists();\n error LZ_SendReentrancy();\n error LZ_NotImplemented();\n error LZ_InsufficientFee(\n uint256 requiredNative,\n uint256 suppliedNative,\n uint256 requiredLzToken,\n uint256 suppliedLzToken\n );\n error LZ_ZeroLzTokenFee();\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/GUID.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { AddressCast } from \"./AddressCast.sol\";\n\nlibrary GUID {\n using AddressCast for address;\n\n function generate(\n uint64 _nonce,\n uint32 _srcEid,\n address _sender,\n uint32 _dstEid,\n bytes32 _receiver\n ) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(_nonce, _srcEid, _sender.toBytes32(), _dstEid, _receiver));\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Transfer.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nlibrary Transfer {\n using SafeERC20 for IERC20;\n\n address internal constant ADDRESS_ZERO = address(0);\n\n error Transfer_NativeFailed(address _to, uint256 _value);\n error Transfer_ToAddressIsZero();\n\n function native(address _to, uint256 _value) internal {\n if (_to == ADDRESS_ZERO) revert Transfer_ToAddressIsZero();\n (bool success, ) = _to.call{ value: _value }(\"\");\n if (!success) revert Transfer_NativeFailed(_to, _value);\n }\n\n function token(address _token, address _to, uint256 _value) internal {\n if (_to == ADDRESS_ZERO) revert Transfer_ToAddressIsZero();\n IERC20(_token).safeTransfer(_to, _value);\n }\n\n function nativeOrToken(address _token, address _to, uint256 _value) internal {\n if (_token == ADDRESS_ZERO) {\n native(_to, _value);\n } else {\n token(_token, _to, _value);\n }\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/BitMaps.sol": { + "content": "// SPDX-License-Identifier: MIT\n\n// modified from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/structs/BitMaps.sol\npragma solidity ^0.8.20;\n\ntype BitMap256 is uint256;\n\nusing BitMaps for BitMap256 global;\n\nlibrary BitMaps {\n /**\n * @dev Returns whether the bit at `index` is set.\n */\n function get(BitMap256 bitmap, uint8 index) internal pure returns (bool) {\n uint256 mask = 1 << index;\n return BitMap256.unwrap(bitmap) & mask != 0;\n }\n\n /**\n * @dev Sets the bit at `index`.\n */\n function set(BitMap256 bitmap, uint8 index) internal pure returns (BitMap256) {\n uint256 mask = 1 << index;\n return BitMap256.wrap(BitMap256.unwrap(bitmap) | mask);\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/ExecutorOptions.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { CalldataBytesLib } from \"../../libs/CalldataBytesLib.sol\";\n\nlibrary ExecutorOptions {\n using CalldataBytesLib for bytes;\n\n uint8 internal constant WORKER_ID = 1;\n\n uint8 internal constant OPTION_TYPE_LZRECEIVE = 1;\n uint8 internal constant OPTION_TYPE_NATIVE_DROP = 2;\n uint8 internal constant OPTION_TYPE_LZCOMPOSE = 3;\n uint8 internal constant OPTION_TYPE_ORDERED_EXECUTION = 4;\n\n error Executor_InvalidLzReceiveOption();\n error Executor_InvalidNativeDropOption();\n error Executor_InvalidLzComposeOption();\n\n /// @dev decode the next executor option from the options starting from the specified cursor\n /// @param _options [executor_id][executor_option][executor_id][executor_option]...\n /// executor_option = [option_size][option_type][option]\n /// option_size = len(option_type) + len(option)\n /// executor_id: uint8, option_size: uint16, option_type: uint8, option: bytes\n /// @param _cursor the cursor to start decoding from\n /// @return optionType the type of the option\n /// @return option the option of the executor\n /// @return cursor the cursor to start decoding the next executor option\n function nextExecutorOption(\n bytes calldata _options,\n uint256 _cursor\n ) internal pure returns (uint8 optionType, bytes calldata option, uint256 cursor) {\n unchecked {\n // skip worker id\n cursor = _cursor + 1;\n\n // read option size\n uint16 size = _options.toU16(cursor);\n cursor += 2;\n\n // read option type\n optionType = _options.toU8(cursor);\n\n // startCursor and endCursor are used to slice the option from _options\n uint256 startCursor = cursor + 1; // skip option type\n uint256 endCursor = cursor + size;\n option = _options[startCursor:endCursor];\n cursor += size;\n }\n }\n\n function decodeLzReceiveOption(bytes calldata _option) internal pure returns (uint128 gas, uint128 value) {\n if (_option.length != 16 && _option.length != 32) revert Executor_InvalidLzReceiveOption();\n gas = _option.toU128(0);\n value = _option.length == 32 ? _option.toU128(16) : 0;\n }\n\n function decodeNativeDropOption(bytes calldata _option) internal pure returns (uint128 amount, bytes32 receiver) {\n if (_option.length != 48) revert Executor_InvalidNativeDropOption();\n amount = _option.toU128(0);\n receiver = _option.toB32(16);\n }\n\n function decodeLzComposeOption(\n bytes calldata _option\n ) internal pure returns (uint16 index, uint128 gas, uint128 value) {\n if (_option.length != 18 && _option.length != 34) revert Executor_InvalidLzComposeOption();\n index = _option.toU16(0);\n gas = _option.toU128(2);\n value = _option.length == 34 ? _option.toU128(18) : 0;\n }\n\n function encodeLzReceiveOption(uint128 _gas, uint128 _value) internal pure returns (bytes memory) {\n return _value == 0 ? abi.encodePacked(_gas) : abi.encodePacked(_gas, _value);\n }\n\n function encodeNativeDropOption(uint128 _amount, bytes32 _receiver) internal pure returns (bytes memory) {\n return abi.encodePacked(_amount, _receiver);\n }\n\n function encodeLzComposeOption(uint16 _index, uint128 _gas, uint128 _value) internal pure returns (bytes memory) {\n return _value == 0 ? abi.encodePacked(_index, _gas) : abi.encodePacked(_index, _gas, _value);\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { Packet } from \"../../interfaces/ISendLib.sol\";\nimport { AddressCast } from \"../../libs/AddressCast.sol\";\n\nlibrary PacketV1Codec {\n using AddressCast for address;\n using AddressCast for bytes32;\n\n uint8 internal constant PACKET_VERSION = 1;\n\n // header (version + nonce + path)\n // version\n uint256 private constant PACKET_VERSION_OFFSET = 0;\n // nonce\n uint256 private constant NONCE_OFFSET = 1;\n // path\n uint256 private constant SRC_EID_OFFSET = 9;\n uint256 private constant SENDER_OFFSET = 13;\n uint256 private constant DST_EID_OFFSET = 45;\n uint256 private constant RECEIVER_OFFSET = 49;\n // payload (guid + message)\n uint256 private constant GUID_OFFSET = 81; // keccak256(nonce + path)\n uint256 private constant MESSAGE_OFFSET = 113;\n\n function encode(Packet memory _packet) internal pure returns (bytes memory encodedPacket) {\n encodedPacket = abi.encodePacked(\n PACKET_VERSION,\n _packet.nonce,\n _packet.srcEid,\n _packet.sender.toBytes32(),\n _packet.dstEid,\n _packet.receiver,\n _packet.guid,\n _packet.message\n );\n }\n\n function encodePacketHeader(Packet memory _packet) internal pure returns (bytes memory) {\n return\n abi.encodePacked(\n PACKET_VERSION,\n _packet.nonce,\n _packet.srcEid,\n _packet.sender.toBytes32(),\n _packet.dstEid,\n _packet.receiver\n );\n }\n\n function encodePayload(Packet memory _packet) internal pure returns (bytes memory) {\n return abi.encodePacked(_packet.guid, _packet.message);\n }\n\n function header(bytes calldata _packet) internal pure returns (bytes calldata) {\n return _packet[0:GUID_OFFSET];\n }\n\n function version(bytes calldata _packet) internal pure returns (uint8) {\n return uint8(bytes1(_packet[PACKET_VERSION_OFFSET:NONCE_OFFSET]));\n }\n\n function nonce(bytes calldata _packet) internal pure returns (uint64) {\n return uint64(bytes8(_packet[NONCE_OFFSET:SRC_EID_OFFSET]));\n }\n\n function srcEid(bytes calldata _packet) internal pure returns (uint32) {\n return uint32(bytes4(_packet[SRC_EID_OFFSET:SENDER_OFFSET]));\n }\n\n function sender(bytes calldata _packet) internal pure returns (bytes32) {\n return bytes32(_packet[SENDER_OFFSET:DST_EID_OFFSET]);\n }\n\n function senderAddressB20(bytes calldata _packet) internal pure returns (address) {\n return sender(_packet).toAddress();\n }\n\n function dstEid(bytes calldata _packet) internal pure returns (uint32) {\n return uint32(bytes4(_packet[DST_EID_OFFSET:RECEIVER_OFFSET]));\n }\n\n function receiver(bytes calldata _packet) internal pure returns (bytes32) {\n return bytes32(_packet[RECEIVER_OFFSET:GUID_OFFSET]);\n }\n\n function receiverB20(bytes calldata _packet) internal pure returns (address) {\n return receiver(_packet).toAddress();\n }\n\n function guid(bytes calldata _packet) internal pure returns (bytes32) {\n return bytes32(_packet[GUID_OFFSET:MESSAGE_OFFSET]);\n }\n\n function message(bytes calldata _packet) internal pure returns (bytes calldata) {\n return bytes(_packet[MESSAGE_OFFSET:]);\n }\n\n function payload(bytes calldata _packet) internal pure returns (bytes calldata) {\n return bytes(_packet[GUID_OFFSET:]);\n }\n\n function payloadHash(bytes calldata _packet) internal pure returns (bytes32) {\n return keccak256(payload(_packet));\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/MessagingContext.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { IMessagingContext } from \"./interfaces/IMessagingContext.sol\";\nimport { Errors } from \"./libs/Errors.sol\";\n\n/// this contract acts as a non-reentrancy guard and a source of messaging context\n/// the context includes the remote eid and the sender address\n/// it separates the send and receive context to allow messaging receipts (send back on receive())\nabstract contract MessagingContext is IMessagingContext {\n uint256 private constant NOT_ENTERED = 1;\n uint256 private _sendContext = NOT_ENTERED;\n\n /// @dev the sendContext is set to 8 bytes 0s + 4 bytes eid + 20 bytes sender\n modifier sendContext(uint32 _dstEid, address _sender) {\n if (_sendContext != NOT_ENTERED) revert Errors.LZ_SendReentrancy();\n _sendContext = (uint256(_dstEid) << 160) | uint160(_sender);\n _;\n _sendContext = NOT_ENTERED;\n }\n\n /// @dev returns true if sending message\n function isSendingMessage() public view returns (bool) {\n return _sendContext != NOT_ENTERED;\n }\n\n /// @dev returns (eid, sender) if sending message, (0, 0) otherwise\n function getSendContext() external view returns (uint32, address) {\n return isSendingMessage() ? _getSendContext(_sendContext) : (0, address(0));\n }\n\n function _getSendContext(uint256 _context) internal pure returns (uint32, address) {\n return (uint32(_context >> 160), address(uint160(_context)));\n }\n}\n" + }, + "@layerzerolabs/test-devtools-evm-hardhat/contracts/mocks/EndpointV2Mock.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.22;\n\nimport { SafeCast } from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport { ILayerZeroEndpointV2, MessagingParams, MessagingReceipt, MessagingFee, Origin } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport { ExecutionState } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/EndpointV2ViewUpgradeable.sol\";\nimport { ILayerZeroReceiver } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol\";\nimport { SetConfigParam } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol\";\nimport { MessagingContext } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/MessagingContext.sol\";\nimport { Packet } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol\";\nimport { OFTMsgCodec } from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/libs/OFTMsgCodec.sol\";\nimport { Origin } from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppReceiver.sol\";\nimport { Errors } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Errors.sol\";\nimport { GUID } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/GUID.sol\";\nimport { ExecutorOptions } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/ExecutorOptions.sol\";\nimport { PacketV1Codec } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol\";\nimport { WorkerOptions } from \"@layerzerolabs/lz-evm-messagelib-v2/contracts/SendLibBase.sol\";\nimport { IExecutorFeeLib } from \"@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/IExecutorFeeLib.sol\";\nimport { DVNOptions } from \"@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/libs/DVNOptions.sol\";\nimport { UlnOptions } from \"@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/libs/UlnOptions.sol\";\nimport { CalldataBytesLib } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/CalldataBytesLib.sol\";\n\ncontract EndpointV2Mock is ILayerZeroEndpointV2, MessagingContext {\n using ExecutorOptions for bytes;\n using OFTMsgCodec for bytes;\n using OFTMsgCodec for bytes32;\n using OFTMsgCodec for address;\n using SafeCast for uint256;\n using CalldataBytesLib for bytes;\n\n bytes32 public constant EMPTY_PAYLOAD_HASH = bytes32(0);\n\n uint32 public immutable eid;\n mapping(address => address) public lzEndpointLookup;\n\n mapping(address receiver => mapping(uint32 srcEid => mapping(bytes32 sender => uint64 nonce)))\n public lazyInboundNonce;\n mapping(address receiver => mapping(uint32 srcEid => mapping(bytes32 sender => mapping(uint64 inboundNonce => bytes32 payloadHash))))\n public inboundPayloadHash;\n mapping(address sender => mapping(uint32 dstEid => mapping(bytes32 receiver => uint64 nonce))) public outboundNonce;\n\n RelayerFeeConfig public relayerFeeConfig;\n ProtocolFeeConfig protocolFeeConfig;\n uint256 public verifierFee;\n\n struct ProtocolFeeConfig {\n uint256 zroFee;\n uint256 nativeBP;\n }\n\n struct RelayerFeeConfig {\n uint128 dstPriceRatio; // 10^10\n uint128 dstGasPriceInWei;\n uint128 dstNativeAmtCap;\n uint64 baseGas;\n uint64 gasPerByte;\n }\n\n uint8 internal constant _NOT_ENTERED = 1;\n uint8 internal constant _ENTERED = 2;\n uint8 internal _receive_entered_state = 1;\n modifier receiveNonReentrant() {\n require(_receive_entered_state == _NOT_ENTERED, \"LayerZeroMock: no receive reentrancy\");\n _receive_entered_state = _ENTERED;\n _;\n _receive_entered_state = _NOT_ENTERED;\n }\n\n event ValueTransferFailed(address indexed to, uint256 indexed quantity);\n\n constructor(uint32 _eid) {\n eid = _eid;\n // init config\n relayerFeeConfig = RelayerFeeConfig({\n dstPriceRatio: 1e10, // 1:1, same chain, same native coin\n dstGasPriceInWei: 1e10,\n dstNativeAmtCap: 1e19,\n baseGas: 100,\n gasPerByte: 1\n });\n protocolFeeConfig = ProtocolFeeConfig({ zroFee: 1e18, nativeBP: 1000 }); // BP 0.1\n verifierFee = 1e16;\n }\n\n function send(\n MessagingParams calldata _params,\n address _refundAddress\n ) public payable sendContext(_params.dstEid, msg.sender) returns (MessagingReceipt memory receipt) {\n if (_params.payInLzToken) revert Errors.LZ_LzTokenUnavailable();\n\n address lzEndpoint = lzEndpointLookup[_params.receiver.bytes32ToAddress()];\n require(lzEndpoint != address(0), \"LayerZeroMock: destination LayerZero Endpoint not found\");\n\n // get the correct outbound nonce\n uint64 latestNonce = _outbound(msg.sender, _params.dstEid, _params.receiver);\n\n Packet memory packet = Packet({\n nonce: latestNonce,\n srcEid: eid,\n sender: msg.sender,\n dstEid: _params.dstEid,\n receiver: _params.receiver,\n guid: GUID.generate(latestNonce, eid, msg.sender, _params.dstEid, _params.receiver),\n message: _params.message\n });\n receipt.guid = packet.guid;\n receipt.nonce = packet.nonce;\n receipt.fee = _quote(_params, msg.sender);\n require(msg.value >= receipt.fee.nativeFee, \"LayerZeroMock: not enough native for fees\");\n\n // refund if they send too much\n uint256 amount = msg.value - receipt.fee.nativeFee;\n if (amount > 0) {\n (bool success, ) = _refundAddress.call{ value: amount }(\"\");\n require(success, \"LayerZeroMock: failed to refund\");\n }\n\n uint256 totalGas;\n uint256 dstAmount;\n (totalGas, dstAmount) = executeNativeAirDropAndReturnLzGas(_params.options);\n\n // TODO fix\n // composed calls with correct gas\n\n Origin memory origin = Origin({\n srcEid: packet.srcEid,\n sender: packet.sender.addressToBytes32(),\n nonce: packet.nonce\n });\n\n bytes memory payload = PacketV1Codec.encodePayload(packet);\n bytes32 payloadHash = keccak256(payload);\n\n EndpointV2Mock(lzEndpoint).receivePayload{ value: dstAmount }(\n origin,\n packet.receiver.bytes32ToAddress(),\n payloadHash,\n packet.message,\n totalGas,\n dstAmount,\n packet.guid\n );\n }\n\n function receivePayload(\n Origin calldata _origin,\n address _receiver,\n bytes32 _payloadHash,\n bytes calldata _message,\n uint256 _gas,\n uint256 _msgValue,\n bytes32 _guid\n ) external payable receiveNonReentrant {\n inboundPayloadHash[_receiver][_origin.srcEid][_origin.sender][_origin.nonce] = _payloadHash;\n if (_msgValue > 0) {\n try\n ILayerZeroReceiver(_receiver).lzReceive{ value: _msgValue, gas: _gas }(\n _origin,\n _guid,\n _message,\n address(0),\n \"\"\n )\n {} catch (bytes memory /*reason*/) {}\n } else {\n try\n ILayerZeroReceiver(_receiver).lzReceive{ gas: _gas }(_origin, _guid, _message, address(0), \"\")\n {} catch (bytes memory /*reason*/) {}\n }\n }\n\n function getExecutorFee(uint256 _payloadSize, bytes calldata _options) public view returns (uint256) {\n uint256 nativeFee;\n // 2) get Executor fee\n // a) decodeLzReceiveOption\n // b) decodeNativeDropOption\n // c) decodeLzComposeOption\n (uint256 totalDstAmount, uint256 totalGas) = _decodeExecutorOptions(_options);\n uint256 remoteGasTotal = relayerFeeConfig.dstGasPriceInWei * (relayerFeeConfig.baseGas + totalGas);\n nativeFee += totalDstAmount + remoteGasTotal;\n\n // tokenConversionRate = dstPrice / localPrice\n // basePrice = totalRemoteToken * tokenConversionRate\n uint256 basePrice = (nativeFee * relayerFeeConfig.dstPriceRatio) / 10 ** 10;\n\n // pricePerByte = (dstGasPriceInWei * gasPerBytes) * tokenConversionRate\n uint256 pricePerByte = ((relayerFeeConfig.dstGasPriceInWei *\n relayerFeeConfig.gasPerByte *\n relayerFeeConfig.dstPriceRatio) / 10 ** 10) * _payloadSize;\n\n return basePrice + pricePerByte;\n }\n\n function _quote(\n MessagingParams calldata _params,\n address /*_sender*/\n ) internal view returns (MessagingFee memory messagingFee) {\n (bytes memory executorOptions, ) = splitOptions(_params.options);\n\n // 2) get Executor fee\n uint256 executorFee = this.getExecutorFee(_params.message.length, executorOptions);\n\n // 1) get Verifier fee\n // 3) get Treasury fee\n uint256 treasuryAndVerifierFee = _getTreasuryAndVerifierFees(executorFee, verifierFee);\n\n messagingFee.lzTokenFee = 0;\n messagingFee.nativeFee = executorFee + treasuryAndVerifierFee;\n }\n\n function _getTreasuryAndVerifierFees(uint256 _executorFee, uint256 _verifierFee) internal view returns (uint256) {\n return ((_executorFee + _verifierFee) * protocolFeeConfig.nativeBP) / 10000;\n }\n\n function _outbound(address _sender, uint32 _dstEid, bytes32 _receiver) internal returns (uint64 nonce) {\n unchecked {\n nonce = ++outboundNonce[_sender][_dstEid][_receiver];\n }\n }\n\n function setDestLzEndpoint(address destAddr, address lzEndpointAddr) external {\n lzEndpointLookup[destAddr] = lzEndpointAddr;\n }\n\n function _decodeExecutorOptions(\n bytes calldata _options\n ) internal view returns (uint256 dstAmount, uint256 totalGas) {\n if (_options.length == 0) {\n revert IExecutorFeeLib.Executor_NoOptions();\n }\n\n uint256 cursor = 0;\n totalGas = relayerFeeConfig.baseGas;\n\n while (cursor < _options.length) {\n (uint8 optionType, bytes calldata option, uint256 newCursor) = _options.nextExecutorOption(cursor);\n cursor = newCursor;\n\n if (optionType == ExecutorOptions.OPTION_TYPE_LZRECEIVE) {\n (uint128 gas, uint128 value) = ExecutorOptions.decodeLzReceiveOption(option);\n dstAmount += value;\n totalGas += gas;\n } else if (optionType == ExecutorOptions.OPTION_TYPE_NATIVE_DROP) {\n (uint128 nativeDropAmount, ) = ExecutorOptions.decodeNativeDropOption(option);\n dstAmount += nativeDropAmount;\n } else if (optionType == ExecutorOptions.OPTION_TYPE_LZCOMPOSE) {\n (, uint128 gas, uint128 value) = ExecutorOptions.decodeLzComposeOption(option);\n dstAmount += value;\n totalGas += gas;\n } else {\n revert IExecutorFeeLib.Executor_UnsupportedOptionType(optionType);\n }\n }\n\n if (cursor != _options.length) revert IExecutorFeeLib.Executor_InvalidExecutorOptions(cursor);\n if (dstAmount > relayerFeeConfig.dstNativeAmtCap)\n revert IExecutorFeeLib.Executor_NativeAmountExceedsCap(dstAmount, relayerFeeConfig.dstNativeAmtCap);\n }\n\n function splitOptions(bytes calldata _options) internal pure returns (bytes memory, WorkerOptions[] memory) {\n (bytes memory executorOpts, bytes memory dvnOpts) = decode(_options);\n\n if (dvnOpts.length == 0) {\n return (executorOpts, new WorkerOptions[](0));\n }\n\n WorkerOptions[] memory workerOpts = new WorkerOptions[](1);\n workerOpts[0] = WorkerOptions(DVNOptions.WORKER_ID, dvnOpts);\n return (executorOpts, workerOpts);\n }\n\n function decode(\n bytes calldata _options\n ) internal pure returns (bytes memory executorOptions, bytes memory dvnOptions) {\n // at least 2 bytes for the option type, but can have no options\n if (_options.length < 2) revert UlnOptions.LZ_ULN_InvalidWorkerOptions(0);\n\n uint16 optionsType = uint16(bytes2(_options[0:2]));\n uint256 cursor = 2;\n\n // type3 options: [worker_option][worker_option]...\n // worker_option: [worker_id][option_size][option]\n // worker_id: uint8, option_size: uint16, option: bytes\n if (optionsType == UlnOptions.TYPE_3) {\n unchecked {\n uint256 start = cursor;\n uint8 lastWorkerId; // worker_id starts from 1, so 0 is an invalid worker_id\n\n // heuristic: we assume that the options are mostly EXECUTOR options only\n // checking the workerID can reduce gas usage for most cases\n while (cursor < _options.length) {\n uint8 workerId = uint8(bytes1(_options[cursor:cursor + 1]));\n if (workerId == 0) revert UlnOptions.LZ_ULN_InvalidWorkerId(0);\n\n // workerId must equal to the lastWorkerId for the first option\n // so it is always skipped in the first option\n // this operation slices out options whenever the scan finds a different workerId\n if (lastWorkerId == 0) {\n lastWorkerId = workerId;\n } else if (workerId != lastWorkerId) {\n bytes calldata op = _options[start:cursor]; // slice out the last worker's options\n (executorOptions, dvnOptions) = _insertWorkerOptions(\n executorOptions,\n dvnOptions,\n lastWorkerId,\n op\n );\n\n // reset the start cursor and lastWorkerId\n start = cursor;\n lastWorkerId = workerId;\n }\n\n ++cursor; // for workerId\n\n uint16 size = uint16(bytes2(_options[cursor:cursor + 2]));\n if (size == 0) revert UlnOptions.LZ_ULN_InvalidWorkerOptions(cursor);\n cursor += size + 2;\n }\n\n // the options length must be the same as the cursor at the end\n if (cursor != _options.length) revert UlnOptions.LZ_ULN_InvalidWorkerOptions(cursor);\n\n // if we have reached the end of the options and the options are not empty\n // we need to process the last worker's options\n if (_options.length > 2) {\n bytes calldata op = _options[start:cursor];\n (executorOptions, dvnOptions) = _insertWorkerOptions(executorOptions, dvnOptions, lastWorkerId, op);\n }\n }\n } else {\n executorOptions = decodeLegacyOptions(optionsType, _options);\n }\n }\n\n function _insertWorkerOptions(\n bytes memory _executorOptions,\n bytes memory _dvnOptions,\n uint8 _workerId,\n bytes calldata _newOptions\n ) private pure returns (bytes memory, bytes memory) {\n if (_workerId == ExecutorOptions.WORKER_ID) {\n _executorOptions = _executorOptions.length == 0\n ? _newOptions\n : abi.encodePacked(_executorOptions, _newOptions);\n } else if (_workerId == DVNOptions.WORKER_ID) {\n _dvnOptions = _dvnOptions.length == 0 ? _newOptions : abi.encodePacked(_dvnOptions, _newOptions);\n } else {\n revert UlnOptions.LZ_ULN_InvalidWorkerId(_workerId);\n }\n return (_executorOptions, _dvnOptions);\n }\n\n function decodeLegacyOptions(\n uint16 _optionType,\n bytes calldata _options\n ) internal pure returns (bytes memory executorOptions) {\n if (_optionType == UlnOptions.TYPE_1) {\n if (_options.length != 34) revert UlnOptions.LZ_ULN_InvalidLegacyType1Option();\n\n // execution gas\n uint128 executionGas = uint256(bytes32(_options[2:2 + 32])).toUint128();\n\n // dont use the encode function in the ExecutorOptions lib for saving gas by calling abi.encodePacked once\n // the result is a lzReceive option: [executor_id][option_size][option_type][execution_gas]\n // option_type: uint8, execution_gas: uint128\n // option_size = len(option_type) + len(execution_gas) = 1 + 16 = 17\n executorOptions = abi.encodePacked(\n ExecutorOptions.WORKER_ID,\n uint16(17), // 16 + 1, 16 for option_length, + 1 for option_type\n ExecutorOptions.OPTION_TYPE_LZRECEIVE,\n executionGas\n );\n } else if (_optionType == UlnOptions.TYPE_2) {\n // receiver size <= 32\n if (_options.length <= 66 || _options.length > 98) revert UlnOptions.LZ_ULN_InvalidLegacyType2Option();\n\n // execution gas\n uint128 executionGas = uint256(bytes32(_options[2:2 + 32])).toUint128();\n\n // nativeDrop (amount + receiver)\n uint128 amount = uint256(bytes32(_options[34:34 + 32])).toUint128(); // offset 2 + 32\n bytes32 receiver;\n unchecked {\n uint256 receiverLen = _options.length - 66; // offset 2 + 32 + 32\n receiver = bytes32(_options[66:]);\n receiver = receiver >> (8 * (32 - receiverLen)); // padding 0 to the left\n }\n\n // dont use the encode function in the ExecutorOptions lib for saving gas by calling abi.encodePacked once\n // the result has one lzReceive option and one nativeDrop option:\n // [executor_id][lzReceive_option_size][option_type][execution_gas] +\n // [executor_id][nativeDrop_option_size][option_type][nativeDrop_amount][receiver]\n // option_type: uint8, execution_gas: uint128, nativeDrop_amount: uint128, receiver: bytes32\n // lzReceive_option_size = len(option_type) + len(execution_gas) = 1 + 16 = 17\n // nativeDrop_option_size = len(option_type) + len(nativeDrop_amount) + len(receiver) = 1 + 16 + 32 = 49\n executorOptions = abi.encodePacked(\n ExecutorOptions.WORKER_ID,\n uint16(17), // 16 + 1, 16 for option_length, + 1 for option_type\n ExecutorOptions.OPTION_TYPE_LZRECEIVE,\n executionGas,\n ExecutorOptions.WORKER_ID,\n uint16(49), // 48 + 1, 32 + 16 for option_length, + 1 for option_type\n ExecutorOptions.OPTION_TYPE_NATIVE_DROP,\n amount,\n receiver\n );\n } else {\n revert UlnOptions.LZ_ULN_UnsupportedOptionType(_optionType);\n }\n }\n\n // NOT IMPLEMENTING\n function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external {}\n\n function clear(address _oapp, Origin calldata _origin, bytes32 _guid, bytes calldata _message) external {}\n\n mapping(address from => mapping(address to => mapping(bytes32 guid => mapping(uint16 index => bytes32 messageHash))))\n public composeQueue;\n\n function defaultReceiveLibrary(uint32 /*_eid*/) external pure returns (address) {\n return address(0);\n }\n\n function defaultReceiveLibraryTimeout(uint32 /*_eid*/) external pure returns (address lib, uint256 expiry) {\n return (address(0), 0);\n }\n\n function defaultSendLibrary(uint32 /*_eid*/) external pure returns (address) {\n return address(0);\n }\n\n function executable(Origin calldata /*_origin*/, address /*receiver*/) external pure returns (ExecutionState) {\n return ExecutionState.NotExecutable;\n }\n\n function getConfig(\n address /*_oapp*/,\n address /*_lib*/,\n uint32 /*_eid*/,\n uint32 /*_configType*/\n ) external pure returns (bytes memory config) {\n return bytes(\"0x\");\n }\n\n function getReceiveLibrary(\n address /*receiver*/,\n uint32 /*_eid*/\n ) external pure returns (address lib, bool isDefault) {\n return (address(0), false);\n }\n\n function getRegisteredLibraries() external pure returns (address[] memory) {\n address[] memory addresses = new address[](1);\n addresses[0] = address(0);\n return addresses;\n }\n\n function getSendLibrary(address /*_sender*/, uint32 /*_eid*/) external pure returns (address lib) {\n return address(0);\n }\n\n function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64) {\n return lazyInboundNonce[_receiver][_srcEid][_sender];\n }\n\n function isDefaultSendLibrary(address /*_sender*/, uint32 /*_eid*/) external pure returns (bool) {\n return false;\n }\n\n function isRegisteredLibrary(address /*_lib*/) external pure returns (bool) {\n return false;\n }\n\n function isSupportedEid(uint32 /*_eid*/) external pure returns (bool) {\n return false;\n }\n\n function lzCompose(\n address /*_from,*/,\n address /*_to,*/,\n bytes32 /*_guid,*/,\n uint16 /*_index,*/,\n bytes calldata /*_message,*/,\n bytes calldata /*_extraData*/\n ) external payable {}\n\n function lzReceive(\n Origin calldata /*_origin,*/,\n address /*_receiver,*/,\n bytes32 /*_guid,*/,\n bytes calldata /*_message,*/,\n bytes calldata /*_extraData*/\n ) external payable {}\n\n function lzToken() external pure returns (address) {\n return address(0);\n }\n\n function nativeToken() external pure returns (address) {\n return address(0);\n }\n\n function nextGuid(\n address /*_sender,*/,\n uint32 /*_dstEid,*/,\n bytes32 /*_receiver*/\n ) external pure returns (bytes32) {\n return 0;\n }\n\n function nilify(\n address /*_oapp,*/,\n uint32 /*_srcEid,*/,\n bytes32 /*_sender,*/,\n uint64 /*_nonce,*/,\n bytes32 /*_payloadHash*/\n ) external {}\n\n function quote(MessagingParams calldata _params, address _sender) external view returns (MessagingFee memory) {\n return _quote(_params, _sender);\n }\n\n mapping(address receiver => mapping(uint32 srcEid => Timeout)) public receiveLibraryTimeout;\n\n function registerLibrary(address /*_lib*/) public {}\n\n function sendCompose(address, /*_to*/ bytes32, /*_guid*/ uint16, /*_index*/ bytes calldata /*_message*/) external {}\n\n function setConfig(address, /*_oapp*/ address, /*_lib*/ SetConfigParam[] calldata /*_params*/) external {}\n\n function setDefaultReceiveLibrary(uint32 /*_eid*/, address /*_newLib*/, uint256 /*_gracePeriod*/) external {}\n\n function setDefaultReceiveLibraryTimeout(uint32 /*_eid*/, address /*_lib*/, uint256 /*_expiry*/) external {}\n\n function setDefaultSendLibrary(uint32 /*_eid*/, address /*_newLib*/) external {}\n\n function setDelegate(address /*_delegate*/) external {}\n\n function setLzToken(address /*_lzToken*/) external {}\n\n function setReceiveLibrary(\n address,\n /*_oapp*/ uint32,\n /*_eid*/ address,\n /*_newLib*/ uint256 /*_gracePeriod*/\n ) external {}\n\n function setReceiveLibraryTimeout(\n address,\n /*_oapp*/ uint32,\n /*_eid*/ address,\n /*_lib*/ uint256 /*_gracePeriod*/\n ) external {}\n\n function setSendLibrary(address, /*_oapp*/ uint32, /*_eid*/ address /*_newLib*/) external {}\n\n function skip(address, /*_oapp*/ uint32, /*_srcEid*/ bytes32, /*_sender*/ uint64 /*_nonce*/) external {}\n\n function verifiable(\n Origin calldata /*_origin*/,\n address /*_receiver*/,\n address /*_receiveLib*/,\n bytes32 /*_payloadHash*/\n ) external pure returns (bool) {\n return false;\n }\n\n function verify(Origin calldata /*origin*/, address /*_receiver*/, bytes32 /*_payloadHash*/) external {}\n\n // Helper Functions\n function executeNativeAirDropAndReturnLzGas(\n bytes calldata _options\n ) public returns (uint256 totalGas, uint256 dstAmount) {\n (bytes memory executorOpts, ) = decode(_options);\n return this._executeNativeAirDropAndReturnLzGas(executorOpts);\n }\n\n function _executeNativeAirDropAndReturnLzGas(\n bytes calldata _options\n ) public returns (uint256 totalGas, uint256 dstAmount) {\n if (_options.length == 0) {\n revert IExecutorFeeLib.Executor_NoOptions();\n }\n\n uint256 cursor = 0;\n while (cursor < _options.length) {\n (uint8 optionType, bytes calldata option, uint256 newCursor) = _options.nextExecutorOption(cursor);\n cursor = newCursor;\n\n if (optionType == ExecutorOptions.OPTION_TYPE_LZRECEIVE) {\n (uint128 gas, uint128 value) = ExecutorOptions.decodeLzReceiveOption(option);\n totalGas += gas;\n dstAmount += value;\n } else if (optionType == ExecutorOptions.OPTION_TYPE_NATIVE_DROP) {\n (uint128 nativeDropAmount, bytes32 receiver) = ExecutorOptions.decodeNativeDropOption(option);\n (bool success, ) = receiver.bytes32ToAddress().call{ value: nativeDropAmount }(\"\");\n if (!success) {\n emit ValueTransferFailed(receiver.bytes32ToAddress(), nativeDropAmount);\n }\n } else {\n revert IExecutorFeeLib.Executor_UnsupportedOptionType(optionType);\n }\n }\n\n if (cursor != _options.length) revert IExecutorFeeLib.Executor_InvalidExecutorOptions(cursor);\n }\n\n function _initializable(\n Origin calldata _origin,\n address _receiver,\n uint64 _lazyInboundNonce\n ) internal view returns (bool) {\n return\n _lazyInboundNonce > 0 || // allowInitializePath already checked\n ILayerZeroReceiver(_receiver).allowInitializePath(_origin);\n }\n\n /// @dev bytes(0) payloadHash can never be submitted\n function _verifiable(\n Origin calldata _origin,\n address _receiver,\n uint64 _lazyInboundNonce\n ) internal view returns (bool) {\n return\n _origin.nonce > _lazyInboundNonce || // either initializing an empty slot or reverifying\n inboundPayloadHash[_receiver][_origin.srcEid][_origin.sender][_origin.nonce] != EMPTY_PAYLOAD_HASH; // only allow reverifying if it hasn't been executed\n }\n\n // ========================= VIEW FUNCTIONS FOR OFFCHAIN ONLY =========================\n // Not involved in any state transition function.\n // ====================================================================================\n function initializable(Origin calldata _origin, address _receiver) external view returns (bool) {\n return _initializable(_origin, _receiver, lazyInboundNonce[_receiver][_origin.srcEid][_origin.sender]);\n }\n\n function verifiable(Origin calldata _origin, address _receiver) external view returns (bool) {\n return _verifiable(_origin, _receiver, lazyInboundNonce[_receiver][_origin.srcEid][_origin.sender]);\n }\n\n /// @dev called when the endpoint checks if the msgLib attempting to verify the msg is the configured msgLib of the Oapp\n /// @dev this check provides the ability for Oapp to lock in a trusted msgLib\n /// @dev it will fist check if the msgLib is the currently configured one. then check if the msgLib is the one in grace period of msgLib versioning upgrade\n function isValidReceiveLibrary(\n address _receiver,\n uint32 _srcEid,\n address _actualReceiveLib\n ) public view returns (bool) {\n return true;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Storage of the initializable contract.\n *\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n * when using with upgradeable contracts.\n *\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n */\n struct InitializableStorage {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n uint64 _initialized;\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool _initializing;\n }\n\n // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n /**\n * @dev The contract is already initialized.\n */\n error InvalidInitialization();\n\n /**\n * @dev The contract is not initializing.\n */\n error NotInitializing();\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint64 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n * production.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n // solhint-disable-next-line var-name-mixedcase\n InitializableStorage storage $ = _getInitializableStorage();\n\n // Cache values to avoid duplicated sloads\n bool isTopLevelCall = !$._initializing;\n uint64 initialized = $._initialized;\n\n // Allowed calls:\n // - initialSetup: the contract is not in the initializing state and no previous version was\n // initialized\n // - construction: the contract is initialized at version 1 (no reininitialization) and the\n // current contract is just being deployed\n bool initialSetup = initialized == 0 && isTopLevelCall;\n bool construction = initialized == 1 && address(this).code.length == 0;\n\n if (!initialSetup && !construction) {\n revert InvalidInitialization();\n }\n $._initialized = 1;\n if (isTopLevelCall) {\n $._initializing = true;\n }\n _;\n if (isTopLevelCall) {\n $._initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint64 version) {\n // solhint-disable-next-line var-name-mixedcase\n InitializableStorage storage $ = _getInitializableStorage();\n\n if ($._initializing || $._initialized >= version) {\n revert InvalidInitialization();\n }\n $._initialized = version;\n $._initializing = true;\n _;\n $._initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n _checkInitializing();\n _;\n }\n\n /**\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n */\n function _checkInitializing() internal view virtual {\n if (!_isInitializing()) {\n revert NotInitializing();\n }\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n // solhint-disable-next-line var-name-mixedcase\n InitializableStorage storage $ = _getInitializableStorage();\n\n if ($._initializing) {\n revert InvalidInitialization();\n }\n if ($._initialized != type(uint64).max) {\n $._initialized = type(uint64).max;\n emit Initialized(type(uint64).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint64) {\n return _getInitializableStorage()._initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _getInitializableStorage()._initializing;\n }\n\n /**\n * @dev Returns a pointer to the storage namespace.\n */\n // solhint-disable-next-line var-name-mixedcase\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n assembly {\n $.slot := INITIALIZABLE_STORAGE\n }\n }\n}\n" + }, + "@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/interfaces/draft-IERC6093.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 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 ERC721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 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 EIP-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 ERC1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 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/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../token/ERC20/IERC20.sol\";\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\nimport {IERC20Permit} from \"../extensions/IERC20Permit.sol\";\nimport {Address} from \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance < requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 && !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\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 AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\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 * {FailedInnerCall} 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 AddressInsufficientBalance(address(this));\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 {FailedInnerCall}) in case of an\n * 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 {FailedInnerCall} 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 {FailedInnerCall}.\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 /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\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/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\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[EIP 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/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.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 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" + }, + "@sandbox-smart-contracts/oft-sand/contracts/interfaces/IERC20Extended.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.23;\n\nimport {IERC20} from \"@openzeppelin/contracts/interfaces/IERC20.sol\";\n\ninterface IERC20Extended is IERC20 {\n function burnFor(address from, uint256 amount) external;\n\n function burn(uint256 amount) external;\n\n function approveFor(address owner, address spender, uint256 amount) external returns (bool success);\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/interfaces/IErrors.sol": { + "content": "//SPDX-License-Identifier: MIT\n\npragma solidity 0.8.23;\n\n/// @title Errors\n/// @author The Sandbox\n/// @custom:security-contact contact-blockchain@sandbox.game\n/// @notice Common errors\ninterface IErrors {\n /// @notice Error for overflow conditions\n error Overflow();\n\n /// @notice Error for unauthorized access\n error NotAuthorized();\n\n /// @notice Error for invalid sender\n error InvalidSender();\n\n /// @notice Error for invalid amount\n error InvalidAmount();\n\n /// @notice Error for invalid owner or spender\n error InvalidOwnerOrSpender();\n\n /// @notice Error for mismatched first parameter and sender address\n error FirstParamNotSender();\n\n /// @notice Error for failed calls, containing the error message\n /// @param message error message returned from the failed call\n error CallFailed(string message);\n\n /// @notice Error for admin-only access\n error OnlyAdmin();\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/libraries/BytesUtil.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nlibrary BytesUtil {\n uint256 private constant DATA_MIN_LENGTH = 68;\n\n /// @dev Check if the data == _address.\n /// @param data The bytes passed to the function.\n /// @param _address The address to compare to.\n /// @return Whether the first param == _address.\n function doFirstParamEqualsAddress(bytes memory data, address _address) internal pure returns (bool) {\n if (data.length < DATA_MIN_LENGTH) {\n return false;\n }\n uint256 value;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n value := mload(add(data, 36))\n }\n return value == uint256(uint160(_address));\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/mock/EndpointMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.23;\n\nimport {EndpointV2Mock} from \"@layerzerolabs/test-devtools-evm-hardhat/contracts/mocks/EndpointV2Mock.sol\";\n\ncontract EndpointMock is EndpointV2Mock {\n constructor(uint32 eid) EndpointV2Mock(eid) {}\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/oft/libraries/OFTMsgCodec.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nlibrary OFTMsgCodec {\n // Offset constants for encoding and decoding OFT messages\n uint8 private constant SEND_TO_OFFSET = 32;\n uint8 private constant SEND_AMOUNT_SD_OFFSET = 40;\n\n /**\n * @dev Encodes an OFT LayerZero message.\n * @param _sendTo The recipient address.\n * @param _amountShared The amount in shared decimals.\n * @param _composeMsg The composed message.\n * @param _sender The msg sender\n * @return _msg The encoded message.\n * @return hasCompose A boolean indicating whether the message has a composed payload.\n */\n function encode(\n bytes32 _sendTo,\n uint64 _amountShared,\n bytes memory _composeMsg,\n address _sender\n ) internal pure returns (bytes memory _msg, bool hasCompose) {\n hasCompose = _composeMsg.length > 0;\n // @dev Remote chains will want to know the composed function caller ie. msg.sender on the src.\n _msg = hasCompose\n ? abi.encodePacked(_sendTo, _amountShared, addressToBytes32(_sender), _composeMsg)\n : abi.encodePacked(_sendTo, _amountShared);\n }\n\n /**\n * @dev Checks if the OFT message is composed.\n * @param _msg The OFT message.\n * @return A boolean indicating whether the message is composed.\n */\n function isComposed(bytes calldata _msg) internal pure returns (bool) {\n return _msg.length > SEND_AMOUNT_SD_OFFSET;\n }\n\n /**\n * @dev Retrieves the recipient address from the OFT message.\n * @param _msg The OFT message.\n * @return The recipient address.\n */\n function sendTo(bytes calldata _msg) internal pure returns (bytes32) {\n return bytes32(_msg[:SEND_TO_OFFSET]);\n }\n\n /**\n * @dev Retrieves the amount in shared decimals from the OFT message.\n * @param _msg The OFT message.\n * @return The amount in shared decimals.\n */\n function amountSD(bytes calldata _msg) internal pure returns (uint64) {\n return uint64(bytes8(_msg[SEND_TO_OFFSET:SEND_AMOUNT_SD_OFFSET]));\n }\n\n /**\n * @dev Retrieves the composed message from the OFT message.\n * @param _msg The OFT message.\n * @return The composed message.\n */\n function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\n return _msg[SEND_AMOUNT_SD_OFFSET:];\n }\n\n /**\n * @dev Converts an address to bytes32.\n * @param _addr The address to convert.\n * @return The bytes32 representation of the address.\n */\n function addressToBytes32(address _addr) internal pure returns (bytes32) {\n return bytes32(uint256(uint160(_addr)));\n }\n\n /**\n * @dev Converts bytes32 to an address.\n * @param _b The bytes32 value to convert.\n * @return The address representation of bytes32.\n */\n function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\n return address(uint160(uint256(_b)));\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/oft/oapp/OApp.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\n// @dev Import the 'MessagingFee' and 'MessagingReceipt' so it's exposed to OApp implementers\n// solhint-disable-next-line no-unused-import\nimport {OAppSender, MessagingFee, MessagingReceipt} from \"./OAppSender.sol\";\n// @dev Import the 'Origin' so it's exposed to OApp implementers\n// solhint-disable-next-line no-unused-import\nimport {OAppReceiver, Origin} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppReceiver.sol\";\nimport {OAppCore} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppCore.sol\";\n\n/**\n * @title OApp\n * @dev Abstract contract serving as the base for OApp implementation, combining OAppSender and OAppReceiver functionality.\n * @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OApp.sol'\n * but has been modified to support ERC2771 compatibility.\n */\nabstract contract OApp is OAppSender, OAppReceiver {\n /**\n * @dev Constructor to initialize the OApp with the provided endpoint and owner.\n * @param _endpoint The address of the LOCAL LayerZero endpoint.\n * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n */\n constructor(address _endpoint, address _delegate) OAppCore(_endpoint, _delegate) {}\n\n /**\n * @notice Retrieves the OApp version information.\n * @return senderVersion The version of the OAppSender.sol implementation.\n * @return receiverVersion The version of the OAppReceiver.sol implementation.\n */\n function oAppVersion()\n public\n pure\n virtual\n override(OAppSender, OAppReceiver)\n returns (uint64 senderVersion, uint64 receiverVersion)\n {\n return (SENDER_VERSION, RECEIVER_VERSION);\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/oft/oapp/OAppSender.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport {SafeERC20, IERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {MessagingParams, MessagingFee, MessagingReceipt} from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport {OAppCore} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppCore.sol\";\n/**\n * @title OAppSender\n * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.\n * @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppSender.sol'\n * but has been modified to support ERC2771 compatibility.\n */\nabstract contract OAppSender is OAppCore {\n using SafeERC20 for IERC20;\n\n // Custom error messages\n error NotEnoughNative(uint256 msgValue);\n error LzTokenUnavailable();\n\n // @dev The version of the OAppSender implementation.\n // @dev Version is bumped when changes are made to this contract.\n uint64 internal constant SENDER_VERSION = 1;\n\n /**\n * @notice Retrieves the OApp version information.\n * @return senderVersion The version of the OAppSender.sol contract.\n * @return receiverVersion The version of the OAppReceiver.sol contract.\n *\n * @dev Providing 0 as the default for OAppReceiver version. Indicates that the OAppReceiver is not implemented.\n * ie. this is a SEND only OApp.\n * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions\n */\n function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\n return (SENDER_VERSION, 0);\n }\n\n /**\n * @dev Internal function to interact with the LayerZero EndpointV2.quote() for fee calculation.\n * @param _dstEid The destination endpoint ID.\n * @param _message The message payload.\n * @param _options Additional options for the message.\n * @param _payInLzToken Flag indicating whether to pay the fee in LZ tokens.\n * @return fee The calculated MessagingFee for the message.\n * - nativeFee: The native fee for the message.\n * - lzTokenFee: The LZ token fee for the message.\n */\n function _quote(\n uint32 _dstEid,\n bytes memory _message,\n bytes memory _options,\n bool _payInLzToken\n ) internal view virtual returns (MessagingFee memory fee) {\n return\n endpoint.quote(\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken),\n address(this)\n );\n }\n\n /**\n * @dev Internal function to interact with the LayerZero EndpointV2.send() for sending a message.\n * @param _dstEid The destination endpoint ID.\n * @param _message The message payload.\n * @param _options Additional options for the message.\n * @param _fee The calculated LayerZero fee for the message.\n * - nativeFee: The native fee.\n * - lzTokenFee: The lzToken fee.\n * @param _refundAddress The address to receive any excess fee values sent to the endpoint.\n * @return receipt The receipt for the sent message.\n * - guid: The unique identifier for the sent message.\n * - nonce: The nonce of the sent message.\n * - fee: The LayerZero fee incurred for the message.\n */\n function _lzSend(\n uint32 _dstEid,\n bytes memory _message,\n bytes memory _options,\n MessagingFee memory _fee,\n address _refundAddress\n ) internal virtual returns (MessagingReceipt memory receipt) {\n // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint.\n uint256 messageValue = _payNative(_fee.nativeFee);\n if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);\n\n return\n // solhint-disable-next-line check-send-result\n endpoint.send{value: messageValue}(\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0),\n _refundAddress\n );\n }\n\n /**\n * @dev Internal function to pay the native fee associated with the message.\n * @param _nativeFee The native fee to be paid.\n * @return nativeFee The amount of native currency paid.\n *\n * @dev If the OApp needs to initiate MULTIPLE LayerZero messages in a single transaction,\n * this will need to be overridden because msg.value would contain multiple lzFees.\n * @dev Should be overridden in the event the LayerZero endpoint requires a different native currency.\n * @dev Some EVMs use an ERC20 as a method for paying transactions/gasFees.\n * @dev The endpoint is EITHER/OR, ie. it will NOT support both types of native payment at a time.\n */\n function _payNative(uint256 _nativeFee) internal virtual returns (uint256 nativeFee) {\n if (msg.value != _nativeFee) revert NotEnoughNative(msg.value);\n return _nativeFee;\n }\n\n /**\n * @dev Internal function to pay the LZ token fee associated with the message.\n * @param _lzTokenFee The LZ token fee to be paid.\n *\n * @dev If the caller is trying to pay in the specified lzToken, then the lzTokenFee is passed to the endpoint.\n * @dev Any excess sent, is passed back to the specified _refundAddress in the _lzSend().\n */\n function _payLzToken(uint256 _lzTokenFee) internal virtual {\n // @dev Cannot cache the token because it is not immutable in the endpoint.\n address lzToken = endpoint.lzToken();\n if (lzToken == address(0)) revert LzTokenUnavailable();\n\n // Pay LZ token fee by sending tokens to the endpoint.\n IERC20(lzToken).safeTransferFrom(_msgSender(), address(endpoint), _lzTokenFee);\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/oft/OFTAdapter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport {IERC20Metadata, IERC20} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {OFTCore} from \"./OFTCore.sol\";\n\n/// @title OFTAdapter Contract\n/// @dev OFTAdapter is a contract that adapts an ERC-20 token to the OFT functionality.\n/// @dev For existing ERC20 tokens, this can be used to convert the token to crosschain compatibility.\n/// @dev WARNING: ONLY 1 of these should exist for a given global mesh,\n/// unless you make a NON-default implementation of OFT and needs to be done very carefully.\n/// @dev WARNING: The default OFTAdapter implementation assumes LOSSLESS transfers, ie. 1 token in, 1 token out.\n/// IF the 'innerToken' applies something like a transfer fee, the default will NOT work...\n/// a pre/post balance check will need to be done to calculate the amountSentLD/amountReceivedLD.\n/// @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFTAdapter.sol'\n/// but has been modified to support ERC2771 compatibility.\nabstract contract OFTAdapter is OFTCore {\n using SafeERC20 for IERC20;\n\n IERC20 internal immutable innerToken;\n\n /// @dev Constructor for the OFTAdapter contract.\n /// @param _token The address of the ERC-20 token to be adapted.\n /// @param _lzEndpoint The LayerZero endpoint address.\n /// @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n constructor(\n address _token,\n address _lzEndpoint,\n address _delegate\n ) OFTCore(IERC20Metadata(_token).decimals(), _lzEndpoint, _delegate) {\n innerToken = IERC20(_token);\n }\n\n /// @dev Retrieves the address of the underlying ERC20 implementation.\n /// @return The address of the adapted ERC-20 token.\n /// @dev In the case of OFTAdapter, address(this) and erc20 are NOT the same contract.\n function token() public view returns (address) {\n return address(innerToken);\n }\n\n /// @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\n /// @return requiresApproval Needs approval of the underlying token implementation.\n /// @dev In the case of default OFTAdapter, approval is required.\n /// @dev In non-default OFTAdapter contracts with something like mint and burn privileges, it would NOT need approval.\n function approvalRequired() external pure virtual returns (bool) {\n return true;\n }\n\n /// @dev Burns tokens from the sender's specified balance, ie. pull method.\n /// @param _from The address to debit from.\n /// @param _amountLD The amount of tokens to send in local decimals.\n /// @param _minAmountLD The minimum amount to send in local decimals.\n /// @param _dstEid The destination chain ID.\n /// @return amountSentLD The amount sent in local decimals.\n /// @return amountReceivedLD The amount received in local decimals on the remote.\n /// @dev msg.sender will need to approve this _amountLD of tokens to be locked inside of the contract.\n /// @dev WARNING: The default OFTAdapter implementation assumes LOSSLESS transfers, ie. 1 token in, 1 token out.\n /// IF the 'innerToken' applies something like a transfer fee, the default will NOT work...\n /// a pre/post balance check will need to be done to calculate the amountReceivedLD.\n function _debit(\n address _from,\n uint256 _amountLD,\n uint256 _minAmountLD,\n uint32 _dstEid\n ) internal virtual override returns (uint256 amountSentLD, uint256 amountReceivedLD) {\n (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid);\n // @dev Lock tokens by moving them into this contract from the caller.\n innerToken.safeTransferFrom(_from, address(this), amountSentLD);\n }\n\n /// @dev Credits tokens to the specified address.\n /// @param _to The address to credit the tokens to.\n /// @param _amountLD The amount of tokens to credit in local decimals.\n /// @dev _srcEid The source chain ID.\n /// @return amountReceivedLD The amount of tokens ACTUALLY received in local decimals.\n /// @dev WARNING: The default OFTAdapter implementation assumes LOSSLESS transfers, ie. 1 token in, 1 token out.\n /// IF the 'innerToken' applies something like a transfer fee, the default will NOT work...\n /// a pre/post balance check will need to be done to calculate the amountReceivedLD.\n function _credit(\n address _to,\n uint256 _amountLD,\n uint32 /*_srcEid*/\n ) internal virtual override returns (uint256 amountReceivedLD) {\n // @dev Unlock the tokens and transfer to the recipient.\n innerToken.safeTransfer(_to, _amountLD);\n // @dev In the case of NON-default OFTAdapter, the amountLD MIGHT not be == amountReceivedLD.\n return _amountLD;\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/oft/OFTCore.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport {OApp, Origin} from \"./oapp/OApp.sol\";\nimport {OAppOptionsType3} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OAppOptionsType3.sol\";\nimport {IOAppMsgInspector} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppMsgInspector.sol\";\n\nimport {OAppPreCrimeSimulator} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/OAppPreCrimeSimulator.sol\";\n\nimport {IOFT, SendParam, OFTLimit, OFTReceipt, OFTFeeDetail, MessagingReceipt, MessagingFee} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol\";\nimport {OFTMsgCodec} from \"./libraries/OFTMsgCodec.sol\";\nimport {OFTComposeMsgCodec} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/libs/OFTComposeMsgCodec.sol\";\n\n/// @title OFTCore\n/// @dev Abstract contract for the OftChain (OFT) token.\n/// @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFTCore.sol'\n/// but has been modified to support ERC2771 compatibility.\nabstract contract OFTCore is IOFT, OApp, OAppPreCrimeSimulator, OAppOptionsType3 {\n using OFTMsgCodec for bytes;\n using OFTMsgCodec for bytes32;\n\n // @notice Provides a conversion rate when swapping between denominations of SD and LD\n // - shareDecimals == SD == shared Decimals\n // - localDecimals == LD == local decimals\n // @dev Considers that tokens have different decimal amounts on various chains.\n // @dev eg.\n // For a token\n // - locally with 4 decimals --> 1.2345 => uint(12345)\n // - remotely with 2 decimals --> 1.23 => uint(123)\n // - The conversion rate would be 10 ** (4 - 2) = 100\n // @dev If you want to send 1.2345 -> (uint 12345), you CANNOT represent that value on the remote,\n // you can only display 1.23 -> uint(123).\n // @dev To preserve the dust that would otherwise be lost on that conversion,\n // we need to unify a denomination that can be represented on ALL chains inside of the OFT mesh\n uint256 public immutable decimalConversionRate;\n\n // @notice Msg types that are used to identify the various OFT operations.\n // @dev This can be extended in child contracts for non-default oft operations\n // @dev These values are used in things like combineOptions() in OAppOptionsType3.sol.\n uint16 public constant SEND = 1;\n uint16 public constant SEND_AND_CALL = 2;\n\n // Address of an optional contract to inspect both 'message' and 'options'\n address public msgInspector;\n event MsgInspectorSet(address inspector);\n\n /// @dev Constructor.\n /// @param _localDecimals The decimals of the token on the local chain (this chain).\n /// @param _endpoint The address of the LayerZero endpoint.\n /// @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n constructor(uint8 _localDecimals, address _endpoint, address _delegate) OApp(_endpoint, _delegate) {\n if (_localDecimals < sharedDecimals()) revert InvalidLocalDecimals();\n decimalConversionRate = 10 ** (_localDecimals - sharedDecimals());\n }\n\n /// @notice Retrieves interfaceID and the version of the OFT.\n /// @return interfaceId The interface ID.\n /// @return version The version.\n /// @dev interfaceId: This specific interface ID is '0x02e49c2c'.\n /// @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.\n /// @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.\n /// ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\n function oftVersion() external pure virtual returns (bytes4 interfaceId, uint64 version) {\n return (type(IOFT).interfaceId, 1);\n }\n\n /// @dev Retrieves the shared decimals of the OFT.\n /// @return The shared decimals of the OFT.\n /// @dev Sets an implicit cap on the amount of tokens, over uint64.max() will need some sort of outbound cap / totalSupply cap\n /// Lowest common decimal denominator between chains.\n /// Defaults to 6 decimal places to provide up to 18,446,744,073,709.551615 units (max uint64).\n /// For tokens exceeding this totalSupply(), they will need to override the sharedDecimals function with something smaller.\n /// ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615\n function sharedDecimals() public view virtual returns (uint8) {\n return 6;\n }\n\n /// @dev Sets the message inspector address for the OFT.\n /// @param _msgInspector The address of the message inspector.\n /// @dev This is an optional contract that can be used to inspect both 'message' and 'options'.\n /// @dev Set it to address(0) to disable it, or set it to a contract address to enable it.\n function setMsgInspector(address _msgInspector) public virtual onlyOwner {\n msgInspector = _msgInspector;\n emit MsgInspectorSet(_msgInspector);\n }\n\n /// @notice Provides a quote for OFT-related operations.\n /// @param _sendParam The parameters for the send operation.\n /// @return oftLimit The OFT limit information.\n /// @return oftFeeDetails The details of OFT fees.\n /// @return oftReceipt The OFT receipt information.\n function quoteOFT(\n SendParam calldata _sendParam\n )\n external\n view\n virtual\n returns (OFTLimit memory oftLimit, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory oftReceipt)\n {\n uint256 minAmountLD = 0; // Unused in the default implementation.\n uint256 maxAmountLD = type(uint64).max; // Unused in the default implementation.\n oftLimit = OFTLimit(minAmountLD, maxAmountLD);\n\n // Unused in the default implementation; reserved for future complex fee details.\n oftFeeDetails = new OFTFeeDetail[](0);\n\n // @dev This is the same as the send() operation, but without the actual send.\n // - amountSentLD is the amount in local decimals that would be sent from the sender.\n // - amountReceivedLD is the amount in local decimals that will be credited to the recipient on the remote OFT instance.\n // @dev The amountSentLD MIGHT not equal the amount the user actually receives. HOWEVER, the default does.\n (uint256 amountSentLD, uint256 amountReceivedLD) = _debitView(\n _sendParam.amountLD,\n _sendParam.minAmountLD,\n _sendParam.dstEid\n );\n oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD);\n }\n\n /// @notice Provides a quote for the send() operation.\n /// @param _sendParam The parameters for the send() operation.\n /// @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.\n /// @return msgFee The calculated LayerZero messaging fee from the send() operation.\n /// @dev MessagingFee: LayerZero msg fee\n /// - nativeFee: The native fee.\n /// - lzTokenFee: The lzToken fee.\n function quoteSend(\n SendParam calldata _sendParam,\n bool _payInLzToken\n ) external view virtual returns (MessagingFee memory msgFee) {\n // @dev mock the amount to receive, this is the same operation used in the send().\n // The quote is as similar as possible to the actual send() operation.\n (, uint256 amountReceivedLD) = _debitView(_sendParam.amountLD, _sendParam.minAmountLD, _sendParam.dstEid);\n\n // @dev Builds the options and OFT message to quote in the endpoint.\n (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD);\n\n // @dev Calculates the LayerZero fee for the send() operation.\n return _quote(_sendParam.dstEid, message, options, _payInLzToken);\n }\n\n /// @dev Executes the send operation.\n /// @param _sendParam The parameters for the send operation.\n /// @param _fee The calculated fee for the send() operation.\n /// - nativeFee: The native fee.\n /// - lzTokenFee: The lzToken fee.\n /// @param _refundAddress The address to receive any excess funds.\n /// @return msgReceipt The receipt for the send operation.\n /// @return oftReceipt The OFT receipt information.\n /// @dev MessagingReceipt: LayerZero msg receipt\n /// - guid: The unique identifier for the sent message.\n /// - nonce: The nonce of the sent message.\n /// - fee: The LayerZero fee incurred for the message.\n function send(\n SendParam calldata _sendParam,\n MessagingFee calldata _fee,\n address _refundAddress\n ) public payable virtual returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) {\n // @dev Applies the token transfers regarding this send() operation.\n // - amountSentLD is the amount in local decimals that was ACTUALLY sent/debited from the sender.\n // - amountReceivedLD is the amount in local decimals that will be received/credited to the recipient on the remote OFT instance.\n (uint256 amountSentLD, uint256 amountReceivedLD) = _debit(\n _msgSender(),\n _sendParam.amountLD,\n _sendParam.minAmountLD,\n _sendParam.dstEid\n );\n\n // @dev Builds the options and OFT message to quote in the endpoint.\n (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD);\n\n // @dev Sends the message to the LayerZero endpoint and returns the LayerZero msg receipt.\n msgReceipt = _lzSend(_sendParam.dstEid, message, options, _fee, _refundAddress);\n // @dev Formulate the OFT receipt.\n oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD);\n\n emit OFTSent(msgReceipt.guid, _sendParam.dstEid, _msgSender(), amountSentLD, amountReceivedLD);\n }\n\n /// @dev Internal function to build the message and options.\n /// @param _sendParam The parameters for the send() operation.\n /// @param _amountLD The amount in local decimals.\n /// @return message The encoded message.\n /// @return options The encoded options.\n function _buildMsgAndOptions(\n SendParam calldata _sendParam,\n uint256 _amountLD\n ) internal view virtual returns (bytes memory message, bytes memory options) {\n bool hasCompose;\n // @dev This generated message has the msg.sender encoded into the payload so the remote knows who the caller is.\n (message, hasCompose) = OFTMsgCodec.encode(\n _sendParam.to,\n _toSD(_amountLD),\n // @dev Must be include a non empty bytes if you want to compose, EVEN if you dont need it on the remote.\n // EVEN if you dont require an arbitrary payload to be sent... eg. '0x01'\n _sendParam.composeMsg,\n _msgSender()\n );\n // @dev Change the msg type depending if its composed or not.\n uint16 msgType = hasCompose ? SEND_AND_CALL : SEND;\n // @dev Combine the callers _extraOptions with the enforced options via the OAppOptionsType3.\n options = combineOptions(_sendParam.dstEid, msgType, _sendParam.extraOptions);\n\n // @dev Optionally inspect the message and options depending if the OApp owner has set a msg inspector.\n // @dev If it fails inspection, needs to revert in the implementation. ie. does not rely on return boolean\n if (msgInspector != address(0)) IOAppMsgInspector(msgInspector).inspect(message, options);\n }\n\n /// @dev Internal function to handle the receive on the LayerZero endpoint.\n /// @param _origin The origin information.\n /// - srcEid: The source chain endpoint ID.\n /// - sender: The sender address from the src chain.\n /// - nonce: The nonce of the LayerZero message.\n /// @param _guid The unique identifier for the received LayerZero message.\n /// @param _message The encoded message.\n /// @dev _executor The address of the executor.\n /// @dev _extraData Additional data.\n\n function _lzReceive(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address /*_executor*/, // @dev unused in the default implementation.\n bytes calldata /*_extraData*/ // @dev unused in the default implementation.\n ) internal virtual override {\n // @dev The src sending chain doesnt know the address length on this chain (potentially non-evm)\n // Thus everything is bytes32() encoded in flight.\n address toAddress = _message.sendTo().bytes32ToAddress();\n // @dev Credit the amountLD to the recipient and return the ACTUAL amount the recipient received in local decimals\n uint256 amountReceivedLD = _credit(toAddress, _toLD(_message.amountSD()), _origin.srcEid);\n\n if (_message.isComposed()) {\n // @dev Proprietary composeMsg format for the OFT.\n bytes memory composeMsg = OFTComposeMsgCodec.encode(\n _origin.nonce,\n _origin.srcEid,\n amountReceivedLD,\n _message.composeMsg()\n );\n\n // @dev Stores the lzCompose payload that will be executed in a separate tx.\n // Standardizes functionality for executing arbitrary contract invocation on some non-evm chains.\n // @dev The off-chain executor will listen and process the msg based on the src-chain-callers compose options passed.\n // @dev The index is used when a OApp needs to compose multiple msgs on lzReceive.\n // For default OFT implementation there is only 1 compose msg per lzReceive, thus its always 0.\n endpoint.sendCompose(toAddress, _guid, 0 /* the index of the composed message*/, composeMsg);\n }\n\n emit OFTReceived(_guid, _origin.srcEid, toAddress, amountReceivedLD);\n }\n\n /// @dev Internal function to handle the OAppPreCrimeSimulator simulated receive.\n /// @param _origin The origin information.\n /// - srcEid: The source chain endpoint ID.\n /// - sender: The sender address from the src chain.\n /// - nonce: The nonce of the LayerZero message.\n /// @param _guid The unique identifier for the received LayerZero message.\n /// @param _message The LayerZero message.\n /// @param _executor The address of the off-chain executor.\n /// @param _extraData Arbitrary data passed by the msg executor.\n /// @dev Enables the preCrime simulator to mock sending lzReceive() messages,\n /// routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver.\n function _lzReceiveSimulate(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address _executor,\n bytes calldata _extraData\n ) internal virtual override {\n _lzReceive(_origin, _guid, _message, _executor, _extraData);\n }\n\n /// @dev Check if the peer is considered 'trusted' by the OApp.\n /// @param _eid The endpoint ID to check.\n /// @param _peer The peer to check.\n /// @return Whether the peer passed is considered 'trusted' by the OApp.\n /// @dev Enables OAppPreCrimeSimulator to check whether a potential Inbound Packet is from a trusted source.\n function isPeer(uint32 _eid, bytes32 _peer) public view virtual override returns (bool) {\n return peers[_eid] == _peer;\n }\n\n /// @dev Internal function to remove dust from the given local decimal amount.\n /// @param _amountLD The amount in local decimals.\n /// @return amountLD The amount after removing dust.\n /// @dev Prevents the loss of dust when moving amounts between chains with different decimals.\n /// @dev eg. uint(123) with a conversion rate of 100 becomes uint(100).\n function _removeDust(uint256 _amountLD) internal view virtual returns (uint256 amountLD) {\n return (_amountLD / decimalConversionRate) * decimalConversionRate;\n }\n\n /// @dev Internal function to convert an amount from shared decimals into local decimals.\n /// @param _amountSD The amount in shared decimals.\n /// @return amountLD The amount in local decimals.\n function _toLD(uint64 _amountSD) internal view virtual returns (uint256 amountLD) {\n return _amountSD * decimalConversionRate;\n }\n\n /// @dev Internal function to convert an amount from local decimals into shared decimals.\n /// @param _amountLD The amount in local decimals.\n /// @return amountSD The amount in shared decimals.\n function _toSD(uint256 _amountLD) internal view virtual returns (uint64 amountSD) {\n return uint64(_amountLD / decimalConversionRate);\n }\n\n /// @dev Internal function to mock the amount mutation from a OFT debit() operation.\n /// @param _amountLD The amount to send in local decimals.\n /// @param _minAmountLD The minimum amount to send in local decimals.\n /// @dev _dstEid The destination endpoint ID.\n /// @return amountSentLD The amount sent, in local decimals.\n /// @return amountReceivedLD The amount to be received on the remote chain, in local decimals.\n /// @dev This is where things like fees would be calculated and deducted from the amount to be received on the remote.\n function _debitView(\n uint256 _amountLD,\n uint256 _minAmountLD,\n uint32 /*_dstEid*/\n ) internal view virtual returns (uint256 amountSentLD, uint256 amountReceivedLD) {\n // @dev Remove the dust so nothing is lost on the conversion between chains with different decimals for the token.\n amountSentLD = _removeDust(_amountLD);\n // @dev The amount to send is the same as amount received in the default implementation.\n amountReceivedLD = amountSentLD;\n\n // @dev Check for slippage.\n if (amountReceivedLD < _minAmountLD) {\n revert SlippageExceeded(amountReceivedLD, _minAmountLD);\n }\n }\n\n /// @dev Internal function to perform a debit operation.\n /// @param _from The address to debit.\n /// @param _amountLD The amount to send in local decimals.\n /// @param _minAmountLD The minimum amount to send in local decimals.\n /// @param _dstEid The destination endpoint ID.\n /// @return amountSentLD The amount sent in local decimals.\n /// @return amountReceivedLD The amount received in local decimals on the remote.\n /// @dev Defined here but are intended to be overriden depending on the OFT implementation.\n /// @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD.\n function _debit(\n address _from,\n uint256 _amountLD,\n uint256 _minAmountLD,\n uint32 _dstEid\n ) internal virtual returns (uint256 amountSentLD, uint256 amountReceivedLD);\n\n /// @dev Internal function to perform a credit operation.\n /// @param _to The address to credit.\n /// @param _amountLD The amount to credit in local decimals.\n /// @param _srcEid The source endpoint ID.\n /// @return amountReceivedLD The amount ACTUALLY received in local decimals.\n /// @dev Defined here but are intended to be overriden depending on the OFT implementation.\n /// @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD.\n\n function _credit(\n address _to,\n uint256 _amountLD,\n uint32 _srcEid\n ) internal virtual returns (uint256 amountReceivedLD);\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/OFTAdapterForSand.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport {SendParam, OFTReceipt, MessagingReceipt, MessagingFee} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol\";\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport {Context} from \"@openzeppelin/contracts/utils/Context.sol\";\nimport {OFTAdapter} from \"./oft/OFTAdapter.sol\";\nimport {WithAdmin} from \"./sand/WithAdmin.sol\";\nimport {ERC2771Handler} from \"./sand/ERC2771Handler.sol\";\n\n/// @title OFTAdapterForSand\n/// @author The Sandbox\n/// @dev contract to be used with non-upgradable SAND contract\ncontract OFTAdapterForSand is OFTAdapter, WithAdmin, ERC2771Handler {\n bool internal _enabled;\n\n /// @notice Emitted when the enabled state changes\n /// @param enabled The new enabled state\n event Enabled(bool enabled);\n\n /// @notice Custom error thrown when the send function is called while disabled\n error SendFunctionDisabled();\n\n /// @param sandToken SAND token address on the same network as the OFT Adapter\n /// @param layerZeroEndpoint local endpoint address\n /// @param owner owner used as a delegate in LayerZero Endpoint\n /// @param trustedForwarder trusted forwarder address\n constructor(\n address sandToken,\n address layerZeroEndpoint,\n address owner,\n address trustedForwarder,\n address admin\n ) OFTAdapter(sandToken, layerZeroEndpoint, owner) Ownable(owner) {\n __ERC2771Handler_initialize(trustedForwarder);\n _changeAdmin(admin);\n _enable(true);\n }\n\n /// @notice Change the address of the trusted forwarder for meta-TX.\n /// @param trustedForwarder The new trustedForwarder.\n function setTrustedForwarder(address trustedForwarder) external onlyOwner {\n _trustedForwarder = trustedForwarder;\n }\n\n function enable(bool enabled) external onlyAdmin {\n _enable(enabled);\n }\n\n function getEnabled() external view returns (bool) {\n return _enabled;\n }\n\n function send(\n SendParam calldata _sendParam,\n MessagingFee calldata _fee,\n address _refundAddress\n ) public payable virtual override returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) {\n if (!_enabled) {\n revert SendFunctionDisabled();\n }\n\n super.send(_sendParam, _fee, _refundAddress);\n }\n\n function _enable(bool enabled) internal {\n _enabled = enabled;\n emit Enabled(_enabled);\n }\n\n function _msgSender() internal view override(ERC2771Handler, Context) returns (address sender) {\n return ERC2771Handler._msgSender();\n }\n\n function _msgData() internal view override(ERC2771Handler, Context) returns (bytes calldata) {\n return ERC2771Handler._msgData();\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport {SendParam, OFTReceipt, MessagingReceipt, MessagingFee} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol\";\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport {Context} from \"@openzeppelin/contracts/utils/Context.sol\";\nimport {OFTCore} from \"./oft/OFTCore.sol\";\nimport {ERC2771Handler} from \"./sand/ERC2771Handler.sol\";\nimport {SandBaseToken} from \"./sand/SandBaseToken.sol\";\n\n/// @title OFTSand\n/// @author The Sandbox\n/// @dev OFTSand is a contract that combines SandBaseToken, ERC2771Handler, and OFTCore functionalities.\n/// @dev It provides a token contract implementation of Sand token with LayerZero compatibility.\ncontract OFTSand is SandBaseToken, ERC2771Handler, OFTCore {\n bool internal _enabled;\n\n /// @notice Emitted when the enabled state changes\n /// @param enabled The new enabled state\n event Enabled(bool enabled);\n\n /// @notice Custom error thrown when the send function is called while disabled\n error SendFunctionDisabled();\n\n constructor(\n address trustedForwarder,\n address sandAdmin,\n address executionAdmin,\n address layerZeroEndpoint,\n address owner\n ) SandBaseToken(sandAdmin, executionAdmin, address(0), 0) OFTCore(18, layerZeroEndpoint, owner) Ownable(owner) {\n __ERC2771Handler_initialize(trustedForwarder);\n _enable(true);\n }\n\n /// @notice Change the address of the trusted forwarder for meta-TX.\n /// @param trustedForwarder The new trustedForwarder.\n function setTrustedForwarder(address trustedForwarder) external onlyOwner {\n _trustedForwarder = trustedForwarder;\n }\n\n function enable(bool enabled) external onlyAdmin {\n _enable(enabled);\n }\n\n function getEnabled() external view returns (bool) {\n return _enabled;\n }\n\n /// @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\n /// @return requiresApproval Needs approval of the underlying token implementation.\n /// @dev In the case of OFT where the contract IS the token, approval is NOT required.\n function approvalRequired() external pure virtual returns (bool) {\n return false;\n }\n\n /// @dev Retrieves the address of the underlying ERC20 implementation.\n /// @return The address of the OFT token.\n /// @dev In the case of OFT, address(this) and erc20 are the same contract.\n function token() external view returns (address) {\n return address(this);\n }\n\n function send(\n SendParam calldata _sendParam,\n MessagingFee calldata _fee,\n address _refundAddress\n ) public payable virtual override returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) {\n if (!_enabled) {\n revert SendFunctionDisabled();\n }\n\n super.send(_sendParam, _fee, _refundAddress);\n }\n\n function _enable(bool enabled) internal {\n _enabled = enabled;\n emit Enabled(_enabled);\n }\n\n /// @dev Burns tokens from the sender's specified balance.\n /// @param _from The address to debit the tokens from.\n /// @param _amountLD The amount of tokens to send in local decimals.\n /// @param _minAmountLD The minimum amount to send in local decimals.\n /// @param _dstEid The destination chain ID.\n /// @return amountSentLD The amount sent in local decimals.\n /// @return amountReceivedLD The amount received in local decimals on the remote.\n function _debit(\n address _from,\n uint256 _amountLD,\n uint256 _minAmountLD,\n uint32 _dstEid\n ) internal virtual override returns (uint256 amountSentLD, uint256 amountReceivedLD) {\n (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid);\n\n // @dev In NON-default OFT, amountSentLD could be 100, with a 10% fee, the amountReceivedLD amount is 90,\n // therefore amountSentLD CAN differ from amountReceivedLD.\n\n // @dev Default OFT burns on src.\n _burn(_from, amountSentLD);\n }\n\n /// @dev Credits tokens to the specified address.\n /// @param _to The address to credit the tokens to.\n /// @param _amountLD The amount of tokens to credit in local decimals.\n /// @dev _srcEid The source chain ID.\n /// @return amountReceivedLD The amount of tokens ACTUALLY received in local decimals.\n function _credit(\n address _to,\n uint256 _amountLD,\n uint32 /*_srcEid*/\n ) internal virtual override returns (uint256 amountReceivedLD) {\n // @dev Default OFT mints on dst.\n _mint(_to, _amountLD);\n // @dev In the case of NON-default OFT, the _amountLD MIGHT not be == amountReceivedLD.\n return _amountLD;\n }\n\n function _msgSender() internal view override(ERC2771Handler, Context) returns (address sender) {\n return ERC2771Handler._msgSender();\n }\n\n function _msgData() internal view override(ERC2771Handler, Context) returns (bytes calldata) {\n return ERC2771Handler._msgData();\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/ERC20BaseToken.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport {Context} from \"@openzeppelin/contracts/utils/Context.sol\";\nimport {IERC20Errors} from \"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\";\nimport {ERC20Internal} from \"./ERC20Internal.sol\";\nimport {IErrors} from \"../interfaces/IErrors.sol\";\nimport {IERC20, IERC20Extended} from \"../interfaces/IERC20Extended.sol\";\nimport {WithSuperOperators} from \"./WithSuperOperators.sol\";\n\nabstract contract ERC20BaseToken is\n IErrors,\n WithSuperOperators,\n IERC20,\n IERC20Extended,\n IERC20Errors,\n ERC20Internal,\n Context\n{\n string internal _name;\n string internal _symbol;\n address internal immutable _operator;\n uint256 internal _totalSupply;\n mapping(address => uint256) internal _balances;\n mapping(address => mapping(address => uint256)) internal _allowances;\n\n constructor(string memory tokenName, string memory tokenSymbol, address admin, address operator) {\n _name = tokenName;\n _symbol = tokenSymbol;\n _admin = admin;\n _operator = operator;\n }\n\n /// @notice Transfer `amount` tokens to `to`.\n /// @param to The recipient address of the tokens being transfered.\n /// @param amount The number of tokens being transfered.\n /// @return success Whether or not the transfer succeeded.\n function transfer(address to, uint256 amount) external override returns (bool success) {\n _transfer(_msgSender(), to, amount);\n return true;\n }\n\n /// @notice Transfer `amount` tokens from `from` to `to`.\n /// @param from The origin address of the tokens being transferred.\n /// @param to The recipient address of the tokensbeing transfered.\n /// @param amount The number of tokens transfered.\n /// @return success Whether or not the transfer succeeded.\n function transferFrom(address from, address to, uint256 amount) external override returns (bool success) {\n if (_msgSender() != from && !_superOperators[_msgSender()] && _msgSender() != _operator) {\n uint256 currentAllowance = _allowances[from][_msgSender()];\n if (currentAllowance != ~uint256(0)) {\n // save gas when allowance is maximal by not reducing it (see https://github.com/ethereum/EIPs/issues/717)\n if (currentAllowance < amount) {\n revert ERC20InsufficientAllowance(_msgSender(), currentAllowance, amount);\n }\n _allowances[from][_msgSender()] = currentAllowance - amount;\n }\n }\n _transfer(from, to, amount);\n return true;\n }\n\n /// @notice Burn `amount` tokens.\n /// @param amount The number of tokens to burn.\n function burn(uint256 amount) external override {\n _burn(_msgSender(), amount);\n }\n\n /// @notice Burn `amount` tokens from `owner`.\n /// @param from The address whose token to burn.\n /// @param amount The number of tokens to burn.\n function burnFor(address from, uint256 amount) external override {\n _burn(from, amount);\n }\n\n /// @notice Approve `spender` to transfer `amount` tokens.\n /// @param spender The address to be given rights to transfer.\n /// @param amount The number of tokens allowed.\n /// @return success Whether or not the call succeeded.\n function approve(address spender, uint256 amount) external override returns (bool success) {\n _approveFor(_msgSender(), spender, amount);\n return true;\n }\n\n /// @notice Get the name of the token collection.\n /// @return The name of the token collection.\n function name() external view virtual returns (string memory) {\n //added virtual\n return _name;\n }\n\n /// @notice Get the symbol for the token collection.\n /// @return The symbol of the token collection.\n function symbol() external view virtual returns (string memory) {\n //added virtual\n return _symbol;\n }\n\n /// @notice Get the total number of tokens in existence.\n /// @return The total number of tokens in existence.\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n\n /// @notice Get the balance of `owner`.\n /// @param owner The address to query the balance of.\n /// @return The amount owned by `owner`.\n function balanceOf(address owner) external view override returns (uint256) {\n return _balances[owner];\n }\n\n /// @notice Get the allowance of `spender` for `owner`'s tokens.\n /// @param owner The address whose token is allowed.\n /// @param spender The address allowed to transfer.\n /// @return remaining The amount of token `spender` is allowed to transfer on behalf of `owner`.\n function allowance(address owner, address spender) external view override returns (uint256 remaining) {\n return _allowances[owner][spender];\n }\n\n /// @notice Get the number of decimals for the token collection.\n /// @return The number of decimals.\n function decimals() external pure virtual returns (uint8) {\n return uint8(18);\n }\n\n /// @notice Approve `spender` to transfer `amount` tokens from `owner`.\n /// @param owner The address whose token is allowed.\n /// @param spender The address to be given rights to transfer.\n /// @param amount The number of tokens allowed.\n /// @return success Whether or not the call succeeded.\n function approveFor(address owner, address spender, uint256 amount) public override returns (bool success) {\n if (!(_msgSender() == owner || _superOperators[_msgSender()] || _msgSender() == _operator)) {\n revert NotAuthorized();\n }\n _approveFor(owner, spender, amount);\n return true;\n }\n\n /// @notice Increase the allowance for the spender if needed\n /// @param owner The address of the owner of the tokens\n /// @param spender The address wanting to spend tokens\n /// @param amountNeeded The amount requested to spend\n /// @return success Whether or not the call succeeded.\n function addAllowanceIfNeeded(address owner, address spender, uint256 amountNeeded) public returns (bool success) {\n if (!(_msgSender() == owner || _superOperators[_msgSender()] || _msgSender() == _operator)) {\n revert InvalidSender();\n }\n _addAllowanceIfNeeded(owner, spender, amountNeeded);\n return true;\n }\n\n /// @dev See addAllowanceIfNeeded.\n function _addAllowanceIfNeeded(\n address owner,\n address spender,\n uint256 amountNeeded /*(ERC20Internal, ERC20ExecuteExtension, ERC20BasicApproveExtension)*/\n ) internal virtual override {\n if (amountNeeded > 0 && !isSuperOperator(spender) && spender != _operator) {\n uint256 currentAllowance = _allowances[owner][spender];\n if (currentAllowance < amountNeeded) {\n _approveFor(owner, spender, amountNeeded);\n }\n }\n }\n\n /// @dev See approveFor.\n function _approveFor(\n address owner,\n address spender,\n uint256 amount /*(ERC20BasicApproveExtension, ERC20Internal)*/\n ) internal virtual override {\n if (owner == address(0) || spender == address(0)) {\n revert InvalidOwnerOrSpender();\n }\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /// @dev See transfer.\n function _transfer(\n address from,\n address to,\n uint256 amount /*(ERC20Internal, ERC20ExecuteExtension)*/\n ) internal virtual override {\n if (to == address(0) || to == address(this)) {\n revert ERC20InvalidReceiver(to);\n }\n uint256 currentBalance = _balances[from];\n if (currentBalance < amount) {\n revert ERC20InsufficientBalance(from, currentBalance, amount);\n }\n _balances[from] = currentBalance - amount;\n _balances[to] += amount;\n emit Transfer(from, to, amount);\n }\n\n /// @dev Mint tokens for a recipient.\n /// @param to The recipient address.\n /// @param amount The number of token to mint.\n function _mint(address to, uint256 amount) internal {\n if (to == address(0)) {\n revert ERC20InvalidReceiver(to);\n }\n if (amount == 0) {\n revert InvalidAmount();\n }\n uint256 currentTotalSupply = _totalSupply;\n uint256 newTotalSupply = currentTotalSupply + amount;\n if (newTotalSupply <= currentTotalSupply) {\n revert Overflow();\n }\n _totalSupply = newTotalSupply;\n _balances[to] += amount;\n emit Transfer(address(0), to, amount);\n }\n\n /// @dev Burn tokens from an address.\n /// @param from The address whose tokens to burn.\n /// @param amount The number of token to burn.\n function _burn(address from, uint256 amount) internal {\n if (amount == 0) {\n revert InvalidAmount();\n }\n if (_msgSender() != from && !_superOperators[_msgSender()] && _msgSender() != _operator) {\n uint256 currentAllowance = _allowances[from][_msgSender()];\n if (currentAllowance != ~uint256(0)) {\n // save gas when allowance is maximal by not reducing it (see https://github.com/ethereum/EIPs/issues/717)\n if (currentAllowance < amount) {\n revert ERC20InsufficientAllowance(_msgSender(), currentAllowance, amount);\n }\n _allowances[from][_msgSender()] = currentAllowance - amount;\n }\n }\n\n uint256 currentBalance = _balances[from];\n if (currentBalance < amount) {\n revert ERC20InsufficientBalance(from, currentBalance, amount);\n }\n _balances[from] = currentBalance - amount;\n _totalSupply -= amount;\n emit Transfer(from, address(0), amount);\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/ERC20BasicApproveExtension.sol": { + "content": "//SPDX-License-Identifier: MIT\n\npragma solidity 0.8.23;\n\nimport {Context} from \"@openzeppelin/contracts/utils/Context.sol\";\nimport {ERC20Internal} from \"./ERC20Internal.sol\";\nimport {IErrors} from \"../interfaces/IErrors.sol\";\nimport {BytesUtil} from \"../libraries/BytesUtil.sol\";\n\nabstract contract ERC20BasicApproveExtension is IErrors, ERC20Internal, Context {\n /// @notice Approve `target` to spend `amount` and call it with data.\n /// @param target The address to be given rights to transfer and destination of the call.\n /// @param amount The number of tokens allowed.\n /// @param data The bytes for the call.\n /// @return The data of the call.\n function approveAndCall(\n address target,\n uint256 amount,\n bytes calldata data\n ) external payable returns (bytes memory) {\n if (!BytesUtil.doFirstParamEqualsAddress(data, _msgSender())) {\n revert FirstParamNotSender();\n }\n\n _approveFor(_msgSender(), target, amount);\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returnData) = target.call{value: msg.value}(data);\n if (!success) {\n revert CallFailed(string(returnData));\n }\n return returnData;\n }\n\n /// @notice Temporarily approve `target` to spend `amount` and call it with data.\n /// Previous approvals remains unchanged.\n /// @param target The destination of the call, allowed to spend the amount specified\n /// @param amount The number of tokens allowed to spend.\n /// @param data The bytes for the call.\n /// @return The data of the call.\n function paidCall(address target, uint256 amount, bytes calldata data) external payable returns (bytes memory) {\n if (!BytesUtil.doFirstParamEqualsAddress(data, _msgSender())) {\n revert FirstParamNotSender();\n }\n\n if (amount > 0) {\n _addAllowanceIfNeeded(_msgSender(), target, amount);\n }\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returnData) = target.call{value: msg.value}(data);\n if (!success) {\n revert CallFailed(string(returnData));\n }\n\n return returnData;\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/ERC20Internal.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nabstract contract ERC20Internal {\n function _approveFor(address owner, address target, uint256 amount) internal virtual;\n\n function _addAllowanceIfNeeded(address owner, address spender, uint256 amountNeeded) internal virtual;\n\n function _transfer(address from, address to, uint256 amount) internal virtual;\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/ERC2771Handler.sol": { + "content": "// SPDX-License-Identifier: MIT\n// solhint-disable-next-line compiler-version\npragma solidity 0.8.23;\n\n/// @title ERC2771Handler\n/// @author The Sandbox\n/// @notice Handle meta-transactions\n/// @dev minimal ERC2771 handler to keep bytecode-size down\n/// based on: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.6.0/contracts/metatx/ERC2771Context.sol\n/// with an initializer for proxies and a mutable forwarder\nabstract contract ERC2771Handler {\n address internal _trustedForwarder;\n\n event TrustedForwarderSet(address indexed newForwarder);\n\n /// @dev Initializes the contract\n /// @param forwarder trusted forwarder address\n function __ERC2771Handler_initialize(address forwarder) internal {\n _trustedForwarder = forwarder;\n emit TrustedForwarderSet(_trustedForwarder);\n }\n\n /// @notice Checks if an address is a trusted forwarder\n /// @param forwarder address to check\n /// @return is trusted\n function isTrustedForwarder(address forwarder) public view returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n /// @notice Get the current trusted forwarder\n /// @return trustedForwarder address of the trusted forwarder\n function getTrustedForwarder() external view returns (address) {\n return _trustedForwarder;\n }\n\n /// @dev if the call comes from the trusted forwarder, it gets the real sender by checking the encoded address in the data\n /// @return sender address of the real sender\n function _msgSender() internal view virtual returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return msg.sender;\n }\n }\n\n /// @dev if the call comes from the trusted forwarder, it substracts the sender address from `msg.data` to get the real `msg.data`\n /// @return the real `msg.data`\n function _msgData() internal view virtual returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return msg.data;\n }\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/SandBaseToken.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.23;\n\nimport {ERC20BasicApproveExtension} from \"./ERC20BasicApproveExtension.sol\";\nimport {ERC20BaseToken} from \"./ERC20BaseToken.sol\";\n\ncontract SandBaseToken is ERC20BaseToken, ERC20BasicApproveExtension {\n constructor(\n address sandAdmin,\n address executionAdmin,\n address beneficiary,\n uint256 amount\n ) ERC20BaseToken(\"SAND\", \"SAND\", sandAdmin, executionAdmin) {\n _changeAdmin(sandAdmin);\n if (beneficiary != address(0)) {\n uint256 initialSupply = amount * (1 ether);\n _mint(beneficiary, initialSupply);\n }\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/WithAdmin.sol": { + "content": "//SPDX-License-Identifier: MIT\n// solhint-disable-next-line compiler-version\npragma solidity 0.8.23;\n\nimport {IErrors} from \"../interfaces/IErrors.sol\";\n\ncontract WithAdmin is IErrors {\n address internal _admin;\n\n /// @dev Emits when the contract administrator is changed.\n /// @param oldAdmin The address of the previous administrator.\n /// @param newAdmin The address of the new administrator.\n event AdminChanged(address indexed oldAdmin, address indexed newAdmin);\n\n modifier onlyAdmin() {\n if (msg.sender != _admin) {\n revert OnlyAdmin();\n }\n _;\n }\n\n /// @dev Get the current administrator of this contract.\n /// @return The current administrator of this contract.\n function getAdmin() external view returns (address) {\n return _admin;\n }\n\n /// @dev Change the administrator to be `newAdmin`.\n /// @param newAdmin The address of the new administrator.\n function changeAdmin(address newAdmin) external onlyAdmin {\n _changeAdmin(newAdmin);\n }\n\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_admin, newAdmin);\n _admin = newAdmin;\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/WithSuperOperators.sol": { + "content": "//SPDX-License-Identifier: MIT\n// solhint-disable-next-line compiler-version\npragma solidity 0.8.23;\n\nimport {IErrors} from \"../interfaces/IErrors.sol\";\nimport {WithAdmin} from \"./WithAdmin.sol\";\n\ncontract WithSuperOperators is IErrors, WithAdmin {\n mapping(address => bool) internal _superOperators;\n\n event SuperOperator(address indexed superOperator, bool indexed enabled);\n\n /// @notice Enable or disable the ability of `superOperator` to transfer tokens of all (superOperator rights).\n /// @param superOperator address that will be given/removed superOperator right.\n /// @param enabled set whether the superOperator is enabled or disabled.\n function setSuperOperator(address superOperator, bool enabled) external onlyAdmin {\n _superOperators[superOperator] = enabled;\n emit SuperOperator(superOperator, enabled);\n }\n\n /// @notice check whether address `who` is given superOperator rights.\n /// @param who The address to query.\n /// @return whether the address has superOperator rights.\n function isSuperOperator(address who) public view returns (bool) {\n return _superOperators[who];\n }\n}\n" + }, + "solidity-bytes-utils/contracts/BytesLib.sol": { + "content": "// SPDX-License-Identifier: Unlicense\n/*\n * @title Solidity Bytes Arrays Utils\n * @author Gonçalo Sá \n *\n * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.\n * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.\n */\npragma solidity >=0.8.0 <0.9.0;\n\n\nlibrary BytesLib {\n function concat(\n bytes memory _preBytes,\n bytes memory _postBytes\n )\n internal\n pure\n returns (bytes memory)\n {\n bytes memory tempBytes;\n\n assembly {\n // Get a location of some free memory and store it in tempBytes as\n // Solidity does for memory variables.\n tempBytes := mload(0x40)\n\n // Store the length of the first bytes array at the beginning of\n // the memory for tempBytes.\n let length := mload(_preBytes)\n mstore(tempBytes, length)\n\n // Maintain a memory counter for the current write location in the\n // temp bytes array by adding the 32 bytes for the array length to\n // the starting location.\n let mc := add(tempBytes, 0x20)\n // Stop copying when the memory counter reaches the length of the\n // first bytes array.\n let end := add(mc, length)\n\n for {\n // Initialize a copy counter to the start of the _preBytes data,\n // 32 bytes into its memory.\n let cc := add(_preBytes, 0x20)\n } lt(mc, end) {\n // Increase both counters by 32 bytes each iteration.\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n // Write the _preBytes data into the tempBytes memory 32 bytes\n // at a time.\n mstore(mc, mload(cc))\n }\n\n // Add the length of _postBytes to the current length of tempBytes\n // and store it as the new length in the first 32 bytes of the\n // tempBytes memory.\n length := mload(_postBytes)\n mstore(tempBytes, add(length, mload(tempBytes)))\n\n // Move the memory counter back from a multiple of 0x20 to the\n // actual end of the _preBytes data.\n mc := end\n // Stop copying when the memory counter reaches the new combined\n // length of the arrays.\n end := add(mc, length)\n\n for {\n let cc := add(_postBytes, 0x20)\n } lt(mc, end) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n mstore(mc, mload(cc))\n }\n\n // Update the free-memory pointer by padding our last write location\n // to 32 bytes: add 31 bytes to the end of tempBytes to move to the\n // next 32 byte block, then round down to the nearest multiple of\n // 32. If the sum of the length of the two arrays is zero then add\n // one before rounding down to leave a blank 32 bytes (the length block with 0).\n mstore(0x40, and(\n add(add(end, iszero(add(length, mload(_preBytes)))), 31),\n not(31) // Round down to the nearest 32 bytes.\n ))\n }\n\n return tempBytes;\n }\n\n function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {\n assembly {\n // Read the first 32 bytes of _preBytes storage, which is the length\n // of the array. (We don't need to use the offset into the slot\n // because arrays use the entire slot.)\n let fslot := sload(_preBytes.slot)\n // Arrays of 31 bytes or less have an even value in their slot,\n // while longer arrays have an odd value. The actual length is\n // the slot divided by two for odd values, and the lowest order\n // byte divided by two for even values.\n // If the slot is even, bitwise and the slot with 255 and divide by\n // two to get the length. If the slot is odd, bitwise and the slot\n // with -1 and divide by two.\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\n let mlength := mload(_postBytes)\n let newlength := add(slength, mlength)\n // slength can contain both the length and contents of the array\n // if length < 32 bytes so let's prepare for that\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\n switch add(lt(slength, 32), lt(newlength, 32))\n case 2 {\n // Since the new array still fits in the slot, we just need to\n // update the contents of the slot.\n // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length\n sstore(\n _preBytes.slot,\n // all the modifications to the slot are inside this\n // next block\n add(\n // we can just add to the slot contents because the\n // bytes we want to change are the LSBs\n fslot,\n add(\n mul(\n div(\n // load the bytes from memory\n mload(add(_postBytes, 0x20)),\n // zero all bytes to the right\n exp(0x100, sub(32, mlength))\n ),\n // and now shift left the number of bytes to\n // leave space for the length in the slot\n exp(0x100, sub(32, newlength))\n ),\n // increase length by the double of the memory\n // bytes length\n mul(mlength, 2)\n )\n )\n )\n }\n case 1 {\n // The stored value fits in the slot, but the combined value\n // will exceed it.\n // get the keccak hash to get the contents of the array\n mstore(0x0, _preBytes.slot)\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\n\n // save new length\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\n\n // The contents of the _postBytes array start 32 bytes into\n // the structure. Our first read should obtain the `submod`\n // bytes that can fit into the unused space in the last word\n // of the stored array. To get this, we read 32 bytes starting\n // from `submod`, so the data we read overlaps with the array\n // contents by `submod` bytes. Masking the lowest-order\n // `submod` bytes allows us to add that value directly to the\n // stored value.\n\n let submod := sub(32, slength)\n let mc := add(_postBytes, submod)\n let end := add(_postBytes, mlength)\n let mask := sub(exp(0x100, submod), 1)\n\n sstore(\n sc,\n add(\n and(\n fslot,\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\n ),\n and(mload(mc), mask)\n )\n )\n\n for {\n mc := add(mc, 0x20)\n sc := add(sc, 1)\n } lt(mc, end) {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } {\n sstore(sc, mload(mc))\n }\n\n mask := exp(0x100, sub(mc, end))\n\n sstore(sc, mul(div(mload(mc), mask), mask))\n }\n default {\n // get the keccak hash to get the contents of the array\n mstore(0x0, _preBytes.slot)\n // Start copying to the last used word of the stored array.\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\n\n // save new length\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\n\n // Copy over the first `submod` bytes of the new data as in\n // case 1 above.\n let slengthmod := mod(slength, 32)\n let mlengthmod := mod(mlength, 32)\n let submod := sub(32, slengthmod)\n let mc := add(_postBytes, submod)\n let end := add(_postBytes, mlength)\n let mask := sub(exp(0x100, submod), 1)\n\n sstore(sc, add(sload(sc), and(mload(mc), mask)))\n\n for {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } lt(mc, end) {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } {\n sstore(sc, mload(mc))\n }\n\n mask := exp(0x100, sub(mc, end))\n\n sstore(sc, mul(div(mload(mc), mask), mask))\n }\n }\n }\n\n function slice(\n bytes memory _bytes,\n uint256 _start,\n uint256 _length\n )\n internal\n pure\n returns (bytes memory)\n {\n require(_length + 31 >= _length, \"slice_overflow\");\n require(_bytes.length >= _start + _length, \"slice_outOfBounds\");\n\n bytes memory tempBytes;\n\n assembly {\n switch iszero(_length)\n case 0 {\n // Get a location of some free memory and store it in tempBytes as\n // Solidity does for memory variables.\n tempBytes := mload(0x40)\n\n // The first word of the slice result is potentially a partial\n // word read from the original array. To read it, we calculate\n // the length of that partial word and start copying that many\n // bytes into the array. The first word we copy will start with\n // data we don't care about, but the last `lengthmod` bytes will\n // land at the beginning of the contents of the new array. When\n // we're done copying, we overwrite the full first word with\n // the actual length of the slice.\n let lengthmod := and(_length, 31)\n\n // The multiplication in the next line is necessary\n // because when slicing multiples of 32 bytes (lengthmod == 0)\n // the following copy loop was copying the origin's length\n // and then ending prematurely not copying everything it should.\n let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))\n let end := add(mc, _length)\n\n for {\n // The multiplication in the next line has the same exact purpose\n // as the one above.\n let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)\n } lt(mc, end) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n mstore(mc, mload(cc))\n }\n\n mstore(tempBytes, _length)\n\n //update free-memory pointer\n //allocating the array padded to 32 bytes like the compiler does now\n mstore(0x40, and(add(mc, 31), not(31)))\n }\n //if we want a zero-length slice let's just return a zero-length array\n default {\n tempBytes := mload(0x40)\n //zero out the 32 bytes slice we are about to return\n //we need to do it because Solidity does not garbage collect\n mstore(tempBytes, 0)\n\n mstore(0x40, add(tempBytes, 0x20))\n }\n }\n\n return tempBytes;\n }\n\n function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {\n require(_bytes.length >= _start + 20, \"toAddress_outOfBounds\");\n address tempAddress;\n\n assembly {\n tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\n }\n\n return tempAddress;\n }\n\n function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {\n require(_bytes.length >= _start + 1 , \"toUint8_outOfBounds\");\n uint8 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x1), _start))\n }\n\n return tempUint;\n }\n\n function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) {\n require(_bytes.length >= _start + 2, \"toUint16_outOfBounds\");\n uint16 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x2), _start))\n }\n\n return tempUint;\n }\n\n function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) {\n require(_bytes.length >= _start + 4, \"toUint32_outOfBounds\");\n uint32 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x4), _start))\n }\n\n return tempUint;\n }\n\n function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) {\n require(_bytes.length >= _start + 8, \"toUint64_outOfBounds\");\n uint64 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x8), _start))\n }\n\n return tempUint;\n }\n\n function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) {\n require(_bytes.length >= _start + 12, \"toUint96_outOfBounds\");\n uint96 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0xc), _start))\n }\n\n return tempUint;\n }\n\n function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {\n require(_bytes.length >= _start + 16, \"toUint128_outOfBounds\");\n uint128 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x10), _start))\n }\n\n return tempUint;\n }\n\n function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {\n require(_bytes.length >= _start + 32, \"toUint256_outOfBounds\");\n uint256 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x20), _start))\n }\n\n return tempUint;\n }\n\n function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) {\n require(_bytes.length >= _start + 32, \"toBytes32_outOfBounds\");\n bytes32 tempBytes32;\n\n assembly {\n tempBytes32 := mload(add(add(_bytes, 0x20), _start))\n }\n\n return tempBytes32;\n }\n\n function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\n bool success = true;\n\n assembly {\n let length := mload(_preBytes)\n\n // if lengths don't match the arrays are not equal\n switch eq(length, mload(_postBytes))\n case 1 {\n // cb is a circuit breaker in the for loop since there's\n // no said feature for inline assembly loops\n // cb = 1 - don't breaker\n // cb = 0 - break\n let cb := 1\n\n let mc := add(_preBytes, 0x20)\n let end := add(mc, length)\n\n for {\n let cc := add(_postBytes, 0x20)\n // the next line is the loop condition:\n // while(uint256(mc < end) + cb == 2)\n } eq(add(lt(mc, end), cb), 2) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n // if any of these checks fails then arrays are not equal\n if iszero(eq(mload(mc), mload(cc))) {\n // unsuccess:\n success := 0\n cb := 0\n }\n }\n }\n default {\n // unsuccess:\n success := 0\n }\n }\n\n return success;\n }\n\n function equal_nonAligned(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\n bool success = true;\n\n assembly {\n let length := mload(_preBytes)\n\n // if lengths don't match the arrays are not equal\n switch eq(length, mload(_postBytes))\n case 1 {\n // cb is a circuit breaker in the for loop since there's\n // no said feature for inline assembly loops\n // cb = 1 - don't breaker\n // cb = 0 - break\n let cb := 1\n\n let endMinusWord := add(_preBytes, length)\n let mc := add(_preBytes, 0x20)\n let cc := add(_postBytes, 0x20)\n\n for {\n // the next line is the loop condition:\n // while(uint256(mc < endWord) + cb == 2)\n } eq(add(lt(mc, endMinusWord), cb), 2) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n // if any of these checks fails then arrays are not equal\n if iszero(eq(mload(mc), mload(cc))) {\n // unsuccess:\n success := 0\n cb := 0\n }\n }\n\n // Only if still successful\n // For <1 word tail bytes\n if gt(success, 0) {\n // Get the remainder of length/32\n // length % 32 = AND(length, 32 - 1)\n let numTailBytes := and(length, 0x1f)\n let mcRem := mload(mc)\n let ccRem := mload(cc)\n for {\n let i := 0\n // the next line is the loop condition:\n // while(uint256(i < numTailBytes) + cb == 2)\n } eq(add(lt(i, numTailBytes), cb), 2) {\n i := add(i, 1)\n } {\n if iszero(eq(byte(i, mcRem), byte(i, ccRem))) {\n // unsuccess:\n success := 0\n cb := 0\n }\n }\n }\n }\n default {\n // unsuccess:\n success := 0\n }\n }\n\n return success;\n }\n\n function equalStorage(\n bytes storage _preBytes,\n bytes memory _postBytes\n )\n internal\n view\n returns (bool)\n {\n bool success = true;\n\n assembly {\n // we know _preBytes_offset is 0\n let fslot := sload(_preBytes.slot)\n // Decode the length of the stored array like in concatStorage().\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\n let mlength := mload(_postBytes)\n\n // if lengths don't match the arrays are not equal\n switch eq(slength, mlength)\n case 1 {\n // slength can contain both the length and contents of the array\n // if length < 32 bytes so let's prepare for that\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\n if iszero(iszero(slength)) {\n switch lt(slength, 32)\n case 1 {\n // blank the last byte which is the length\n fslot := mul(div(fslot, 0x100), 0x100)\n\n if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {\n // unsuccess:\n success := 0\n }\n }\n default {\n // cb is a circuit breaker in the for loop since there's\n // no said feature for inline assembly loops\n // cb = 1 - don't breaker\n // cb = 0 - break\n let cb := 1\n\n // get the keccak hash to get the contents of the array\n mstore(0x0, _preBytes.slot)\n let sc := keccak256(0x0, 0x20)\n\n let mc := add(_postBytes, 0x20)\n let end := add(mc, mlength)\n\n // the next line is the loop condition:\n // while(uint256(mc < end) + cb == 2)\n for {} eq(add(lt(mc, end), cb), 2) {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } {\n if iszero(eq(sload(sc), mload(mc))) {\n // unsuccess:\n success := 0\n cb := 0\n }\n }\n }\n }\n }\n default {\n // unsuccess:\n success := 0\n }\n }\n\n return success;\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 2000 + }, + "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/packages/deploy/deployments/mainnet/OFTAdapterForSand.json b/packages/deploy/deployments/mainnet/OFTAdapterForSand.json new file mode 100644 index 0000000000..00540b681e --- /dev/null +++ b/packages/deploy/deployments/mainnet/OFTAdapterForSand.json @@ -0,0 +1,2129 @@ +{ + "address": "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "sandToken", + "type": "address" + }, + { + "internalType": "address", + "name": "layerZeroEndpoint", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "trustedForwarder", + "type": "address" + }, + { + "internalType": "address", + "name": "admin", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "AddressInsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "message", + "type": "string" + } + ], + "name": "CallFailed", + "type": "error" + }, + { + "inputs": [], + "name": "FailedInnerCall", + "type": "error" + }, + { + "inputs": [], + "name": "FirstParamNotSender", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidDelegate", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidEndpointCall", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidLocalDecimals", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "options", + "type": "bytes" + } + ], + "name": "InvalidOptions", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidOwnerOrSpender", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidSender", + "type": "error" + }, + { + "inputs": [], + "name": "LzTokenUnavailable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + } + ], + "name": "NoPeer", + "type": "error" + }, + { + "inputs": [], + "name": "NotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "msgValue", + "type": "uint256" + } + ], + "name": "NotEnoughNative", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyAdmin", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "OnlyEndpoint", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + } + ], + "name": "OnlyPeer", + "type": "error" + }, + { + "inputs": [], + "name": "OnlySelf", + "type": "error" + }, + { + "inputs": [], + "name": "Overflow", + "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": "address", + "name": "token", + "type": "address" + } + ], + "name": "SafeERC20FailedOperation", + "type": "error" + }, + { + "inputs": [], + "name": "SendFunctionDisabled", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "result", + "type": "bytes" + } + ], + "name": "SimulationResult", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountLD", + "type": "uint256" + } + ], + "name": "SlippageExceeded", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "Enabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "internalType": "uint16", + "name": "msgType", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "options", + "type": "bytes" + } + ], + "indexed": false, + "internalType": "struct EnforcedOptionParam[]", + "name": "_enforcedOptions", + "type": "tuple[]" + } + ], + "name": "EnforcedOptionSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "inspector", + "type": "address" + } + ], + "name": "MsgInspectorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "indexed": true, + "internalType": "address", + "name": "toAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountReceivedLD", + "type": "uint256" + } + ], + "name": "OFTReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "indexed": true, + "internalType": "address", + "name": "fromAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountSentLD", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountReceivedLD", + "type": "uint256" + } + ], + "name": "OFTSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "peer", + "type": "bytes32" + } + ], + "name": "PeerSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "preCrimeAddress", + "type": "address" + } + ], + "name": "PreCrimeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newForwarder", + "type": "address" + } + ], + "name": "TrustedForwarderSet", + "type": "event" + }, + { + "inputs": [], + "name": "SEND", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "SEND_AND_CALL", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "origin", + "type": "tuple" + } + ], + "name": "allowInitializePath", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "approvalRequired", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "uint16", + "name": "_msgType", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_extraOptions", + "type": "bytes" + } + ], + "name": "combineOptions", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimalConversionRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "enable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "endpoint", + "outputs": [ + { + "internalType": "contract ILayerZeroEndpointV2", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "internalType": "uint16", + "name": "msgType", + "type": "uint16" + } + ], + "name": "enforcedOptions", + "outputs": [ + { + "internalType": "bytes", + "name": "enforcedOption", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getTrustedForwarder", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "", + "type": "tuple" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_sender", + "type": "address" + } + ], + "name": "isComposeMsgSender", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_peer", + "type": "bytes32" + } + ], + "name": "isPeer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "forwarder", + "type": "address" + } + ], + "name": "isTrustedForwarder", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_executor", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "lzReceive", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "origin", + "type": "tuple" + }, + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "address", + "name": "executor", + "type": "address" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + } + ], + "internalType": "struct InboundPacket[]", + "name": "_packets", + "type": "tuple[]" + } + ], + "name": "lzReceiveAndRevert", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "address", + "name": "_executor", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "lzReceiveSimulate", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "msgInspector", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "nextNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oApp", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oAppVersion", + "outputs": [ + { + "internalType": "uint64", + "name": "senderVersion", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "receiverVersion", + "type": "uint64" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "oftVersion", + "outputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + }, + { + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + } + ], + "name": "peers", + "outputs": [ + { + "internalType": "bytes32", + "name": "peer", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "preCrime", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "to", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "amountLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountLD", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "extraOptions", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "composeMsg", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "oftCmd", + "type": "bytes" + } + ], + "internalType": "struct SendParam", + "name": "_sendParam", + "type": "tuple" + } + ], + "name": "quoteOFT", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "minAmountLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxAmountLD", + "type": "uint256" + } + ], + "internalType": "struct OFTLimit", + "name": "oftLimit", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "int256", + "name": "feeAmountLD", + "type": "int256" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "internalType": "struct OFTFeeDetail[]", + "name": "oftFeeDetails", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "amountSentLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountReceivedLD", + "type": "uint256" + } + ], + "internalType": "struct OFTReceipt", + "name": "oftReceipt", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "to", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "amountLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountLD", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "extraOptions", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "composeMsg", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "oftCmd", + "type": "bytes" + } + ], + "internalType": "struct SendParam", + "name": "_sendParam", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "_payInLzToken", + "type": "bool" + } + ], + "name": "quoteSend", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lzTokenFee", + "type": "uint256" + } + ], + "internalType": "struct MessagingFee", + "name": "msgFee", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "to", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "amountLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountLD", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "extraOptions", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "composeMsg", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "oftCmd", + "type": "bytes" + } + ], + "internalType": "struct SendParam", + "name": "_sendParam", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lzTokenFee", + "type": "uint256" + } + ], + "internalType": "struct MessagingFee", + "name": "_fee", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_refundAddress", + "type": "address" + } + ], + "name": "send", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lzTokenFee", + "type": "uint256" + } + ], + "internalType": "struct MessagingFee", + "name": "fee", + "type": "tuple" + } + ], + "internalType": "struct MessagingReceipt", + "name": "msgReceipt", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "amountSentLD", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountReceivedLD", + "type": "uint256" + } + ], + "internalType": "struct OFTReceipt", + "name": "oftReceipt", + "type": "tuple" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "internalType": "uint16", + "name": "msgType", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "options", + "type": "bytes" + } + ], + "internalType": "struct EnforcedOptionParam[]", + "name": "_enforcedOptions", + "type": "tuple[]" + } + ], + "name": "setEnforcedOptions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_msgInspector", + "type": "address" + } + ], + "name": "setMsgInspector", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_peer", + "type": "bytes32" + } + ], + "name": "setPeer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_preCrime", + "type": "address" + } + ], + "name": "setPreCrime", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "trustedForwarder", + "type": "address" + } + ], + "name": "setTrustedForwarder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sharedDecimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x8aad310cced3af2380d233a92530d4a6a46d111b02b79e76474eebbe943bdba1", + "receipt": { + "to": null, + "from": "0xCba49d154b4Bb9a9aD7F5Dad396CB9a0a3a62ABc", + "contractAddress": "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF", + "transactionIndex": 1, + "gasUsed": "2985722", + "logsBloom": "0x00000000800000000000010000000000000000000000000000800000001000020000000020000000000008000000000800000002000000000000000200000000000000000000000000000000000000080001000000000000000000000000000000000000020000000000000000000800000040800010001000000000000000400000000000000000000000000000000000002000000000000400000000800000000000000000000000000000000000000000000000000000000000000000000400000000000000200000021000000000000000000400000000000000000020000000080000000000000000000000000000000000010000000040200000000000", + "blockHash": "0x159b89bd9bd172c79449da8197352137a0fb9b863eaa8c3a5fd1d74f76b07fad", + "transactionHash": "0x8aad310cced3af2380d233a92530d4a6a46d111b02b79e76474eebbe943bdba1", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 20412464, + "transactionHash": "0x8aad310cced3af2380d233a92530d4a6a46d111b02b79e76474eebbe943bdba1", + "address": "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000cba49d154b4bb9a9ad7f5dad396cb9a0a3a62abc" + ], + "data": "0x", + "logIndex": 5, + "blockHash": "0x159b89bd9bd172c79449da8197352137a0fb9b863eaa8c3a5fd1d74f76b07fad" + }, + { + "transactionIndex": 1, + "blockNumber": 20412464, + "transactionHash": "0x8aad310cced3af2380d233a92530d4a6a46d111b02b79e76474eebbe943bdba1", + "address": "0x1a44076050125825900e736c501f859c50fE728c", + "topics": [ + "0x6ee10e9ed4d6ce9742703a498707862f4b00f1396a87195eb93267b3d7983981" + ], + "data": "0x000000000000000000000000ac531eb26ca1d21b85126de8fb87e80e09002dcf000000000000000000000000cba49d154b4bb9a9ad7f5dad396cb9a0a3a62abc", + "logIndex": 6, + "blockHash": "0x159b89bd9bd172c79449da8197352137a0fb9b863eaa8c3a5fd1d74f76b07fad" + }, + { + "transactionIndex": 1, + "blockNumber": 20412464, + "transactionHash": "0x8aad310cced3af2380d233a92530d4a6a46d111b02b79e76474eebbe943bdba1", + "address": "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF", + "topics": [ + "0xd91237492a9e30cd2faf361fc103998a382ff0ec2b1b07dc1cbebb76ae2f1ea2", + "0x00000000000000000000000084a0856b038eaad1cc7e297cf34a7e72685a8693" + ], + "data": "0x", + "logIndex": 7, + "blockHash": "0x159b89bd9bd172c79449da8197352137a0fb9b863eaa8c3a5fd1d74f76b07fad" + }, + { + "transactionIndex": 1, + "blockNumber": 20412464, + "transactionHash": "0x8aad310cced3af2380d233a92530d4a6a46d111b02b79e76474eebbe943bdba1", + "address": "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000006ec4090d0f3cb76d9f3d8c4d5bb058a225e560a1" + ], + "data": "0x", + "logIndex": 8, + "blockHash": "0x159b89bd9bd172c79449da8197352137a0fb9b863eaa8c3a5fd1d74f76b07fad" + }, + { + "transactionIndex": 1, + "blockNumber": 20412464, + "transactionHash": "0x8aad310cced3af2380d233a92530d4a6a46d111b02b79e76474eebbe943bdba1", + "address": "0xac531Eb26Ca1d21b85126De8FB87E80E09002DcF", + "topics": [ + "0x54ca1f89aee2b8d11c89b7813c6aa99caa0f8c55c8eccf8b70c3bb42029fa134" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 9, + "blockHash": "0x159b89bd9bd172c79449da8197352137a0fb9b863eaa8c3a5fd1d74f76b07fad" + } + ], + "blockNumber": 20412464, + "cumulativeGasUsed": "3158367", + "status": 1, + "byzantium": true + }, + "args": [ + "0x3845badAde8e6dFF049820680d1F14bD3903a5d0", + "0x1a44076050125825900e736c501f859c50fE728c", + "0xCba49d154b4Bb9a9aD7F5Dad396CB9a0a3a62ABc", + "0x84a0856b038eaAd1cC7E297cF34A7e72685A8693", + "0x6ec4090d0F3cB76d9f3D8c4D5BB058A225E560a1" + ], + "numDeployments": 1, + "solcInputHash": "4bade374f62f6d78bc3ea2aa3ebdd50f", + "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sandToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"layerZeroEndpoint\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"trustedForwarder\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AddressInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"CallFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FirstParamNotSender\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDelegate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidEndpointCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidLocalDecimals\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"options\",\"type\":\"bytes\"}],\"name\":\"InvalidOptions\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidOwnerOrSpender\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSender\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LzTokenUnavailable\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"}],\"name\":\"NoPeer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotAuthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"msgValue\",\"type\":\"uint256\"}],\"name\":\"NotEnoughNative\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyAdmin\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"OnlyEndpoint\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"}],\"name\":\"OnlyPeer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlySelf\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Overflow\",\"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\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SendFunctionDisabled\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"result\",\"type\":\"bytes\"}],\"name\":\"SimulationResult\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minAmountLD\",\"type\":\"uint256\"}],\"name\":\"SlippageExceeded\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldAdmin\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"Enabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"msgType\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"options\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct EnforcedOptionParam[]\",\"name\":\"_enforcedOptions\",\"type\":\"tuple[]\"}],\"name\":\"EnforcedOptionSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"inspector\",\"type\":\"address\"}],\"name\":\"MsgInspectorSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"guid\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"srcEid\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountReceivedLD\",\"type\":\"uint256\"}],\"name\":\"OFTReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"guid\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"dstEid\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountSentLD\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountReceivedLD\",\"type\":\"uint256\"}],\"name\":\"OFTSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"peer\",\"type\":\"bytes32\"}],\"name\":\"PeerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"preCrimeAddress\",\"type\":\"address\"}],\"name\":\"PreCrimeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newForwarder\",\"type\":\"address\"}],\"name\":\"TrustedForwarderSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"SEND\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SEND_AND_CALL\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"srcEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"struct Origin\",\"name\":\"origin\",\"type\":\"tuple\"}],\"name\":\"allowInitializePath\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"approvalRequired\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_eid\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_msgType\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_extraOptions\",\"type\":\"bytes\"}],\"name\":\"combineOptions\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimalConversionRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"enable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"endpoint\",\"outputs\":[{\"internalType\":\"contract ILayerZeroEndpointV2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"msgType\",\"type\":\"uint16\"}],\"name\":\"enforcedOptions\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"enforcedOption\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getTrustedForwarder\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"srcEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"struct Origin\",\"name\":\"\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"}],\"name\":\"isComposeMsgSender\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_eid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"_peer\",\"type\":\"bytes32\"}],\"name\":\"isPeer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"forwarder\",\"type\":\"address\"}],\"name\":\"isTrustedForwarder\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"srcEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"struct Origin\",\"name\":\"_origin\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"_guid\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_message\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_executor\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"lzReceive\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"srcEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"struct Origin\",\"name\":\"origin\",\"type\":\"tuple\"},{\"internalType\":\"uint32\",\"name\":\"dstEid\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"guid\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct InboundPacket[]\",\"name\":\"_packets\",\"type\":\"tuple[]\"}],\"name\":\"lzReceiveAndRevert\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"srcEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"internalType\":\"struct Origin\",\"name\":\"_origin\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"_guid\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_message\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_executor\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"lzReceiveSimulate\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"msgInspector\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"nextNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"oApp\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"oAppVersion\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"senderVersion\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"receiverVersion\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"oftVersion\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"},{\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"}],\"name\":\"peers\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"peer\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"preCrime\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"dstEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"to\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"amountLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minAmountLD\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraOptions\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"composeMsg\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"oftCmd\",\"type\":\"bytes\"}],\"internalType\":\"struct SendParam\",\"name\":\"_sendParam\",\"type\":\"tuple\"}],\"name\":\"quoteOFT\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"minAmountLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxAmountLD\",\"type\":\"uint256\"}],\"internalType\":\"struct OFTLimit\",\"name\":\"oftLimit\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"int256\",\"name\":\"feeAmountLD\",\"type\":\"int256\"},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"}],\"internalType\":\"struct OFTFeeDetail[]\",\"name\":\"oftFeeDetails\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amountSentLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountReceivedLD\",\"type\":\"uint256\"}],\"internalType\":\"struct OFTReceipt\",\"name\":\"oftReceipt\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"dstEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"to\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"amountLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minAmountLD\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraOptions\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"composeMsg\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"oftCmd\",\"type\":\"bytes\"}],\"internalType\":\"struct SendParam\",\"name\":\"_sendParam\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"_payInLzToken\",\"type\":\"bool\"}],\"name\":\"quoteSend\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nativeFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lzTokenFee\",\"type\":\"uint256\"}],\"internalType\":\"struct MessagingFee\",\"name\":\"msgFee\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"dstEid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"to\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"amountLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minAmountLD\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraOptions\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"composeMsg\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"oftCmd\",\"type\":\"bytes\"}],\"internalType\":\"struct SendParam\",\"name\":\"_sendParam\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nativeFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lzTokenFee\",\"type\":\"uint256\"}],\"internalType\":\"struct MessagingFee\",\"name\":\"_fee\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"_refundAddress\",\"type\":\"address\"}],\"name\":\"send\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"guid\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"nativeFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lzTokenFee\",\"type\":\"uint256\"}],\"internalType\":\"struct MessagingFee\",\"name\":\"fee\",\"type\":\"tuple\"}],\"internalType\":\"struct MessagingReceipt\",\"name\":\"msgReceipt\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amountSentLD\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountReceivedLD\",\"type\":\"uint256\"}],\"internalType\":\"struct OFTReceipt\",\"name\":\"oftReceipt\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_delegate\",\"type\":\"address\"}],\"name\":\"setDelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"msgType\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"options\",\"type\":\"bytes\"}],\"internalType\":\"struct EnforcedOptionParam[]\",\"name\":\"_enforcedOptions\",\"type\":\"tuple[]\"}],\"name\":\"setEnforcedOptions\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_msgInspector\",\"type\":\"address\"}],\"name\":\"setMsgInspector\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_eid\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"_peer\",\"type\":\"bytes32\"}],\"name\":\"setPeer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_preCrime\",\"type\":\"address\"}],\"name\":\"setPreCrime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"trustedForwarder\",\"type\":\"address\"}],\"name\":\"setTrustedForwarder\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sharedDecimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"The Sandbox\",\"details\":\"contract to be used with non-upgradable SAND contract\",\"errors\":{\"AddressEmptyCode(address)\":[{\"details\":\"There's no code at `target` (it is not a contract).\"}],\"AddressInsufficientBalance(address)\":[{\"details\":\"The ETH balance of the account is not enough to perform the operation.\"}],\"CallFailed(string)\":[{\"params\":{\"message\":\"error message returned from the failed call\"}}],\"FailedInnerCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"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.\"}],\"SafeERC20FailedOperation(address)\":[{\"details\":\"An operation with an ERC20 token failed.\"}]},\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emits when the contract administrator is changed.\",\"params\":{\"newAdmin\":\"The address of the new administrator.\",\"oldAdmin\":\"The address of the previous administrator.\"}},\"Enabled(bool)\":{\"params\":{\"enabled\":\"The new enabled state\"}},\"PreCrimeSet(address)\":{\"details\":\"Emitted when the preCrime contract address is set.\",\"params\":{\"preCrimeAddress\":\"The address of the preCrime contract.\"}}},\"kind\":\"dev\",\"methods\":{\"allowInitializePath((uint32,bytes32,uint64))\":{\"details\":\"This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received.This defaults to assuming if a peer has been set, its initialized. Can be overridden by the OApp if there is other logic to determine this.\",\"params\":{\"origin\":\"The origin information containing the source endpoint and sender address.\"},\"returns\":{\"_0\":\"Whether the path has been initialized.\"}},\"approvalRequired()\":{\"details\":\"In the case of default OFTAdapter, approval is required.In non-default OFTAdapter contracts with something like mint and burn privileges, it would NOT need approval.\",\"returns\":{\"_0\":\"requiresApproval Needs approval of the underlying token implementation.\"}},\"changeAdmin(address)\":{\"details\":\"Change the administrator to be `newAdmin`.\",\"params\":{\"newAdmin\":\"The address of the new administrator.\"}},\"combineOptions(uint32,uint16,bytes)\":{\"details\":\"If there is an enforced lzReceive option: - {gasLimit: 200k, msg.value: 1 ether} AND a caller supplies a lzReceive option: {gasLimit: 100k, msg.value: 0.5 ether} - The resulting options will be {gasLimit: 300k, msg.value: 1.5 ether} when the message is executed on the remote lzReceive() function.This presence of duplicated options is handled off-chain in the verifier/executor.\",\"params\":{\"_eid\":\"The endpoint ID.\",\"_extraOptions\":\"Additional options passed by the caller.\",\"_msgType\":\"The OAPP message type.\"},\"returns\":{\"_0\":\"options The combination of caller specified options AND enforced options.\"}},\"constructor\":{\"params\":{\"layerZeroEndpoint\":\"local endpoint address\",\"owner\":\"owner used as a delegate in LayerZero Endpoint\",\"sandToken\":\"SAND token address on the same network as the OFT Adapter\",\"trustedForwarder\":\"trusted forwarder address\"}},\"getAdmin()\":{\"details\":\"Get the current administrator of this contract.\",\"returns\":{\"_0\":\"The current administrator of this contract.\"}},\"getTrustedForwarder()\":{\"returns\":{\"_0\":\"trustedForwarder address of the trusted forwarder\"}},\"isComposeMsgSender((uint32,bytes32,uint64),bytes,address)\":{\"details\":\"_origin The origin information containing the source endpoint and sender address. - srcEid: The source chain endpoint ID. - sender: The sender address on the src chain. - nonce: The nonce of the message._message The lzReceive payload.Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer.The default sender IS the OAppReceiver implementer.\",\"params\":{\"_sender\":\"The sender address.\"},\"returns\":{\"_0\":\"isSender Is a valid sender.\"}},\"isPeer(uint32,bytes32)\":{\"details\":\"Check if the peer is considered 'trusted' by the OApp.Enables OAppPreCrimeSimulator to check whether a potential Inbound Packet is from a trusted source.\",\"params\":{\"_eid\":\"The endpoint ID to check.\",\"_peer\":\"The peer to check.\"},\"returns\":{\"_0\":\"Whether the peer passed is considered 'trusted' by the OApp.\"}},\"isTrustedForwarder(address)\":{\"params\":{\"forwarder\":\"address to check\"},\"returns\":{\"_0\":\"is trusted\"}},\"lzReceive((uint32,bytes32,uint64),bytes32,bytes,address,bytes)\":{\"details\":\"Entry point for receiving messages or packets from the endpoint.Entry point for receiving msg/packet from the LayerZero endpoint.\",\"params\":{\"_executor\":\"The address of the executor for the received message.\",\"_extraData\":\"Additional arbitrary data provided by the corresponding executor.\",\"_guid\":\"The unique identifier for the received LayerZero message.\",\"_message\":\"The payload of the received message.\",\"_origin\":\"The origin information containing the source endpoint and sender address. - srcEid: The source chain endpoint ID. - sender: The sender address on the src chain. - nonce: The nonce of the message.\"}},\"lzReceiveAndRevert(((uint32,bytes32,uint64),uint32,address,bytes32,uint256,address,bytes,bytes)[])\":{\"details\":\"Interface for pre-crime simulations. Always reverts at the end with the simulation results.WARNING: MUST revert at the end with the simulation results.Gives the preCrime implementation the ability to mock sending packets to the lzReceive function, WITHOUT actually executing them.\",\"params\":{\"_packets\":\"An array of InboundPacket objects representing received packets to be delivered.\"}},\"lzReceiveSimulate((uint32,bytes32,uint64),bytes32,bytes,address,bytes)\":{\"details\":\"Is effectively an internal function because msg.sender must be address(this). Allows resetting the call stack for 'internal' calls.\",\"params\":{\"_executor\":\"The executor address for the packet.\",\"_extraData\":\"Additional data for the packet.\",\"_guid\":\"The unique identifier of the packet.\",\"_message\":\"The message payload of the packet.\",\"_origin\":\"The origin information containing the source endpoint and sender address. - srcEid: The source chain endpoint ID. - sender: The sender address on the src chain. - nonce: The nonce of the message.\"}},\"nextNonce(uint32,bytes32)\":{\"details\":\"_srcEid The source endpoint ID._sender The sender address.The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement.Is required by the off-chain executor to determine the OApp expects msg execution is ordered.This is also enforced by the OApp.By default this is NOT enabled. ie. nextNonce is hardcoded to return 0.\",\"returns\":{\"nonce\":\"The next nonce.\"}},\"oApp()\":{\"details\":\"Retrieves the address of the OApp contract.The simulator contract is the base contract for the OApp by default.If the simulator is a separate contract, override this function.\",\"returns\":{\"_0\":\"The address of the OApp contract.\"}},\"oAppVersion()\":{\"returns\":{\"receiverVersion\":\"The version of the OAppReceiver.sol implementation.\",\"senderVersion\":\"The version of the OAppSender.sol implementation.\"}},\"oftVersion()\":{\"details\":\"interfaceId: This specific interface ID is '0x02e49c2c'.version: Indicates a cross-chain compatible msg encoding with other OFTs.If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented. ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\",\"returns\":{\"interfaceId\":\"The interface ID.\",\"version\":\"The version.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"quoteOFT((uint32,bytes32,uint256,uint256,bytes,bytes,bytes))\":{\"params\":{\"_sendParam\":\"The parameters for the send operation.\"},\"returns\":{\"oftFeeDetails\":\"The details of OFT fees.\",\"oftLimit\":\"The OFT limit information.\",\"oftReceipt\":\"The OFT receipt information.\"}},\"quoteSend((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),bool)\":{\"details\":\"MessagingFee: LayerZero msg fee - nativeFee: The native fee. - lzTokenFee: The lzToken fee.\",\"params\":{\"_payInLzToken\":\"Flag indicating whether the caller is paying in the LZ token.\",\"_sendParam\":\"The parameters for the send() operation.\"},\"returns\":{\"msgFee\":\"The calculated LayerZero messaging fee from the send() operation.\"}},\"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.\"},\"send((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),(uint256,uint256),address)\":{\"details\":\"Executes the send operation.MessagingReceipt: LayerZero msg receipt - guid: The unique identifier for the sent message. - nonce: The nonce of the sent message. - fee: The LayerZero fee incurred for the message.\",\"params\":{\"_fee\":\"The calculated fee for the send() operation. - nativeFee: The native fee. - lzTokenFee: The lzToken fee.\",\"_refundAddress\":\"The address to receive any excess funds.\",\"_sendParam\":\"The parameters for the send operation.\"},\"returns\":{\"msgReceipt\":\"The receipt for the send operation.\",\"oftReceipt\":\"The OFT receipt information.\"}},\"setDelegate(address)\":{\"details\":\"Only the owner/admin of the OApp can call this function.Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.\",\"params\":{\"_delegate\":\"The address of the delegate to be set.\"}},\"setEnforcedOptions((uint32,uint16,bytes)[])\":{\"details\":\"Sets the enforced options for specific endpoint and message type combinations.Only the owner/admin of the OApp can call this function.Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.These enforced options can vary as the potential options/execution on the remote may differ as per the msgType. eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().\",\"params\":{\"_enforcedOptions\":\"An array of EnforcedOptionParam structures specifying enforced options.\"}},\"setMsgInspector(address)\":{\"details\":\"Sets the message inspector address for the OFT.This is an optional contract that can be used to inspect both 'message' and 'options'.Set it to address(0) to disable it, or set it to a contract address to enable it.\",\"params\":{\"_msgInspector\":\"The address of the message inspector.\"}},\"setPeer(uint32,bytes32)\":{\"details\":\"Only the owner/admin of the OApp can call this function.Indicates that the peer is trusted to send LayerZero messages to this OApp.Set this to bytes32(0) to remove the peer address.Peer is a bytes32 to accommodate non-evm chains.\",\"params\":{\"_eid\":\"The endpoint ID.\",\"_peer\":\"The address of the peer to be associated with the corresponding endpoint.\"}},\"setPreCrime(address)\":{\"details\":\"Sets the preCrime contract address.\",\"params\":{\"_preCrime\":\"The address of the preCrime contract.\"}},\"setTrustedForwarder(address)\":{\"params\":{\"trustedForwarder\":\"The new trustedForwarder.\"}},\"sharedDecimals()\":{\"details\":\"Retrieves the shared decimals of the OFT.Sets an implicit cap on the amount of tokens, over uint64.max() will need some sort of outbound cap / totalSupply cap Lowest common decimal denominator between chains. Defaults to 6 decimal places to provide up to 18,446,744,073,709.551615 units (max uint64). For tokens exceeding this totalSupply(), they will need to override the sharedDecimals function with something smaller. ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615\",\"returns\":{\"_0\":\"The shared decimals of the OFT.\"}},\"token()\":{\"details\":\"Retrieves the address of the underlying ERC20 implementation.In the case of OFTAdapter, address(this) and erc20 are NOT the same contract.\",\"returns\":{\"_0\":\"The address of the adapted ERC-20 token.\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"OFTAdapterForSand\",\"version\":1},\"userdoc\":{\"errors\":{\"CallFailed(string)\":[{\"notice\":\"Error for failed calls, containing the error message\"}],\"FirstParamNotSender()\":[{\"notice\":\"Error for mismatched first parameter and sender address\"}],\"InvalidAmount()\":[{\"notice\":\"Error for invalid amount\"}],\"InvalidOwnerOrSpender()\":[{\"notice\":\"Error for invalid owner or spender\"}],\"InvalidSender()\":[{\"notice\":\"Error for invalid sender\"}],\"NotAuthorized()\":[{\"notice\":\"Error for unauthorized access\"}],\"OnlyAdmin()\":[{\"notice\":\"Error for admin-only access\"}],\"Overflow()\":[{\"notice\":\"Error for overflow conditions\"}],\"SendFunctionDisabled()\":[{\"notice\":\"Custom error thrown when the send function is called while disabled\"}]},\"events\":{\"Enabled(bool)\":{\"notice\":\"Emitted when the enabled state changes\"}},\"kind\":\"user\",\"methods\":{\"allowInitializePath((uint32,bytes32,uint64))\":{\"notice\":\"Checks if the path initialization is allowed based on the provided origin.\"},\"approvalRequired()\":{\"notice\":\"Indicates whether the OFT contract requires approval of the 'token()' to send.\"},\"combineOptions(uint32,uint16,bytes)\":{\"notice\":\"Combines options for a given endpoint and message type.\"},\"endpoint()\":{\"notice\":\"Retrieves the LayerZero endpoint associated with the OApp.\"},\"getTrustedForwarder()\":{\"notice\":\"Get the current trusted forwarder\"},\"isComposeMsgSender((uint32,bytes32,uint64),bytes,address)\":{\"notice\":\"Indicates whether an address is an approved composeMsg sender to the Endpoint.\"},\"isTrustedForwarder(address)\":{\"notice\":\"Checks if an address is a trusted forwarder\"},\"nextNonce(uint32,bytes32)\":{\"notice\":\"Retrieves the next nonce for a given source endpoint and sender address.\"},\"oAppVersion()\":{\"notice\":\"Retrieves the OApp version information.\"},\"oftVersion()\":{\"notice\":\"Retrieves interfaceID and the version of the OFT.\"},\"peers(uint32)\":{\"notice\":\"Retrieves the peer (OApp) associated with a corresponding endpoint.\"},\"quoteOFT((uint32,bytes32,uint256,uint256,bytes,bytes,bytes))\":{\"notice\":\"Provides a quote for OFT-related operations.\"},\"quoteSend((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),bool)\":{\"notice\":\"Provides a quote for the send() operation.\"},\"setDelegate(address)\":{\"notice\":\"Sets the delegate address for the OApp.\"},\"setPeer(uint32,bytes32)\":{\"notice\":\"Sets the peer address (OApp instance) for a corresponding endpoint.\"},\"setTrustedForwarder(address)\":{\"notice\":\"Change the address of the trusted forwarder for meta-TX.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@sandbox-smart-contracts/oft-sand/contracts/OFTAdapterForSand.sol\":\"OFTAdapterForSand\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":2000},\"remappings\":[]},\"sources\":{\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport { IOAppCore, ILayerZeroEndpointV2 } from \\\"./interfaces/IOAppCore.sol\\\";\\n\\n/**\\n * @title OAppCore\\n * @dev Abstract contract implementing the IOAppCore interface with basic OApp configurations.\\n */\\nabstract contract OAppCore is IOAppCore, Ownable {\\n // The LayerZero endpoint associated with the given OApp\\n ILayerZeroEndpointV2 public immutable endpoint;\\n\\n // Mapping to store peers associated with corresponding endpoints\\n mapping(uint32 eid => bytes32 peer) public peers;\\n\\n /**\\n * @dev Constructor to initialize the OAppCore with the provided endpoint and delegate.\\n * @param _endpoint The address of the LOCAL Layer Zero endpoint.\\n * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\\n *\\n * @dev The delegate typically should be set as the owner of the contract.\\n */\\n constructor(address _endpoint, address _delegate) {\\n endpoint = ILayerZeroEndpointV2(_endpoint);\\n\\n if (_delegate == address(0)) revert InvalidDelegate();\\n endpoint.setDelegate(_delegate);\\n }\\n\\n /**\\n * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\\n * @param _eid The endpoint ID.\\n * @param _peer The address of the peer to be associated with the corresponding endpoint.\\n *\\n * @dev Only the owner/admin of the OApp can call this function.\\n * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.\\n * @dev Set this to bytes32(0) to remove the peer address.\\n * @dev Peer is a bytes32 to accommodate non-evm chains.\\n */\\n function setPeer(uint32 _eid, bytes32 _peer) public virtual onlyOwner {\\n _setPeer(_eid, _peer);\\n }\\n\\n /**\\n * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\\n * @param _eid The endpoint ID.\\n * @param _peer The address of the peer to be associated with the corresponding endpoint.\\n *\\n * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.\\n * @dev Set this to bytes32(0) to remove the peer address.\\n * @dev Peer is a bytes32 to accommodate non-evm chains.\\n */\\n function _setPeer(uint32 _eid, bytes32 _peer) internal virtual {\\n peers[_eid] = _peer;\\n emit PeerSet(_eid, _peer);\\n }\\n\\n /**\\n * @notice Internal function to get the peer address associated with a specific endpoint; reverts if NOT set.\\n * ie. the peer is set to bytes32(0).\\n * @param _eid The endpoint ID.\\n * @return peer The address of the peer associated with the specified endpoint.\\n */\\n function _getPeerOrRevert(uint32 _eid) internal view virtual returns (bytes32) {\\n bytes32 peer = peers[_eid];\\n if (peer == bytes32(0)) revert NoPeer(_eid);\\n return peer;\\n }\\n\\n /**\\n * @notice Sets the delegate address for the OApp.\\n * @param _delegate The address of the delegate to be set.\\n *\\n * @dev Only the owner/admin of the OApp can call this function.\\n * @dev Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.\\n */\\n function setDelegate(address _delegate) public onlyOwner {\\n endpoint.setDelegate(_delegate);\\n }\\n}\\n\",\"keccak256\":\"0x13a9c2d1d2c1f086b8624f2e84c4a4702212daae36f701d92bb915b535cbe4cc\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { IOAppReceiver, Origin } from \\\"./interfaces/IOAppReceiver.sol\\\";\\nimport { OAppCore } from \\\"./OAppCore.sol\\\";\\n\\n/**\\n * @title OAppReceiver\\n * @dev Abstract contract implementing the ILayerZeroReceiver interface and extending OAppCore for OApp receivers.\\n */\\nabstract contract OAppReceiver is IOAppReceiver, OAppCore {\\n // Custom error message for when the caller is not the registered endpoint/\\n error OnlyEndpoint(address addr);\\n\\n // @dev The version of the OAppReceiver implementation.\\n // @dev Version is bumped when changes are made to this contract.\\n uint64 internal constant RECEIVER_VERSION = 2;\\n\\n /**\\n * @notice Retrieves the OApp version information.\\n * @return senderVersion The version of the OAppSender.sol contract.\\n * @return receiverVersion The version of the OAppReceiver.sol contract.\\n *\\n * @dev Providing 0 as the default for OAppSender version. Indicates that the OAppSender is not implemented.\\n * ie. this is a RECEIVE only OApp.\\n * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions.\\n */\\n function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\\n return (0, RECEIVER_VERSION);\\n }\\n\\n /**\\n * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint.\\n * @dev _origin The origin information containing the source endpoint and sender address.\\n * - srcEid: The source chain endpoint ID.\\n * - sender: The sender address on the src chain.\\n * - nonce: The nonce of the message.\\n * @dev _message The lzReceive payload.\\n * @param _sender The sender address.\\n * @return isSender Is a valid sender.\\n *\\n * @dev Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer.\\n * @dev The default sender IS the OAppReceiver implementer.\\n */\\n function isComposeMsgSender(\\n Origin calldata /*_origin*/,\\n bytes calldata /*_message*/,\\n address _sender\\n ) public view virtual returns (bool) {\\n return _sender == address(this);\\n }\\n\\n /**\\n * @notice Checks if the path initialization is allowed based on the provided origin.\\n * @param origin The origin information containing the source endpoint and sender address.\\n * @return Whether the path has been initialized.\\n *\\n * @dev This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received.\\n * @dev This defaults to assuming if a peer has been set, its initialized.\\n * Can be overridden by the OApp if there is other logic to determine this.\\n */\\n function allowInitializePath(Origin calldata origin) public view virtual returns (bool) {\\n return peers[origin.srcEid] == origin.sender;\\n }\\n\\n /**\\n * @notice Retrieves the next nonce for a given source endpoint and sender address.\\n * @dev _srcEid The source endpoint ID.\\n * @dev _sender The sender address.\\n * @return nonce The next nonce.\\n *\\n * @dev The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement.\\n * @dev Is required by the off-chain executor to determine the OApp expects msg execution is ordered.\\n * @dev This is also enforced by the OApp.\\n * @dev By default this is NOT enabled. ie. nextNonce is hardcoded to return 0.\\n */\\n function nextNonce(uint32 /*_srcEid*/, bytes32 /*_sender*/) public view virtual returns (uint64 nonce) {\\n return 0;\\n }\\n\\n /**\\n * @dev Entry point for receiving messages or packets from the endpoint.\\n * @param _origin The origin information containing the source endpoint and sender address.\\n * - srcEid: The source chain endpoint ID.\\n * - sender: The sender address on the src chain.\\n * - nonce: The nonce of the message.\\n * @param _guid The unique identifier for the received LayerZero message.\\n * @param _message The payload of the received message.\\n * @param _executor The address of the executor for the received message.\\n * @param _extraData Additional arbitrary data provided by the corresponding executor.\\n *\\n * @dev Entry point for receiving msg/packet from the LayerZero endpoint.\\n */\\n function lzReceive(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address _executor,\\n bytes calldata _extraData\\n ) public payable virtual {\\n // Ensures that only the endpoint can attempt to lzReceive() messages to this OApp.\\n if (address(endpoint) != msg.sender) revert OnlyEndpoint(msg.sender);\\n\\n // Ensure that the sender matches the expected peer for the source endpoint.\\n if (_getPeerOrRevert(_origin.srcEid) != _origin.sender) revert OnlyPeer(_origin.srcEid, _origin.sender);\\n\\n // Call the internal OApp implementation of lzReceive.\\n _lzReceive(_origin, _guid, _message, _executor, _extraData);\\n }\\n\\n /**\\n * @dev Internal function to implement lzReceive logic without needing to copy the basic parameter validation.\\n */\\n function _lzReceive(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address _executor,\\n bytes calldata _extraData\\n ) internal virtual;\\n}\\n\",\"keccak256\":\"0x0174e9f1ec4cefe4b5adc26c392269c699b9ff75965364e5b7264426a462c70b\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppSender.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { SafeERC20, IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport { MessagingParams, MessagingFee, MessagingReceipt } from \\\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\\\";\\nimport { OAppCore } from \\\"./OAppCore.sol\\\";\\n\\n/**\\n * @title OAppSender\\n * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.\\n */\\nabstract contract OAppSender is OAppCore {\\n using SafeERC20 for IERC20;\\n\\n // Custom error messages\\n error NotEnoughNative(uint256 msgValue);\\n error LzTokenUnavailable();\\n\\n // @dev The version of the OAppSender implementation.\\n // @dev Version is bumped when changes are made to this contract.\\n uint64 internal constant SENDER_VERSION = 1;\\n\\n /**\\n * @notice Retrieves the OApp version information.\\n * @return senderVersion The version of the OAppSender.sol contract.\\n * @return receiverVersion The version of the OAppReceiver.sol contract.\\n *\\n * @dev Providing 0 as the default for OAppReceiver version. Indicates that the OAppReceiver is not implemented.\\n * ie. this is a SEND only OApp.\\n * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions\\n */\\n function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\\n return (SENDER_VERSION, 0);\\n }\\n\\n /**\\n * @dev Internal function to interact with the LayerZero EndpointV2.quote() for fee calculation.\\n * @param _dstEid The destination endpoint ID.\\n * @param _message The message payload.\\n * @param _options Additional options for the message.\\n * @param _payInLzToken Flag indicating whether to pay the fee in LZ tokens.\\n * @return fee The calculated MessagingFee for the message.\\n * - nativeFee: The native fee for the message.\\n * - lzTokenFee: The LZ token fee for the message.\\n */\\n function _quote(\\n uint32 _dstEid,\\n bytes memory _message,\\n bytes memory _options,\\n bool _payInLzToken\\n ) internal view virtual returns (MessagingFee memory fee) {\\n return\\n endpoint.quote(\\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken),\\n address(this)\\n );\\n }\\n\\n /**\\n * @dev Internal function to interact with the LayerZero EndpointV2.send() for sending a message.\\n * @param _dstEid The destination endpoint ID.\\n * @param _message The message payload.\\n * @param _options Additional options for the message.\\n * @param _fee The calculated LayerZero fee for the message.\\n * - nativeFee: The native fee.\\n * - lzTokenFee: The lzToken fee.\\n * @param _refundAddress The address to receive any excess fee values sent to the endpoint.\\n * @return receipt The receipt for the sent message.\\n * - guid: The unique identifier for the sent message.\\n * - nonce: The nonce of the sent message.\\n * - fee: The LayerZero fee incurred for the message.\\n */\\n function _lzSend(\\n uint32 _dstEid,\\n bytes memory _message,\\n bytes memory _options,\\n MessagingFee memory _fee,\\n address _refundAddress\\n ) internal virtual returns (MessagingReceipt memory receipt) {\\n // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint.\\n uint256 messageValue = _payNative(_fee.nativeFee);\\n if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);\\n\\n return\\n // solhint-disable-next-line check-send-result\\n endpoint.send{ value: messageValue }(\\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0),\\n _refundAddress\\n );\\n }\\n\\n /**\\n * @dev Internal function to pay the native fee associated with the message.\\n * @param _nativeFee The native fee to be paid.\\n * @return nativeFee The amount of native currency paid.\\n *\\n * @dev If the OApp needs to initiate MULTIPLE LayerZero messages in a single transaction,\\n * this will need to be overridden because msg.value would contain multiple lzFees.\\n * @dev Should be overridden in the event the LayerZero endpoint requires a different native currency.\\n * @dev Some EVMs use an ERC20 as a method for paying transactions/gasFees.\\n * @dev The endpoint is EITHER/OR, ie. it will NOT support both types of native payment at a time.\\n */\\n function _payNative(uint256 _nativeFee) internal virtual returns (uint256 nativeFee) {\\n if (msg.value != _nativeFee) revert NotEnoughNative(msg.value);\\n return _nativeFee;\\n }\\n\\n /**\\n * @dev Internal function to pay the LZ token fee associated with the message.\\n * @param _lzTokenFee The LZ token fee to be paid.\\n *\\n * @dev If the caller is trying to pay in the specified lzToken, then the lzTokenFee is passed to the endpoint.\\n * @dev Any excess sent, is passed back to the specified _refundAddress in the _lzSend().\\n */\\n function _payLzToken(uint256 _lzTokenFee) internal virtual {\\n // @dev Cannot cache the token because it is not immutable in the endpoint.\\n address lzToken = endpoint.lzToken();\\n if (lzToken == address(0)) revert LzTokenUnavailable();\\n\\n // Pay LZ token fee by sending tokens to the endpoint.\\n IERC20(lzToken).safeTransferFrom(msg.sender, address(endpoint), _lzTokenFee);\\n }\\n}\\n\",\"keccak256\":\"0x518cf4adca601923ed4baa6619846a253ea32b8d8775f8bc1faa3dfac7f67c20\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { ILayerZeroEndpointV2 } from \\\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\\\";\\n\\n/**\\n * @title IOAppCore\\n */\\ninterface IOAppCore {\\n // Custom error messages\\n error OnlyPeer(uint32 eid, bytes32 sender);\\n error NoPeer(uint32 eid);\\n error InvalidEndpointCall();\\n error InvalidDelegate();\\n\\n // Event emitted when a peer (OApp) is set for a corresponding endpoint\\n event PeerSet(uint32 eid, bytes32 peer);\\n\\n /**\\n * @notice Retrieves the OApp version information.\\n * @return senderVersion The version of the OAppSender.sol contract.\\n * @return receiverVersion The version of the OAppReceiver.sol contract.\\n */\\n function oAppVersion() external view returns (uint64 senderVersion, uint64 receiverVersion);\\n\\n /**\\n * @notice Retrieves the LayerZero endpoint associated with the OApp.\\n * @return iEndpoint The LayerZero endpoint as an interface.\\n */\\n function endpoint() external view returns (ILayerZeroEndpointV2 iEndpoint);\\n\\n /**\\n * @notice Retrieves the peer (OApp) associated with a corresponding endpoint.\\n * @param _eid The endpoint ID.\\n * @return peer The peer address (OApp instance) associated with the corresponding endpoint.\\n */\\n function peers(uint32 _eid) external view returns (bytes32 peer);\\n\\n /**\\n * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\\n * @param _eid The endpoint ID.\\n * @param _peer The address of the peer to be associated with the corresponding endpoint.\\n */\\n function setPeer(uint32 _eid, bytes32 _peer) external;\\n\\n /**\\n * @notice Sets the delegate address for the OApp Core.\\n * @param _delegate The address of the delegate to be set.\\n */\\n function setDelegate(address _delegate) external;\\n}\\n\",\"keccak256\":\"0x40e49f2de74506e1da5dcaed53a39853f691647f4ceb0fccc8f49a68d3f47c58\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppMsgInspector.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title IOAppMsgInspector\\n * @dev Interface for the OApp Message Inspector, allowing examination of message and options contents.\\n */\\ninterface IOAppMsgInspector {\\n // Custom error message for inspection failure\\n error InspectionFailed(bytes message, bytes options);\\n\\n /**\\n * @notice Allows the inspector to examine LayerZero message contents and optionally throw a revert if invalid.\\n * @param _message The message payload to be inspected.\\n * @param _options Additional options or parameters for inspection.\\n * @return valid A boolean indicating whether the inspection passed (true) or failed (false).\\n *\\n * @dev Optionally done as a revert, OR use the boolean provided to handle the failure.\\n */\\n function inspect(bytes calldata _message, bytes calldata _options) external view returns (bool valid);\\n}\\n\",\"keccak256\":\"0x339654e699043c400cad92de209aa23855ce10211c31cf4114042cc5224d3b7c\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppOptionsType3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Struct representing enforced option parameters.\\n */\\nstruct EnforcedOptionParam {\\n uint32 eid; // Endpoint ID\\n uint16 msgType; // Message Type\\n bytes options; // Additional options\\n}\\n\\n/**\\n * @title IOAppOptionsType3\\n * @dev Interface for the OApp with Type 3 Options, allowing the setting and combining of enforced options.\\n */\\ninterface IOAppOptionsType3 {\\n // Custom error message for invalid options\\n error InvalidOptions(bytes options);\\n\\n // Event emitted when enforced options are set\\n event EnforcedOptionSet(EnforcedOptionParam[] _enforcedOptions);\\n\\n /**\\n * @notice Sets enforced options for specific endpoint and message type combinations.\\n * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\\n */\\n function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) external;\\n\\n /**\\n * @notice Combines options for a given endpoint and message type.\\n * @param _eid The endpoint ID.\\n * @param _msgType The OApp message type.\\n * @param _extraOptions Additional options passed by the caller.\\n * @return options The combination of caller specified options AND enforced options.\\n */\\n function combineOptions(\\n uint32 _eid,\\n uint16 _msgType,\\n bytes calldata _extraOptions\\n ) external view returns (bytes memory options);\\n}\\n\",\"keccak256\":\"0x9fc08a51e9d7c9c710c4eb26f84fe77228305ad7da63fa486ff24ebf2f3bc461\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.20;\\n\\nimport { ILayerZeroReceiver, Origin } from \\\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol\\\";\\n\\ninterface IOAppReceiver is ILayerZeroReceiver {\\n /**\\n * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint.\\n * @param _origin The origin information containing the source endpoint and sender address.\\n * - srcEid: The source chain endpoint ID.\\n * - sender: The sender address on the src chain.\\n * - nonce: The nonce of the message.\\n * @param _message The lzReceive payload.\\n * @param _sender The sender address.\\n * @return isSender Is a valid sender.\\n *\\n * @dev Applications can optionally choose to implement a separate composeMsg sender that is NOT the bridging layer.\\n * @dev The default sender IS the OAppReceiver implementer.\\n */\\n function isComposeMsgSender(\\n Origin calldata _origin,\\n bytes calldata _message,\\n address _sender\\n ) external view returns (bool isSender);\\n}\\n\",\"keccak256\":\"0xd26135185e19b3732746d4a9e2923e896f28dec8664bab161faea2ee26fcdc3d\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OAppOptionsType3.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport { IOAppOptionsType3, EnforcedOptionParam } from \\\"../interfaces/IOAppOptionsType3.sol\\\";\\n\\n/**\\n * @title OAppOptionsType3\\n * @dev Abstract contract implementing the IOAppOptionsType3 interface with type 3 options.\\n */\\nabstract contract OAppOptionsType3 is IOAppOptionsType3, Ownable {\\n uint16 internal constant OPTION_TYPE_3 = 3;\\n\\n // @dev The \\\"msgType\\\" should be defined in the child contract.\\n mapping(uint32 eid => mapping(uint16 msgType => bytes enforcedOption)) public enforcedOptions;\\n\\n /**\\n * @dev Sets the enforced options for specific endpoint and message type combinations.\\n * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\\n *\\n * @dev Only the owner/admin of the OApp can call this function.\\n * @dev Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.\\n * @dev These enforced options can vary as the potential options/execution on the remote may differ as per the msgType.\\n * eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay\\n * if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().\\n */\\n function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) public virtual onlyOwner {\\n _setEnforcedOptions(_enforcedOptions);\\n }\\n\\n /**\\n * @dev Sets the enforced options for specific endpoint and message type combinations.\\n * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\\n *\\n * @dev Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.\\n * @dev These enforced options can vary as the potential options/execution on the remote may differ as per the msgType.\\n * eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay\\n * if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().\\n */\\n function _setEnforcedOptions(EnforcedOptionParam[] memory _enforcedOptions) internal virtual {\\n for (uint256 i = 0; i < _enforcedOptions.length; i++) {\\n // @dev Enforced options are only available for optionType 3, as type 1 and 2 dont support combining.\\n _assertOptionsType3(_enforcedOptions[i].options);\\n enforcedOptions[_enforcedOptions[i].eid][_enforcedOptions[i].msgType] = _enforcedOptions[i].options;\\n }\\n\\n emit EnforcedOptionSet(_enforcedOptions);\\n }\\n\\n /**\\n * @notice Combines options for a given endpoint and message type.\\n * @param _eid The endpoint ID.\\n * @param _msgType The OAPP message type.\\n * @param _extraOptions Additional options passed by the caller.\\n * @return options The combination of caller specified options AND enforced options.\\n *\\n * @dev If there is an enforced lzReceive option:\\n * - {gasLimit: 200k, msg.value: 1 ether} AND a caller supplies a lzReceive option: {gasLimit: 100k, msg.value: 0.5 ether}\\n * - The resulting options will be {gasLimit: 300k, msg.value: 1.5 ether} when the message is executed on the remote lzReceive() function.\\n * @dev This presence of duplicated options is handled off-chain in the verifier/executor.\\n */\\n function combineOptions(\\n uint32 _eid,\\n uint16 _msgType,\\n bytes calldata _extraOptions\\n ) public view virtual returns (bytes memory) {\\n bytes memory enforced = enforcedOptions[_eid][_msgType];\\n\\n // No enforced options, pass whatever the caller supplied, even if it's empty or legacy type 1/2 options.\\n if (enforced.length == 0) return _extraOptions;\\n\\n // No caller options, return enforced\\n if (_extraOptions.length == 0) return enforced;\\n\\n // @dev If caller provided _extraOptions, must be type 3 as its the ONLY type that can be combined.\\n if (_extraOptions.length >= 2) {\\n _assertOptionsType3(_extraOptions);\\n // @dev Remove the first 2 bytes containing the type from the _extraOptions and combine with enforced.\\n return bytes.concat(enforced, _extraOptions[2:]);\\n }\\n\\n // No valid set of options was found.\\n revert InvalidOptions(_extraOptions);\\n }\\n\\n /**\\n * @dev Internal function to assert that options are of type 3.\\n * @param _options The options to be checked.\\n */\\n function _assertOptionsType3(bytes memory _options) internal pure virtual {\\n uint16 optionsType;\\n assembly {\\n optionsType := mload(add(_options, 2))\\n }\\n if (optionsType != OPTION_TYPE_3) revert InvalidOptions(_options);\\n }\\n}\\n\",\"keccak256\":\"0x5275636cd47e660a2fdf6c7fe9d41ff3cc866b785cc8a9d88c1b8ca983509f01\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { MessagingReceipt, MessagingFee } from \\\"../../oapp/OAppSender.sol\\\";\\n\\n/**\\n * @dev Struct representing token parameters for the OFT send() operation.\\n */\\nstruct SendParam {\\n uint32 dstEid; // Destination endpoint ID.\\n bytes32 to; // Recipient address.\\n uint256 amountLD; // Amount to send in local decimals.\\n uint256 minAmountLD; // Minimum amount to send in local decimals.\\n bytes extraOptions; // Additional options supplied by the caller to be used in the LayerZero message.\\n bytes composeMsg; // The composed message for the send() operation.\\n bytes oftCmd; // The OFT command to be executed, unused in default OFT implementations.\\n}\\n\\n/**\\n * @dev Struct representing OFT limit information.\\n * @dev These amounts can change dynamically and are up the the specific oft implementation.\\n */\\nstruct OFTLimit {\\n uint256 minAmountLD; // Minimum amount in local decimals that can be sent to the recipient.\\n uint256 maxAmountLD; // Maximum amount in local decimals that can be sent to the recipient.\\n}\\n\\n/**\\n * @dev Struct representing OFT receipt information.\\n */\\nstruct OFTReceipt {\\n uint256 amountSentLD; // Amount of tokens ACTUALLY debited from the sender in local decimals.\\n // @dev In non-default implementations, the amountReceivedLD COULD differ from this value.\\n uint256 amountReceivedLD; // Amount of tokens to be received on the remote side.\\n}\\n\\n/**\\n * @dev Struct representing OFT fee details.\\n * @dev Future proof mechanism to provide a standardized way to communicate fees to things like a UI.\\n */\\nstruct OFTFeeDetail {\\n int256 feeAmountLD; // Amount of the fee in local decimals.\\n string description; // Description of the fee.\\n}\\n\\n/**\\n * @title IOFT\\n * @dev Interface for the OftChain (OFT) token.\\n * @dev Does not inherit ERC20 to accommodate usage by OFTAdapter as well.\\n * @dev This specific interface ID is '0x02e49c2c'.\\n */\\ninterface IOFT {\\n // Custom error messages\\n error InvalidLocalDecimals();\\n error SlippageExceeded(uint256 amountLD, uint256 minAmountLD);\\n\\n // Events\\n event OFTSent(\\n bytes32 indexed guid, // GUID of the OFT message.\\n uint32 dstEid, // Destination Endpoint ID.\\n address indexed fromAddress, // Address of the sender on the src chain.\\n uint256 amountSentLD, // Amount of tokens sent in local decimals.\\n uint256 amountReceivedLD // Amount of tokens received in local decimals.\\n );\\n event OFTReceived(\\n bytes32 indexed guid, // GUID of the OFT message.\\n uint32 srcEid, // Source Endpoint ID.\\n address indexed toAddress, // Address of the recipient on the dst chain.\\n uint256 amountReceivedLD // Amount of tokens received in local decimals.\\n );\\n\\n /**\\n * @notice Retrieves interfaceID and the version of the OFT.\\n * @return interfaceId The interface ID.\\n * @return version The version.\\n *\\n * @dev interfaceId: This specific interface ID is '0x02e49c2c'.\\n * @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.\\n * @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.\\n * ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\\n */\\n function oftVersion() external view returns (bytes4 interfaceId, uint64 version);\\n\\n /**\\n * @notice Retrieves the address of the token associated with the OFT.\\n * @return token The address of the ERC20 token implementation.\\n */\\n function token() external view returns (address);\\n\\n /**\\n * @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\\n * @return requiresApproval Needs approval of the underlying token implementation.\\n *\\n * @dev Allows things like wallet implementers to determine integration requirements,\\n * without understanding the underlying token implementation.\\n */\\n function approvalRequired() external view returns (bool);\\n\\n /**\\n * @notice Retrieves the shared decimals of the OFT.\\n * @return sharedDecimals The shared decimals of the OFT.\\n */\\n function sharedDecimals() external view returns (uint8);\\n\\n /**\\n * @notice Provides a quote for OFT-related operations.\\n * @param _sendParam The parameters for the send operation.\\n * @return limit The OFT limit information.\\n * @return oftFeeDetails The details of OFT fees.\\n * @return receipt The OFT receipt information.\\n */\\n function quoteOFT(\\n SendParam calldata _sendParam\\n ) external view returns (OFTLimit memory, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory);\\n\\n /**\\n * @notice Provides a quote for the send() operation.\\n * @param _sendParam The parameters for the send() operation.\\n * @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.\\n * @return fee The calculated LayerZero messaging fee from the send() operation.\\n *\\n * @dev MessagingFee: LayerZero msg fee\\n * - nativeFee: The native fee.\\n * - lzTokenFee: The lzToken fee.\\n */\\n function quoteSend(SendParam calldata _sendParam, bool _payInLzToken) external view returns (MessagingFee memory);\\n\\n /**\\n * @notice Executes the send() operation.\\n * @param _sendParam The parameters for the send operation.\\n * @param _fee The fee information supplied by the caller.\\n * - nativeFee: The native fee.\\n * - lzTokenFee: The lzToken fee.\\n * @param _refundAddress The address to receive any excess funds from fees etc. on the src.\\n * @return receipt The LayerZero messaging receipt from the send() operation.\\n * @return oftReceipt The OFT receipt information.\\n *\\n * @dev MessagingReceipt: LayerZero msg receipt\\n * - guid: The unique identifier for the sent message.\\n * - nonce: The nonce of the sent message.\\n * - fee: The LayerZero fee incurred for the message.\\n */\\n function send(\\n SendParam calldata _sendParam,\\n MessagingFee calldata _fee,\\n address _refundAddress\\n ) external payable returns (MessagingReceipt memory, OFTReceipt memory);\\n}\\n\",\"keccak256\":\"0x42431bdbe135f7cfefd0be6cd345a6a1045124f6ea707a06756ef2322140eef5\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/libs/OFTComposeMsgCodec.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nlibrary OFTComposeMsgCodec {\\n // Offset constants for decoding composed messages\\n uint8 private constant NONCE_OFFSET = 8;\\n uint8 private constant SRC_EID_OFFSET = 12;\\n uint8 private constant AMOUNT_LD_OFFSET = 44;\\n uint8 private constant COMPOSE_FROM_OFFSET = 76;\\n\\n /**\\n * @dev Encodes a OFT composed message.\\n * @param _nonce The nonce value.\\n * @param _srcEid The source endpoint ID.\\n * @param _amountLD The amount in local decimals.\\n * @param _composeMsg The composed message.\\n * @return _msg The encoded Composed message.\\n */\\n function encode(\\n uint64 _nonce,\\n uint32 _srcEid,\\n uint256 _amountLD,\\n bytes memory _composeMsg // 0x[composeFrom][composeMsg]\\n ) internal pure returns (bytes memory _msg) {\\n _msg = abi.encodePacked(_nonce, _srcEid, _amountLD, _composeMsg);\\n }\\n\\n /**\\n * @dev Retrieves the nonce from the composed message.\\n * @param _msg The message.\\n * @return The nonce value.\\n */\\n function nonce(bytes calldata _msg) internal pure returns (uint64) {\\n return uint64(bytes8(_msg[:NONCE_OFFSET]));\\n }\\n\\n /**\\n * @dev Retrieves the source endpoint ID from the composed message.\\n * @param _msg The message.\\n * @return The source endpoint ID.\\n */\\n function srcEid(bytes calldata _msg) internal pure returns (uint32) {\\n return uint32(bytes4(_msg[NONCE_OFFSET:SRC_EID_OFFSET]));\\n }\\n\\n /**\\n * @dev Retrieves the amount in local decimals from the composed message.\\n * @param _msg The message.\\n * @return The amount in local decimals.\\n */\\n function amountLD(bytes calldata _msg) internal pure returns (uint256) {\\n return uint256(bytes32(_msg[SRC_EID_OFFSET:AMOUNT_LD_OFFSET]));\\n }\\n\\n /**\\n * @dev Retrieves the composeFrom value from the composed message.\\n * @param _msg The message.\\n * @return The composeFrom value.\\n */\\n function composeFrom(bytes calldata _msg) internal pure returns (bytes32) {\\n return bytes32(_msg[AMOUNT_LD_OFFSET:COMPOSE_FROM_OFFSET]);\\n }\\n\\n /**\\n * @dev Retrieves the composed message.\\n * @param _msg The message.\\n * @return The composed message.\\n */\\n function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\\n return _msg[COMPOSE_FROM_OFFSET:];\\n }\\n\\n /**\\n * @dev Converts an address to bytes32.\\n * @param _addr The address to convert.\\n * @return The bytes32 representation of the address.\\n */\\n function addressToBytes32(address _addr) internal pure returns (bytes32) {\\n return bytes32(uint256(uint160(_addr)));\\n }\\n\\n /**\\n * @dev Converts bytes32 to an address.\\n * @param _b The bytes32 value to convert.\\n * @return The address representation of bytes32.\\n */\\n function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\\n return address(uint160(uint256(_b)));\\n }\\n}\\n\",\"keccak256\":\"0xfbdaf41743232e6ff64cd00b495ee854d0225e2bb73a66fe9b413d2780359902\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/OAppPreCrimeSimulator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { Ownable } from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport { IPreCrime } from \\\"./interfaces/IPreCrime.sol\\\";\\nimport { IOAppPreCrimeSimulator, InboundPacket, Origin } from \\\"./interfaces/IOAppPreCrimeSimulator.sol\\\";\\n\\n/**\\n * @title OAppPreCrimeSimulator\\n * @dev Abstract contract serving as the base for preCrime simulation functionality in an OApp.\\n */\\nabstract contract OAppPreCrimeSimulator is IOAppPreCrimeSimulator, Ownable {\\n // The address of the preCrime implementation.\\n address public preCrime;\\n\\n /**\\n * @dev Retrieves the address of the OApp contract.\\n * @return The address of the OApp contract.\\n *\\n * @dev The simulator contract is the base contract for the OApp by default.\\n * @dev If the simulator is a separate contract, override this function.\\n */\\n function oApp() external view virtual returns (address) {\\n return address(this);\\n }\\n\\n /**\\n * @dev Sets the preCrime contract address.\\n * @param _preCrime The address of the preCrime contract.\\n */\\n function setPreCrime(address _preCrime) public virtual onlyOwner {\\n preCrime = _preCrime;\\n emit PreCrimeSet(_preCrime);\\n }\\n\\n /**\\n * @dev Interface for pre-crime simulations. Always reverts at the end with the simulation results.\\n * @param _packets An array of InboundPacket objects representing received packets to be delivered.\\n *\\n * @dev WARNING: MUST revert at the end with the simulation results.\\n * @dev Gives the preCrime implementation the ability to mock sending packets to the lzReceive function,\\n * WITHOUT actually executing them.\\n */\\n function lzReceiveAndRevert(InboundPacket[] calldata _packets) public payable virtual {\\n for (uint256 i = 0; i < _packets.length; i++) {\\n InboundPacket calldata packet = _packets[i];\\n\\n // Ignore packets that are not from trusted peers.\\n if (!isPeer(packet.origin.srcEid, packet.origin.sender)) continue;\\n\\n // @dev Because a verifier is calling this function, it doesnt have access to executor params:\\n // - address _executor\\n // - bytes calldata _extraData\\n // preCrime will NOT work for OApps that rely on these two parameters inside of their _lzReceive().\\n // They are instead stubbed to default values, address(0) and bytes(\\\"\\\")\\n // @dev Calling this.lzReceiveSimulate removes ability for assembly return 0 callstack exit,\\n // which would cause the revert to be ignored.\\n this.lzReceiveSimulate{ value: packet.value }(\\n packet.origin,\\n packet.guid,\\n packet.message,\\n packet.executor,\\n packet.extraData\\n );\\n }\\n\\n // @dev Revert with the simulation results. msg.sender must implement IPreCrime.buildSimulationResult().\\n revert SimulationResult(IPreCrime(msg.sender).buildSimulationResult());\\n }\\n\\n /**\\n * @dev Is effectively an internal function because msg.sender must be address(this).\\n * Allows resetting the call stack for 'internal' calls.\\n * @param _origin The origin information containing the source endpoint and sender address.\\n * - srcEid: The source chain endpoint ID.\\n * - sender: The sender address on the src chain.\\n * - nonce: The nonce of the message.\\n * @param _guid The unique identifier of the packet.\\n * @param _message The message payload of the packet.\\n * @param _executor The executor address for the packet.\\n * @param _extraData Additional data for the packet.\\n */\\n function lzReceiveSimulate(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address _executor,\\n bytes calldata _extraData\\n ) external payable virtual {\\n // @dev Ensure ONLY can be called 'internally'.\\n if (msg.sender != address(this)) revert OnlySelf();\\n _lzReceiveSimulate(_origin, _guid, _message, _executor, _extraData);\\n }\\n\\n /**\\n * @dev Internal function to handle the OAppPreCrimeSimulator simulated receive.\\n * @param _origin The origin information.\\n * - srcEid: The source chain endpoint ID.\\n * - sender: The sender address from the src chain.\\n * - nonce: The nonce of the LayerZero message.\\n * @param _guid The GUID of the LayerZero message.\\n * @param _message The LayerZero message.\\n * @param _executor The address of the off-chain executor.\\n * @param _extraData Arbitrary data passed by the msg executor.\\n *\\n * @dev Enables the preCrime simulator to mock sending lzReceive() messages,\\n * routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver.\\n */\\n function _lzReceiveSimulate(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address _executor,\\n bytes calldata _extraData\\n ) internal virtual;\\n\\n /**\\n * @dev checks if the specified peer is considered 'trusted' by the OApp.\\n * @param _eid The endpoint Id to check.\\n * @param _peer The peer to check.\\n * @return Whether the peer passed is considered 'trusted' by the OApp.\\n */\\n function isPeer(uint32 _eid, bytes32 _peer) public view virtual returns (bool);\\n}\\n\",\"keccak256\":\"0x205a0abfd8b3c9af2740769f251381b84999b8e9347f3cd50de3ef8290a17750\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/interfaces/IOAppPreCrimeSimulator.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\n// @dev Import the Origin so it's exposed to OAppPreCrimeSimulator implementers.\\n// solhint-disable-next-line no-unused-import\\nimport { InboundPacket, Origin } from \\\"../libs/Packet.sol\\\";\\n\\n/**\\n * @title IOAppPreCrimeSimulator Interface\\n * @dev Interface for the preCrime simulation functionality in an OApp.\\n */\\ninterface IOAppPreCrimeSimulator {\\n // @dev simulation result used in PreCrime implementation\\n error SimulationResult(bytes result);\\n error OnlySelf();\\n\\n /**\\n * @dev Emitted when the preCrime contract address is set.\\n * @param preCrimeAddress The address of the preCrime contract.\\n */\\n event PreCrimeSet(address preCrimeAddress);\\n\\n /**\\n * @dev Retrieves the address of the preCrime contract implementation.\\n * @return The address of the preCrime contract.\\n */\\n function preCrime() external view returns (address);\\n\\n /**\\n * @dev Retrieves the address of the OApp contract.\\n * @return The address of the OApp contract.\\n */\\n function oApp() external view returns (address);\\n\\n /**\\n * @dev Sets the preCrime contract address.\\n * @param _preCrime The address of the preCrime contract.\\n */\\n function setPreCrime(address _preCrime) external;\\n\\n /**\\n * @dev Mocks receiving a packet, then reverts with a series of data to infer the state/result.\\n * @param _packets An array of LayerZero InboundPacket objects representing received packets.\\n */\\n function lzReceiveAndRevert(InboundPacket[] calldata _packets) external payable;\\n\\n /**\\n * @dev checks if the specified peer is considered 'trusted' by the OApp.\\n * @param _eid The endpoint Id to check.\\n * @param _peer The peer to check.\\n * @return Whether the peer passed is considered 'trusted' by the OApp.\\n */\\n function isPeer(uint32 _eid, bytes32 _peer) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5d24db150949ea8e6437178e65a942e8c8b7f332e5daf32750f56b23b35b5bb2\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/interfaces/IPreCrime.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\nstruct PreCrimePeer {\\n uint32 eid;\\n bytes32 preCrime;\\n bytes32 oApp;\\n}\\n\\n// TODO not done yet\\ninterface IPreCrime {\\n error OnlyOffChain();\\n\\n // for simulate()\\n error PacketOversize(uint256 max, uint256 actual);\\n error PacketUnsorted();\\n error SimulationFailed(bytes reason);\\n\\n // for preCrime()\\n error SimulationResultNotFound(uint32 eid);\\n error InvalidSimulationResult(uint32 eid, bytes reason);\\n error CrimeFound(bytes crime);\\n\\n function getConfig(bytes[] calldata _packets, uint256[] calldata _packetMsgValues) external returns (bytes memory);\\n\\n function simulate(\\n bytes[] calldata _packets,\\n uint256[] calldata _packetMsgValues\\n ) external payable returns (bytes memory);\\n\\n function buildSimulationResult() external view returns (bytes memory);\\n\\n function preCrime(\\n bytes[] calldata _packets,\\n uint256[] calldata _packetMsgValues,\\n bytes[] calldata _simulations\\n ) external;\\n\\n function version() external view returns (uint64 major, uint8 minor);\\n}\\n\",\"keccak256\":\"0xc8d869f27ef8ceb2e13fdf6a70682fd4dee3f90c4924eb8e125bc1e66cb6af84\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/libs/Packet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.20;\\n\\nimport { Origin } from \\\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\\\";\\nimport { PacketV1Codec } from \\\"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol\\\";\\n\\n/**\\n * @title InboundPacket\\n * @dev Structure representing an inbound packet received by the contract.\\n */\\nstruct InboundPacket {\\n Origin origin; // Origin information of the packet.\\n uint32 dstEid; // Destination endpointId of the packet.\\n address receiver; // Receiver address for the packet.\\n bytes32 guid; // Unique identifier of the packet.\\n uint256 value; // msg.value of the packet.\\n address executor; // Executor address for the packet.\\n bytes message; // Message payload of the packet.\\n bytes extraData; // Additional arbitrary data for the packet.\\n}\\n\\n/**\\n * @title PacketDecoder\\n * @dev Library for decoding LayerZero packets.\\n */\\nlibrary PacketDecoder {\\n using PacketV1Codec for bytes;\\n\\n /**\\n * @dev Decode an inbound packet from the given packet data.\\n * @param _packet The packet data to decode.\\n * @return packet An InboundPacket struct representing the decoded packet.\\n */\\n function decode(bytes calldata _packet) internal pure returns (InboundPacket memory packet) {\\n packet.origin = Origin(_packet.srcEid(), _packet.sender(), _packet.nonce());\\n packet.dstEid = _packet.dstEid();\\n packet.receiver = _packet.receiverB20();\\n packet.guid = _packet.guid();\\n packet.message = _packet.message();\\n }\\n\\n /**\\n * @dev Decode multiple inbound packets from the given packet data and associated message values.\\n * @param _packets An array of packet data to decode.\\n * @param _packetMsgValues An array of associated message values for each packet.\\n * @return packets An array of InboundPacket structs representing the decoded packets.\\n */\\n function decode(\\n bytes[] calldata _packets,\\n uint256[] memory _packetMsgValues\\n ) internal pure returns (InboundPacket[] memory packets) {\\n packets = new InboundPacket[](_packets.length);\\n for (uint256 i = 0; i < _packets.length; i++) {\\n bytes calldata packet = _packets[i];\\n packets[i] = PacketDecoder.decode(packet);\\n // @dev Allows the verifier to specify the msg.value that gets passed in lzReceive.\\n packets[i].value = _packetMsgValues[i];\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcb2fb1c5b2eb3731de78b479b9c2ab3bba326fe0b0b3a008590f18e881e457a6\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\nimport { IMessageLibManager } from \\\"./IMessageLibManager.sol\\\";\\nimport { IMessagingComposer } from \\\"./IMessagingComposer.sol\\\";\\nimport { IMessagingChannel } from \\\"./IMessagingChannel.sol\\\";\\nimport { IMessagingContext } from \\\"./IMessagingContext.sol\\\";\\n\\nstruct MessagingParams {\\n uint32 dstEid;\\n bytes32 receiver;\\n bytes message;\\n bytes options;\\n bool payInLzToken;\\n}\\n\\nstruct MessagingReceipt {\\n bytes32 guid;\\n uint64 nonce;\\n MessagingFee fee;\\n}\\n\\nstruct MessagingFee {\\n uint256 nativeFee;\\n uint256 lzTokenFee;\\n}\\n\\nstruct Origin {\\n uint32 srcEid;\\n bytes32 sender;\\n uint64 nonce;\\n}\\n\\ninterface ILayerZeroEndpointV2 is IMessageLibManager, IMessagingComposer, IMessagingChannel, IMessagingContext {\\n event PacketSent(bytes encodedPayload, bytes options, address sendLibrary);\\n\\n event PacketVerified(Origin origin, address receiver, bytes32 payloadHash);\\n\\n event PacketDelivered(Origin origin, address receiver);\\n\\n event LzReceiveAlert(\\n address indexed receiver,\\n address indexed executor,\\n Origin origin,\\n bytes32 guid,\\n uint256 gas,\\n uint256 value,\\n bytes message,\\n bytes extraData,\\n bytes reason\\n );\\n\\n event LzTokenSet(address token);\\n\\n event DelegateSet(address sender, address delegate);\\n\\n function quote(MessagingParams calldata _params, address _sender) external view returns (MessagingFee memory);\\n\\n function send(\\n MessagingParams calldata _params,\\n address _refundAddress\\n ) external payable returns (MessagingReceipt memory);\\n\\n function verify(Origin calldata _origin, address _receiver, bytes32 _payloadHash) external;\\n\\n function verifiable(Origin calldata _origin, address _receiver) external view returns (bool);\\n\\n function initializable(Origin calldata _origin, address _receiver) external view returns (bool);\\n\\n function lzReceive(\\n Origin calldata _origin,\\n address _receiver,\\n bytes32 _guid,\\n bytes calldata _message,\\n bytes calldata _extraData\\n ) external payable;\\n\\n // oapp can burn messages partially by calling this function with its own business logic if messages are verified in order\\n function clear(address _oapp, Origin calldata _origin, bytes32 _guid, bytes calldata _message) external;\\n\\n function setLzToken(address _lzToken) external;\\n\\n function lzToken() external view returns (address);\\n\\n function nativeToken() external view returns (address);\\n\\n function setDelegate(address _delegate) external;\\n}\\n\",\"keccak256\":\"0xf7f941bee89ea6369950fe54e8ac476ae6478b958b20fc0e8a83e8ff1364eac3\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\nimport { Origin } from \\\"./ILayerZeroEndpointV2.sol\\\";\\n\\ninterface ILayerZeroReceiver {\\n function allowInitializePath(Origin calldata _origin) external view returns (bool);\\n\\n function nextNonce(uint32 _eid, bytes32 _sender) external view returns (uint64);\\n\\n function lzReceive(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address _executor,\\n bytes calldata _extraData\\n ) external payable;\\n}\\n\",\"keccak256\":\"0x9641abba8d53b08bb517d1b74801dd15ea7b84d77a6719085bd96c8ea94e3ca0\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\nimport { IERC165 } from \\\"@openzeppelin/contracts/utils/introspection/IERC165.sol\\\";\\n\\nimport { SetConfigParam } from \\\"./IMessageLibManager.sol\\\";\\n\\nenum MessageLibType {\\n Send,\\n Receive,\\n SendAndReceive\\n}\\n\\ninterface IMessageLib is IERC165 {\\n function setConfig(address _oapp, SetConfigParam[] calldata _config) external;\\n\\n function getConfig(uint32 _eid, address _oapp, uint32 _configType) external view returns (bytes memory config);\\n\\n function isSupportedEid(uint32 _eid) external view returns (bool);\\n\\n // message libs of same major version are compatible\\n function version() external view returns (uint64 major, uint8 minor, uint8 endpointVersion);\\n\\n function messageLibType() external view returns (MessageLibType);\\n}\\n\",\"keccak256\":\"0x5cf5f24751b4e3ea1c9c5ded07cedfdfd62566b6daaffcc0144733859c9dba0c\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\nstruct SetConfigParam {\\n uint32 eid;\\n uint32 configType;\\n bytes config;\\n}\\n\\ninterface IMessageLibManager {\\n struct Timeout {\\n address lib;\\n uint256 expiry;\\n }\\n\\n event LibraryRegistered(address newLib);\\n event DefaultSendLibrarySet(uint32 eid, address newLib);\\n event DefaultReceiveLibrarySet(uint32 eid, address newLib);\\n event DefaultReceiveLibraryTimeoutSet(uint32 eid, address oldLib, uint256 expiry);\\n event SendLibrarySet(address sender, uint32 eid, address newLib);\\n event ReceiveLibrarySet(address receiver, uint32 eid, address newLib);\\n event ReceiveLibraryTimeoutSet(address receiver, uint32 eid, address oldLib, uint256 timeout);\\n\\n function registerLibrary(address _lib) external;\\n\\n function isRegisteredLibrary(address _lib) external view returns (bool);\\n\\n function getRegisteredLibraries() external view returns (address[] memory);\\n\\n function setDefaultSendLibrary(uint32 _eid, address _newLib) external;\\n\\n function defaultSendLibrary(uint32 _eid) external view returns (address);\\n\\n function setDefaultReceiveLibrary(uint32 _eid, address _newLib, uint256 _gracePeriod) external;\\n\\n function defaultReceiveLibrary(uint32 _eid) external view returns (address);\\n\\n function setDefaultReceiveLibraryTimeout(uint32 _eid, address _lib, uint256 _expiry) external;\\n\\n function defaultReceiveLibraryTimeout(uint32 _eid) external view returns (address lib, uint256 expiry);\\n\\n function isSupportedEid(uint32 _eid) external view returns (bool);\\n\\n function isValidReceiveLibrary(address _receiver, uint32 _eid, address _lib) external view returns (bool);\\n\\n /// ------------------- OApp interfaces -------------------\\n function setSendLibrary(address _oapp, uint32 _eid, address _newLib) external;\\n\\n function getSendLibrary(address _sender, uint32 _eid) external view returns (address lib);\\n\\n function isDefaultSendLibrary(address _sender, uint32 _eid) external view returns (bool);\\n\\n function setReceiveLibrary(address _oapp, uint32 _eid, address _newLib, uint256 _gracePeriod) external;\\n\\n function getReceiveLibrary(address _receiver, uint32 _eid) external view returns (address lib, bool isDefault);\\n\\n function setReceiveLibraryTimeout(address _oapp, uint32 _eid, address _lib, uint256 _expiry) external;\\n\\n function receiveLibraryTimeout(address _receiver, uint32 _eid) external view returns (address lib, uint256 expiry);\\n\\n function setConfig(address _oapp, address _lib, SetConfigParam[] calldata _params) external;\\n\\n function getConfig(\\n address _oapp,\\n address _lib,\\n uint32 _eid,\\n uint32 _configType\\n ) external view returns (bytes memory config);\\n}\\n\",\"keccak256\":\"0x919b37133adff4dc528e3061deb2789c3149971b530c61e556fb3d09ab315dfc\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingChannel.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\ninterface IMessagingChannel {\\n event InboundNonceSkipped(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce);\\n event PacketNilified(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);\\n event PacketBurnt(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);\\n\\n function eid() external view returns (uint32);\\n\\n // this is an emergency function if a message cannot be verified for some reasons\\n // required to provide _nextNonce to avoid race condition\\n function skip(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce) external;\\n\\n function nilify(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;\\n\\n function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;\\n\\n function nextGuid(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (bytes32);\\n\\n function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);\\n\\n function outboundNonce(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (uint64);\\n\\n function inboundPayloadHash(\\n address _receiver,\\n uint32 _srcEid,\\n bytes32 _sender,\\n uint64 _nonce\\n ) external view returns (bytes32);\\n\\n function lazyInboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);\\n}\\n\",\"keccak256\":\"0x0878f64dffebf58c4165569416372f40860fab546b88cd926eba0d5cb6d8d972\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingComposer.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\ninterface IMessagingComposer {\\n event ComposeSent(address from, address to, bytes32 guid, uint16 index, bytes message);\\n event ComposeDelivered(address from, address to, bytes32 guid, uint16 index);\\n event LzComposeAlert(\\n address indexed from,\\n address indexed to,\\n address indexed executor,\\n bytes32 guid,\\n uint16 index,\\n uint256 gas,\\n uint256 value,\\n bytes message,\\n bytes extraData,\\n bytes reason\\n );\\n\\n function composeQueue(\\n address _from,\\n address _to,\\n bytes32 _guid,\\n uint16 _index\\n ) external view returns (bytes32 messageHash);\\n\\n function sendCompose(address _to, bytes32 _guid, uint16 _index, bytes calldata _message) external;\\n\\n function lzCompose(\\n address _from,\\n address _to,\\n bytes32 _guid,\\n uint16 _index,\\n bytes calldata _message,\\n bytes calldata _extraData\\n ) external payable;\\n}\\n\",\"keccak256\":\"0x85bc7090134529ec474866dc4bb1c48692d518c756eb0a961c82574829c51901\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingContext.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\ninterface IMessagingContext {\\n function isSendingMessage() external view returns (bool);\\n\\n function getSendContext() external view returns (uint32 dstEid, address sender);\\n}\\n\",\"keccak256\":\"0xff0c546c2813dae3e440882f46b377375f7461b0714efd80bd3f0c6e5cb8da4e\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.8.0;\\n\\nimport { MessagingFee } from \\\"./ILayerZeroEndpointV2.sol\\\";\\nimport { IMessageLib } from \\\"./IMessageLib.sol\\\";\\n\\nstruct Packet {\\n uint64 nonce;\\n uint32 srcEid;\\n address sender;\\n uint32 dstEid;\\n bytes32 receiver;\\n bytes32 guid;\\n bytes message;\\n}\\n\\ninterface ISendLib is IMessageLib {\\n function send(\\n Packet calldata _packet,\\n bytes calldata _options,\\n bool _payInLzToken\\n ) external returns (MessagingFee memory, bytes memory encodedPacket);\\n\\n function quote(\\n Packet calldata _packet,\\n bytes calldata _options,\\n bool _payInLzToken\\n ) external view returns (MessagingFee memory);\\n\\n function setTreasury(address _treasury) external;\\n\\n function withdrawFee(address _to, uint256 _amount) external;\\n\\n function withdrawLzTokenFee(address _lzToken, address _to, uint256 _amount) external;\\n}\\n\",\"keccak256\":\"0xf1c07bc61e7b1dce195ed12d50f87980fbf2d63cac1326fd28287f55fe0ba625\",\"license\":\"MIT\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/AddressCast.sol\":{\"content\":\"// SPDX-License-Identifier: LZBL-1.2\\n\\npragma solidity ^0.8.20;\\n\\nlibrary AddressCast {\\n error AddressCast_InvalidSizeForAddress();\\n error AddressCast_InvalidAddress();\\n\\n function toBytes32(bytes calldata _addressBytes) internal pure returns (bytes32 result) {\\n if (_addressBytes.length > 32) revert AddressCast_InvalidAddress();\\n result = bytes32(_addressBytes);\\n unchecked {\\n uint256 offset = 32 - _addressBytes.length;\\n result = result >> (offset * 8);\\n }\\n }\\n\\n function toBytes32(address _address) internal pure returns (bytes32 result) {\\n result = bytes32(uint256(uint160(_address)));\\n }\\n\\n function toBytes(bytes32 _addressBytes32, uint256 _size) internal pure returns (bytes memory result) {\\n if (_size == 0 || _size > 32) revert AddressCast_InvalidSizeForAddress();\\n result = new bytes(_size);\\n unchecked {\\n uint256 offset = 256 - _size * 8;\\n assembly {\\n mstore(add(result, 32), shl(offset, _addressBytes32))\\n }\\n }\\n }\\n\\n function toAddress(bytes32 _addressBytes32) internal pure returns (address result) {\\n result = address(uint160(uint256(_addressBytes32)));\\n }\\n\\n function toAddress(bytes calldata _addressBytes) internal pure returns (address result) {\\n if (_addressBytes.length != 20) revert AddressCast_InvalidAddress();\\n result = address(bytes20(_addressBytes));\\n }\\n}\\n\",\"keccak256\":\"0x2ebbcaaab3554edcd41b581f1a72ac1806afbfb8047d0d47ff098f9af30d6deb\",\"license\":\"LZBL-1.2\"},\"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol\":{\"content\":\"// SPDX-License-Identifier: LZBL-1.2\\n\\npragma solidity ^0.8.20;\\n\\nimport { Packet } from \\\"../../interfaces/ISendLib.sol\\\";\\nimport { AddressCast } from \\\"../../libs/AddressCast.sol\\\";\\n\\nlibrary PacketV1Codec {\\n using AddressCast for address;\\n using AddressCast for bytes32;\\n\\n uint8 internal constant PACKET_VERSION = 1;\\n\\n // header (version + nonce + path)\\n // version\\n uint256 private constant PACKET_VERSION_OFFSET = 0;\\n // nonce\\n uint256 private constant NONCE_OFFSET = 1;\\n // path\\n uint256 private constant SRC_EID_OFFSET = 9;\\n uint256 private constant SENDER_OFFSET = 13;\\n uint256 private constant DST_EID_OFFSET = 45;\\n uint256 private constant RECEIVER_OFFSET = 49;\\n // payload (guid + message)\\n uint256 private constant GUID_OFFSET = 81; // keccak256(nonce + path)\\n uint256 private constant MESSAGE_OFFSET = 113;\\n\\n function encode(Packet memory _packet) internal pure returns (bytes memory encodedPacket) {\\n encodedPacket = abi.encodePacked(\\n PACKET_VERSION,\\n _packet.nonce,\\n _packet.srcEid,\\n _packet.sender.toBytes32(),\\n _packet.dstEid,\\n _packet.receiver,\\n _packet.guid,\\n _packet.message\\n );\\n }\\n\\n function encodePacketHeader(Packet memory _packet) internal pure returns (bytes memory) {\\n return\\n abi.encodePacked(\\n PACKET_VERSION,\\n _packet.nonce,\\n _packet.srcEid,\\n _packet.sender.toBytes32(),\\n _packet.dstEid,\\n _packet.receiver\\n );\\n }\\n\\n function encodePayload(Packet memory _packet) internal pure returns (bytes memory) {\\n return abi.encodePacked(_packet.guid, _packet.message);\\n }\\n\\n function header(bytes calldata _packet) internal pure returns (bytes calldata) {\\n return _packet[0:GUID_OFFSET];\\n }\\n\\n function version(bytes calldata _packet) internal pure returns (uint8) {\\n return uint8(bytes1(_packet[PACKET_VERSION_OFFSET:NONCE_OFFSET]));\\n }\\n\\n function nonce(bytes calldata _packet) internal pure returns (uint64) {\\n return uint64(bytes8(_packet[NONCE_OFFSET:SRC_EID_OFFSET]));\\n }\\n\\n function srcEid(bytes calldata _packet) internal pure returns (uint32) {\\n return uint32(bytes4(_packet[SRC_EID_OFFSET:SENDER_OFFSET]));\\n }\\n\\n function sender(bytes calldata _packet) internal pure returns (bytes32) {\\n return bytes32(_packet[SENDER_OFFSET:DST_EID_OFFSET]);\\n }\\n\\n function senderAddressB20(bytes calldata _packet) internal pure returns (address) {\\n return sender(_packet).toAddress();\\n }\\n\\n function dstEid(bytes calldata _packet) internal pure returns (uint32) {\\n return uint32(bytes4(_packet[DST_EID_OFFSET:RECEIVER_OFFSET]));\\n }\\n\\n function receiver(bytes calldata _packet) internal pure returns (bytes32) {\\n return bytes32(_packet[RECEIVER_OFFSET:GUID_OFFSET]);\\n }\\n\\n function receiverB20(bytes calldata _packet) internal pure returns (address) {\\n return receiver(_packet).toAddress();\\n }\\n\\n function guid(bytes calldata _packet) internal pure returns (bytes32) {\\n return bytes32(_packet[GUID_OFFSET:MESSAGE_OFFSET]);\\n }\\n\\n function message(bytes calldata _packet) internal pure returns (bytes calldata) {\\n return bytes(_packet[MESSAGE_OFFSET:]);\\n }\\n\\n function payload(bytes calldata _packet) internal pure returns (bytes calldata) {\\n return bytes(_packet[GUID_OFFSET:]);\\n }\\n\\n function payloadHash(bytes calldata _packet) internal pure returns (bytes32) {\\n return keccak256(payload(_packet));\\n }\\n}\\n\",\"keccak256\":\"0xc84cf1bf785977fe1fbe7566eef902c2db68d0e163813ebe6c34921754802680\",\"license\":\"LZBL-1.2\"},\"@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/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xc6a8ff0ea489379b61faa647490411b80102578440ab9d84e9a957cc12164e70\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0xaa761817f6cd7892fcf158b3c776b34551cde36f48ff9703d53898bc45a94ea2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * ==== Security Considerations\\n *\\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\\n * generally recommended is:\\n *\\n * ```solidity\\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\\n * doThing(..., value);\\n * }\\n *\\n * function doThing(..., uint256 value) public {\\n * token.safeTransferFrom(msg.sender, address(this), value);\\n * ...\\n * }\\n * ```\\n *\\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\\n * {SafeERC20-safeTransferFrom}).\\n *\\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\\n * contracts should have entry points that don't rely on permit.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n *\\n * CAUTION: See Security Considerations above.\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x6008dabfe393240d73d7dd7688033f72740d570aa422254d29a7dce8568f3aff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC20} from \\\"../IERC20.sol\\\";\\nimport {IERC20Permit} from \\\"../extensions/IERC20Permit.sol\\\";\\nimport {Address} from \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n /**\\n * @dev An operation with an ERC20 token failed.\\n */\\n error SafeERC20FailedOperation(address token);\\n\\n /**\\n * @dev Indicates a failed `decreaseAllowance` request.\\n */\\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n forceApprove(token, spender, oldAllowance + value);\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\\n * value, non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\\n unchecked {\\n uint256 currentAllowance = token.allowance(address(this), spender);\\n if (currentAllowance < requestedDecrease) {\\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\\n }\\n forceApprove(token, spender, currentAllowance - requestedDecrease);\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data);\\n if (returndata.length != 0 && !abi.decode(returndata, (bool))) {\\n revert SafeERC20FailedOperation(address(token));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;\\n }\\n}\\n\",\"keccak256\":\"0x37bb49513c49c87c4642a891b13b63571bc87013dde806617aa1efb54605f386\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error AddressInsufficientBalance(address account);\\n\\n /**\\n * @dev There's no code at `target` (it is not a contract).\\n */\\n error AddressEmptyCode(address target);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedInnerCall();\\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 AddressInsufficientBalance(address(this));\\n }\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n if (!success) {\\n revert FailedInnerCall();\\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 * {FailedInnerCall} 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 AddressInsufficientBalance(address(this));\\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 {FailedInnerCall}) in case of an\\n * 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 {FailedInnerCall} 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 {FailedInnerCall}.\\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 /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert FailedInnerCall();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaf28a975a78550e45f65e559a3ad6a5ad43b9b8a37366999abd1b7084eb70721\",\"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/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\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[EIP 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\":\"0x4296879f55019b23e135000eb36896057e7101fb7fb859c5ef690cf14643757b\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/OFTAdapterForSand.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nimport {SendParam, OFTReceipt, MessagingReceipt, MessagingFee} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol\\\";\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport {Context} from \\\"@openzeppelin/contracts/utils/Context.sol\\\";\\nimport {OFTAdapter} from \\\"./oft/OFTAdapter.sol\\\";\\nimport {WithAdmin} from \\\"./sand/WithAdmin.sol\\\";\\nimport {ERC2771Handler} from \\\"./sand/ERC2771Handler.sol\\\";\\n\\n/// @title OFTAdapterForSand\\n/// @author The Sandbox\\n/// @dev contract to be used with non-upgradable SAND contract\\ncontract OFTAdapterForSand is OFTAdapter, WithAdmin, ERC2771Handler {\\n bool internal _enabled;\\n\\n /// @notice Emitted when the enabled state changes\\n /// @param enabled The new enabled state\\n event Enabled(bool enabled);\\n\\n /// @notice Custom error thrown when the send function is called while disabled\\n error SendFunctionDisabled();\\n\\n /// @param sandToken SAND token address on the same network as the OFT Adapter\\n /// @param layerZeroEndpoint local endpoint address\\n /// @param owner owner used as a delegate in LayerZero Endpoint\\n /// @param trustedForwarder trusted forwarder address\\n constructor(\\n address sandToken,\\n address layerZeroEndpoint,\\n address owner,\\n address trustedForwarder,\\n address admin\\n ) OFTAdapter(sandToken, layerZeroEndpoint, owner) Ownable(owner) {\\n __ERC2771Handler_initialize(trustedForwarder);\\n _changeAdmin(admin);\\n _enable(true);\\n }\\n\\n /// @notice Change the address of the trusted forwarder for meta-TX.\\n /// @param trustedForwarder The new trustedForwarder.\\n function setTrustedForwarder(address trustedForwarder) external onlyOwner {\\n _trustedForwarder = trustedForwarder;\\n }\\n\\n function enable(bool enabled) external onlyAdmin {\\n _enable(enabled);\\n }\\n\\n function getEnabled() external view returns (bool) {\\n return _enabled;\\n }\\n\\n function send(\\n SendParam calldata _sendParam,\\n MessagingFee calldata _fee,\\n address _refundAddress\\n ) public payable virtual override returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) {\\n if (!_enabled) {\\n revert SendFunctionDisabled();\\n }\\n\\n super.send(_sendParam, _fee, _refundAddress);\\n }\\n\\n function _enable(bool enabled) internal {\\n _enabled = enabled;\\n emit Enabled(_enabled);\\n }\\n\\n function _msgSender() internal view override(ERC2771Handler, Context) returns (address sender) {\\n return ERC2771Handler._msgSender();\\n }\\n\\n function _msgData() internal view override(ERC2771Handler, Context) returns (bytes calldata) {\\n return ERC2771Handler._msgData();\\n }\\n}\\n\",\"keccak256\":\"0xad64f82f42dde50a90c5cfc2983b2c3f8b181ed52b2d03fa0fc1de613485a80e\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/interfaces/IErrors.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.23;\\n\\n/// @title Errors\\n/// @author The Sandbox\\n/// @custom:security-contact contact-blockchain@sandbox.game\\n/// @notice Common errors\\ninterface IErrors {\\n /// @notice Error for overflow conditions\\n error Overflow();\\n\\n /// @notice Error for unauthorized access\\n error NotAuthorized();\\n\\n /// @notice Error for invalid sender\\n error InvalidSender();\\n\\n /// @notice Error for invalid amount\\n error InvalidAmount();\\n\\n /// @notice Error for invalid owner or spender\\n error InvalidOwnerOrSpender();\\n\\n /// @notice Error for mismatched first parameter and sender address\\n error FirstParamNotSender();\\n\\n /// @notice Error for failed calls, containing the error message\\n /// @param message error message returned from the failed call\\n error CallFailed(string message);\\n\\n /// @notice Error for admin-only access\\n error OnlyAdmin();\\n}\\n\",\"keccak256\":\"0x73a0517d65a567aaf6181ab1d3c68b6e7fdc20b098e013826db83bc8620fb635\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/oft/OFTAdapter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nimport {IERC20Metadata, IERC20} from \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport {SafeERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {OFTCore} from \\\"./OFTCore.sol\\\";\\n\\n/// @title OFTAdapter Contract\\n/// @dev OFTAdapter is a contract that adapts an ERC-20 token to the OFT functionality.\\n/// @dev For existing ERC20 tokens, this can be used to convert the token to crosschain compatibility.\\n/// @dev WARNING: ONLY 1 of these should exist for a given global mesh,\\n/// unless you make a NON-default implementation of OFT and needs to be done very carefully.\\n/// @dev WARNING: The default OFTAdapter implementation assumes LOSSLESS transfers, ie. 1 token in, 1 token out.\\n/// IF the 'innerToken' applies something like a transfer fee, the default will NOT work...\\n/// a pre/post balance check will need to be done to calculate the amountSentLD/amountReceivedLD.\\n/// @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFTAdapter.sol'\\n/// but has been modified to support ERC2771 compatibility.\\nabstract contract OFTAdapter is OFTCore {\\n using SafeERC20 for IERC20;\\n\\n IERC20 internal immutable innerToken;\\n\\n /// @dev Constructor for the OFTAdapter contract.\\n /// @param _token The address of the ERC-20 token to be adapted.\\n /// @param _lzEndpoint The LayerZero endpoint address.\\n /// @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\\n constructor(\\n address _token,\\n address _lzEndpoint,\\n address _delegate\\n ) OFTCore(IERC20Metadata(_token).decimals(), _lzEndpoint, _delegate) {\\n innerToken = IERC20(_token);\\n }\\n\\n /// @dev Retrieves the address of the underlying ERC20 implementation.\\n /// @return The address of the adapted ERC-20 token.\\n /// @dev In the case of OFTAdapter, address(this) and erc20 are NOT the same contract.\\n function token() public view returns (address) {\\n return address(innerToken);\\n }\\n\\n /// @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\\n /// @return requiresApproval Needs approval of the underlying token implementation.\\n /// @dev In the case of default OFTAdapter, approval is required.\\n /// @dev In non-default OFTAdapter contracts with something like mint and burn privileges, it would NOT need approval.\\n function approvalRequired() external pure virtual returns (bool) {\\n return true;\\n }\\n\\n /// @dev Burns tokens from the sender's specified balance, ie. pull method.\\n /// @param _from The address to debit from.\\n /// @param _amountLD The amount of tokens to send in local decimals.\\n /// @param _minAmountLD The minimum amount to send in local decimals.\\n /// @param _dstEid The destination chain ID.\\n /// @return amountSentLD The amount sent in local decimals.\\n /// @return amountReceivedLD The amount received in local decimals on the remote.\\n /// @dev msg.sender will need to approve this _amountLD of tokens to be locked inside of the contract.\\n /// @dev WARNING: The default OFTAdapter implementation assumes LOSSLESS transfers, ie. 1 token in, 1 token out.\\n /// IF the 'innerToken' applies something like a transfer fee, the default will NOT work...\\n /// a pre/post balance check will need to be done to calculate the amountReceivedLD.\\n function _debit(\\n address _from,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n uint32 _dstEid\\n ) internal virtual override returns (uint256 amountSentLD, uint256 amountReceivedLD) {\\n (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid);\\n // @dev Lock tokens by moving them into this contract from the caller.\\n innerToken.safeTransferFrom(_from, address(this), amountSentLD);\\n }\\n\\n /// @dev Credits tokens to the specified address.\\n /// @param _to The address to credit the tokens to.\\n /// @param _amountLD The amount of tokens to credit in local decimals.\\n /// @dev _srcEid The source chain ID.\\n /// @return amountReceivedLD The amount of tokens ACTUALLY received in local decimals.\\n /// @dev WARNING: The default OFTAdapter implementation assumes LOSSLESS transfers, ie. 1 token in, 1 token out.\\n /// IF the 'innerToken' applies something like a transfer fee, the default will NOT work...\\n /// a pre/post balance check will need to be done to calculate the amountReceivedLD.\\n function _credit(\\n address _to,\\n uint256 _amountLD,\\n uint32 /*_srcEid*/\\n ) internal virtual override returns (uint256 amountReceivedLD) {\\n // @dev Unlock the tokens and transfer to the recipient.\\n innerToken.safeTransfer(_to, _amountLD);\\n // @dev In the case of NON-default OFTAdapter, the amountLD MIGHT not be == amountReceivedLD.\\n return _amountLD;\\n }\\n}\\n\",\"keccak256\":\"0x0291f880f8597122d4983f83f9ba6fbe5f316000a863f2daa66c36101cfc5d48\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/oft/OFTCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nimport {OApp, Origin} from \\\"./oapp/OApp.sol\\\";\\nimport {OAppOptionsType3} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OAppOptionsType3.sol\\\";\\nimport {IOAppMsgInspector} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppMsgInspector.sol\\\";\\n\\nimport {OAppPreCrimeSimulator} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/OAppPreCrimeSimulator.sol\\\";\\n\\nimport {IOFT, SendParam, OFTLimit, OFTReceipt, OFTFeeDetail, MessagingReceipt, MessagingFee} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol\\\";\\nimport {OFTMsgCodec} from \\\"./libraries/OFTMsgCodec.sol\\\";\\nimport {OFTComposeMsgCodec} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/libs/OFTComposeMsgCodec.sol\\\";\\n\\n/// @title OFTCore\\n/// @dev Abstract contract for the OftChain (OFT) token.\\n/// @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFTCore.sol'\\n/// but has been modified to support ERC2771 compatibility.\\nabstract contract OFTCore is IOFT, OApp, OAppPreCrimeSimulator, OAppOptionsType3 {\\n using OFTMsgCodec for bytes;\\n using OFTMsgCodec for bytes32;\\n\\n // @notice Provides a conversion rate when swapping between denominations of SD and LD\\n // - shareDecimals == SD == shared Decimals\\n // - localDecimals == LD == local decimals\\n // @dev Considers that tokens have different decimal amounts on various chains.\\n // @dev eg.\\n // For a token\\n // - locally with 4 decimals --> 1.2345 => uint(12345)\\n // - remotely with 2 decimals --> 1.23 => uint(123)\\n // - The conversion rate would be 10 ** (4 - 2) = 100\\n // @dev If you want to send 1.2345 -> (uint 12345), you CANNOT represent that value on the remote,\\n // you can only display 1.23 -> uint(123).\\n // @dev To preserve the dust that would otherwise be lost on that conversion,\\n // we need to unify a denomination that can be represented on ALL chains inside of the OFT mesh\\n uint256 public immutable decimalConversionRate;\\n\\n // @notice Msg types that are used to identify the various OFT operations.\\n // @dev This can be extended in child contracts for non-default oft operations\\n // @dev These values are used in things like combineOptions() in OAppOptionsType3.sol.\\n uint16 public constant SEND = 1;\\n uint16 public constant SEND_AND_CALL = 2;\\n\\n // Address of an optional contract to inspect both 'message' and 'options'\\n address public msgInspector;\\n event MsgInspectorSet(address inspector);\\n\\n /// @dev Constructor.\\n /// @param _localDecimals The decimals of the token on the local chain (this chain).\\n /// @param _endpoint The address of the LayerZero endpoint.\\n /// @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\\n constructor(uint8 _localDecimals, address _endpoint, address _delegate) OApp(_endpoint, _delegate) {\\n if (_localDecimals < sharedDecimals()) revert InvalidLocalDecimals();\\n decimalConversionRate = 10 ** (_localDecimals - sharedDecimals());\\n }\\n\\n /// @notice Retrieves interfaceID and the version of the OFT.\\n /// @return interfaceId The interface ID.\\n /// @return version The version.\\n /// @dev interfaceId: This specific interface ID is '0x02e49c2c'.\\n /// @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.\\n /// @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.\\n /// ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\\n function oftVersion() external pure virtual returns (bytes4 interfaceId, uint64 version) {\\n return (type(IOFT).interfaceId, 1);\\n }\\n\\n /// @dev Retrieves the shared decimals of the OFT.\\n /// @return The shared decimals of the OFT.\\n /// @dev Sets an implicit cap on the amount of tokens, over uint64.max() will need some sort of outbound cap / totalSupply cap\\n /// Lowest common decimal denominator between chains.\\n /// Defaults to 6 decimal places to provide up to 18,446,744,073,709.551615 units (max uint64).\\n /// For tokens exceeding this totalSupply(), they will need to override the sharedDecimals function with something smaller.\\n /// ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615\\n function sharedDecimals() public view virtual returns (uint8) {\\n return 6;\\n }\\n\\n /// @dev Sets the message inspector address for the OFT.\\n /// @param _msgInspector The address of the message inspector.\\n /// @dev This is an optional contract that can be used to inspect both 'message' and 'options'.\\n /// @dev Set it to address(0) to disable it, or set it to a contract address to enable it.\\n function setMsgInspector(address _msgInspector) public virtual onlyOwner {\\n msgInspector = _msgInspector;\\n emit MsgInspectorSet(_msgInspector);\\n }\\n\\n /// @notice Provides a quote for OFT-related operations.\\n /// @param _sendParam The parameters for the send operation.\\n /// @return oftLimit The OFT limit information.\\n /// @return oftFeeDetails The details of OFT fees.\\n /// @return oftReceipt The OFT receipt information.\\n function quoteOFT(\\n SendParam calldata _sendParam\\n )\\n external\\n view\\n virtual\\n returns (OFTLimit memory oftLimit, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory oftReceipt)\\n {\\n uint256 minAmountLD = 0; // Unused in the default implementation.\\n uint256 maxAmountLD = type(uint64).max; // Unused in the default implementation.\\n oftLimit = OFTLimit(minAmountLD, maxAmountLD);\\n\\n // Unused in the default implementation; reserved for future complex fee details.\\n oftFeeDetails = new OFTFeeDetail[](0);\\n\\n // @dev This is the same as the send() operation, but without the actual send.\\n // - amountSentLD is the amount in local decimals that would be sent from the sender.\\n // - amountReceivedLD is the amount in local decimals that will be credited to the recipient on the remote OFT instance.\\n // @dev The amountSentLD MIGHT not equal the amount the user actually receives. HOWEVER, the default does.\\n (uint256 amountSentLD, uint256 amountReceivedLD) = _debitView(\\n _sendParam.amountLD,\\n _sendParam.minAmountLD,\\n _sendParam.dstEid\\n );\\n oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD);\\n }\\n\\n /// @notice Provides a quote for the send() operation.\\n /// @param _sendParam The parameters for the send() operation.\\n /// @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.\\n /// @return msgFee The calculated LayerZero messaging fee from the send() operation.\\n /// @dev MessagingFee: LayerZero msg fee\\n /// - nativeFee: The native fee.\\n /// - lzTokenFee: The lzToken fee.\\n function quoteSend(\\n SendParam calldata _sendParam,\\n bool _payInLzToken\\n ) external view virtual returns (MessagingFee memory msgFee) {\\n // @dev mock the amount to receive, this is the same operation used in the send().\\n // The quote is as similar as possible to the actual send() operation.\\n (, uint256 amountReceivedLD) = _debitView(_sendParam.amountLD, _sendParam.minAmountLD, _sendParam.dstEid);\\n\\n // @dev Builds the options and OFT message to quote in the endpoint.\\n (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD);\\n\\n // @dev Calculates the LayerZero fee for the send() operation.\\n return _quote(_sendParam.dstEid, message, options, _payInLzToken);\\n }\\n\\n /// @dev Executes the send operation.\\n /// @param _sendParam The parameters for the send operation.\\n /// @param _fee The calculated fee for the send() operation.\\n /// - nativeFee: The native fee.\\n /// - lzTokenFee: The lzToken fee.\\n /// @param _refundAddress The address to receive any excess funds.\\n /// @return msgReceipt The receipt for the send operation.\\n /// @return oftReceipt The OFT receipt information.\\n /// @dev MessagingReceipt: LayerZero msg receipt\\n /// - guid: The unique identifier for the sent message.\\n /// - nonce: The nonce of the sent message.\\n /// - fee: The LayerZero fee incurred for the message.\\n function send(\\n SendParam calldata _sendParam,\\n MessagingFee calldata _fee,\\n address _refundAddress\\n ) public payable virtual returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) {\\n // @dev Applies the token transfers regarding this send() operation.\\n // - amountSentLD is the amount in local decimals that was ACTUALLY sent/debited from the sender.\\n // - amountReceivedLD is the amount in local decimals that will be received/credited to the recipient on the remote OFT instance.\\n (uint256 amountSentLD, uint256 amountReceivedLD) = _debit(\\n _msgSender(),\\n _sendParam.amountLD,\\n _sendParam.minAmountLD,\\n _sendParam.dstEid\\n );\\n\\n // @dev Builds the options and OFT message to quote in the endpoint.\\n (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD);\\n\\n // @dev Sends the message to the LayerZero endpoint and returns the LayerZero msg receipt.\\n msgReceipt = _lzSend(_sendParam.dstEid, message, options, _fee, _refundAddress);\\n // @dev Formulate the OFT receipt.\\n oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD);\\n\\n emit OFTSent(msgReceipt.guid, _sendParam.dstEid, _msgSender(), amountSentLD, amountReceivedLD);\\n }\\n\\n /// @dev Internal function to build the message and options.\\n /// @param _sendParam The parameters for the send() operation.\\n /// @param _amountLD The amount in local decimals.\\n /// @return message The encoded message.\\n /// @return options The encoded options.\\n function _buildMsgAndOptions(\\n SendParam calldata _sendParam,\\n uint256 _amountLD\\n ) internal view virtual returns (bytes memory message, bytes memory options) {\\n bool hasCompose;\\n // @dev This generated message has the msg.sender encoded into the payload so the remote knows who the caller is.\\n (message, hasCompose) = OFTMsgCodec.encode(\\n _sendParam.to,\\n _toSD(_amountLD),\\n // @dev Must be include a non empty bytes if you want to compose, EVEN if you dont need it on the remote.\\n // EVEN if you dont require an arbitrary payload to be sent... eg. '0x01'\\n _sendParam.composeMsg,\\n _msgSender()\\n );\\n // @dev Change the msg type depending if its composed or not.\\n uint16 msgType = hasCompose ? SEND_AND_CALL : SEND;\\n // @dev Combine the callers _extraOptions with the enforced options via the OAppOptionsType3.\\n options = combineOptions(_sendParam.dstEid, msgType, _sendParam.extraOptions);\\n\\n // @dev Optionally inspect the message and options depending if the OApp owner has set a msg inspector.\\n // @dev If it fails inspection, needs to revert in the implementation. ie. does not rely on return boolean\\n if (msgInspector != address(0)) IOAppMsgInspector(msgInspector).inspect(message, options);\\n }\\n\\n /// @dev Internal function to handle the receive on the LayerZero endpoint.\\n /// @param _origin The origin information.\\n /// - srcEid: The source chain endpoint ID.\\n /// - sender: The sender address from the src chain.\\n /// - nonce: The nonce of the LayerZero message.\\n /// @param _guid The unique identifier for the received LayerZero message.\\n /// @param _message The encoded message.\\n /// @dev _executor The address of the executor.\\n /// @dev _extraData Additional data.\\n\\n function _lzReceive(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address /*_executor*/, // @dev unused in the default implementation.\\n bytes calldata /*_extraData*/ // @dev unused in the default implementation.\\n ) internal virtual override {\\n // @dev The src sending chain doesnt know the address length on this chain (potentially non-evm)\\n // Thus everything is bytes32() encoded in flight.\\n address toAddress = _message.sendTo().bytes32ToAddress();\\n // @dev Credit the amountLD to the recipient and return the ACTUAL amount the recipient received in local decimals\\n uint256 amountReceivedLD = _credit(toAddress, _toLD(_message.amountSD()), _origin.srcEid);\\n\\n if (_message.isComposed()) {\\n // @dev Proprietary composeMsg format for the OFT.\\n bytes memory composeMsg = OFTComposeMsgCodec.encode(\\n _origin.nonce,\\n _origin.srcEid,\\n amountReceivedLD,\\n _message.composeMsg()\\n );\\n\\n // @dev Stores the lzCompose payload that will be executed in a separate tx.\\n // Standardizes functionality for executing arbitrary contract invocation on some non-evm chains.\\n // @dev The off-chain executor will listen and process the msg based on the src-chain-callers compose options passed.\\n // @dev The index is used when a OApp needs to compose multiple msgs on lzReceive.\\n // For default OFT implementation there is only 1 compose msg per lzReceive, thus its always 0.\\n endpoint.sendCompose(toAddress, _guid, 0 /* the index of the composed message*/, composeMsg);\\n }\\n\\n emit OFTReceived(_guid, _origin.srcEid, toAddress, amountReceivedLD);\\n }\\n\\n /// @dev Internal function to handle the OAppPreCrimeSimulator simulated receive.\\n /// @param _origin The origin information.\\n /// - srcEid: The source chain endpoint ID.\\n /// - sender: The sender address from the src chain.\\n /// - nonce: The nonce of the LayerZero message.\\n /// @param _guid The unique identifier for the received LayerZero message.\\n /// @param _message The LayerZero message.\\n /// @param _executor The address of the off-chain executor.\\n /// @param _extraData Arbitrary data passed by the msg executor.\\n /// @dev Enables the preCrime simulator to mock sending lzReceive() messages,\\n /// routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver.\\n function _lzReceiveSimulate(\\n Origin calldata _origin,\\n bytes32 _guid,\\n bytes calldata _message,\\n address _executor,\\n bytes calldata _extraData\\n ) internal virtual override {\\n _lzReceive(_origin, _guid, _message, _executor, _extraData);\\n }\\n\\n /// @dev Check if the peer is considered 'trusted' by the OApp.\\n /// @param _eid The endpoint ID to check.\\n /// @param _peer The peer to check.\\n /// @return Whether the peer passed is considered 'trusted' by the OApp.\\n /// @dev Enables OAppPreCrimeSimulator to check whether a potential Inbound Packet is from a trusted source.\\n function isPeer(uint32 _eid, bytes32 _peer) public view virtual override returns (bool) {\\n return peers[_eid] == _peer;\\n }\\n\\n /// @dev Internal function to remove dust from the given local decimal amount.\\n /// @param _amountLD The amount in local decimals.\\n /// @return amountLD The amount after removing dust.\\n /// @dev Prevents the loss of dust when moving amounts between chains with different decimals.\\n /// @dev eg. uint(123) with a conversion rate of 100 becomes uint(100).\\n function _removeDust(uint256 _amountLD) internal view virtual returns (uint256 amountLD) {\\n return (_amountLD / decimalConversionRate) * decimalConversionRate;\\n }\\n\\n /// @dev Internal function to convert an amount from shared decimals into local decimals.\\n /// @param _amountSD The amount in shared decimals.\\n /// @return amountLD The amount in local decimals.\\n function _toLD(uint64 _amountSD) internal view virtual returns (uint256 amountLD) {\\n return _amountSD * decimalConversionRate;\\n }\\n\\n /// @dev Internal function to convert an amount from local decimals into shared decimals.\\n /// @param _amountLD The amount in local decimals.\\n /// @return amountSD The amount in shared decimals.\\n function _toSD(uint256 _amountLD) internal view virtual returns (uint64 amountSD) {\\n return uint64(_amountLD / decimalConversionRate);\\n }\\n\\n /// @dev Internal function to mock the amount mutation from a OFT debit() operation.\\n /// @param _amountLD The amount to send in local decimals.\\n /// @param _minAmountLD The minimum amount to send in local decimals.\\n /// @dev _dstEid The destination endpoint ID.\\n /// @return amountSentLD The amount sent, in local decimals.\\n /// @return amountReceivedLD The amount to be received on the remote chain, in local decimals.\\n /// @dev This is where things like fees would be calculated and deducted from the amount to be received on the remote.\\n function _debitView(\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n uint32 /*_dstEid*/\\n ) internal view virtual returns (uint256 amountSentLD, uint256 amountReceivedLD) {\\n // @dev Remove the dust so nothing is lost on the conversion between chains with different decimals for the token.\\n amountSentLD = _removeDust(_amountLD);\\n // @dev The amount to send is the same as amount received in the default implementation.\\n amountReceivedLD = amountSentLD;\\n\\n // @dev Check for slippage.\\n if (amountReceivedLD < _minAmountLD) {\\n revert SlippageExceeded(amountReceivedLD, _minAmountLD);\\n }\\n }\\n\\n /// @dev Internal function to perform a debit operation.\\n /// @param _from The address to debit.\\n /// @param _amountLD The amount to send in local decimals.\\n /// @param _minAmountLD The minimum amount to send in local decimals.\\n /// @param _dstEid The destination endpoint ID.\\n /// @return amountSentLD The amount sent in local decimals.\\n /// @return amountReceivedLD The amount received in local decimals on the remote.\\n /// @dev Defined here but are intended to be overriden depending on the OFT implementation.\\n /// @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD.\\n function _debit(\\n address _from,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n uint32 _dstEid\\n ) internal virtual returns (uint256 amountSentLD, uint256 amountReceivedLD);\\n\\n /// @dev Internal function to perform a credit operation.\\n /// @param _to The address to credit.\\n /// @param _amountLD The amount to credit in local decimals.\\n /// @param _srcEid The source endpoint ID.\\n /// @return amountReceivedLD The amount ACTUALLY received in local decimals.\\n /// @dev Defined here but are intended to be overriden depending on the OFT implementation.\\n /// @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD.\\n\\n function _credit(\\n address _to,\\n uint256 _amountLD,\\n uint32 _srcEid\\n ) internal virtual returns (uint256 amountReceivedLD);\\n}\\n\",\"keccak256\":\"0x9e0e9be45f8ce68f9230febff5feaee523023799797083396253d000204babdc\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/oft/libraries/OFTMsgCodec.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nlibrary OFTMsgCodec {\\n // Offset constants for encoding and decoding OFT messages\\n uint8 private constant SEND_TO_OFFSET = 32;\\n uint8 private constant SEND_AMOUNT_SD_OFFSET = 40;\\n\\n /**\\n * @dev Encodes an OFT LayerZero message.\\n * @param _sendTo The recipient address.\\n * @param _amountShared The amount in shared decimals.\\n * @param _composeMsg The composed message.\\n * @param _sender The msg sender\\n * @return _msg The encoded message.\\n * @return hasCompose A boolean indicating whether the message has a composed payload.\\n */\\n function encode(\\n bytes32 _sendTo,\\n uint64 _amountShared,\\n bytes memory _composeMsg,\\n address _sender\\n ) internal pure returns (bytes memory _msg, bool hasCompose) {\\n hasCompose = _composeMsg.length > 0;\\n // @dev Remote chains will want to know the composed function caller ie. msg.sender on the src.\\n _msg = hasCompose\\n ? abi.encodePacked(_sendTo, _amountShared, addressToBytes32(_sender), _composeMsg)\\n : abi.encodePacked(_sendTo, _amountShared);\\n }\\n\\n /**\\n * @dev Checks if the OFT message is composed.\\n * @param _msg The OFT message.\\n * @return A boolean indicating whether the message is composed.\\n */\\n function isComposed(bytes calldata _msg) internal pure returns (bool) {\\n return _msg.length > SEND_AMOUNT_SD_OFFSET;\\n }\\n\\n /**\\n * @dev Retrieves the recipient address from the OFT message.\\n * @param _msg The OFT message.\\n * @return The recipient address.\\n */\\n function sendTo(bytes calldata _msg) internal pure returns (bytes32) {\\n return bytes32(_msg[:SEND_TO_OFFSET]);\\n }\\n\\n /**\\n * @dev Retrieves the amount in shared decimals from the OFT message.\\n * @param _msg The OFT message.\\n * @return The amount in shared decimals.\\n */\\n function amountSD(bytes calldata _msg) internal pure returns (uint64) {\\n return uint64(bytes8(_msg[SEND_TO_OFFSET:SEND_AMOUNT_SD_OFFSET]));\\n }\\n\\n /**\\n * @dev Retrieves the composed message from the OFT message.\\n * @param _msg The OFT message.\\n * @return The composed message.\\n */\\n function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\\n return _msg[SEND_AMOUNT_SD_OFFSET:];\\n }\\n\\n /**\\n * @dev Converts an address to bytes32.\\n * @param _addr The address to convert.\\n * @return The bytes32 representation of the address.\\n */\\n function addressToBytes32(address _addr) internal pure returns (bytes32) {\\n return bytes32(uint256(uint160(_addr)));\\n }\\n\\n /**\\n * @dev Converts bytes32 to an address.\\n * @param _b The bytes32 value to convert.\\n * @return The address representation of bytes32.\\n */\\n function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\\n return address(uint160(uint256(_b)));\\n }\\n}\\n\",\"keccak256\":\"0xf706ea7e0523d956e2a9d479690c7f455533d20c49ae4473fb10dfc3c9221faa\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/oft/oapp/OApp.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\n// @dev Import the 'MessagingFee' and 'MessagingReceipt' so it's exposed to OApp implementers\\n// solhint-disable-next-line no-unused-import\\nimport {OAppSender, MessagingFee, MessagingReceipt} from \\\"./OAppSender.sol\\\";\\n// @dev Import the 'Origin' so it's exposed to OApp implementers\\n// solhint-disable-next-line no-unused-import\\nimport {OAppReceiver, Origin} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppReceiver.sol\\\";\\nimport {OAppCore} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppCore.sol\\\";\\n\\n/**\\n * @title OApp\\n * @dev Abstract contract serving as the base for OApp implementation, combining OAppSender and OAppReceiver functionality.\\n * @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OApp.sol'\\n * but has been modified to support ERC2771 compatibility.\\n */\\nabstract contract OApp is OAppSender, OAppReceiver {\\n /**\\n * @dev Constructor to initialize the OApp with the provided endpoint and owner.\\n * @param _endpoint The address of the LOCAL LayerZero endpoint.\\n * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\\n */\\n constructor(address _endpoint, address _delegate) OAppCore(_endpoint, _delegate) {}\\n\\n /**\\n * @notice Retrieves the OApp version information.\\n * @return senderVersion The version of the OAppSender.sol implementation.\\n * @return receiverVersion The version of the OAppReceiver.sol implementation.\\n */\\n function oAppVersion()\\n public\\n pure\\n virtual\\n override(OAppSender, OAppReceiver)\\n returns (uint64 senderVersion, uint64 receiverVersion)\\n {\\n return (SENDER_VERSION, RECEIVER_VERSION);\\n }\\n}\\n\",\"keccak256\":\"0x0ba47a702d1d5689b38a055a72110529225cfa0570e3f102a5de45af70dcee82\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/oft/oapp/OAppSender.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\n\\nimport {SafeERC20, IERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {MessagingParams, MessagingFee, MessagingReceipt} from \\\"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\\\";\\nimport {OAppCore} from \\\"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppCore.sol\\\";\\n/**\\n * @title OAppSender\\n * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.\\n * @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppSender.sol'\\n * but has been modified to support ERC2771 compatibility.\\n */\\nabstract contract OAppSender is OAppCore {\\n using SafeERC20 for IERC20;\\n\\n // Custom error messages\\n error NotEnoughNative(uint256 msgValue);\\n error LzTokenUnavailable();\\n\\n // @dev The version of the OAppSender implementation.\\n // @dev Version is bumped when changes are made to this contract.\\n uint64 internal constant SENDER_VERSION = 1;\\n\\n /**\\n * @notice Retrieves the OApp version information.\\n * @return senderVersion The version of the OAppSender.sol contract.\\n * @return receiverVersion The version of the OAppReceiver.sol contract.\\n *\\n * @dev Providing 0 as the default for OAppReceiver version. Indicates that the OAppReceiver is not implemented.\\n * ie. this is a SEND only OApp.\\n * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions\\n */\\n function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\\n return (SENDER_VERSION, 0);\\n }\\n\\n /**\\n * @dev Internal function to interact with the LayerZero EndpointV2.quote() for fee calculation.\\n * @param _dstEid The destination endpoint ID.\\n * @param _message The message payload.\\n * @param _options Additional options for the message.\\n * @param _payInLzToken Flag indicating whether to pay the fee in LZ tokens.\\n * @return fee The calculated MessagingFee for the message.\\n * - nativeFee: The native fee for the message.\\n * - lzTokenFee: The LZ token fee for the message.\\n */\\n function _quote(\\n uint32 _dstEid,\\n bytes memory _message,\\n bytes memory _options,\\n bool _payInLzToken\\n ) internal view virtual returns (MessagingFee memory fee) {\\n return\\n endpoint.quote(\\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken),\\n address(this)\\n );\\n }\\n\\n /**\\n * @dev Internal function to interact with the LayerZero EndpointV2.send() for sending a message.\\n * @param _dstEid The destination endpoint ID.\\n * @param _message The message payload.\\n * @param _options Additional options for the message.\\n * @param _fee The calculated LayerZero fee for the message.\\n * - nativeFee: The native fee.\\n * - lzTokenFee: The lzToken fee.\\n * @param _refundAddress The address to receive any excess fee values sent to the endpoint.\\n * @return receipt The receipt for the sent message.\\n * - guid: The unique identifier for the sent message.\\n * - nonce: The nonce of the sent message.\\n * - fee: The LayerZero fee incurred for the message.\\n */\\n function _lzSend(\\n uint32 _dstEid,\\n bytes memory _message,\\n bytes memory _options,\\n MessagingFee memory _fee,\\n address _refundAddress\\n ) internal virtual returns (MessagingReceipt memory receipt) {\\n // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint.\\n uint256 messageValue = _payNative(_fee.nativeFee);\\n if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);\\n\\n return\\n // solhint-disable-next-line check-send-result\\n endpoint.send{value: messageValue}(\\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0),\\n _refundAddress\\n );\\n }\\n\\n /**\\n * @dev Internal function to pay the native fee associated with the message.\\n * @param _nativeFee The native fee to be paid.\\n * @return nativeFee The amount of native currency paid.\\n *\\n * @dev If the OApp needs to initiate MULTIPLE LayerZero messages in a single transaction,\\n * this will need to be overridden because msg.value would contain multiple lzFees.\\n * @dev Should be overridden in the event the LayerZero endpoint requires a different native currency.\\n * @dev Some EVMs use an ERC20 as a method for paying transactions/gasFees.\\n * @dev The endpoint is EITHER/OR, ie. it will NOT support both types of native payment at a time.\\n */\\n function _payNative(uint256 _nativeFee) internal virtual returns (uint256 nativeFee) {\\n if (msg.value != _nativeFee) revert NotEnoughNative(msg.value);\\n return _nativeFee;\\n }\\n\\n /**\\n * @dev Internal function to pay the LZ token fee associated with the message.\\n * @param _lzTokenFee The LZ token fee to be paid.\\n *\\n * @dev If the caller is trying to pay in the specified lzToken, then the lzTokenFee is passed to the endpoint.\\n * @dev Any excess sent, is passed back to the specified _refundAddress in the _lzSend().\\n */\\n function _payLzToken(uint256 _lzTokenFee) internal virtual {\\n // @dev Cannot cache the token because it is not immutable in the endpoint.\\n address lzToken = endpoint.lzToken();\\n if (lzToken == address(0)) revert LzTokenUnavailable();\\n\\n // Pay LZ token fee by sending tokens to the endpoint.\\n IERC20(lzToken).safeTransferFrom(_msgSender(), address(endpoint), _lzTokenFee);\\n }\\n}\\n\",\"keccak256\":\"0x4f4a30772bee7afac6945cdfb978202470722aa244c614efb245d2e4cd205bf3\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/sand/ERC2771Handler.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// solhint-disable-next-line compiler-version\\npragma solidity 0.8.23;\\n\\n/// @title ERC2771Handler\\n/// @author The Sandbox\\n/// @notice Handle meta-transactions\\n/// @dev minimal ERC2771 handler to keep bytecode-size down\\n/// based on: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.6.0/contracts/metatx/ERC2771Context.sol\\n/// with an initializer for proxies and a mutable forwarder\\nabstract contract ERC2771Handler {\\n address internal _trustedForwarder;\\n\\n event TrustedForwarderSet(address indexed newForwarder);\\n\\n /// @dev Initializes the contract\\n /// @param forwarder trusted forwarder address\\n function __ERC2771Handler_initialize(address forwarder) internal {\\n _trustedForwarder = forwarder;\\n emit TrustedForwarderSet(_trustedForwarder);\\n }\\n\\n /// @notice Checks if an address is a trusted forwarder\\n /// @param forwarder address to check\\n /// @return is trusted\\n function isTrustedForwarder(address forwarder) public view returns (bool) {\\n return forwarder == _trustedForwarder;\\n }\\n\\n /// @notice Get the current trusted forwarder\\n /// @return trustedForwarder address of the trusted forwarder\\n function getTrustedForwarder() external view returns (address) {\\n return _trustedForwarder;\\n }\\n\\n /// @dev if the call comes from the trusted forwarder, it gets the real sender by checking the encoded address in the data\\n /// @return sender address of the real sender\\n function _msgSender() internal view virtual returns (address sender) {\\n if (isTrustedForwarder(msg.sender)) {\\n // The assembly code is more direct than the Solidity version using `abi.decode`.\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\\n }\\n } else {\\n return msg.sender;\\n }\\n }\\n\\n /// @dev if the call comes from the trusted forwarder, it substracts the sender address from `msg.data` to get the real `msg.data`\\n /// @return the real `msg.data`\\n function _msgData() internal view virtual returns (bytes calldata) {\\n if (isTrustedForwarder(msg.sender)) {\\n return msg.data[:msg.data.length - 20];\\n } else {\\n return msg.data;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x740d1ad5b4dea0a78c29422d27ad22bc649505221bda874599a0370843c9dcad\",\"license\":\"MIT\"},\"@sandbox-smart-contracts/oft-sand/contracts/sand/WithAdmin.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\n// solhint-disable-next-line compiler-version\\npragma solidity 0.8.23;\\n\\nimport {IErrors} from \\\"../interfaces/IErrors.sol\\\";\\n\\ncontract WithAdmin is IErrors {\\n address internal _admin;\\n\\n /// @dev Emits when the contract administrator is changed.\\n /// @param oldAdmin The address of the previous administrator.\\n /// @param newAdmin The address of the new administrator.\\n event AdminChanged(address indexed oldAdmin, address indexed newAdmin);\\n\\n modifier onlyAdmin() {\\n if (msg.sender != _admin) {\\n revert OnlyAdmin();\\n }\\n _;\\n }\\n\\n /// @dev Get the current administrator of this contract.\\n /// @return The current administrator of this contract.\\n function getAdmin() external view returns (address) {\\n return _admin;\\n }\\n\\n /// @dev Change the administrator to be `newAdmin`.\\n /// @param newAdmin The address of the new administrator.\\n function changeAdmin(address newAdmin) external onlyAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_admin, newAdmin);\\n _admin = newAdmin;\\n }\\n}\\n\",\"keccak256\":\"0x1e31132c4458d4d9206e04ffd9ff718ce214885619d17817a23ed1e71a09b7c5\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60e06040523480156200001157600080fd5b50604051620038dd380380620038dd833981016040819052620000349162000379565b848484826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000076573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200009c9190620003e9565b8282818181818c6001600160a01b038116620000d257604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000dd8162000206565b506001600160a01b0380831660805281166200010c57604051632d618d8160e21b815260040160405180910390fd5b60805160405163ca5eb5e160e01b81526001600160a01b0383811660048301529091169063ca5eb5e190602401600060405180830381600087803b1580156200015457600080fd5b505af115801562000169573d6000803e3d6000fd5b5050505050505050620001816200025660201b60201c565b60ff168360ff161015620001a8576040516301e9714b60e41b815260040160405180910390fd5b620001b56006846200042b565b620001c290600a6200054a565b60a0525050506001600160a01b0390921660c05250620001e49050826200025b565b620001ef81620002a5565b620001fb600162000301565b50505050506200055b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600690565b600680546001600160a01b0319166001600160a01b0383169081179091556040517fd91237492a9e30cd2faf361fc103998a382ff0ec2b1b07dc1cbebb76ae2f1ea290600090a250565b6005546040516001600160a01b038084169216907f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f90600090a3600580546001600160a01b0319166001600160a01b0392909216919091179055565b6006805460ff60a01b1916600160a01b8315158102919091179182905560405160ff9190920416151581527f54ca1f89aee2b8d11c89b7813c6aa99caa0f8c55c8eccf8b70c3bb42029fa1349060200160405180910390a150565b80516001600160a01b03811681146200037457600080fd5b919050565b600080600080600060a086880312156200039257600080fd5b6200039d866200035c565b9450620003ad602087016200035c565b9350620003bd604087016200035c565b9250620003cd606087016200035c565b9150620003dd608087016200035c565b90509295509295909350565b600060208284031215620003fc57600080fd5b815160ff811681146200040e57600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b60ff828116828216039081111562000447576200044762000415565b92915050565b600181815b808511156200048e57816000190482111562000472576200047262000415565b808516156200048057918102915b93841c939080029062000452565b509250929050565b600082620004a75750600162000447565b81620004b65750600062000447565b8160018114620004cf5760028114620004da57620004fa565b600191505062000447565b60ff841115620004ee57620004ee62000415565b50506001821b62000447565b5060208310610133831016604e8410600b84101617156200051f575081810a62000447565b6200052b83836200044d565b806000190482111562000542576200054262000415565b029392505050565b60006200040e60ff84168362000496565b60805160a05160c0516132fe620005df6000396000818161084801528181611c3a0152611ddd01526000818161068301528181611b8001528181611bfc0152611cfc01526000818161054601528181610960015281816110e7015281816114120152818161170c01528181611e410152818161205b015261213501526132fe6000f3fe6080604052600436106102bb5760003560e01c806382413eac1161016e578063bd815db0116100cb578063d42438851161007f578063f2fde38b11610064578063f2fde38b14610819578063fc0c546a14610839578063ff7bd03d1461086c57600080fd5b8063d4243885146107d9578063da742228146107f957600080fd5b8063ca5eb5e1116100b0578063ca5eb5e114610788578063ce1b815f146107a8578063d045a0dc146107c657600080fd5b8063bd815db014610754578063c7c7f5b31461076757600080fd5b80639f68b96411610122578063b98bd07011610107578063b98bd070146106e7578063bb0b6a5314610707578063bc70b3541461073457600080fd5b80639f68b964146106b3578063b731ea0a146106c757600080fd5b80638da5cb5b116101535780638da5cb5b146106335780638f28397014610651578063963efcaa1461067157600080fd5b806382413eac146105f7578063857749b01461061757600080fd5b80634df68ada1161021c5780635e280f11116101d05780636fc1b31e116101b55780636fc1b31e14610586578063715018a6146105a65780637d25a05e146105bb57600080fd5b80635e280f11146105345780636e9960c31461056857600080fd5b80635535d461116102015780635535d461146104a1578063572b6c05146104ce5780635a0dfe4d146104fd57600080fd5b80634df68ada1461046e57806352ae28791461048e57600080fd5b806317442b70116102735780631f5e1334116102585780631f5e13341461040c5780633400288b146104215780633b6f743b1461044157600080fd5b806317442b70146103ae57806318de0afd146103d057600080fd5b806313137d65116102a457806313137d6514610330578063134d4f2514610345578063156a0d0f1461036d57600080fd5b80630d35b415146102c0578063111ecdad146102f8575b600080fd5b3480156102cc57600080fd5b506102e06102db36600461236f565b61088c565b6040516102ef939291906123f4565b60405180910390f35b34801561030457600080fd5b50600454610318906001600160a01b031681565b6040516001600160a01b0390911681526020016102ef565b61034361033e36600461251b565b61095e565b005b34801561035157600080fd5b5061035a600281565b60405161ffff90911681526020016102ef565b34801561037957600080fd5b50604080517f02e49c2c00000000000000000000000000000000000000000000000000000000815260016020820152016102ef565b3480156103ba57600080fd5b50604080516001815260026020820152016102ef565b3480156103dc57600080fd5b5060065474010000000000000000000000000000000000000000900460ff165b60405190151581526020016102ef565b34801561041857600080fd5b5061035a600181565b34801561042d57600080fd5b5061034361043c3660046125d4565b610a50565b34801561044d57600080fd5b5061046161045c36600461260c565b610a66565b6040516102ef919061265e565b34801561047a57600080fd5b50610343610489366004612675565b610acf565b34801561049a57600080fd5b5030610318565b3480156104ad57600080fd5b506104c16104bc3660046126a4565b610b1f565b6040516102ef91906126d7565b3480156104da57600080fd5b506103fc6104e93660046126ea565b6006546001600160a01b0391821691161490565b34801561050957600080fd5b506103fc6105183660046125d4565b63ffffffff919091166000908152600160205260409020541490565b34801561054057600080fd5b506103187f000000000000000000000000000000000000000000000000000000000000000081565b34801561057457600080fd5b506005546001600160a01b0316610318565b34801561059257600080fd5b506103436105a13660046126ea565b610bc4565b3480156105b257600080fd5b50610343610c2e565b3480156105c757600080fd5b506105de6105d63660046125d4565b600092915050565b60405167ffffffffffffffff90911681526020016102ef565b34801561060357600080fd5b506103fc610612366004612707565b610c42565b34801561062357600080fd5b50604051600681526020016102ef565b34801561063f57600080fd5b506000546001600160a01b0316610318565b34801561065d57600080fd5b5061034361066c3660046126ea565b610c57565b34801561067d57600080fd5b506106a57f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016102ef565b3480156106bf57600080fd5b5060016103fc565b3480156106d357600080fd5b50600254610318906001600160a01b031681565b3480156106f357600080fd5b506103436107023660046127b3565b610ca4565b34801561071357600080fd5b506106a56107223660046127f5565b60016020526000908152604090205481565b34801561074057600080fd5b506104c161074f366004612810565b610cbe565b6103436107623660046127b3565b610e7f565b61077a610775366004612871565b611022565b6040516102ef9291906128df565b34801561079457600080fd5b506103436107a33660046126ea565b6110a7565b3480156107b457600080fd5b506006546001600160a01b0316610318565b6103436107d436600461251b565b611146565b3480156107e557600080fd5b506103436107f43660046126ea565b61118e565b34801561080557600080fd5b506103436108143660046126ea565b6111f1565b34801561082557600080fd5b506103436108343660046126ea565b611228565b34801561084557600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610318565b34801561087857600080fd5b506103fc610887366004612932565b61127c565b604080518082019091526000808252602082015260606108bf604051806040016040528060008152602001600081525090565b604080518082018252600080825267ffffffffffffffff60208084018290528451838152908101909452919550918261091b565b6040805180820190915260008152606060208201528152602001906001900390816108f35790505b509350600080610940604089013560608a013561093b60208c018c6127f5565b6112b2565b60408051808201909152918252602082015296989597505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633146109c7576040517f91ac5e4f0000000000000000000000000000000000000000000000000000000081523360048201526024015b60405180910390fd5b602087018035906109e1906109dc908a6127f5565b61130f565b14610a38576109f360208801886127f5565b6040517fc26bebcc00000000000000000000000000000000000000000000000000000000815263ffffffff9091166004820152602088013560248201526044016109be565b610a4787878787878787611364565b50505050505050565b610a586114e4565b610a62828261155b565b5050565b60408051808201909152600080825260208201526000610a966040850135606086013561093b60208801886127f5565b915050600080610aa686846115b0565b9092509050610ac3610abb60208801886127f5565b8383886116f6565b93505050505b92915050565b6005546001600160a01b03163314610b13576040517f4755657900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b1c816117d7565b50565b600360209081526000928352604080842090915290825290208054610b4390612964565b80601f0160208091040260200160405190810160405280929190818152602001828054610b6f90612964565b8015610bbc5780601f10610b9157610100808354040283529160200191610bbc565b820191906000526020600020905b815481529060010190602001808311610b9f57829003601f168201915b505050505081565b610bcc6114e4565b6004805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527ff0be4f1e87349231d80c36b33f9e8639658eeaf474014dee15a3e6a4d4414197906020015b60405180910390a150565b610c366114e4565b610c406000611858565b565b6001600160a01b03811630145b949350505050565b6005546001600160a01b03163314610c9b576040517f4755657900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b1c816118b5565b610cac6114e4565b610a62610cb98284612a3d565b61191e565b63ffffffff8416600090815260036020908152604080832061ffff87168452909152812080546060929190610cf290612964565b80601f0160208091040260200160405190810160405280929190818152602001828054610d1e90612964565b8015610d6b5780601f10610d4057610100808354040283529160200191610d6b565b820191906000526020600020905b815481529060010190602001808311610d4e57829003601f168201915b505050505090508051600003610dbb5783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929450610c4f9350505050565b6000839003610dcb579050610c4f565b60028310610e4957610e1284848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a2592505050565b80610e208460028188612b53565b604051602001610e3293929190612b7d565b604051602081830303815290604052915050610c4f565b83836040517f9a6d49cd0000000000000000000000000000000000000000000000000000000081526004016109be929190612bd0565b60005b81811015610f885736838383818110610e9d57610e9d612be4565b9050602002810190610eaf9190612bfa565b9050610ee2610ec160208301836127f5565b602083013563ffffffff919091166000908152600160205260409020541490565b610eec5750610f80565b3063d045a0dc60c08301358360a0810135610f0b610100830183612c38565b610f1c610100890160e08a016126ea565b610f2a6101208a018a612c38565b6040518963ffffffff1660e01b8152600401610f4c9796959493929190612cb3565b6000604051808303818588803b158015610f6557600080fd5b505af1158015610f79573d6000803e3d6000fd5b5050505050505b600101610e82565b50336001600160a01b0316638e9e70996040518163ffffffff1660e01b8152600401600060405180830381865afa158015610fc7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fef9190810190612d3a565b6040517f8351eea70000000000000000000000000000000000000000000000000000000081526004016109be91906126d7565b61102a61230f565b604080518082019091526000808252602082015260065474010000000000000000000000000000000000000000900460ff16611092576040517f3a4155f600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61109d858585611a6a565b5050935093915050565b6110af6114e4565b6040517fca5eb5e10000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063ca5eb5e190602401600060405180830381600087803b15801561112b57600080fd5b505af115801561113f573d6000803e3d6000fd5b5050505050565b33301461117f576040517f14d4a4e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610a4787878787878787610a38565b6111966114e4565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fd48d879cef83a1c0bdda516f27b13ddb1b3f8bbac1c9e1511bb2a659c242776090602001610c23565b6111f96114e4565b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6112306114e4565b6001600160a01b038116611273576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024016109be565b610b1c81611858565b600060208201803590600190839061129490866127f5565b63ffffffff1681526020810191909152604001600020541492915050565b6000806112be85611b7c565b915081905083811015611307576040517f71c4efed00000000000000000000000000000000000000000000000000000000815260048101829052602481018590526044016109be565b935093915050565b63ffffffff811660009081526001602052604081205480610ac9576040517ff6ff4fb700000000000000000000000000000000000000000000000000000000815263ffffffff841660048201526024016109be565b60006113766113738787611bb3565b90565b905060006113a28261139061138b8a8a611bd2565b611bf5565b61139d60208d018d6127f5565b611c2b565b905060288611156114825760006113df6113c260608c0160408d01612da8565b6113cf60208d018d6127f5565b846113da8c8c611c69565b611cb4565b6040517f7cb590120000000000000000000000000000000000000000000000000000000081529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690637cb590129061144e9086908d906000908790600401612dc5565b600060405180830381600087803b15801561146857600080fd5b505af115801561147c573d6000803e3d6000fd5b50505050505b6001600160a01b038216887fefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c6114bb60208d018d6127f5565b6040805163ffffffff9092168252602082018690520160405180910390a3505050505050505050565b6114ec611ce6565b6001600160a01b03166115076000546001600160a01b031690565b6001600160a01b031614610c405761151d611ce6565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024016109be565b63ffffffff8216600081815260016020908152604091829020849055815192835282018390527f238399d427b947898edb290f5ff0f9109849b1c3ba196a42e35f00c50a54b98b910160405180910390a15050565b606080600061161685602001356115c686611cf5565b6115d360a0890189612c38565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506116119250611ce6915050565b611d21565b909350905060008161162957600161162c565b60025b905061164c61163e60208801886127f5565b8261074f60808a018a612c38565b6004549093506001600160a01b0316156116ed57600480546040517f043a78eb0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169163043a78eb916116aa918891889101612df7565b602060405180830381865afa1580156116c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116eb9190612e1c565b505b50509250929050565b60408051808201909152600080825260208201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ddc28c586040518060a001604052808863ffffffff1681526020016117598961130f565b8152602001878152602001868152602001851515815250306040518363ffffffff1660e01b815260040161178e929190612e39565b6040805180830381865afa1580156117aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ce9190612ee2565b95945050505050565b600680547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000008315158102919091179182905560405160ff9190920416151581527f54ca1f89aee2b8d11c89b7813c6aa99caa0f8c55c8eccf8b70c3bb42029fa13490602001610c23565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6005546040516001600160a01b038084169216907f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f90600090a36005805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60005b81518110156119f55761195082828151811061193f5761193f612be4565b602002602001015160400151611a25565b81818151811061196257611962612be4565b6020026020010151604001516003600084848151811061198457611984612be4565b60200260200101516000015163ffffffff1663ffffffff16815260200190815260200160002060008484815181106119be576119be612be4565b60200260200101516020015161ffff1661ffff16815260200190815260200160002090816119ec9190612f4e565b50600101611921565b507fbe4864a8e820971c0247f5992e2da559595f7bf076a21cb5928d443d2a13b67481604051610c23919061300e565b600281015161ffff8116600314610a6257816040517f9a6d49cd0000000000000000000000000000000000000000000000000000000081526004016109be91906126d7565b611a7261230f565b6040805180820190915260008082526020820152600080611ab0611a94611ce6565b604089013560608a0135611aab60208c018c6127f5565b611dbd565b91509150600080611ac189846115b0565b9092509050611aed611ad660208b018b6127f5565b8383611ae7368d90038d018d613099565b8b611e0e565b95506040518060400160405280858152602001848152509450611b0e611ce6565b86516001600160a01b0391909116907f85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a611b4b60208d018d6127f5565b6040805163ffffffff909216825260208201899052810187905260600160405180910390a350505050935093915050565b60007f0000000000000000000000000000000000000000000000000000000000000000611ba981846130cb565b610ac991906130ed565b6000611bc26020828486612b53565b611bcb91613112565b9392505050565b6000611be2602860208486612b53565b611beb91613130565b60c01c9392505050565b6000610ac97f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff84166130ed565b6000611c616001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168585611f19565b509092915050565b6060611c788260288186612b53565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929695505050505050565b606084848484604051602001611ccd9493929190613178565b6040516020818303038152906040529050949350505050565b6000611cf0611f92565b905090565b6000610ac97f0000000000000000000000000000000000000000000000000000000000000000836130cb565b8151606090151580611d82578585604051602001611d6e92919091825260c01b7fffffffffffffffff00000000000000000000000000000000000000000000000016602082015260280190565b604051602081830303815290604052611db2565b85856001600160a01b03851686604051602001611da294939291906131f6565b6040516020818303038152906040525b915094509492505050565b600080611dcb8585856112b2565b9092509050611e056001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016873085611fd7565b94509492505050565b611e1661230f565b6000611e258460000151612016565b602085015190915015611e3f57611e3f8460200151612057565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632637a450826040518060a001604052808b63ffffffff168152602001611e8f8c61130f565b81526020018a815260200189815260200160008960200151111515815250866040518463ffffffff1660e01b8152600401611ecb929190612e39565b60806040518083038185885af1158015611ee9573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611f0e919061324f565b979650505050505050565b6040516001600160a01b03838116602483015260448201839052611f8d91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061215a565b505050565b6006546000906001600160a01b03163303611fd257507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c90565b503390565b6040516001600160a01b0384811660248301528381166044830152606482018390526120109186918216906323b872dd90608401611f46565b50505050565b6000813414612053576040517f9f7041200000000000000000000000000000000000000000000000000000000081523460048201526024016109be565b5090565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e4fe1d946040518163ffffffff1660e01b8152600401602060405180830381865afa1580156120b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120db9190613299565b90506001600160a01b03811661211d576040517f5373352a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610a62612128611ce6565b6001600160a01b038316907f000000000000000000000000000000000000000000000000000000000000000085611fd7565b600061216f6001600160a01b038416836121d6565b905080516000141580156121945750808060200190518101906121929190612e1c565b155b15611f8d576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024016109be565b6060611bcb8383600084600080856001600160a01b031684866040516121fc91906132b6565b60006040518083038185875af1925050503d8060008114612239576040519150601f19603f3d011682016040523d82523d6000602084013e61223e565b606091505b509150915061224e868383612258565b9695505050505050565b60608261226d57612268826122cd565b611bcb565b815115801561228457506001600160a01b0384163b155b156122c6576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024016109be565b5080611bcb565b8051156122dd5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604051806060016040528060008019168152602001600067ffffffffffffffff168152602001612352604051806040016040528060008152602001600081525090565b905290565b600060e0828403121561236957600080fd5b50919050565b60006020828403121561238157600080fd5b813567ffffffffffffffff81111561239857600080fd5b610c4f84828501612357565b60005b838110156123bf5781810151838201526020016123a7565b50506000910152565b600081518084526123e08160208601602086016123a4565b601f01601f19169290920160200192915050565b8351815260208085015190820152600060a08201604060a0604085015281865180845260c08601915060c08160051b8701019350602080890160005b8381101561248d578887037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4001855281518051885283015183880187905261247a878901826123c8565b9750509382019390820190600101612430565b50508751606088015250505060208501516080850152509050610c4f565b60006060828403121561236957600080fd5b60008083601f8401126124cf57600080fd5b50813567ffffffffffffffff8111156124e757600080fd5b6020830191508360208285010111156124ff57600080fd5b9250929050565b6001600160a01b0381168114610b1c57600080fd5b600080600080600080600060e0888a03121561253657600080fd5b61254089896124ab565b965060608801359550608088013567ffffffffffffffff8082111561256457600080fd5b6125708b838c016124bd565b909750955060a08a0135915061258582612506565b90935060c0890135908082111561259b57600080fd5b506125a88a828b016124bd565b989b979a50959850939692959293505050565b803563ffffffff811681146125cf57600080fd5b919050565b600080604083850312156125e757600080fd5b6125f0836125bb565b946020939093013593505050565b8015158114610b1c57600080fd5b6000806040838503121561261f57600080fd5b823567ffffffffffffffff81111561263657600080fd5b61264285828601612357565b9250506020830135612653816125fe565b809150509250929050565b815181526020808301519082015260408101610ac9565b60006020828403121561268757600080fd5b8135611bcb816125fe565b803561ffff811681146125cf57600080fd5b600080604083850312156126b757600080fd5b6126c0836125bb565b91506126ce60208401612692565b90509250929050565b602081526000611bcb60208301846123c8565b6000602082840312156126fc57600080fd5b8135611bcb81612506565b60008060008060a0858703121561271d57600080fd5b61272786866124ab565b9350606085013567ffffffffffffffff81111561274357600080fd5b61274f878288016124bd565b909450925050608085013561276381612506565b939692955090935050565b60008083601f84011261278057600080fd5b50813567ffffffffffffffff81111561279857600080fd5b6020830191508360208260051b85010111156124ff57600080fd5b600080602083850312156127c657600080fd5b823567ffffffffffffffff8111156127dd57600080fd5b6127e98582860161276e565b90969095509350505050565b60006020828403121561280757600080fd5b611bcb826125bb565b6000806000806060858703121561282657600080fd5b61282f856125bb565b935061283d60208601612692565b9250604085013567ffffffffffffffff81111561285957600080fd5b612865878288016124bd565b95989497509550505050565b6000806000838503608081121561288757600080fd5b843567ffffffffffffffff81111561289e57600080fd5b6128aa87828801612357565b9450506040601f19820112156128bf57600080fd5b5060208401915060608401356128d481612506565b809150509250925092565b600060c0820190508351825267ffffffffffffffff6020850151166020830152604084015161291b604084018280518252602090810151910152565b5082516080830152602083015160a0830152611bcb565b60006060828403121561294457600080fd5b611bcb83836124ab565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061297857607f821691505b60208210810361236957634e487b7160e01b600052602260045260246000fd5b6040516060810167ffffffffffffffff811182821017156129bb576129bb61294e565b60405290565b6040805190810167ffffffffffffffff811182821017156129bb576129bb61294e565b604051601f8201601f1916810167ffffffffffffffff81118282101715612a0d57612a0d61294e565b604052919050565b600067ffffffffffffffff821115612a2f57612a2f61294e565b50601f01601f191660200190565b600067ffffffffffffffff80841115612a5857612a5861294e565b8360051b6020612a698183016129e4565b868152918501918181019036841115612a8157600080fd5b865b84811015612b4757803586811115612a9b5760008081fd5b88016060368290031215612aaf5760008081fd5b612ab7612998565b612ac0826125bb565b8152612acd868301612692565b8682015260408083013589811115612ae55760008081fd5b929092019136601f840112612afa5760008081fd5b8235612b0d612b0882612a15565b6129e4565b8181523689838701011115612b225760008081fd5b818986018a830137600091810189019190915290820152845250918301918301612a83565b50979650505050505050565b60008085851115612b6357600080fd5b83861115612b7057600080fd5b5050820193919092039150565b60008451612b8f8184602089016123a4565b8201838582376000930192835250909392505050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b602081526000610c4f602083018486612ba5565b634e487b7160e01b600052603260045260246000fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec1833603018112612c2e57600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612c6d57600080fd5b83018035915067ffffffffffffffff821115612c8857600080fd5b6020019150368190038213156124ff57600080fd5b67ffffffffffffffff81168114610b1c57600080fd5b63ffffffff612cc1896125bb565b1681526020880135602082015260006040890135612cde81612c9d565b67ffffffffffffffff811660408401525087606083015260e06080830152612d0a60e083018789612ba5565b6001600160a01b03861660a084015282810360c0840152612d2c818587612ba5565b9a9950505050505050505050565b600060208284031215612d4c57600080fd5b815167ffffffffffffffff811115612d6357600080fd5b8201601f81018413612d7457600080fd5b8051612d82612b0882612a15565b818152856020838501011115612d9757600080fd5b6117ce8260208301602086016123a4565b600060208284031215612dba57600080fd5b8135611bcb81612c9d565b6001600160a01b038516815283602082015261ffff8316604082015260806060820152600061224e60808301846123c8565b604081526000612e0a60408301856123c8565b82810360208401526117ce81856123c8565b600060208284031215612e2e57600080fd5b8151611bcb816125fe565b6040815263ffffffff8351166040820152602083015160608201526000604084015160a06080840152612e6f60e08401826123c8565b90506060850151603f198483030160a0850152612e8c82826123c8565b60809690960151151560c08501525050506001600160a01b039190911660209091015290565b600060408284031215612ec457600080fd5b612ecc6129c1565b9050815181526020820151602082015292915050565b600060408284031215612ef457600080fd5b611bcb8383612eb2565b601f821115611f8d576000816000526020600020601f850160051c81016020861015612f275750805b601f850160051c820191505b81811015612f4657828155600101612f33565b505050505050565b815167ffffffffffffffff811115612f6857612f6861294e565b612f7c81612f768454612964565b84612efe565b602080601f831160018114612fb15760008415612f995750858301515b600019600386901b1c1916600185901b178555612f46565b600085815260208120601f198616915b82811015612fe057888601518255948401946001909101908401612fc1565b5085821015612ffe5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b8381101561308b57888303603f190185528151805163ffffffff1684528781015161ffff16888501528601516060878501819052613077818601836123c8565b968901969450505090860190600101613037565b509098975050505050505050565b6000604082840312156130ab57600080fd5b6130b36129c1565b82358152602083013560208201528091505092915050565b6000826130e857634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610ac957634e487b7160e01b600052601160045260246000fd5b80356020831015610ac957600019602084900360031b1b1692915050565b7fffffffffffffffff00000000000000000000000000000000000000000000000081358181169160088510156131705780818660080360031b1b83161692505b505092915050565b7fffffffffffffffff0000000000000000000000000000000000000000000000008560c01b1681527fffffffff000000000000000000000000000000000000000000000000000000008460e01b16600882015282600c820152600082516131e681602c8501602087016123a4565b91909101602c0195945050505050565b8481527fffffffffffffffff0000000000000000000000000000000000000000000000008460c01b1660208201528260288201526000825161323f8160488501602087016123a4565b9190910160480195945050505050565b60006080828403121561326157600080fd5b613269612998565b82518152602083015161327b81612c9d565b602082015261328d8460408501612eb2565b60408201529392505050565b6000602082840312156132ab57600080fd5b8151611bcb81612506565b60008251612c2e8184602087016123a456fea26469706673582212205c46b82c536edf6d6947388d0f3e373e057efb49f5e043f296faa1ceb20a2a6964736f6c63430008170033", + "deployedBytecode": "0x6080604052600436106102bb5760003560e01c806382413eac1161016e578063bd815db0116100cb578063d42438851161007f578063f2fde38b11610064578063f2fde38b14610819578063fc0c546a14610839578063ff7bd03d1461086c57600080fd5b8063d4243885146107d9578063da742228146107f957600080fd5b8063ca5eb5e1116100b0578063ca5eb5e114610788578063ce1b815f146107a8578063d045a0dc146107c657600080fd5b8063bd815db014610754578063c7c7f5b31461076757600080fd5b80639f68b96411610122578063b98bd07011610107578063b98bd070146106e7578063bb0b6a5314610707578063bc70b3541461073457600080fd5b80639f68b964146106b3578063b731ea0a146106c757600080fd5b80638da5cb5b116101535780638da5cb5b146106335780638f28397014610651578063963efcaa1461067157600080fd5b806382413eac146105f7578063857749b01461061757600080fd5b80634df68ada1161021c5780635e280f11116101d05780636fc1b31e116101b55780636fc1b31e14610586578063715018a6146105a65780637d25a05e146105bb57600080fd5b80635e280f11146105345780636e9960c31461056857600080fd5b80635535d461116102015780635535d461146104a1578063572b6c05146104ce5780635a0dfe4d146104fd57600080fd5b80634df68ada1461046e57806352ae28791461048e57600080fd5b806317442b70116102735780631f5e1334116102585780631f5e13341461040c5780633400288b146104215780633b6f743b1461044157600080fd5b806317442b70146103ae57806318de0afd146103d057600080fd5b806313137d65116102a457806313137d6514610330578063134d4f2514610345578063156a0d0f1461036d57600080fd5b80630d35b415146102c0578063111ecdad146102f8575b600080fd5b3480156102cc57600080fd5b506102e06102db36600461236f565b61088c565b6040516102ef939291906123f4565b60405180910390f35b34801561030457600080fd5b50600454610318906001600160a01b031681565b6040516001600160a01b0390911681526020016102ef565b61034361033e36600461251b565b61095e565b005b34801561035157600080fd5b5061035a600281565b60405161ffff90911681526020016102ef565b34801561037957600080fd5b50604080517f02e49c2c00000000000000000000000000000000000000000000000000000000815260016020820152016102ef565b3480156103ba57600080fd5b50604080516001815260026020820152016102ef565b3480156103dc57600080fd5b5060065474010000000000000000000000000000000000000000900460ff165b60405190151581526020016102ef565b34801561041857600080fd5b5061035a600181565b34801561042d57600080fd5b5061034361043c3660046125d4565b610a50565b34801561044d57600080fd5b5061046161045c36600461260c565b610a66565b6040516102ef919061265e565b34801561047a57600080fd5b50610343610489366004612675565b610acf565b34801561049a57600080fd5b5030610318565b3480156104ad57600080fd5b506104c16104bc3660046126a4565b610b1f565b6040516102ef91906126d7565b3480156104da57600080fd5b506103fc6104e93660046126ea565b6006546001600160a01b0391821691161490565b34801561050957600080fd5b506103fc6105183660046125d4565b63ffffffff919091166000908152600160205260409020541490565b34801561054057600080fd5b506103187f000000000000000000000000000000000000000000000000000000000000000081565b34801561057457600080fd5b506005546001600160a01b0316610318565b34801561059257600080fd5b506103436105a13660046126ea565b610bc4565b3480156105b257600080fd5b50610343610c2e565b3480156105c757600080fd5b506105de6105d63660046125d4565b600092915050565b60405167ffffffffffffffff90911681526020016102ef565b34801561060357600080fd5b506103fc610612366004612707565b610c42565b34801561062357600080fd5b50604051600681526020016102ef565b34801561063f57600080fd5b506000546001600160a01b0316610318565b34801561065d57600080fd5b5061034361066c3660046126ea565b610c57565b34801561067d57600080fd5b506106a57f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016102ef565b3480156106bf57600080fd5b5060016103fc565b3480156106d357600080fd5b50600254610318906001600160a01b031681565b3480156106f357600080fd5b506103436107023660046127b3565b610ca4565b34801561071357600080fd5b506106a56107223660046127f5565b60016020526000908152604090205481565b34801561074057600080fd5b506104c161074f366004612810565b610cbe565b6103436107623660046127b3565b610e7f565b61077a610775366004612871565b611022565b6040516102ef9291906128df565b34801561079457600080fd5b506103436107a33660046126ea565b6110a7565b3480156107b457600080fd5b506006546001600160a01b0316610318565b6103436107d436600461251b565b611146565b3480156107e557600080fd5b506103436107f43660046126ea565b61118e565b34801561080557600080fd5b506103436108143660046126ea565b6111f1565b34801561082557600080fd5b506103436108343660046126ea565b611228565b34801561084557600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610318565b34801561087857600080fd5b506103fc610887366004612932565b61127c565b604080518082019091526000808252602082015260606108bf604051806040016040528060008152602001600081525090565b604080518082018252600080825267ffffffffffffffff60208084018290528451838152908101909452919550918261091b565b6040805180820190915260008152606060208201528152602001906001900390816108f35790505b509350600080610940604089013560608a013561093b60208c018c6127f5565b6112b2565b60408051808201909152918252602082015296989597505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633146109c7576040517f91ac5e4f0000000000000000000000000000000000000000000000000000000081523360048201526024015b60405180910390fd5b602087018035906109e1906109dc908a6127f5565b61130f565b14610a38576109f360208801886127f5565b6040517fc26bebcc00000000000000000000000000000000000000000000000000000000815263ffffffff9091166004820152602088013560248201526044016109be565b610a4787878787878787611364565b50505050505050565b610a586114e4565b610a62828261155b565b5050565b60408051808201909152600080825260208201526000610a966040850135606086013561093b60208801886127f5565b915050600080610aa686846115b0565b9092509050610ac3610abb60208801886127f5565b8383886116f6565b93505050505b92915050565b6005546001600160a01b03163314610b13576040517f4755657900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b1c816117d7565b50565b600360209081526000928352604080842090915290825290208054610b4390612964565b80601f0160208091040260200160405190810160405280929190818152602001828054610b6f90612964565b8015610bbc5780601f10610b9157610100808354040283529160200191610bbc565b820191906000526020600020905b815481529060010190602001808311610b9f57829003601f168201915b505050505081565b610bcc6114e4565b6004805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527ff0be4f1e87349231d80c36b33f9e8639658eeaf474014dee15a3e6a4d4414197906020015b60405180910390a150565b610c366114e4565b610c406000611858565b565b6001600160a01b03811630145b949350505050565b6005546001600160a01b03163314610c9b576040517f4755657900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610b1c816118b5565b610cac6114e4565b610a62610cb98284612a3d565b61191e565b63ffffffff8416600090815260036020908152604080832061ffff87168452909152812080546060929190610cf290612964565b80601f0160208091040260200160405190810160405280929190818152602001828054610d1e90612964565b8015610d6b5780601f10610d4057610100808354040283529160200191610d6b565b820191906000526020600020905b815481529060010190602001808311610d4e57829003601f168201915b505050505090508051600003610dbb5783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929450610c4f9350505050565b6000839003610dcb579050610c4f565b60028310610e4957610e1284848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a2592505050565b80610e208460028188612b53565b604051602001610e3293929190612b7d565b604051602081830303815290604052915050610c4f565b83836040517f9a6d49cd0000000000000000000000000000000000000000000000000000000081526004016109be929190612bd0565b60005b81811015610f885736838383818110610e9d57610e9d612be4565b9050602002810190610eaf9190612bfa565b9050610ee2610ec160208301836127f5565b602083013563ffffffff919091166000908152600160205260409020541490565b610eec5750610f80565b3063d045a0dc60c08301358360a0810135610f0b610100830183612c38565b610f1c610100890160e08a016126ea565b610f2a6101208a018a612c38565b6040518963ffffffff1660e01b8152600401610f4c9796959493929190612cb3565b6000604051808303818588803b158015610f6557600080fd5b505af1158015610f79573d6000803e3d6000fd5b5050505050505b600101610e82565b50336001600160a01b0316638e9e70996040518163ffffffff1660e01b8152600401600060405180830381865afa158015610fc7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fef9190810190612d3a565b6040517f8351eea70000000000000000000000000000000000000000000000000000000081526004016109be91906126d7565b61102a61230f565b604080518082019091526000808252602082015260065474010000000000000000000000000000000000000000900460ff16611092576040517f3a4155f600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61109d858585611a6a565b5050935093915050565b6110af6114e4565b6040517fca5eb5e10000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063ca5eb5e190602401600060405180830381600087803b15801561112b57600080fd5b505af115801561113f573d6000803e3d6000fd5b5050505050565b33301461117f576040517f14d4a4e800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610a4787878787878787610a38565b6111966114e4565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fd48d879cef83a1c0bdda516f27b13ddb1b3f8bbac1c9e1511bb2a659c242776090602001610c23565b6111f96114e4565b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6112306114e4565b6001600160a01b038116611273576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024016109be565b610b1c81611858565b600060208201803590600190839061129490866127f5565b63ffffffff1681526020810191909152604001600020541492915050565b6000806112be85611b7c565b915081905083811015611307576040517f71c4efed00000000000000000000000000000000000000000000000000000000815260048101829052602481018590526044016109be565b935093915050565b63ffffffff811660009081526001602052604081205480610ac9576040517ff6ff4fb700000000000000000000000000000000000000000000000000000000815263ffffffff841660048201526024016109be565b60006113766113738787611bb3565b90565b905060006113a28261139061138b8a8a611bd2565b611bf5565b61139d60208d018d6127f5565b611c2b565b905060288611156114825760006113df6113c260608c0160408d01612da8565b6113cf60208d018d6127f5565b846113da8c8c611c69565b611cb4565b6040517f7cb590120000000000000000000000000000000000000000000000000000000081529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690637cb590129061144e9086908d906000908790600401612dc5565b600060405180830381600087803b15801561146857600080fd5b505af115801561147c573d6000803e3d6000fd5b50505050505b6001600160a01b038216887fefed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c6114bb60208d018d6127f5565b6040805163ffffffff9092168252602082018690520160405180910390a3505050505050505050565b6114ec611ce6565b6001600160a01b03166115076000546001600160a01b031690565b6001600160a01b031614610c405761151d611ce6565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526001600160a01b0390911660048201526024016109be565b63ffffffff8216600081815260016020908152604091829020849055815192835282018390527f238399d427b947898edb290f5ff0f9109849b1c3ba196a42e35f00c50a54b98b910160405180910390a15050565b606080600061161685602001356115c686611cf5565b6115d360a0890189612c38565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506116119250611ce6915050565b611d21565b909350905060008161162957600161162c565b60025b905061164c61163e60208801886127f5565b8261074f60808a018a612c38565b6004549093506001600160a01b0316156116ed57600480546040517f043a78eb0000000000000000000000000000000000000000000000000000000081526001600160a01b039091169163043a78eb916116aa918891889101612df7565b602060405180830381865afa1580156116c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116eb9190612e1c565b505b50509250929050565b60408051808201909152600080825260208201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663ddc28c586040518060a001604052808863ffffffff1681526020016117598961130f565b8152602001878152602001868152602001851515815250306040518363ffffffff1660e01b815260040161178e929190612e39565b6040805180830381865afa1580156117aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ce9190612ee2565b95945050505050565b600680547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000008315158102919091179182905560405160ff9190920416151581527f54ca1f89aee2b8d11c89b7813c6aa99caa0f8c55c8eccf8b70c3bb42029fa13490602001610c23565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6005546040516001600160a01b038084169216907f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f90600090a36005805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60005b81518110156119f55761195082828151811061193f5761193f612be4565b602002602001015160400151611a25565b81818151811061196257611962612be4565b6020026020010151604001516003600084848151811061198457611984612be4565b60200260200101516000015163ffffffff1663ffffffff16815260200190815260200160002060008484815181106119be576119be612be4565b60200260200101516020015161ffff1661ffff16815260200190815260200160002090816119ec9190612f4e565b50600101611921565b507fbe4864a8e820971c0247f5992e2da559595f7bf076a21cb5928d443d2a13b67481604051610c23919061300e565b600281015161ffff8116600314610a6257816040517f9a6d49cd0000000000000000000000000000000000000000000000000000000081526004016109be91906126d7565b611a7261230f565b6040805180820190915260008082526020820152600080611ab0611a94611ce6565b604089013560608a0135611aab60208c018c6127f5565b611dbd565b91509150600080611ac189846115b0565b9092509050611aed611ad660208b018b6127f5565b8383611ae7368d90038d018d613099565b8b611e0e565b95506040518060400160405280858152602001848152509450611b0e611ce6565b86516001600160a01b0391909116907f85496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a611b4b60208d018d6127f5565b6040805163ffffffff909216825260208201899052810187905260600160405180910390a350505050935093915050565b60007f0000000000000000000000000000000000000000000000000000000000000000611ba981846130cb565b610ac991906130ed565b6000611bc26020828486612b53565b611bcb91613112565b9392505050565b6000611be2602860208486612b53565b611beb91613130565b60c01c9392505050565b6000610ac97f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff84166130ed565b6000611c616001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168585611f19565b509092915050565b6060611c788260288186612b53565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929695505050505050565b606084848484604051602001611ccd9493929190613178565b6040516020818303038152906040529050949350505050565b6000611cf0611f92565b905090565b6000610ac97f0000000000000000000000000000000000000000000000000000000000000000836130cb565b8151606090151580611d82578585604051602001611d6e92919091825260c01b7fffffffffffffffff00000000000000000000000000000000000000000000000016602082015260280190565b604051602081830303815290604052611db2565b85856001600160a01b03851686604051602001611da294939291906131f6565b6040516020818303038152906040525b915094509492505050565b600080611dcb8585856112b2565b9092509050611e056001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016873085611fd7565b94509492505050565b611e1661230f565b6000611e258460000151612016565b602085015190915015611e3f57611e3f8460200151612057565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632637a450826040518060a001604052808b63ffffffff168152602001611e8f8c61130f565b81526020018a815260200189815260200160008960200151111515815250866040518463ffffffff1660e01b8152600401611ecb929190612e39565b60806040518083038185885af1158015611ee9573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611f0e919061324f565b979650505050505050565b6040516001600160a01b03838116602483015260448201839052611f8d91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061215a565b505050565b6006546000906001600160a01b03163303611fd257507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c90565b503390565b6040516001600160a01b0384811660248301528381166044830152606482018390526120109186918216906323b872dd90608401611f46565b50505050565b6000813414612053576040517f9f7041200000000000000000000000000000000000000000000000000000000081523460048201526024016109be565b5090565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e4fe1d946040518163ffffffff1660e01b8152600401602060405180830381865afa1580156120b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120db9190613299565b90506001600160a01b03811661211d576040517f5373352a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610a62612128611ce6565b6001600160a01b038316907f000000000000000000000000000000000000000000000000000000000000000085611fd7565b600061216f6001600160a01b038416836121d6565b905080516000141580156121945750808060200190518101906121929190612e1c565b155b15611f8d576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024016109be565b6060611bcb8383600084600080856001600160a01b031684866040516121fc91906132b6565b60006040518083038185875af1925050503d8060008114612239576040519150601f19603f3d011682016040523d82523d6000602084013e61223e565b606091505b509150915061224e868383612258565b9695505050505050565b60608261226d57612268826122cd565b611bcb565b815115801561228457506001600160a01b0384163b155b156122c6576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024016109be565b5080611bcb565b8051156122dd5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604051806060016040528060008019168152602001600067ffffffffffffffff168152602001612352604051806040016040528060008152602001600081525090565b905290565b600060e0828403121561236957600080fd5b50919050565b60006020828403121561238157600080fd5b813567ffffffffffffffff81111561239857600080fd5b610c4f84828501612357565b60005b838110156123bf5781810151838201526020016123a7565b50506000910152565b600081518084526123e08160208601602086016123a4565b601f01601f19169290920160200192915050565b8351815260208085015190820152600060a08201604060a0604085015281865180845260c08601915060c08160051b8701019350602080890160005b8381101561248d578887037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4001855281518051885283015183880187905261247a878901826123c8565b9750509382019390820190600101612430565b50508751606088015250505060208501516080850152509050610c4f565b60006060828403121561236957600080fd5b60008083601f8401126124cf57600080fd5b50813567ffffffffffffffff8111156124e757600080fd5b6020830191508360208285010111156124ff57600080fd5b9250929050565b6001600160a01b0381168114610b1c57600080fd5b600080600080600080600060e0888a03121561253657600080fd5b61254089896124ab565b965060608801359550608088013567ffffffffffffffff8082111561256457600080fd5b6125708b838c016124bd565b909750955060a08a0135915061258582612506565b90935060c0890135908082111561259b57600080fd5b506125a88a828b016124bd565b989b979a50959850939692959293505050565b803563ffffffff811681146125cf57600080fd5b919050565b600080604083850312156125e757600080fd5b6125f0836125bb565b946020939093013593505050565b8015158114610b1c57600080fd5b6000806040838503121561261f57600080fd5b823567ffffffffffffffff81111561263657600080fd5b61264285828601612357565b9250506020830135612653816125fe565b809150509250929050565b815181526020808301519082015260408101610ac9565b60006020828403121561268757600080fd5b8135611bcb816125fe565b803561ffff811681146125cf57600080fd5b600080604083850312156126b757600080fd5b6126c0836125bb565b91506126ce60208401612692565b90509250929050565b602081526000611bcb60208301846123c8565b6000602082840312156126fc57600080fd5b8135611bcb81612506565b60008060008060a0858703121561271d57600080fd5b61272786866124ab565b9350606085013567ffffffffffffffff81111561274357600080fd5b61274f878288016124bd565b909450925050608085013561276381612506565b939692955090935050565b60008083601f84011261278057600080fd5b50813567ffffffffffffffff81111561279857600080fd5b6020830191508360208260051b85010111156124ff57600080fd5b600080602083850312156127c657600080fd5b823567ffffffffffffffff8111156127dd57600080fd5b6127e98582860161276e565b90969095509350505050565b60006020828403121561280757600080fd5b611bcb826125bb565b6000806000806060858703121561282657600080fd5b61282f856125bb565b935061283d60208601612692565b9250604085013567ffffffffffffffff81111561285957600080fd5b612865878288016124bd565b95989497509550505050565b6000806000838503608081121561288757600080fd5b843567ffffffffffffffff81111561289e57600080fd5b6128aa87828801612357565b9450506040601f19820112156128bf57600080fd5b5060208401915060608401356128d481612506565b809150509250925092565b600060c0820190508351825267ffffffffffffffff6020850151166020830152604084015161291b604084018280518252602090810151910152565b5082516080830152602083015160a0830152611bcb565b60006060828403121561294457600080fd5b611bcb83836124ab565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061297857607f821691505b60208210810361236957634e487b7160e01b600052602260045260246000fd5b6040516060810167ffffffffffffffff811182821017156129bb576129bb61294e565b60405290565b6040805190810167ffffffffffffffff811182821017156129bb576129bb61294e565b604051601f8201601f1916810167ffffffffffffffff81118282101715612a0d57612a0d61294e565b604052919050565b600067ffffffffffffffff821115612a2f57612a2f61294e565b50601f01601f191660200190565b600067ffffffffffffffff80841115612a5857612a5861294e565b8360051b6020612a698183016129e4565b868152918501918181019036841115612a8157600080fd5b865b84811015612b4757803586811115612a9b5760008081fd5b88016060368290031215612aaf5760008081fd5b612ab7612998565b612ac0826125bb565b8152612acd868301612692565b8682015260408083013589811115612ae55760008081fd5b929092019136601f840112612afa5760008081fd5b8235612b0d612b0882612a15565b6129e4565b8181523689838701011115612b225760008081fd5b818986018a830137600091810189019190915290820152845250918301918301612a83565b50979650505050505050565b60008085851115612b6357600080fd5b83861115612b7057600080fd5b5050820193919092039150565b60008451612b8f8184602089016123a4565b8201838582376000930192835250909392505050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b602081526000610c4f602083018486612ba5565b634e487b7160e01b600052603260045260246000fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec1833603018112612c2e57600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612c6d57600080fd5b83018035915067ffffffffffffffff821115612c8857600080fd5b6020019150368190038213156124ff57600080fd5b67ffffffffffffffff81168114610b1c57600080fd5b63ffffffff612cc1896125bb565b1681526020880135602082015260006040890135612cde81612c9d565b67ffffffffffffffff811660408401525087606083015260e06080830152612d0a60e083018789612ba5565b6001600160a01b03861660a084015282810360c0840152612d2c818587612ba5565b9a9950505050505050505050565b600060208284031215612d4c57600080fd5b815167ffffffffffffffff811115612d6357600080fd5b8201601f81018413612d7457600080fd5b8051612d82612b0882612a15565b818152856020838501011115612d9757600080fd5b6117ce8260208301602086016123a4565b600060208284031215612dba57600080fd5b8135611bcb81612c9d565b6001600160a01b038516815283602082015261ffff8316604082015260806060820152600061224e60808301846123c8565b604081526000612e0a60408301856123c8565b82810360208401526117ce81856123c8565b600060208284031215612e2e57600080fd5b8151611bcb816125fe565b6040815263ffffffff8351166040820152602083015160608201526000604084015160a06080840152612e6f60e08401826123c8565b90506060850151603f198483030160a0850152612e8c82826123c8565b60809690960151151560c08501525050506001600160a01b039190911660209091015290565b600060408284031215612ec457600080fd5b612ecc6129c1565b9050815181526020820151602082015292915050565b600060408284031215612ef457600080fd5b611bcb8383612eb2565b601f821115611f8d576000816000526020600020601f850160051c81016020861015612f275750805b601f850160051c820191505b81811015612f4657828155600101612f33565b505050505050565b815167ffffffffffffffff811115612f6857612f6861294e565b612f7c81612f768454612964565b84612efe565b602080601f831160018114612fb15760008415612f995750858301515b600019600386901b1c1916600185901b178555612f46565b600085815260208120601f198616915b82811015612fe057888601518255948401946001909101908401612fc1565b5085821015612ffe5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208083018184528085518083526040925060408601915060408160051b87010184880160005b8381101561308b57888303603f190185528151805163ffffffff1684528781015161ffff16888501528601516060878501819052613077818601836123c8565b968901969450505090860190600101613037565b509098975050505050505050565b6000604082840312156130ab57600080fd5b6130b36129c1565b82358152602083013560208201528091505092915050565b6000826130e857634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610ac957634e487b7160e01b600052601160045260246000fd5b80356020831015610ac957600019602084900360031b1b1692915050565b7fffffffffffffffff00000000000000000000000000000000000000000000000081358181169160088510156131705780818660080360031b1b83161692505b505092915050565b7fffffffffffffffff0000000000000000000000000000000000000000000000008560c01b1681527fffffffff000000000000000000000000000000000000000000000000000000008460e01b16600882015282600c820152600082516131e681602c8501602087016123a4565b91909101602c0195945050505050565b8481527fffffffffffffffff0000000000000000000000000000000000000000000000008460c01b1660208201528260288201526000825161323f8160488501602087016123a4565b9190910160480195945050505050565b60006080828403121561326157600080fd5b613269612998565b82518152602083015161327b81612c9d565b602082015261328d8460408501612eb2565b60408201529392505050565b6000602082840312156132ab57600080fd5b8151611bcb81612506565b60008251612c2e8184602087016123a456fea26469706673582212205c46b82c536edf6d6947388d0f3e373e057efb49f5e043f296faa1ceb20a2a6964736f6c63430008170033", + "devdoc": { + "author": "The Sandbox", + "details": "contract to be used with non-upgradable SAND contract", + "errors": { + "AddressEmptyCode(address)": [ + { + "details": "There's no code at `target` (it is not a contract)." + } + ], + "AddressInsufficientBalance(address)": [ + { + "details": "The ETH balance of the account is not enough to perform the operation." + } + ], + "CallFailed(string)": [ + { + "params": { + "message": "error message returned from the failed call" + } + } + ], + "FailedInnerCall()": [ + { + "details": "A call to an address target failed. The target may have reverted." + } + ], + "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." + } + ], + "SafeERC20FailedOperation(address)": [ + { + "details": "An operation with an ERC20 token failed." + } + ] + }, + "events": { + "AdminChanged(address,address)": { + "details": "Emits when the contract administrator is changed.", + "params": { + "newAdmin": "The address of the new administrator.", + "oldAdmin": "The address of the previous administrator." + } + }, + "Enabled(bool)": { + "params": { + "enabled": "The new enabled state" + } + }, + "PreCrimeSet(address)": { + "details": "Emitted when the preCrime contract address is set.", + "params": { + "preCrimeAddress": "The address of the preCrime contract." + } + } + }, + "kind": "dev", + "methods": { + "allowInitializePath((uint32,bytes32,uint64))": { + "details": "This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received.This defaults to assuming if a peer has been set, its initialized. Can be overridden by the OApp if there is other logic to determine this.", + "params": { + "origin": "The origin information containing the source endpoint and sender address." + }, + "returns": { + "_0": "Whether the path has been initialized." + } + }, + "approvalRequired()": { + "details": "In the case of default OFTAdapter, approval is required.In non-default OFTAdapter contracts with something like mint and burn privileges, it would NOT need approval.", + "returns": { + "_0": "requiresApproval Needs approval of the underlying token implementation." + } + }, + "changeAdmin(address)": { + "details": "Change the administrator to be `newAdmin`.", + "params": { + "newAdmin": "The address of the new administrator." + } + }, + "combineOptions(uint32,uint16,bytes)": { + "details": "If there is an enforced lzReceive option: - {gasLimit: 200k, msg.value: 1 ether} AND a caller supplies a lzReceive option: {gasLimit: 100k, msg.value: 0.5 ether} - The resulting options will be {gasLimit: 300k, msg.value: 1.5 ether} when the message is executed on the remote lzReceive() function.This presence of duplicated options is handled off-chain in the verifier/executor.", + "params": { + "_eid": "The endpoint ID.", + "_extraOptions": "Additional options passed by the caller.", + "_msgType": "The OAPP message type." + }, + "returns": { + "_0": "options The combination of caller specified options AND enforced options." + } + }, + "constructor": { + "params": { + "layerZeroEndpoint": "local endpoint address", + "owner": "owner used as a delegate in LayerZero Endpoint", + "sandToken": "SAND token address on the same network as the OFT Adapter", + "trustedForwarder": "trusted forwarder address" + } + }, + "getAdmin()": { + "details": "Get the current administrator of this contract.", + "returns": { + "_0": "The current administrator of this contract." + } + }, + "getTrustedForwarder()": { + "returns": { + "_0": "trustedForwarder address of the trusted forwarder" + } + }, + "isComposeMsgSender((uint32,bytes32,uint64),bytes,address)": { + "details": "_origin The origin information containing the source endpoint and sender address. - srcEid: The source chain endpoint ID. - sender: The sender address on the src chain. - nonce: The nonce of the message._message The lzReceive payload.Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer.The default sender IS the OAppReceiver implementer.", + "params": { + "_sender": "The sender address." + }, + "returns": { + "_0": "isSender Is a valid sender." + } + }, + "isPeer(uint32,bytes32)": { + "details": "Check if the peer is considered 'trusted' by the OApp.Enables OAppPreCrimeSimulator to check whether a potential Inbound Packet is from a trusted source.", + "params": { + "_eid": "The endpoint ID to check.", + "_peer": "The peer to check." + }, + "returns": { + "_0": "Whether the peer passed is considered 'trusted' by the OApp." + } + }, + "isTrustedForwarder(address)": { + "params": { + "forwarder": "address to check" + }, + "returns": { + "_0": "is trusted" + } + }, + "lzReceive((uint32,bytes32,uint64),bytes32,bytes,address,bytes)": { + "details": "Entry point for receiving messages or packets from the endpoint.Entry point for receiving msg/packet from the LayerZero endpoint.", + "params": { + "_executor": "The address of the executor for the received message.", + "_extraData": "Additional arbitrary data provided by the corresponding executor.", + "_guid": "The unique identifier for the received LayerZero message.", + "_message": "The payload of the received message.", + "_origin": "The origin information containing the source endpoint and sender address. - srcEid: The source chain endpoint ID. - sender: The sender address on the src chain. - nonce: The nonce of the message." + } + }, + "lzReceiveAndRevert(((uint32,bytes32,uint64),uint32,address,bytes32,uint256,address,bytes,bytes)[])": { + "details": "Interface for pre-crime simulations. Always reverts at the end with the simulation results.WARNING: MUST revert at the end with the simulation results.Gives the preCrime implementation the ability to mock sending packets to the lzReceive function, WITHOUT actually executing them.", + "params": { + "_packets": "An array of InboundPacket objects representing received packets to be delivered." + } + }, + "lzReceiveSimulate((uint32,bytes32,uint64),bytes32,bytes,address,bytes)": { + "details": "Is effectively an internal function because msg.sender must be address(this). Allows resetting the call stack for 'internal' calls.", + "params": { + "_executor": "The executor address for the packet.", + "_extraData": "Additional data for the packet.", + "_guid": "The unique identifier of the packet.", + "_message": "The message payload of the packet.", + "_origin": "The origin information containing the source endpoint and sender address. - srcEid: The source chain endpoint ID. - sender: The sender address on the src chain. - nonce: The nonce of the message." + } + }, + "nextNonce(uint32,bytes32)": { + "details": "_srcEid The source endpoint ID._sender The sender address.The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement.Is required by the off-chain executor to determine the OApp expects msg execution is ordered.This is also enforced by the OApp.By default this is NOT enabled. ie. nextNonce is hardcoded to return 0.", + "returns": { + "nonce": "The next nonce." + } + }, + "oApp()": { + "details": "Retrieves the address of the OApp contract.The simulator contract is the base contract for the OApp by default.If the simulator is a separate contract, override this function.", + "returns": { + "_0": "The address of the OApp contract." + } + }, + "oAppVersion()": { + "returns": { + "receiverVersion": "The version of the OAppReceiver.sol implementation.", + "senderVersion": "The version of the OAppSender.sol implementation." + } + }, + "oftVersion()": { + "details": "interfaceId: This specific interface ID is '0x02e49c2c'.version: Indicates a cross-chain compatible msg encoding with other OFTs.If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented. ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)", + "returns": { + "interfaceId": "The interface ID.", + "version": "The version." + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "quoteOFT((uint32,bytes32,uint256,uint256,bytes,bytes,bytes))": { + "params": { + "_sendParam": "The parameters for the send operation." + }, + "returns": { + "oftFeeDetails": "The details of OFT fees.", + "oftLimit": "The OFT limit information.", + "oftReceipt": "The OFT receipt information." + } + }, + "quoteSend((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),bool)": { + "details": "MessagingFee: LayerZero msg fee - nativeFee: The native fee. - lzTokenFee: The lzToken fee.", + "params": { + "_payInLzToken": "Flag indicating whether the caller is paying in the LZ token.", + "_sendParam": "The parameters for the send() operation." + }, + "returns": { + "msgFee": "The calculated LayerZero messaging fee from the send() operation." + } + }, + "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." + }, + "send((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),(uint256,uint256),address)": { + "details": "Executes the send operation.MessagingReceipt: LayerZero msg receipt - guid: The unique identifier for the sent message. - nonce: The nonce of the sent message. - fee: The LayerZero fee incurred for the message.", + "params": { + "_fee": "The calculated fee for the send() operation. - nativeFee: The native fee. - lzTokenFee: The lzToken fee.", + "_refundAddress": "The address to receive any excess funds.", + "_sendParam": "The parameters for the send operation." + }, + "returns": { + "msgReceipt": "The receipt for the send operation.", + "oftReceipt": "The OFT receipt information." + } + }, + "setDelegate(address)": { + "details": "Only the owner/admin of the OApp can call this function.Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.", + "params": { + "_delegate": "The address of the delegate to be set." + } + }, + "setEnforcedOptions((uint32,uint16,bytes)[])": { + "details": "Sets the enforced options for specific endpoint and message type combinations.Only the owner/admin of the OApp can call this function.Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.These enforced options can vary as the potential options/execution on the remote may differ as per the msgType. eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().", + "params": { + "_enforcedOptions": "An array of EnforcedOptionParam structures specifying enforced options." + } + }, + "setMsgInspector(address)": { + "details": "Sets the message inspector address for the OFT.This is an optional contract that can be used to inspect both 'message' and 'options'.Set it to address(0) to disable it, or set it to a contract address to enable it.", + "params": { + "_msgInspector": "The address of the message inspector." + } + }, + "setPeer(uint32,bytes32)": { + "details": "Only the owner/admin of the OApp can call this function.Indicates that the peer is trusted to send LayerZero messages to this OApp.Set this to bytes32(0) to remove the peer address.Peer is a bytes32 to accommodate non-evm chains.", + "params": { + "_eid": "The endpoint ID.", + "_peer": "The address of the peer to be associated with the corresponding endpoint." + } + }, + "setPreCrime(address)": { + "details": "Sets the preCrime contract address.", + "params": { + "_preCrime": "The address of the preCrime contract." + } + }, + "setTrustedForwarder(address)": { + "params": { + "trustedForwarder": "The new trustedForwarder." + } + }, + "sharedDecimals()": { + "details": "Retrieves the shared decimals of the OFT.Sets an implicit cap on the amount of tokens, over uint64.max() will need some sort of outbound cap / totalSupply cap Lowest common decimal denominator between chains. Defaults to 6 decimal places to provide up to 18,446,744,073,709.551615 units (max uint64). For tokens exceeding this totalSupply(), they will need to override the sharedDecimals function with something smaller. ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615", + "returns": { + "_0": "The shared decimals of the OFT." + } + }, + "token()": { + "details": "Retrieves the address of the underlying ERC20 implementation.In the case of OFTAdapter, address(this) and erc20 are NOT the same contract.", + "returns": { + "_0": "The address of the adapted ERC-20 token." + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "title": "OFTAdapterForSand", + "version": 1 + }, + "userdoc": { + "errors": { + "CallFailed(string)": [ + { + "notice": "Error for failed calls, containing the error message" + } + ], + "FirstParamNotSender()": [ + { + "notice": "Error for mismatched first parameter and sender address" + } + ], + "InvalidAmount()": [ + { + "notice": "Error for invalid amount" + } + ], + "InvalidOwnerOrSpender()": [ + { + "notice": "Error for invalid owner or spender" + } + ], + "InvalidSender()": [ + { + "notice": "Error for invalid sender" + } + ], + "NotAuthorized()": [ + { + "notice": "Error for unauthorized access" + } + ], + "OnlyAdmin()": [ + { + "notice": "Error for admin-only access" + } + ], + "Overflow()": [ + { + "notice": "Error for overflow conditions" + } + ], + "SendFunctionDisabled()": [ + { + "notice": "Custom error thrown when the send function is called while disabled" + } + ] + }, + "events": { + "Enabled(bool)": { + "notice": "Emitted when the enabled state changes" + } + }, + "kind": "user", + "methods": { + "allowInitializePath((uint32,bytes32,uint64))": { + "notice": "Checks if the path initialization is allowed based on the provided origin." + }, + "approvalRequired()": { + "notice": "Indicates whether the OFT contract requires approval of the 'token()' to send." + }, + "combineOptions(uint32,uint16,bytes)": { + "notice": "Combines options for a given endpoint and message type." + }, + "endpoint()": { + "notice": "Retrieves the LayerZero endpoint associated with the OApp." + }, + "getTrustedForwarder()": { + "notice": "Get the current trusted forwarder" + }, + "isComposeMsgSender((uint32,bytes32,uint64),bytes,address)": { + "notice": "Indicates whether an address is an approved composeMsg sender to the Endpoint." + }, + "isTrustedForwarder(address)": { + "notice": "Checks if an address is a trusted forwarder" + }, + "nextNonce(uint32,bytes32)": { + "notice": "Retrieves the next nonce for a given source endpoint and sender address." + }, + "oAppVersion()": { + "notice": "Retrieves the OApp version information." + }, + "oftVersion()": { + "notice": "Retrieves interfaceID and the version of the OFT." + }, + "peers(uint32)": { + "notice": "Retrieves the peer (OApp) associated with a corresponding endpoint." + }, + "quoteOFT((uint32,bytes32,uint256,uint256,bytes,bytes,bytes))": { + "notice": "Provides a quote for OFT-related operations." + }, + "quoteSend((uint32,bytes32,uint256,uint256,bytes,bytes,bytes),bool)": { + "notice": "Provides a quote for the send() operation." + }, + "setDelegate(address)": { + "notice": "Sets the delegate address for the OApp." + }, + "setPeer(uint32,bytes32)": { + "notice": "Sets the peer address (OApp instance) for a corresponding endpoint." + }, + "setTrustedForwarder(address)": { + "notice": "Change the address of the trusted forwarder for meta-TX." + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 8589, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTAdapterForSand.sol:OFTAdapterForSand", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 2127, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTAdapterForSand.sol:OFTAdapterForSand", + "label": "peers", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint32,t_bytes32)" + }, + { + "astId": 3370, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTAdapterForSand.sol:OFTAdapterForSand", + "label": "preCrime", + "offset": 0, + "slot": "2", + "type": "t_address" + }, + { + "astId": 2743, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTAdapterForSand.sol:OFTAdapterForSand", + "label": "enforcedOptions", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint32,t_mapping(t_uint16,t_bytes_storage))" + }, + { + "astId": 12074, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTAdapterForSand.sol:OFTAdapterForSand", + "label": "msgInspector", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 14049, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTAdapterForSand.sol:OFTAdapterForSand", + "label": "_admin", + "offset": 0, + "slot": "5", + "type": "t_address" + }, + { + "astId": 13902, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTAdapterForSand.sol:OFTAdapterForSand", + "label": "_trustedForwarder", + "offset": 0, + "slot": "6", + "type": "t_address" + }, + { + "astId": 11375, + "contract": "@sandbox-smart-contracts/oft-sand/contracts/OFTAdapterForSand.sol:OFTAdapterForSand", + "label": "_enabled", + "offset": 20, + "slot": "6", + "type": "t_bool" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_storage": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_mapping(t_uint16,t_bytes_storage)": { + "encoding": "mapping", + "key": "t_uint16", + "label": "mapping(uint16 => bytes)", + "numberOfBytes": "32", + "value": "t_bytes_storage" + }, + "t_mapping(t_uint32,t_bytes32)": { + "encoding": "mapping", + "key": "t_uint32", + "label": "mapping(uint32 => bytes32)", + "numberOfBytes": "32", + "value": "t_bytes32" + }, + "t_mapping(t_uint32,t_mapping(t_uint16,t_bytes_storage))": { + "encoding": "mapping", + "key": "t_uint32", + "label": "mapping(uint32 => mapping(uint16 => bytes))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint16,t_bytes_storage)" + }, + "t_uint16": { + "encoding": "inplace", + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + } + } + } +} \ No newline at end of file diff --git a/packages/deploy/deployments/mainnet/Sand.json b/packages/deploy/deployments/mainnet/Sand.json new file mode 100644 index 0000000000..12d6c1296e --- /dev/null +++ b/packages/deploy/deployments/mainnet/Sand.json @@ -0,0 +1,879 @@ +{ + "abi": [ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function", + "signature": "0x06fdde03" + }, + { + "constant": false, + "inputs": [ + { + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeExecutionAdmin", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function", + "signature": "0x0819ba74" + }, + { + "constant": false, + "inputs": [ + { + "name": "spender", + "type": "address" + }, + { + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "success", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function", + "signature": "0x095ea7b3" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function", + "signature": "0x18160ddd" + }, + { + "constant": false, + "inputs": [ + { + "name": "owner", + "type": "address" + }, + { + "name": "amount", + "type": "uint256" + } + ], + "name": "burnFor", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function", + "signature": "0x1dd319cb" + }, + { + "constant": false, + "inputs": [ + { + "name": "from", + "type": "address" + }, + { + "name": "to", + "type": "address" + }, + { + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "success", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function", + "signature": "0x23b872dd" + }, + { + "constant": false, + "inputs": [ + { + "name": "owner", + "type": "address" + }, + { + "name": "spender", + "type": "address" + }, + { + "name": "amount", + "type": "uint256" + } + ], + "name": "approveFor", + "outputs": [ + { + "name": "success", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function", + "signature": "0x2b991746" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function", + "signature": "0x313ce567" + }, + { + "constant": false, + "inputs": [ + { + "name": "owner", + "type": "address" + }, + { + "name": "spender", + "type": "address" + }, + { + "name": "amountNeeded", + "type": "uint256" + } + ], + "name": "addAllowanceIfNeeded", + "outputs": [ + { + "name": "success", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function", + "signature": "0x3b7b5a16" + }, + { + "constant": false, + "inputs": [ + { + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function", + "signature": "0x42966c68" + }, + { + "constant": true, + "inputs": [ + { + "name": "who", + "type": "address" + } + ], + "name": "isExecutionOperator", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function", + "signature": "0x61247de3" + }, + { + "constant": true, + "inputs": [ + { + "name": "who", + "type": "address" + } + ], + "name": "isSuperOperator", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function", + "signature": "0x654b748a" + }, + { + "constant": false, + "inputs": [ + { + "name": "executionOperator", + "type": "address" + }, + { + "name": "enabled", + "type": "bool" + } + ], + "name": "setExecutionOperator", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function", + "signature": "0x699c834b" + }, + { + "constant": true, + "inputs": [], + "name": "getAdmin", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function", + "signature": "0x6e9960c3" + }, + { + "constant": true, + "inputs": [ + { + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function", + "signature": "0x70a08231" + }, + { + "constant": false, + "inputs": [ + { + "name": "from", + "type": "address" + }, + { + "name": "to", + "type": "address" + }, + { + "name": "amount", + "type": "uint256" + }, + { + "name": "gasLimit", + "type": "uint256" + }, + { + "name": "data", + "type": "bytes" + } + ], + "name": "approveAndExecuteWithSpecificGas", + "outputs": [ + { + "name": "success", + "type": "bool" + }, + { + "name": "returnData", + "type": "bytes" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function", + "signature": "0x7dd711c4" + }, + { + "constant": false, + "inputs": [ + { + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function", + "signature": "0x8f283970" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function", + "signature": "0x95d89b41" + }, + { + "constant": false, + "inputs": [ + { + "name": "to", + "type": "address" + }, + { + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "success", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function", + "signature": "0xa9059cbb" + }, + { + "constant": false, + "inputs": [ + { + "name": "superOperator", + "type": "address" + }, + { + "name": "enabled", + "type": "bool" + } + ], + "name": "setSuperOperator", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function", + "signature": "0xac9fe421" + }, + { + "constant": true, + "inputs": [], + "name": "getExecutionAdmin", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function", + "signature": "0xb01b0ef7" + }, + { + "constant": false, + "inputs": [ + { + "name": "target", + "type": "address" + }, + { + "name": "amount", + "type": "uint256" + }, + { + "name": "data", + "type": "bytes" + } + ], + "name": "paidCall", + "outputs": [ + { + "name": "", + "type": "bytes" + } + ], + "payable": true, + "stateMutability": "payable", + "type": "function", + "signature": "0xbb1e23cb" + }, + { + "constant": false, + "inputs": [ + { + "name": "target", + "type": "address" + }, + { + "name": "amount", + "type": "uint256" + }, + { + "name": "data", + "type": "bytes" + } + ], + "name": "approveAndCall", + "outputs": [ + { + "name": "", + "type": "bytes" + } + ], + "payable": true, + "stateMutability": "payable", + "type": "function", + "signature": "0xcae9ca51" + }, + { + "constant": false, + "inputs": [ + { + "name": "from", + "type": "address" + }, + { + "name": "to", + "type": "address" + }, + { + "name": "amount", + "type": "uint256" + }, + { + "name": "gasLimit", + "type": "uint256" + }, + { + "name": "tokenGasPrice", + "type": "uint256" + }, + { + "name": "baseGasCharge", + "type": "uint256" + }, + { + "name": "tokenReceiver", + "type": "address" + }, + { + "name": "data", + "type": "bytes" + } + ], + "name": "approveAndExecuteWithSpecificGasAndChargeForIt", + "outputs": [ + { + "name": "success", + "type": "bool" + }, + { + "name": "returnData", + "type": "bytes" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function", + "signature": "0xdc2173f3" + }, + { + "constant": false, + "inputs": [ + { + "name": "to", + "type": "address" + }, + { + "name": "gasLimit", + "type": "uint256" + }, + { + "name": "data", + "type": "bytes" + } + ], + "name": "executeWithSpecificGas", + "outputs": [ + { + "name": "success", + "type": "bool" + }, + { + "name": "returnData", + "type": "bytes" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function", + "signature": "0xdcdf5158" + }, + { + "constant": true, + "inputs": [ + { + "name": "owner", + "type": "address" + }, + { + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "remaining", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function", + "signature": "0xdd62ed3e" + }, + { + "constant": false, + "inputs": [ + { + "name": "from", + "type": "address" + }, + { + "name": "to", + "type": "address" + }, + { + "name": "amount", + "type": "uint256" + }, + { + "name": "gasLimit", + "type": "uint256" + }, + { + "name": "tokenGasPrice", + "type": "uint256" + }, + { + "name": "baseGasCharge", + "type": "uint256" + }, + { + "name": "tokenReceiver", + "type": "address" + } + ], + "name": "transferAndChargeForGas", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function", + "signature": "0xe18aa335" + }, + { + "inputs": [ + { + "name": "sandAdmin", + "type": "address" + }, + { + "name": "executionAdmin", + "type": "address" + }, + { + "name": "beneficiary", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor", + "signature": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event", + "signature": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event", + "signature": "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "superOperator", + "type": "address" + }, + { + "indexed": false, + "name": "enabled", + "type": "bool" + } + ], + "name": "SuperOperator", + "type": "event", + "signature": "0x44f92d27abdf4cfb6a7d712c3af68f3be086d4ca747ab802c36f67d6790060d8" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": false, + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event", + "signature": "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "oldAdmin", + "type": "address" + }, + { + "indexed": false, + "name": "newAdmin", + "type": "address" + } + ], + "name": "ExecutionAdminAdminChanged", + "type": "event", + "signature": "0xb2b670b34860515166c00eba5e2e5fa8116d57091604f37ba24ac8021c7fa165" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "executionOperator", + "type": "address" + }, + { + "indexed": false, + "name": "enabled", + "type": "bool" + } + ], + "name": "ExecutionOperator", + "type": "event", + "signature": "0xfcebaa973ed84808fb785c92941aa4798f3f66923f5a2ff544382db3a9b3a3a2" + } + ], + "address": "0x3845badAde8e6dFF049820680d1F14bD3903a5d0", + "receipt": { + "transactionHash": "0x43feed4eb9d067a4fa2951c08c04e894cef9b126dbab39f6d7b1f3a3d93a5a63", + "blockNumber": 8835135 + }, + "args": [ + "0x18dd4e0eb8699eA4FeE238dE41ECfb95e32272f8", + "0x18dd4e0eb8699eA4FeE238dE41ECfb95e32272f8", + "0xeaa0993e1d21c2103e4f172a20d29371fbaf6d06" + ], + "bytecode": "0x608060405234801561001057600080fd5b5060405162001ed638038062001ed68339818101604052606081101561003557600080fd5b5080516020820151604090920151600280546001600160a01b038085166001600160a01b0319928316179092556000805492861692909116919091179055909190610095816b09b18ab5df7180b6b80000006001600160e01b0361009d16565b505050610253565b6001600160a01b03821661011257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f43616e6e6f74206d696e7420746f203078300000000000000000000000000000604482015290519081900360640190fd5b6000811161018157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f63616e6e6f74206d696e74203020746f6b656e73000000000000000000000000604482015290519081900360640190fd5b6004548181018181116101f557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600860248201527f6f766572666c6f77000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60048190556001600160a01b0384166000818152600560209081526040808320805488019055805187815290517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a350505050565b611c7380620002636000396000f3fe6080604052600436106101ac5760003560e01c80636e9960c3116100ec578063b01b0ef71161008a578063dc2173f311610064578063dc2173f31461082b578063dcdf5158146108e2578063dd62ed3e14610974578063e18aa335146109af576101ac565b8063b01b0ef71461070c578063bb1e23cb14610721578063cae9ca51146107a6576101ac565b80638f283970116100c65780638f2839701461066557806395d89b41146101b1578063a9059cbb14610698578063ac9fe421146106d1576101ac565b80636e9960c3146104dc57806370a082311461050d5780637dd711c414610540576101ac565b80632b9917461161015957806342966c681161013357806342966c681461041157806361247de31461043b578063654b748a1461046e578063699c834b146104a1576101ac565b80632b99174614610360578063313ce567146103a35780633b7b5a16146103ce576101ac565b806318160ddd1161018a57806318160ddd146102bd5780631dd319cb146102e457806323b872dd1461031d576101ac565b806306fdde03146101b15780630819ba741461023b578063095ea7b314610270575b600080fd5b3480156101bd57600080fd5b506101c6610a0c565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102005781810151838201526020016101e8565b50505050905090810190601f16801561022d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561024757600080fd5b5061026e6004803603602081101561025e57600080fd5b50356001600160a01b0316610a43565b005b34801561027c57600080fd5b506102a96004803603604081101561029357600080fd5b506001600160a01b038135169060200135610b0e565b604080519115158252519081900360200190f35b3480156102c957600080fd5b506102d2610b25565b60408051918252519081900360200190f35b3480156102f057600080fd5b506102a96004803603604081101561030757600080fd5b506001600160a01b038135169060200135610b2b565b34801561032957600080fd5b506102a96004803603606081101561034057600080fd5b506001600160a01b03813581169160208101359091169060400135610b37565b34801561036c57600080fd5b506102a96004803603606081101561038357600080fd5b506001600160a01b03813581169160208101359091169060400135610c29565b3480156103af57600080fd5b506103b8610c97565b6040805160ff9092168252519081900360200190f35b3480156103da57600080fd5b506102a9600480360360608110156103f157600080fd5b506001600160a01b03813581169160208101359091169060400135610c9c565b34801561041d57600080fd5b506102a96004803603602081101561043457600080fd5b5035610d0a565b34801561044757600080fd5b506102a96004803603602081101561045e57600080fd5b50356001600160a01b0316610d1e565b34801561047a57600080fd5b506102a96004803603602081101561049157600080fd5b50356001600160a01b0316610d3c565b3480156104ad57600080fd5b5061026e600480360360408110156104c457600080fd5b506001600160a01b0381351690602001351515610d5a565b3480156104e857600080fd5b506104f1610e07565b604080516001600160a01b039092168252519081900360200190f35b34801561051957600080fd5b506102d26004803603602081101561053057600080fd5b50356001600160a01b0316610e16565b34801561054c57600080fd5b506105e2600480360360a081101561056357600080fd5b6001600160a01b03823581169260208101359091169160408201359160608101359181019060a0810160808201356401000000008111156105a357600080fd5b8201836020820111156105b557600080fd5b803590602001918460018302840111640100000000831117156105d757600080fd5b509092509050610e31565b604051808315151515815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610629578181015183820152602001610611565b50505050905090810190601f1680156106565780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b34801561067157600080fd5b5061026e6004803603602081101561068857600080fd5b50356001600160a01b0316610ed4565b3480156106a457600080fd5b506102a9600480360360408110156106bb57600080fd5b506001600160a01b038135169060200135610fb5565b3480156106dd57600080fd5b5061026e600480360360408110156106f457600080fd5b506001600160a01b0381351690602001351515610fc2565b34801561071857600080fd5b506104f161106f565b6101c66004803603606081101561073757600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561076757600080fd5b82018360208201111561077957600080fd5b8035906020019184600183028401116401000000008311171561079b57600080fd5b50909250905061107e565b6101c6600480360360608110156107bc57600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156107ec57600080fd5b8201836020820111156107fe57600080fd5b8035906020019184600183028401116401000000008311171561082057600080fd5b509092509050611225565b34801561083757600080fd5b506105e2600480360361010081101561084f57600080fd5b6001600160a01b038235811692602081013582169260408201359260608301359260808101359260a08201359260c0830135169190810190610100810160e08201356401000000008111156108a357600080fd5b8201836020820111156108b557600080fd5b803590602001918460018302840111640100000000831117156108d757600080fd5b5090925090506112c4565b3480156108ee57600080fd5b506105e26004803603606081101561090557600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561093557600080fd5b82018360208201111561094757600080fd5b8035906020019184600183028401116401000000008311171561096957600080fd5b509092509050611387565b34801561098057600080fd5b506102d26004803603604081101561099757600080fd5b506001600160a01b0381358116916020013516611456565b3480156109bb57600080fd5b506102a9600480360360e08110156109d257600080fd5b506001600160a01b038135811691602081013582169160408201359160608101359160808201359160a08101359160c09091013516611481565b60408051808201909152600481527f53414e4400000000000000000000000000000000000000000000000000000000602082015290565b6000546001600160a01b03163314610a8c5760405162461bcd60e51b815260040180806020018281038252602d815260200180611bd8602d913960400191505060405180910390fd5b600054604080516001600160a01b039283168152918316602083015280517fb2b670b34860515166c00eba5e2e5fa8116d57091604f37ba24ac8021c7fa1659281900390910190a1600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6000610b1b338484611504565b5060015b92915050565b60045490565b6000610b1b83836115d7565b6000336001600160a01b03851614801590610b6257503360009081526003602052604090205460ff16155b15610c14576001600160a01b03841660009081526006602090815260408083203384529091529020546000198114610c125782811015610be9576040805162461bcd60e51b815260206004820152601860248201527f4e6f7420656e6f7567682066756e647320616c6c6f7765640000000000000000604482015290519081900360640190fd5b6001600160a01b0385166000908152600660209081526040808320338452909152902083820390555b505b610c1f8484846117d8565b5060019392505050565b6000336001600160a01b0385161480610c5157503360009081526003602052604090205460ff165b610c8c5760405162461bcd60e51b8152600401808060200182810382526025815260200180611b0e6025913960400191505060405180910390fd5b610c1f848484611504565b601290565b6000336001600160a01b0385161480610cc457503360009081526003602052604090205460ff165b610cff5760405162461bcd60e51b8152600401808060200182810382526025815260200180611b0e6025913960400191505060405180910390fd5b610c1f84848461190c565b6000610d1633836115d7565b506001919050565b6001600160a01b031660009081526001602052604090205460ff1690565b6001600160a01b031660009081526003602052604090205460ff1690565b6000546001600160a01b03163314610da35760405162461bcd60e51b815260040180806020018281038252603a815260200180611b72603a913960400191505060405180910390fd5b6001600160a01b038216600081815260016020908152604091829020805460ff191685151590811790915582519384529083015280517ffcebaa973ed84808fb785c92941aa4798f3f66923f5a2ff544382db3a9b3a3a29281900390910190a15050565b6002546001600160a01b031690565b6001600160a01b031660009081526005602052604090205490565b3360009081526001602052604081205460609060ff16610e825760405162461bcd60e51b815260040180806020018281038252603a815260200180611c05603a913960400191505060405180910390fd5b610ec58888888888888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061196792505050565b91509150965096945050505050565b6002546001600160a01b03163314610f33576040805162461bcd60e51b815260206004820152601b60248201527f6f6e6c792061646d696e2063616e206368616e67652061646d696e0000000000604482015290519081900360640190fd5b600254604080516001600160a01b039283168152918316602083015280517f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f9281900390910190a1600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6000610b1b3384846117d8565b6002546001600160a01b0316331461100b5760405162461bcd60e51b815260040180806020018281038252602c815260200180611bac602c913960400191505060405180910390fd5b6001600160a01b038216600081815260036020908152604091829020805460ff191685151590811790915582519384529083015280517f44f92d27abdf4cfb6a7d712c3af68f3be086d4ca747ab802c36f67d6790060d89281900390910190a15050565b6000546001600160a01b031690565b60606110c183838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250339250611a59915050565b611112576040805162461bcd60e51b815260206004820152601560248201527f666972737420706172616d20213d2073656e6465720000000000000000000000604482015290519081900360640190fd5b83156111235761112333868661190c565b60006060866001600160a01b0316348686604051808383808284376040519201945060009350909150508083038185875af1925050503d8060008114611185576040519150601f19603f3d011682016040523d82523d6000602084013e61118a565b606091505b509150915081819061121a5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156111df5781810151838201526020016111c7565b50505050905090810190601f16801561120c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509695505050505050565b606061126883838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250339250611a59915050565b6112b9576040805162461bcd60e51b815260206004820152601560248201527f666972737420706172616d20213d2073656e6465720000000000000000000000604482015290519081900360640190fd5b611123338686611504565b6000606060005a3360009081526001602052604090205490915060ff1661131c5760405162461bcd60e51b815260040180806020018281038252603a815260200180611c05603a913960400191505060405180910390fd5b61135f8c8c8c8c89898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061196792505050565b90935091508715611378576113788c8a8a848b8b611a84565b50995099975050505050505050565b3360009081526001602052604081205460609060ff166113d85760405162461bcd60e51b815260040180806020018281038252603a815260200180611c05603a913960400191505060405180910390fd5b856001600160a01b03168585856040518083838082843760405192019450600093509091505080830381838787f1925050503d8060008114611436576040519150601f19603f3d011682016040523d82523d6000602084013e61143b565b606091505b509092509050603f85045a1161144d57fe5b94509492505050565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6000805a3360009081526001602052604090205490915060ff166114d65760405162461bcd60e51b815260040180806020018281038252603f815260200180611b33603f913960400191505060405180910390fd5b6114e18989896117d8565b84156114f5576114f5898787848888611a84565b50600198975050505050505050565b6001600160a01b0383161580159061152457506001600160a01b03821615155b611575576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f7420617070726f7665207769746820307830000000000000000000604482015290519081900360640190fd5b6001600160a01b03808416600081815260066020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6000811161162c576040805162461bcd60e51b815260206004820152601460248201527f63616e6e6f74206275726e203020746f6b656e73000000000000000000000000604482015290519081900360640190fd5b336001600160a01b0383161480159061165557503360009081526003602052604090205460ff16155b15611707576001600160a01b0382166000908152600660209081526040808320338452909152902054818110156116d3576040805162461bcd60e51b815260206004820152601860248201527f4e6f7420656e6f7567682066756e647320616c6c6f7765640000000000000000604482015290519081900360640190fd5b8060001914611705576001600160a01b0383166000908152600660209081526040808320338452909152902082820390555b505b6001600160a01b03821660009081526005602052604090205481811015611775576040805162461bcd60e51b815260206004820152601060248201527f4e6f7420656e6f7567682066756e647300000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03831660008181526005602090815260408083208686039055600480548790039055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3505050565b6001600160a01b038216611833576040805162461bcd60e51b815260206004820152601260248201527f43616e6e6f742073656e6420746f203078300000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b038316600090815260056020526040902054818110156118a1576040805162461bcd60e51b815260206004820152600f60248201527f6e6f7420656e6f7567682066756e640000000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b0380851660008181526005602090815260408083208787039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a350505050565b600081118015611922575061192082610d3c565b155b15611962576001600160a01b038084166000908152600660209081526040808320938616835292905220548181101561196057611960848484611504565b505b505050565b60006060841561197c5761197c87878761190c565b856001600160a01b031684846040518082805190602001908083835b602083106119d557805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611998565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038160008787f1925050503d8060008114611a38576040519150601f19603f3d011682016040523d82523d6000602084013e611a3d565b606091505b509092509050603f84045a11611a4f57fe5b9550959350505050565b6000604483511015611a6d57506000610b1f565b5060248201516001600160a01b0382161492915050565b60005a8403905085811115611a965750845b820184810285828281611aa557fe5b0414611af8576040805162461bcd60e51b815260206004820152600860248201527f6f766572666c6f77000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b611b038884836117d8565b505050505050505056fe6d73672e73656e64657220213d206f776e6572202626202173757065724f70657261746f726f6e6c7920657865637574696f6e206f70657261746f727320616c6c6f77656420746f2070657266726f6d207472616e7366657220616e64206368617267656f6e6c7920657865637574696f6e2061646d696e20697320616c6c6f77656420746f2061646420657865637574696f6e206f70657261746f72736f6e6c792061646d696e20697320616c6c6f77656420746f20616464207375706572206f70657261746f72736f6e6c7920657865637574696f6e41646d696e2063616e206368616e676520657865637574696f6e41646d696e6f6e6c7920657865637574696f6e206f70657261746f727320616c6c6f77656420746f2065786563757465206f6e2053414e4420626568616c66a265627a7a72305820c7a438998ba2dc88fc9df905ee2425cd3898a4efc17aeb7ccfef84f57510980864736f6c63430005090032", + "deployedBytecode": "0x6080604052600436106101ac5760003560e01c80636e9960c3116100ec578063b01b0ef71161008a578063dc2173f311610064578063dc2173f31461082b578063dcdf5158146108e2578063dd62ed3e14610974578063e18aa335146109af576101ac565b8063b01b0ef71461070c578063bb1e23cb14610721578063cae9ca51146107a6576101ac565b80638f283970116100c65780638f2839701461066557806395d89b41146101b1578063a9059cbb14610698578063ac9fe421146106d1576101ac565b80636e9960c3146104dc57806370a082311461050d5780637dd711c414610540576101ac565b80632b9917461161015957806342966c681161013357806342966c681461041157806361247de31461043b578063654b748a1461046e578063699c834b146104a1576101ac565b80632b99174614610360578063313ce567146103a35780633b7b5a16146103ce576101ac565b806318160ddd1161018a57806318160ddd146102bd5780631dd319cb146102e457806323b872dd1461031d576101ac565b806306fdde03146101b15780630819ba741461023b578063095ea7b314610270575b600080fd5b3480156101bd57600080fd5b506101c6610a0c565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102005781810151838201526020016101e8565b50505050905090810190601f16801561022d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561024757600080fd5b5061026e6004803603602081101561025e57600080fd5b50356001600160a01b0316610a43565b005b34801561027c57600080fd5b506102a96004803603604081101561029357600080fd5b506001600160a01b038135169060200135610b0e565b604080519115158252519081900360200190f35b3480156102c957600080fd5b506102d2610b25565b60408051918252519081900360200190f35b3480156102f057600080fd5b506102a96004803603604081101561030757600080fd5b506001600160a01b038135169060200135610b2b565b34801561032957600080fd5b506102a96004803603606081101561034057600080fd5b506001600160a01b03813581169160208101359091169060400135610b37565b34801561036c57600080fd5b506102a96004803603606081101561038357600080fd5b506001600160a01b03813581169160208101359091169060400135610c29565b3480156103af57600080fd5b506103b8610c97565b6040805160ff9092168252519081900360200190f35b3480156103da57600080fd5b506102a9600480360360608110156103f157600080fd5b506001600160a01b03813581169160208101359091169060400135610c9c565b34801561041d57600080fd5b506102a96004803603602081101561043457600080fd5b5035610d0a565b34801561044757600080fd5b506102a96004803603602081101561045e57600080fd5b50356001600160a01b0316610d1e565b34801561047a57600080fd5b506102a96004803603602081101561049157600080fd5b50356001600160a01b0316610d3c565b3480156104ad57600080fd5b5061026e600480360360408110156104c457600080fd5b506001600160a01b0381351690602001351515610d5a565b3480156104e857600080fd5b506104f1610e07565b604080516001600160a01b039092168252519081900360200190f35b34801561051957600080fd5b506102d26004803603602081101561053057600080fd5b50356001600160a01b0316610e16565b34801561054c57600080fd5b506105e2600480360360a081101561056357600080fd5b6001600160a01b03823581169260208101359091169160408201359160608101359181019060a0810160808201356401000000008111156105a357600080fd5b8201836020820111156105b557600080fd5b803590602001918460018302840111640100000000831117156105d757600080fd5b509092509050610e31565b604051808315151515815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610629578181015183820152602001610611565b50505050905090810190601f1680156106565780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b34801561067157600080fd5b5061026e6004803603602081101561068857600080fd5b50356001600160a01b0316610ed4565b3480156106a457600080fd5b506102a9600480360360408110156106bb57600080fd5b506001600160a01b038135169060200135610fb5565b3480156106dd57600080fd5b5061026e600480360360408110156106f457600080fd5b506001600160a01b0381351690602001351515610fc2565b34801561071857600080fd5b506104f161106f565b6101c66004803603606081101561073757600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561076757600080fd5b82018360208201111561077957600080fd5b8035906020019184600183028401116401000000008311171561079b57600080fd5b50909250905061107e565b6101c6600480360360608110156107bc57600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156107ec57600080fd5b8201836020820111156107fe57600080fd5b8035906020019184600183028401116401000000008311171561082057600080fd5b509092509050611225565b34801561083757600080fd5b506105e2600480360361010081101561084f57600080fd5b6001600160a01b038235811692602081013582169260408201359260608301359260808101359260a08201359260c0830135169190810190610100810160e08201356401000000008111156108a357600080fd5b8201836020820111156108b557600080fd5b803590602001918460018302840111640100000000831117156108d757600080fd5b5090925090506112c4565b3480156108ee57600080fd5b506105e26004803603606081101561090557600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561093557600080fd5b82018360208201111561094757600080fd5b8035906020019184600183028401116401000000008311171561096957600080fd5b509092509050611387565b34801561098057600080fd5b506102d26004803603604081101561099757600080fd5b506001600160a01b0381358116916020013516611456565b3480156109bb57600080fd5b506102a9600480360360e08110156109d257600080fd5b506001600160a01b038135811691602081013582169160408201359160608101359160808201359160a08101359160c09091013516611481565b60408051808201909152600481527f53414e4400000000000000000000000000000000000000000000000000000000602082015290565b6000546001600160a01b03163314610a8c5760405162461bcd60e51b815260040180806020018281038252602d815260200180611bd8602d913960400191505060405180910390fd5b600054604080516001600160a01b039283168152918316602083015280517fb2b670b34860515166c00eba5e2e5fa8116d57091604f37ba24ac8021c7fa1659281900390910190a1600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6000610b1b338484611504565b5060015b92915050565b60045490565b6000610b1b83836115d7565b6000336001600160a01b03851614801590610b6257503360009081526003602052604090205460ff16155b15610c14576001600160a01b03841660009081526006602090815260408083203384529091529020546000198114610c125782811015610be9576040805162461bcd60e51b815260206004820152601860248201527f4e6f7420656e6f7567682066756e647320616c6c6f7765640000000000000000604482015290519081900360640190fd5b6001600160a01b0385166000908152600660209081526040808320338452909152902083820390555b505b610c1f8484846117d8565b5060019392505050565b6000336001600160a01b0385161480610c5157503360009081526003602052604090205460ff165b610c8c5760405162461bcd60e51b8152600401808060200182810382526025815260200180611b0e6025913960400191505060405180910390fd5b610c1f848484611504565b601290565b6000336001600160a01b0385161480610cc457503360009081526003602052604090205460ff165b610cff5760405162461bcd60e51b8152600401808060200182810382526025815260200180611b0e6025913960400191505060405180910390fd5b610c1f84848461190c565b6000610d1633836115d7565b506001919050565b6001600160a01b031660009081526001602052604090205460ff1690565b6001600160a01b031660009081526003602052604090205460ff1690565b6000546001600160a01b03163314610da35760405162461bcd60e51b815260040180806020018281038252603a815260200180611b72603a913960400191505060405180910390fd5b6001600160a01b038216600081815260016020908152604091829020805460ff191685151590811790915582519384529083015280517ffcebaa973ed84808fb785c92941aa4798f3f66923f5a2ff544382db3a9b3a3a29281900390910190a15050565b6002546001600160a01b031690565b6001600160a01b031660009081526005602052604090205490565b3360009081526001602052604081205460609060ff16610e825760405162461bcd60e51b815260040180806020018281038252603a815260200180611c05603a913960400191505060405180910390fd5b610ec58888888888888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061196792505050565b91509150965096945050505050565b6002546001600160a01b03163314610f33576040805162461bcd60e51b815260206004820152601b60248201527f6f6e6c792061646d696e2063616e206368616e67652061646d696e0000000000604482015290519081900360640190fd5b600254604080516001600160a01b039283168152918316602083015280517f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f9281900390910190a1600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6000610b1b3384846117d8565b6002546001600160a01b0316331461100b5760405162461bcd60e51b815260040180806020018281038252602c815260200180611bac602c913960400191505060405180910390fd5b6001600160a01b038216600081815260036020908152604091829020805460ff191685151590811790915582519384529083015280517f44f92d27abdf4cfb6a7d712c3af68f3be086d4ca747ab802c36f67d6790060d89281900390910190a15050565b6000546001600160a01b031690565b60606110c183838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250339250611a59915050565b611112576040805162461bcd60e51b815260206004820152601560248201527f666972737420706172616d20213d2073656e6465720000000000000000000000604482015290519081900360640190fd5b83156111235761112333868661190c565b60006060866001600160a01b0316348686604051808383808284376040519201945060009350909150508083038185875af1925050503d8060008114611185576040519150601f19603f3d011682016040523d82523d6000602084013e61118a565b606091505b509150915081819061121a5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156111df5781810151838201526020016111c7565b50505050905090810190601f16801561120c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509695505050505050565b606061126883838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250339250611a59915050565b6112b9576040805162461bcd60e51b815260206004820152601560248201527f666972737420706172616d20213d2073656e6465720000000000000000000000604482015290519081900360640190fd5b611123338686611504565b6000606060005a3360009081526001602052604090205490915060ff1661131c5760405162461bcd60e51b815260040180806020018281038252603a815260200180611c05603a913960400191505060405180910390fd5b61135f8c8c8c8c89898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061196792505050565b90935091508715611378576113788c8a8a848b8b611a84565b50995099975050505050505050565b3360009081526001602052604081205460609060ff166113d85760405162461bcd60e51b815260040180806020018281038252603a815260200180611c05603a913960400191505060405180910390fd5b856001600160a01b03168585856040518083838082843760405192019450600093509091505080830381838787f1925050503d8060008114611436576040519150601f19603f3d011682016040523d82523d6000602084013e61143b565b606091505b509092509050603f85045a1161144d57fe5b94509492505050565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b6000805a3360009081526001602052604090205490915060ff166114d65760405162461bcd60e51b815260040180806020018281038252603f815260200180611b33603f913960400191505060405180910390fd5b6114e18989896117d8565b84156114f5576114f5898787848888611a84565b50600198975050505050505050565b6001600160a01b0383161580159061152457506001600160a01b03821615155b611575576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f7420617070726f7665207769746820307830000000000000000000604482015290519081900360640190fd5b6001600160a01b03808416600081815260066020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6000811161162c576040805162461bcd60e51b815260206004820152601460248201527f63616e6e6f74206275726e203020746f6b656e73000000000000000000000000604482015290519081900360640190fd5b336001600160a01b0383161480159061165557503360009081526003602052604090205460ff16155b15611707576001600160a01b0382166000908152600660209081526040808320338452909152902054818110156116d3576040805162461bcd60e51b815260206004820152601860248201527f4e6f7420656e6f7567682066756e647320616c6c6f7765640000000000000000604482015290519081900360640190fd5b8060001914611705576001600160a01b0383166000908152600660209081526040808320338452909152902082820390555b505b6001600160a01b03821660009081526005602052604090205481811015611775576040805162461bcd60e51b815260206004820152601060248201527f4e6f7420656e6f7567682066756e647300000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b03831660008181526005602090815260408083208686039055600480548790039055805186815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3505050565b6001600160a01b038216611833576040805162461bcd60e51b815260206004820152601260248201527f43616e6e6f742073656e6420746f203078300000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b038316600090815260056020526040902054818110156118a1576040805162461bcd60e51b815260206004820152600f60248201527f6e6f7420656e6f7567682066756e640000000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b0380851660008181526005602090815260408083208787039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a350505050565b600081118015611922575061192082610d3c565b155b15611962576001600160a01b038084166000908152600660209081526040808320938616835292905220548181101561196057611960848484611504565b505b505050565b60006060841561197c5761197c87878761190c565b856001600160a01b031684846040518082805190602001908083835b602083106119d557805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101611998565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038160008787f1925050503d8060008114611a38576040519150601f19603f3d011682016040523d82523d6000602084013e611a3d565b606091505b509092509050603f84045a11611a4f57fe5b9550959350505050565b6000604483511015611a6d57506000610b1f565b5060248201516001600160a01b0382161492915050565b60005a8403905085811115611a965750845b820184810285828281611aa557fe5b0414611af8576040805162461bcd60e51b815260206004820152600860248201527f6f766572666c6f77000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b611b038884836117d8565b505050505050505056fe6d73672e73656e64657220213d206f776e6572202626202173757065724f70657261746f726f6e6c7920657865637574696f6e206f70657261746f727320616c6c6f77656420746f2070657266726f6d207472616e7366657220616e64206368617267656f6e6c7920657865637574696f6e2061646d696e20697320616c6c6f77656420746f2061646420657865637574696f6e206f70657261746f72736f6e6c792061646d696e20697320616c6c6f77656420746f20616464207375706572206f70657261746f72736f6e6c7920657865637574696f6e41646d696e2063616e206368616e676520657865637574696f6e41646d696e6f6e6c7920657865637574696f6e206f70657261746f727320616c6c6f77656420746f2065786563757465206f6e2053414e4420626568616c66a265627a7a72305820c7a438998ba2dc88fc9df905ee2425cd3898a4efc17aeb7ccfef84f57510980864736f6c63430005090032", + "solidityMetadata": "{\"compiler\":{\"version\":\"0.5.9+commit.e560f70d\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeExecutionAdmin\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burnFor\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"from\",\"type\":\"address\"},{\"name\":\"to\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approveFor\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"amountNeeded\",\"type\":\"uint256\"}],\"name\":\"addAllowanceIfNeeded\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"who\",\"type\":\"address\"}],\"name\":\"isExecutionOperator\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"who\",\"type\":\"address\"}],\"name\":\"isSuperOperator\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"executionOperator\",\"type\":\"address\"},{\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"setExecutionOperator\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getAdmin\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"from\",\"type\":\"address\"},{\"name\":\"to\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"},{\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"approveAndExecuteWithSpecificGas\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"},{\"name\":\"returnData\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"to\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"superOperator\",\"type\":\"address\"},{\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"setSuperOperator\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getExecutionAdmin\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"target\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"paidCall\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"target\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"approveAndCall\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"from\",\"type\":\"address\"},{\"name\":\"to\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"},{\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"name\":\"tokenGasPrice\",\"type\":\"uint256\"},{\"name\":\"baseGasCharge\",\"type\":\"uint256\"},{\"name\":\"tokenReceiver\",\"type\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"approveAndExecuteWithSpecificGasAndChargeForIt\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"},{\"name\":\"returnData\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"to\",\"type\":\"address\"},{\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"executeWithSpecificGas\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"},{\"name\":\"returnData\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"remaining\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"from\",\"type\":\"address\"},{\"name\":\"to\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"},{\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"name\":\"tokenGasPrice\",\"type\":\"uint256\"},{\"name\":\"baseGasCharge\",\"type\":\"uint256\"},{\"name\":\"tokenReceiver\",\"type\":\"address\"}],\"name\":\"transferAndChargeForGas\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"sandAdmin\",\"type\":\"address\"},{\"name\":\"executionAdmin\",\"type\":\"address\"},{\"name\":\"beneficiary\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"superOperator\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"SuperOperator\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"oldAdmin\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"oldAdmin\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"ExecutionAdminAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"executionOperator\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"ExecutionOperator\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{\"allowance(address,address)\":{\"params\":{\"owner\":\"address whose token is allowed.\",\"spender\":\"address allowed to transfer.\"},\"return\":\"the amount of token `spender` is allowed to transfer on behalf of `owner`.\"},\"approve(address,uint256)\":{\"params\":{\"amount\":\"the number of tokens allowed.\",\"spender\":\"address to be given rights to transfer.\"},\"return\":\"true if success.\"},\"approveAndCall(address,uint256,bytes)\":{\"params\":{\"amount\":\"the number of tokens allowed.\",\"data\":\"bytes for the call.\",\"target\":\"address to be given rights to transfer and destination of the call.\"},\"return\":\"data of the call.\"},\"approveAndExecuteWithSpecificGas(address,address,uint256,uint256,bytes)\":{\"params\":{\"amount\":\"number of tokens allowed that can be transfer by the code at `to`.\",\"data\":\"the bytes sent to the destination address.\",\"from\":\"address of which token will be transfered.\",\"gasLimit\":\"exact amount of gas to be passed to the call.\",\"to\":\"destination address fo the call.\"},\"return\":\"success whether the execution was successful.returnData data resulting from the execution.\"},\"approveAndExecuteWithSpecificGasAndChargeForIt(address,address,uint256,uint256,uint256,uint256,address,bytes)\":{\"details\":\"the reason for this function is that charging for gas here is more gas-efficient than doing it in the caller.\",\"params\":{\"amount\":\"number of tokens allowed that can be transfer by the code at `to`.\",\"baseGasCharge\":\"amount of gas charged on top of the gas used for the call.\",\"data\":\"the bytes sent to the destination address.\",\"from\":\"address of which token will be transfered.\",\"gasLimit\":\"exact amount of gas to be passed to the call.\",\"to\":\"destination address fo the call.\",\"tokenGasPrice\":\"price in token for the gas to be charged.\",\"tokenReceiver\":\"recipient address of the token charged for the gas used.\"},\"return\":\"success whether the execution was successful.returnData data resulting from the execution.\"},\"approveFor(address,address,uint256)\":{\"params\":{\"amount\":\"the number of tokens allowed.\",\"owner\":\"address whose token is allowed.\",\"spender\":\"address to be given rights to transfer.\"},\"return\":\"true if success.\"},\"balanceOf(address)\":{\"params\":{\"owner\":\"The address to query the balance of.\"},\"return\":\"The amount owned by `owner`.\"},\"burn(uint256)\":{\"params\":{\"amount\":\"the number of tokens to burn.\"},\"return\":\"true if success.\"},\"burnFor(address,uint256)\":{\"params\":{\"amount\":\"the number of token to burn.\",\"owner\":\"address whose token is to burn.\"},\"return\":\"true if success.\"},\"changeAdmin(address)\":{\"params\":{\"newAdmin\":\"address of the new administrator.\"}},\"changeExecutionAdmin(address)\":{\"params\":{\"newAdmin\":\"address of the new administrator.\"}},\"decimals()\":{\"return\":\"the number of decimals.\"},\"executeWithSpecificGas(address,uint256,bytes)\":{\"params\":{\"data\":\"the bytes sent to the destination address.\",\"gasLimit\":\"exact amount of gas to be passed to the call.\",\"to\":\"destination address fo the call.\"},\"return\":\"success whether the execution was successful.returnData data resulting from the execution.\"},\"getAdmin()\":{\"return\":\"the current administrator of this contract.\"},\"getExecutionAdmin()\":{\"return\":\"address of the execution administrator.\"},\"isExecutionOperator(address)\":{\"params\":{\"who\":\"The address to query.\"},\"return\":\"whether the address has executionOperator rights.\"},\"isSuperOperator(address)\":{\"params\":{\"who\":\"The address to query.\"},\"return\":\"whether the address has superOperator rights.\"},\"name()\":{\"return\":\"name of the tokens\"},\"paidCall(address,uint256,bytes)\":{\"params\":{\"amount\":\"the number of tokens allowed to spend.\",\"data\":\"bytes for the call.\",\"target\":\"destination of the call, allowed to spend the amount specified\"},\"return\":\"data of the call.\"},\"setExecutionOperator(address,bool)\":{\"params\":{\"enabled\":\"set whether the executionOperator is enabled or disabled.\",\"executionOperator\":\"address that will be given/removed executionOperator right.\"}},\"setSuperOperator(address,bool)\":{\"params\":{\"enabled\":\"set whether the superOperator is enabled or disabled.\",\"superOperator\":\"address that will be given/removed superOperator right.\"}},\"symbol()\":{\"return\":\"symbol of the tokens\"},\"totalSupply()\":{\"return\":\"the total number of tokens in existence.\"},\"transfer(address,uint256)\":{\"params\":{\"amount\":\"the number of tokens transfered.\",\"to\":\"the recipient address of the tokens transfered.\"},\"return\":\"true if success.\"},\"transferAndChargeForGas(address,address,uint256,uint256,uint256,uint256,address)\":{\"params\":{\"amount\":\"number of tokens allowed that can be transfer by the code at `to`.\",\"baseGasCharge\":\"amount of gas charged on top of the gas used for the call.\",\"from\":\"address of which token will be transfered.\",\"gasLimit\":\"exact amount of gas to be passed to the call.\",\"to\":\"destination address fo the call.\",\"tokenGasPrice\":\"price in token for the gas to be charged.\",\"tokenReceiver\":\"recipient address of the token charged for the gas used.\"},\"return\":\"whether the transfer was successful.\"},\"transferFrom(address,address,uint256)\":{\"params\":{\"amount\":\"the number of tokens transfered.\",\"from\":\"whose token it is transferring from.\",\"to\":\"the recipient address of the tokens transfered.\"},\"return\":\"true if success.\"}}},\"userdoc\":{\"methods\":{\"allowance(address,address)\":{\"notice\":\"gets allowance of `spender` for `owner`'s tokens.\"},\"approve(address,uint256)\":{\"notice\":\"approve `spender` to transfer `amount` tokens.\"},\"approveAndCall(address,uint256,bytes)\":{\"notice\":\"approve `target` to spend `amount` and call it with data.\"},\"approveAndExecuteWithSpecificGas(address,address,uint256,uint256,bytes)\":{\"notice\":\"approve a specific amount of token for `from` and execute on behalf of the contract.\"},\"approveAndExecuteWithSpecificGasAndChargeForIt(address,address,uint256,uint256,uint256,uint256,address,bytes)\":{\"notice\":\"approve a specific amount of token for `from` and execute on behalf of the contract. Plus charge the gas required to perform it.\"},\"approveFor(address,address,uint256)\":{\"notice\":\"approve `spender` to transfer `amount` tokens from `owner`.\"},\"balanceOf(address)\":{\"notice\":\"Gets the balance of `owner`.\"},\"burn(uint256)\":{\"notice\":\"burn `amount` tokens.\"},\"burnFor(address,uint256)\":{\"notice\":\"burn `amount` tokens from `owner`.\"},\"changeAdmin(address)\":{\"notice\":\"change the administrator to be `newAdmin`.\"},\"changeExecutionAdmin(address)\":{\"notice\":\"change the execution adminstrator to be `newAdmin`.\"},\"decimals()\":{\"notice\":\"returns the number of decimals for that token.\"},\"executeWithSpecificGas(address,uint256,bytes)\":{\"notice\":\"execute on behalf of the contract.\"},\"getAdmin()\":{\"notice\":\"gives the current administrator of this contract.\"},\"getExecutionAdmin()\":{\"notice\":\"give the address responsible for adding execution rights.\"},\"isExecutionOperator(address)\":{\"notice\":\"check whether address `who` is given executionOperator rights.\"},\"isSuperOperator(address)\":{\"notice\":\"check whether address `who` is given superOperator rights.\"},\"name()\":{\"notice\":\"A descriptive name for the tokens\"},\"paidCall(address,uint256,bytes)\":{\"notice\":\"temporarly approve `target` to spend `amount` and call it with data. Previous approvals remains unchanged.\"},\"setExecutionOperator(address,bool)\":{\"notice\":\"set `executionOperator` as executionOperator: `enabled`.\"},\"setSuperOperator(address,bool)\":{\"notice\":\"Enable or disable the ability of `superOperator` to transfer tokens of all (superOperator rights).\"},\"symbol()\":{\"notice\":\"An abbreviated name for the tokens\"},\"totalSupply()\":{\"notice\":\"Gets the total number of tokens in existence.\"},\"transfer(address,uint256)\":{\"notice\":\"Transfer `amount` tokens to `to`.\"},\"transferAndChargeForGas(address,address,uint256,uint256,uint256,uint256,address)\":{\"notice\":\"transfer 1amount1 token from `from` to `to` and charge the gas required to perform that transfer.\"},\"transferFrom(address,address,uint256)\":{\"notice\":\"Transfer `amount` tokens from `from` to `to`.\"}}}},\"settings\":{\"compilationTarget\":{\"src/Sand.sol\":\"Sand\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"metadata\":{\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":2000},\"remappings\":[]},\"sources\":{\"contracts_common/src/BaseWithStorage/Admin.sol\":{\"content\":\"pragma solidity ^0.5.2;\\n\\ncontract Admin {\\n\\n address internal _admin;\\n\\n event AdminChanged(address oldAdmin, address newAdmin);\\n\\n /// @notice gives the current administrator of this contract.\\n /// @return the current administrator of this contract.\\n function getAdmin() external view returns (address) {\\n return _admin;\\n }\\n\\n /// @notice change the administrator to be `newAdmin`.\\n /// @param newAdmin address of the new administrator.\\n function changeAdmin(address newAdmin) external {\\n require(msg.sender == _admin, \\\"only admin can change admin\\\");\\n emit AdminChanged(_admin, newAdmin);\\n _admin = newAdmin;\\n }\\n}\\n\",\"keccak256\":\"0x74418caab05cca3fe5b9309ab069a9bfe327ff96f593a347e1f1cc0c02f25693\"},\"contracts_common/src/BaseWithStorage/SuperOperators.sol\":{\"content\":\"pragma solidity ^0.5.2;\\n\\nimport \\\"./Admin.sol\\\";\\n\\ncontract SuperOperators is Admin {\\n\\n mapping(address => bool) internal _superOperators;\\n\\n event SuperOperator(address superOperator, bool enabled);\\n\\n /// @notice Enable or disable the ability of `superOperator` to transfer tokens of all (superOperator rights).\\n /// @param superOperator address that will be given/removed superOperator right.\\n /// @param enabled set whether the superOperator is enabled or disabled.\\n function setSuperOperator(address superOperator, bool enabled) external {\\n require(\\n msg.sender == _admin,\\n \\\"only admin is allowed to add super operators\\\"\\n );\\n _superOperators[superOperator] = enabled;\\n emit SuperOperator(superOperator, enabled);\\n }\\n\\n /// @notice check whether address `who` is given superOperator rights.\\n /// @param who The address to query.\\n /// @return whether the address has superOperator rights.\\n function isSuperOperator(address who) public view returns (bool) {\\n return _superOperators[who];\\n }\\n}\\n\",\"keccak256\":\"0x22354cf60ccf77a6de61c13bdaf4e3094d115b960ae563b0527622c846a12abb\"},\"contracts_common/src/Interfaces/ERC20Events.sol\":{\"content\":\"pragma solidity ^0.5.2;\\n\\n/* interface */\\ncontract ERC20Events {\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n event Approval(\\n address indexed owner,\\n address indexed spender,\\n uint256 value\\n );\\n}\\n\",\"keccak256\":\"0xee09c10a3f9adc913227efdcd94ce44e05b59b04717f8f868153d356bd03f5d2\"},\"contracts_common/src/Libraries/BytesUtil.sol\":{\"content\":\"pragma solidity ^0.5.2;\\n\\nlibrary BytesUtil {\\n function memcpy(uint256 dest, uint256 src, uint256 len) internal pure {\\n // Copy word-length chunks while possible\\n for (; len >= 32; len -= 32) {\\n assembly {\\n mstore(dest, mload(src))\\n }\\n dest += 32;\\n src += 32;\\n }\\n\\n // Copy remaining bytes\\n uint256 mask = 256**(32 - len) - 1;\\n assembly {\\n let srcpart := and(mload(src), not(mask))\\n let destpart := and(mload(dest), mask)\\n mstore(dest, or(destpart, srcpart))\\n }\\n }\\n\\n function pointerToBytes(uint256 src, uint256 len)\\n internal\\n pure\\n returns (bytes memory)\\n {\\n bytes memory ret = new bytes(len);\\n uint256 retptr;\\n assembly {\\n retptr := add(ret, 32)\\n }\\n\\n memcpy(retptr, src, len);\\n return ret;\\n }\\n\\n function addressToBytes(address a) internal pure returns (bytes memory b) {\\n assembly {\\n let m := mload(0x40)\\n mstore(\\n add(m, 20),\\n xor(0x140000000000000000000000000000000000000000, a)\\n )\\n mstore(0x40, add(m, 52))\\n b := m\\n }\\n }\\n\\n function uint256ToBytes(uint256 a) internal pure returns (bytes memory b) {\\n assembly {\\n let m := mload(0x40)\\n mstore(add(m, 32), a)\\n mstore(0x40, add(m, 64))\\n b := m\\n }\\n }\\n\\n function doFirstParamEqualsAddress(bytes memory data, address _address)\\n internal\\n pure\\n returns (bool)\\n {\\n if (data.length < (36 + 32)) {\\n return false;\\n }\\n uint256 value;\\n assembly {\\n value := mload(add(data, 36))\\n }\\n return value == uint256(_address);\\n }\\n\\n function doParamEqualsUInt256(bytes memory data, uint256 i, uint256 value)\\n internal\\n pure\\n returns (bool)\\n {\\n if (data.length < (36 + (i + 1) * 32)) {\\n return false;\\n }\\n uint256 offset = 36 + i * 32;\\n uint256 valuePresent;\\n assembly {\\n valuePresent := mload(add(data, offset))\\n }\\n return valuePresent == value;\\n }\\n\\n function overrideFirst32BytesWithAddress(\\n bytes memory data,\\n address _address\\n ) internal pure returns (bytes memory) {\\n uint256 dest;\\n assembly {\\n dest := add(data, 48)\\n } // 48 = 32 (offset) + 4 (func sig) + 12 (address is only 20 bytes)\\n\\n bytes memory addressBytes = addressToBytes(_address);\\n uint256 src;\\n assembly {\\n src := add(addressBytes, 32)\\n }\\n\\n memcpy(dest, src, 20);\\n return data;\\n }\\n\\n function overrideFirstTwo32BytesWithAddressAndInt(\\n bytes memory data,\\n address _address,\\n uint256 _value\\n ) internal pure returns (bytes memory) {\\n uint256 dest;\\n uint256 src;\\n\\n assembly {\\n dest := add(data, 48)\\n } // 48 = 32 (offset) + 4 (func sig) + 12 (address is only 20 bytes)\\n bytes memory bbytes = addressToBytes(_address);\\n assembly {\\n src := add(bbytes, 32)\\n }\\n memcpy(dest, src, 20);\\n\\n assembly {\\n dest := add(data, 68)\\n } // 48 = 32 (offset) + 4 (func sig) + 32 (next slot)\\n bbytes = uint256ToBytes(_value);\\n assembly {\\n src := add(bbytes, 32)\\n }\\n memcpy(dest, src, 32);\\n\\n return data;\\n }\\n}\\n\",\"keccak256\":\"0xb5c236938e1f71524127371a015836e83103c5ac1b4ed7b7f22892a8c0429e10\"},\"src/Sand.sol\":{\"content\":\"pragma solidity 0.5.9;\\n\\nimport \\\"./Sand/erc20/ERC20ExecuteExtension.sol\\\";\\nimport \\\"./Sand/erc20/ERC20BaseToken.sol\\\";\\nimport \\\"./Sand/erc20/ERC20BasicApproveExtension.sol\\\";\\n\\ncontract Sand is ERC20ExecuteExtension, ERC20BasicApproveExtension, ERC20BaseToken {\\n\\n constructor(address sandAdmin, address executionAdmin, address beneficiary) public {\\n _admin = sandAdmin;\\n _executionAdmin = executionAdmin;\\n _mint(beneficiary, 3000000000000000000000000000);\\n }\\n\\n /// @notice A descriptive name for the tokens\\n /// @return name of the tokens\\n function name() public view returns (string memory) {\\n return \\\"SAND\\\";\\n }\\n\\n /// @notice An abbreviated name for the tokens\\n /// @return symbol of the tokens\\n function symbol() public view returns (string memory) {\\n return \\\"SAND\\\";\\n }\\n\\n}\\n\",\"keccak256\":\"0xe05c8232fddc05f34648fa1db29cbfff2d163357e613425a925d80dbefff75eb\"},\"src/Sand/erc20/ERC20BaseToken.sol\":{\"content\":\"pragma solidity 0.5.9;\\n\\nimport \\\"../../../contracts_common/src/Interfaces/ERC20Events.sol\\\";\\nimport \\\"../../../contracts_common/src/BaseWithStorage/SuperOperators.sol\\\";\\n\\ncontract ERC20BaseToken is SuperOperators, ERC20Events {\\n\\n uint256 internal _totalSupply;\\n mapping(address => uint256) internal _balances;\\n mapping(address => mapping(address => uint256)) internal _allowances;\\n\\n /// @notice Gets the total number of tokens in existence.\\n /// @return the total number of tokens in existence.\\n function totalSupply() public view returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /// @notice Gets the balance of `owner`.\\n /// @param owner The address to query the balance of.\\n /// @return The amount owned by `owner`.\\n function balanceOf(address owner) public view returns (uint256) {\\n return _balances[owner];\\n }\\n\\n /// @notice gets allowance of `spender` for `owner`'s tokens.\\n /// @param owner address whose token is allowed.\\n /// @param spender address allowed to transfer.\\n /// @return the amount of token `spender` is allowed to transfer on behalf of `owner`.\\n function allowance(address owner, address spender)\\n public\\n view\\n returns (uint256 remaining)\\n {\\n return _allowances[owner][spender];\\n }\\n\\n /// @notice returns the number of decimals for that token.\\n /// @return the number of decimals.\\n function decimals() public view returns (uint8) {\\n return uint8(18);\\n }\\n\\n /// @notice Transfer `amount` tokens to `to`.\\n /// @param to the recipient address of the tokens transfered.\\n /// @param amount the number of tokens transfered.\\n /// @return true if success.\\n function transfer(address to, uint256 amount)\\n public\\n returns (bool success)\\n {\\n _transfer(msg.sender, to, amount);\\n return true;\\n }\\n\\n /// @notice Transfer `amount` tokens from `from` to `to`.\\n /// @param from whose token it is transferring from.\\n /// @param to the recipient address of the tokens transfered.\\n /// @param amount the number of tokens transfered.\\n /// @return true if success.\\n function transferFrom(address from, address to, uint256 amount)\\n public\\n returns (bool success)\\n {\\n if (msg.sender != from && !_superOperators[msg.sender]) {\\n uint256 currentAllowance = _allowances[from][msg.sender];\\n if (currentAllowance != (2**256) - 1) {\\n // save gas when allowance is maximal by not reducing it (see https://github.com/ethereum/EIPs/issues/717)\\n require(currentAllowance >= amount, \\\"Not enough funds allowed\\\");\\n _allowances[from][msg.sender] = currentAllowance - amount;\\n }\\n }\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /// @notice burn `amount` tokens.\\n /// @param amount the number of tokens to burn.\\n /// @return true if success.\\n function burn(uint256 amount) external returns (bool) {\\n _burn(msg.sender, amount);\\n return true;\\n }\\n\\n /// @notice burn `amount` tokens from `owner`.\\n /// @param owner address whose token is to burn.\\n /// @param amount the number of token to burn.\\n /// @return true if success.\\n function burnFor(address owner, uint256 amount) external returns (bool) {\\n _burn(owner, amount);\\n return true;\\n }\\n\\n /// @notice approve `spender` to transfer `amount` tokens.\\n /// @param spender address to be given rights to transfer.\\n /// @param amount the number of tokens allowed.\\n /// @return true if success.\\n function approve(address spender, uint256 amount)\\n public\\n returns (bool success)\\n {\\n _approveFor(msg.sender, spender, amount);\\n return true;\\n }\\n\\n /// @notice approve `spender` to transfer `amount` tokens from `owner`.\\n /// @param owner address whose token is allowed.\\n /// @param spender address to be given rights to transfer.\\n /// @param amount the number of tokens allowed.\\n /// @return true if success.\\n function approveFor(address owner, address spender, uint256 amount)\\n public\\n returns (bool success)\\n {\\n require(\\n msg.sender == owner || _superOperators[msg.sender],\\n \\\"msg.sender != owner && !superOperator\\\"\\n );\\n _approveFor(owner, spender, amount);\\n return true;\\n }\\n\\n function addAllowanceIfNeeded(address owner, address spender, uint256 amountNeeded)\\n public\\n returns (bool success)\\n {\\n require(\\n msg.sender == owner || _superOperators[msg.sender],\\n \\\"msg.sender != owner && !superOperator\\\"\\n );\\n _addAllowanceIfNeeded(owner, spender, amountNeeded);\\n return true;\\n }\\n\\n function _addAllowanceIfNeeded(address owner, address spender, uint256 amountNeeded)\\n internal\\n {\\n if(amountNeeded > 0 && !isSuperOperator(spender)) {\\n uint256 currentAllowance = _allowances[owner][spender];\\n if(currentAllowance < amountNeeded) {\\n _approveFor(owner, spender, amountNeeded);\\n }\\n }\\n }\\n\\n function _approveFor(address owner, address spender, uint256 amount)\\n internal\\n {\\n require(\\n owner != address(0) && spender != address(0),\\n \\\"Cannot approve with 0x0\\\"\\n );\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n function _transfer(address from, address to, uint256 amount) internal {\\n require(to != address(0), \\\"Cannot send to 0x0\\\");\\n uint256 currentBalance = _balances[from];\\n require(currentBalance >= amount, \\\"not enough fund\\\");\\n _balances[from] = currentBalance - amount;\\n _balances[to] += amount;\\n emit Transfer(from, to, amount);\\n }\\n\\n function _mint(address to, uint256 amount) internal {\\n require(to != address(0), \\\"Cannot mint to 0x0\\\");\\n require(amount > 0, \\\"cannot mint 0 tokens\\\");\\n uint256 currentTotalSupply = _totalSupply;\\n uint256 newTotalSupply = currentTotalSupply + amount;\\n require(newTotalSupply > currentTotalSupply, \\\"overflow\\\");\\n _totalSupply = newTotalSupply;\\n _balances[to] += amount;\\n emit Transfer(address(0), to, amount);\\n }\\n\\n function _burn(address from, uint256 amount) internal {\\n require(amount > 0, \\\"cannot burn 0 tokens\\\");\\n if (msg.sender != from && !_superOperators[msg.sender]) {\\n uint256 currentAllowance = _allowances[from][msg.sender];\\n require(\\n currentAllowance >= amount,\\n \\\"Not enough funds allowed\\\"\\n );\\n if (currentAllowance != (2**256) - 1) {\\n // save gas when allowance is maximal by not reducing it (see https://github.com/ethereum/EIPs/issues/717)\\n _allowances[from][msg.sender] = currentAllowance - amount;\\n }\\n }\\n\\n uint256 currentBalance = _balances[from];\\n require(currentBalance >= amount, \\\"Not enough funds\\\");\\n _balances[from] = currentBalance - amount;\\n _totalSupply -= amount;\\n emit Transfer(from, address(0), amount);\\n }\\n}\\n\",\"keccak256\":\"0xc70b1452852cbe8f437ba3fdcff911ed3fd7820b0d853e5fe147a90989cc1085\"},\"src/Sand/erc20/ERC20BasicApproveExtension.sol\":{\"content\":\"pragma solidity 0.5.9;\\n\\nimport \\\"../../../contracts_common/src/Libraries/BytesUtil.sol\\\";\\n\\ncontract ERC20BasicApproveExtension {\\n\\n /// @notice approve `target` to spend `amount` and call it with data.\\n /// @param target address to be given rights to transfer and destination of the call.\\n /// @param amount the number of tokens allowed.\\n /// @param data bytes for the call.\\n /// @return data of the call.\\n function approveAndCall(\\n address target,\\n uint256 amount,\\n bytes calldata data\\n ) external payable returns (bytes memory) {\\n require(\\n BytesUtil.doFirstParamEqualsAddress(data, msg.sender),\\n \\\"first param != sender\\\"\\n );\\n\\n _approveFor(msg.sender, target, amount);\\n\\n // solium-disable-next-line security/no-call-value\\n (bool success, bytes memory returnData) = target.call.value(msg.value)(data);\\n require(success, string(returnData));\\n return returnData;\\n }\\n\\n /// @notice temporarly approve `target` to spend `amount` and call it with data. Previous approvals remains unchanged.\\n /// @param target destination of the call, allowed to spend the amount specified\\n /// @param amount the number of tokens allowed to spend.\\n /// @param data bytes for the call.\\n /// @return data of the call.\\n function paidCall(\\n address target,\\n uint256 amount,\\n bytes calldata data\\n ) external payable returns (bytes memory) {\\n require(\\n BytesUtil.doFirstParamEqualsAddress(data, msg.sender),\\n \\\"first param != sender\\\"\\n );\\n\\n if (amount > 0) {\\n _addAllowanceIfNeeded(msg.sender, target, amount);\\n }\\n\\n // solium-disable-next-line security/no-call-value\\n (bool success, bytes memory returnData) = target.call.value(msg.value)(data);\\n require(success, string(returnData));\\n\\n return returnData;\\n }\\n\\n function _approveFor(address owner, address target, uint256 amount) internal;\\n function _addAllowanceIfNeeded(address owner, address spender, uint256 amountNeeded) internal;\\n}\\n\",\"keccak256\":\"0xbd8c882843acf82adb849222068490302925e31ac66305b75f1663a719c7fc37\"},\"src/Sand/erc20/ERC20ExecuteExtension.sol\":{\"content\":\"pragma solidity 0.5.9;\\n\\n\\ncontract ERC20ExecuteExtension {\\n\\n /// @dev _executionAdmin != _admin so that this super power can be disabled independently\\n address internal _executionAdmin;\\n\\n event ExecutionAdminAdminChanged(address oldAdmin, address newAdmin);\\n\\n /// @notice give the address responsible for adding execution rights.\\n /// @return address of the execution administrator.\\n function getExecutionAdmin() external view returns (address) {\\n return _executionAdmin;\\n }\\n\\n /// @notice change the execution adminstrator to be `newAdmin`.\\n /// @param newAdmin address of the new administrator.\\n function changeExecutionAdmin(address newAdmin) external {\\n require(msg.sender == _executionAdmin, \\\"only executionAdmin can change executionAdmin\\\");\\n emit ExecutionAdminAdminChanged(_executionAdmin, newAdmin);\\n _executionAdmin = newAdmin;\\n }\\n\\n mapping(address => bool) internal _executionOperators;\\n event ExecutionOperator(address executionOperator, bool enabled);\\n\\n /// @notice set `executionOperator` as executionOperator: `enabled`.\\n /// @param executionOperator address that will be given/removed executionOperator right.\\n /// @param enabled set whether the executionOperator is enabled or disabled.\\n function setExecutionOperator(address executionOperator, bool enabled) external {\\n require(\\n msg.sender == _executionAdmin,\\n \\\"only execution admin is allowed to add execution operators\\\"\\n );\\n _executionOperators[executionOperator] = enabled;\\n emit ExecutionOperator(executionOperator, enabled);\\n }\\n\\n /// @notice check whether address `who` is given executionOperator rights.\\n /// @param who The address to query.\\n /// @return whether the address has executionOperator rights.\\n function isExecutionOperator(address who) public view returns (bool) {\\n return _executionOperators[who];\\n }\\n\\n /// @notice execute on behalf of the contract.\\n /// @param to destination address fo the call.\\n /// @param gasLimit exact amount of gas to be passed to the call.\\n /// @param data the bytes sent to the destination address.\\n /// @return success whether the execution was successful.\\n /// @return returnData data resulting from the execution.\\n function executeWithSpecificGas(address to, uint256 gasLimit, bytes calldata data) external returns (bool success, bytes memory returnData) {\\n require(_executionOperators[msg.sender], \\\"only execution operators allowed to execute on SAND behalf\\\");\\n (success, returnData) = to.call.gas(gasLimit)(data);\\n assert(gasleft() > gasLimit / 63); // not enough gas provided, assert to throw all gas // TODO use EIP-1930\\n }\\n\\n /// @notice approve a specific amount of token for `from` and execute on behalf of the contract.\\n /// @param from address of which token will be transfered.\\n /// @param to destination address fo the call.\\n /// @param amount number of tokens allowed that can be transfer by the code at `to`.\\n /// @param gasLimit exact amount of gas to be passed to the call.\\n /// @param data the bytes sent to the destination address.\\n /// @return success whether the execution was successful.\\n /// @return returnData data resulting from the execution.\\n function approveAndExecuteWithSpecificGas(\\n address from,\\n address to,\\n uint256 amount,\\n uint256 gasLimit,\\n bytes calldata data\\n ) external returns (bool success, bytes memory returnData) {\\n require(_executionOperators[msg.sender], \\\"only execution operators allowed to execute on SAND behalf\\\");\\n return _approveAndExecuteWithSpecificGas(from, to, amount, gasLimit, data);\\n }\\n\\n /// @dev the reason for this function is that charging for gas here is more gas-efficient than doing it in the caller.\\n /// @notice approve a specific amount of token for `from` and execute on behalf of the contract. Plus charge the gas required to perform it.\\n /// @param from address of which token will be transfered.\\n /// @param to destination address fo the call.\\n /// @param amount number of tokens allowed that can be transfer by the code at `to`.\\n /// @param gasLimit exact amount of gas to be passed to the call.\\n /// @param tokenGasPrice price in token for the gas to be charged.\\n /// @param baseGasCharge amount of gas charged on top of the gas used for the call.\\n /// @param tokenReceiver recipient address of the token charged for the gas used.\\n /// @param data the bytes sent to the destination address.\\n /// @return success whether the execution was successful.\\n /// @return returnData data resulting from the execution.\\n function approveAndExecuteWithSpecificGasAndChargeForIt(\\n address from,\\n address to,\\n uint256 amount,\\n uint256 gasLimit,\\n uint256 tokenGasPrice,\\n uint256 baseGasCharge,\\n address tokenReceiver,\\n bytes calldata data\\n ) external returns (bool success, bytes memory returnData) {\\n uint256 initialGas = gasleft();\\n require(_executionOperators[msg.sender], \\\"only execution operators allowed to execute on SAND behalf\\\");\\n (success, returnData) = _approveAndExecuteWithSpecificGas(from, to, amount, gasLimit, data);\\n if (tokenGasPrice > 0) {\\n _charge(from, gasLimit, tokenGasPrice, initialGas, baseGasCharge, tokenReceiver);\\n }\\n }\\n\\n /// @notice transfer 1amount1 token from `from` to `to` and charge the gas required to perform that transfer.\\n /// @param from address of which token will be transfered.\\n /// @param to destination address fo the call.\\n /// @param amount number of tokens allowed that can be transfer by the code at `to`.\\n /// @param gasLimit exact amount of gas to be passed to the call.\\n /// @param tokenGasPrice price in token for the gas to be charged.\\n /// @param baseGasCharge amount of gas charged on top of the gas used for the call.\\n /// @param tokenReceiver recipient address of the token charged for the gas used.\\n /// @return whether the transfer was successful.\\n function transferAndChargeForGas(\\n address from,\\n address to,\\n uint256 amount,\\n uint256 gasLimit,\\n uint256 tokenGasPrice,\\n uint256 baseGasCharge,\\n address tokenReceiver\\n ) external returns (bool) {\\n uint256 initialGas = gasleft();\\n require(_executionOperators[msg.sender], \\\"only execution operators allowed to perfrom transfer and charge\\\");\\n _transfer(from, to, amount);\\n if (tokenGasPrice > 0) {\\n _charge(from, gasLimit, tokenGasPrice, initialGas, baseGasCharge, tokenReceiver);\\n }\\n return true;\\n }\\n\\n function _charge(\\n address from,\\n uint256 gasLimit,\\n uint256 tokenGasPrice,\\n uint256 initialGas,\\n uint256 baseGasCharge,\\n address tokenReceiver\\n ) internal {\\n uint256 gasCharge = initialGas - gasleft();\\n if(gasCharge > gasLimit) {\\n gasCharge = gasLimit;\\n }\\n gasCharge += baseGasCharge;\\n uint256 tokensToCharge = gasCharge * tokenGasPrice;\\n require(tokensToCharge / gasCharge == tokenGasPrice, \\\"overflow\\\");\\n _transfer(from, tokenReceiver, tokensToCharge);\\n }\\n\\n function _approveAndExecuteWithSpecificGas(\\n address from,\\n address to,\\n uint256 amount,\\n uint256 gasLimit,\\n bytes memory data\\n ) internal returns (bool success, bytes memory returnData) {\\n\\n if (amount > 0) {\\n _addAllowanceIfNeeded(from, to, amount);\\n }\\n (success, returnData) = to.call.gas(gasLimit)(data);\\n assert(gasleft() > gasLimit / 63); // not enough gas provided, assert to throw all gas // TODO use EIP-1930\\n }\\n\\n\\n function _transfer(address from, address to, uint256 amount) internal;\\n function _addAllowanceIfNeeded(address owner, address spender, uint256 amountNeeded) internal;\\n}\",\"keccak256\":\"0x4b9a75299ab80e84aa287f2ecf2ef175e0feb074764e4a670f9397a2d2d4bda8\"}},\"version\":1}", + "userdoc": { + "methods": { + "allowance(address,address)": { + "notice": "gets allowance of `spender` for `owner`'s tokens." + }, + "approve(address,uint256)": { + "notice": "approve `spender` to transfer `amount` tokens." + }, + "approveAndCall(address,uint256,bytes)": { + "notice": "approve `target` to spend `amount` and call it with data." + }, + "approveAndExecuteWithSpecificGas(address,address,uint256,uint256,bytes)": { + "notice": "approve a specific amount of token for `from` and execute on behalf of the contract." + }, + "approveAndExecuteWithSpecificGasAndChargeForIt(address,address,uint256,uint256,uint256,uint256,address,bytes)": { + "notice": "approve a specific amount of token for `from` and execute on behalf of the contract. Plus charge the gas required to perform it." + }, + "approveFor(address,address,uint256)": { + "notice": "approve `spender` to transfer `amount` tokens from `owner`." + }, + "balanceOf(address)": { + "notice": "Gets the balance of `owner`." + }, + "burn(uint256)": { + "notice": "burn `amount` tokens." + }, + "burnFor(address,uint256)": { + "notice": "burn `amount` tokens from `owner`." + }, + "changeAdmin(address)": { + "notice": "change the administrator to be `newAdmin`." + }, + "changeExecutionAdmin(address)": { + "notice": "change the execution adminstrator to be `newAdmin`." + }, + "decimals()": { + "notice": "returns the number of decimals for that token." + }, + "executeWithSpecificGas(address,uint256,bytes)": { + "notice": "execute on behalf of the contract." + }, + "getAdmin()": { + "notice": "gives the current administrator of this contract." + }, + "getExecutionAdmin()": { + "notice": "give the address responsible for adding execution rights." + }, + "isExecutionOperator(address)": { + "notice": "check whether address `who` is given executionOperator rights." + }, + "isSuperOperator(address)": { + "notice": "check whether address `who` is given superOperator rights." + }, + "name()": { + "notice": "A descriptive name for the tokens" + }, + "paidCall(address,uint256,bytes)": { + "notice": "temporarly approve `target` to spend `amount` and call it with data. Previous approvals remains unchanged." + }, + "setExecutionOperator(address,bool)": { + "notice": "set `executionOperator` as executionOperator: `enabled`." + }, + "setSuperOperator(address,bool)": { + "notice": "Enable or disable the ability of `superOperator` to transfer tokens of all (superOperator rights)." + }, + "symbol()": { + "notice": "An abbreviated name for the tokens" + }, + "totalSupply()": { + "notice": "Gets the total number of tokens in existence." + }, + "transfer(address,uint256)": { + "notice": "Transfer `amount` tokens to `to`." + }, + "transferAndChargeForGas(address,address,uint256,uint256,uint256,uint256,address)": { + "notice": "transfer 1amount1 token from `from` to `to` and charge the gas required to perform that transfer." + }, + "transferFrom(address,address,uint256)": { + "notice": "Transfer `amount` tokens from `from` to `to`." + } + } + } +} diff --git a/packages/deploy/deployments/mainnet/solcInputs/4bade374f62f6d78bc3ea2aa3ebdd50f.json b/packages/deploy/deployments/mainnet/solcInputs/4bade374f62f6d78bc3ea2aa3ebdd50f.json new file mode 100644 index 0000000000..a766e97989 --- /dev/null +++ b/packages/deploy/deployments/mainnet/solcInputs/4bade374f62f6d78bc3ea2aa3ebdd50f.json @@ -0,0 +1,258 @@ +{ + "language": "Solidity", + "sources": { + "@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/IExecutor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { Origin } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\n\nimport { IWorker } from \"./IWorker.sol\";\nimport { ILayerZeroExecutor } from \"./ILayerZeroExecutor.sol\";\n\ninterface IExecutor is IWorker, ILayerZeroExecutor {\n struct DstConfigParam {\n uint32 dstEid;\n uint64 lzReceiveBaseGas;\n uint64 lzComposeBaseGas;\n uint16 multiplierBps;\n uint128 floorMarginUSD;\n uint128 nativeCap;\n }\n\n struct DstConfig {\n uint64 lzReceiveBaseGas;\n uint16 multiplierBps;\n uint128 floorMarginUSD; // uses priceFeed PRICE_RATIO_DENOMINATOR\n uint128 nativeCap;\n uint64 lzComposeBaseGas;\n }\n\n struct ExecutionParams {\n address receiver;\n Origin origin;\n bytes32 guid;\n bytes message;\n bytes extraData;\n uint256 gasLimit;\n }\n\n struct NativeDropParams {\n address receiver;\n uint256 amount;\n }\n\n event DstConfigSet(DstConfigParam[] params);\n event NativeDropApplied(Origin origin, uint32 dstEid, address oapp, NativeDropParams[] params, bool[] success);\n\n function dstConfig(uint32 _dstEid) external view returns (uint64, uint16, uint128, uint128, uint64);\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/IExecutorFeeLib.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { IExecutor } from \"./IExecutor.sol\";\n\ninterface IExecutorFeeLib {\n struct FeeParams {\n address priceFeed;\n uint32 dstEid;\n address sender;\n uint256 calldataSize;\n uint16 defaultMultiplierBps;\n }\n\n error Executor_NoOptions();\n error Executor_NativeAmountExceedsCap(uint256 amount, uint256 cap);\n error Executor_UnsupportedOptionType(uint8 optionType);\n error Executor_InvalidExecutorOptions(uint256 cursor);\n error Executor_ZeroLzReceiveGasProvided();\n error Executor_ZeroLzComposeGasProvided();\n error Executor_EidNotSupported(uint32 eid);\n\n function getFeeOnSend(\n FeeParams calldata _params,\n IExecutor.DstConfig calldata _dstConfig,\n bytes calldata _options\n ) external returns (uint256 fee);\n\n function getFee(\n FeeParams calldata _params,\n IExecutor.DstConfig calldata _dstConfig,\n bytes calldata _options\n ) external view returns (uint256 fee);\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/ILayerZeroExecutor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface ILayerZeroExecutor {\n // @notice query price and assign jobs at the same time\n // @param _dstEid - the destination endpoint identifier\n // @param _sender - the source sending contract address. executors may apply price discrimination to senders\n // @param _calldataSize - dynamic data size of message + caller params\n // @param _options - optional parameters for extra service plugins, e.g. sending dust tokens at the destination chain\n function assignJob(\n uint32 _dstEid,\n address _sender,\n uint256 _calldataSize,\n bytes calldata _options\n ) external returns (uint256 price);\n\n // @notice query the executor price for relaying the payload and its proof to the destination chain\n // @param _dstEid - the destination endpoint identifier\n // @param _sender - the source sending contract address. executors may apply price discrimination to senders\n // @param _calldataSize - dynamic data size of message + caller params\n // @param _options - optional parameters for extra service plugins, e.g. sending dust tokens at the destination chain\n function getFee(\n uint32 _dstEid,\n address _sender,\n uint256 _calldataSize,\n bytes calldata _options\n ) external view returns (uint256 price);\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/ILayerZeroTreasury.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface ILayerZeroTreasury {\n function getFee(\n address _sender,\n uint32 _dstEid,\n uint256 _totalNativeFee,\n bool _payInLzToken\n ) external view returns (uint256 fee);\n\n function payFee(\n address _sender,\n uint32 _dstEid,\n uint256 _totalNativeFee,\n bool _payInLzToken\n ) external payable returns (uint256 fee);\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/IWorker.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IWorker {\n event SetWorkerLib(address workerLib);\n event SetPriceFeed(address priceFeed);\n event SetDefaultMultiplierBps(uint16 multiplierBps);\n event SetSupportedOptionTypes(uint32 dstEid, uint8[] optionTypes);\n event Withdraw(address lib, address to, uint256 amount);\n\n error Worker_NotAllowed();\n error Worker_OnlyMessageLib();\n error Worker_RoleRenouncingDisabled();\n\n function setPriceFeed(address _priceFeed) external;\n\n function priceFeed() external view returns (address);\n\n function setDefaultMultiplierBps(uint16 _multiplierBps) external;\n\n function defaultMultiplierBps() external view returns (uint16);\n\n function withdrawFee(address _lib, address _to, uint256 _amount) external;\n\n function setSupportedOptionTypes(uint32 _eid, uint8[] calldata _optionTypes) external;\n\n function getSupportedOptionTypes(uint32 _eid) external view returns (uint8[] memory);\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/libs/SafeCall.sol": { + "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\n\npragma solidity ^0.8.20;\n\n/// @dev copied from https://github.com/nomad-xyz/ExcessivelySafeCall/blob/main/src/ExcessivelySafeCall.sol.\nlibrary SafeCall {\n /// @notice calls a contract with a specified gas limit and value and captures the return data\n /// @param _target The address to call\n /// @param _gas The amount of gas to forward to the remote contract\n /// @param _value The value in wei to send to the remote contract\n /// to memory.\n /// @param _maxCopy The maximum number of bytes of returndata to copy\n /// to memory.\n /// @param _calldata The data to send to the remote contract\n /// @return success and returndata, as `.call()`. Returndata is capped to\n /// `_maxCopy` bytes.\n function safeCall(\n address _target,\n uint256 _gas,\n uint256 _value,\n uint16 _maxCopy,\n bytes memory _calldata\n ) internal returns (bool, bytes memory) {\n // check that target has code\n uint size;\n assembly {\n size := extcodesize(_target)\n }\n if (size == 0) {\n return (false, new bytes(0));\n }\n\n // set up for assembly call\n uint256 _toCopy;\n bool _success;\n bytes memory _returnData = new bytes(_maxCopy);\n // dispatch message to recipient\n // by assembly calling \"handle\" function\n // we call via assembly to avoid memcopying a very large returndata\n // returned by a malicious contract\n assembly {\n _success := call(\n _gas, // gas\n _target, // recipient\n _value, // ether value\n add(_calldata, 0x20), // inloc\n mload(_calldata), // inlen\n 0, // outloc\n 0 // outlen\n )\n // limit our copy to 100 bytes\n _toCopy := returndatasize()\n if gt(_toCopy, _maxCopy) {\n _toCopy := _maxCopy\n }\n // Store the length of the copied bytes\n mstore(_returnData, _toCopy)\n // copy the bytes from returndata[0:_toCopy]\n returndatacopy(add(_returnData, 0x20), 0, _toCopy)\n }\n return (_success, _returnData);\n }\n\n /// @notice Use when you _really_ really _really_ don't trust the called\n /// contract. This prevents the called contract from causing reversion of\n /// the caller in as many ways as we can.\n /// @dev The main difference between this and a solidity low-level call is\n /// that we limit the number of bytes that the callee can cause to be\n /// copied to caller memory. This prevents stupid things like malicious\n /// contracts returning 10,000,000 bytes causing a local OOG when copying\n /// to memory.\n /// @param _target The address to call\n /// @param _gas The amount of gas to forward to the remote contract\n /// @param _maxCopy The maximum number of bytes of returndata to copy\n /// to memory.\n /// @param _calldata The data to send to the remote contract\n /// @return success and returndata, as `.call()`. Returndata is capped to\n /// `_maxCopy` bytes.\n function safeStaticCall(\n address _target,\n uint256 _gas,\n uint16 _maxCopy,\n bytes memory _calldata\n ) internal view returns (bool, bytes memory) {\n // check that target has code\n uint size;\n assembly {\n size := extcodesize(_target)\n }\n if (size == 0) {\n return (false, new bytes(0));\n }\n\n // set up for assembly call\n uint256 _toCopy;\n bool _success;\n bytes memory _returnData = new bytes(_maxCopy);\n // dispatch message to recipient\n // by assembly calling \"handle\" function\n // we call via assembly to avoid memcopying a very large returndata\n // returned by a malicious contract\n assembly {\n _success := staticcall(\n _gas, // gas\n _target, // recipient\n add(_calldata, 0x20), // inloc\n mload(_calldata), // inlen\n 0, // outloc\n 0 // outlen\n )\n // limit our copy to 256 bytes\n _toCopy := returndatasize()\n if gt(_toCopy, _maxCopy) {\n _toCopy := _maxCopy\n }\n // Store the length of the copied bytes\n mstore(_returnData, _toCopy)\n // copy the bytes from returndata[0:_toCopy]\n returndatacopy(add(_returnData, 0x20), 0, _toCopy)\n }\n return (_success, _returnData);\n }\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/MessageLibBase.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\n/// @dev simply a container of endpoint address and local eid\nabstract contract MessageLibBase {\n address internal immutable endpoint;\n uint32 internal immutable localEid;\n\n error LZ_MessageLib_OnlyEndpoint();\n\n modifier onlyEndpoint() {\n if (endpoint != msg.sender) revert LZ_MessageLib_OnlyEndpoint();\n _;\n }\n\n constructor(address _endpoint, uint32 _localEid) {\n endpoint = _endpoint;\n localEid = _localEid;\n }\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/SendLibBase.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { Transfer } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Transfer.sol\";\n\nimport { ILayerZeroExecutor } from \"./interfaces/ILayerZeroExecutor.sol\";\nimport { ILayerZeroTreasury } from \"./interfaces/ILayerZeroTreasury.sol\";\nimport { SafeCall } from \"./libs/SafeCall.sol\";\nimport { MessageLibBase } from \"./MessageLibBase.sol\";\n\nstruct WorkerOptions {\n uint8 workerId;\n bytes options;\n}\n\nstruct SetDefaultExecutorConfigParam {\n uint32 eid;\n ExecutorConfig config;\n}\n\nstruct ExecutorConfig {\n uint32 maxMessageSize;\n address executor;\n}\n\n/// @dev base contract for both SendLibBaseE1 and SendLibBaseE2\nabstract contract SendLibBase is MessageLibBase, Ownable {\n using SafeCall for address;\n\n address private constant DEFAULT_CONFIG = address(0);\n uint16 internal constant TREASURY_MAX_COPY = 32;\n\n uint256 internal immutable treasuryGasLimit;\n uint256 internal treasuryNativeFeeCap;\n\n // config\n address public treasury;\n mapping(address oapp => mapping(uint32 eid => ExecutorConfig)) public executorConfigs;\n\n // accumulated fees for workers and treasury\n mapping(address worker => uint256) public fees;\n\n event ExecutorFeePaid(address executor, uint256 fee);\n event TreasurySet(address treasury);\n event DefaultExecutorConfigsSet(SetDefaultExecutorConfigParam[] params);\n event ExecutorConfigSet(address oapp, uint32 eid, ExecutorConfig config);\n event TreasuryNativeFeeCapSet(uint256 newTreasuryNativeFeeCap);\n\n error LZ_MessageLib_InvalidMessageSize(uint256 actual, uint256 max);\n error LZ_MessageLib_InvalidAmount(uint256 requested, uint256 available);\n error LZ_MessageLib_TransferFailed();\n error LZ_MessageLib_InvalidExecutor();\n error LZ_MessageLib_ZeroMessageSize();\n\n constructor(\n address _endpoint,\n uint32 _localEid,\n uint256 _treasuryGasLimit,\n uint256 _treasuryNativeFeeCap\n ) MessageLibBase(_endpoint, _localEid) {\n treasuryGasLimit = _treasuryGasLimit;\n treasuryNativeFeeCap = _treasuryNativeFeeCap;\n }\n\n function setDefaultExecutorConfigs(SetDefaultExecutorConfigParam[] calldata _params) external onlyOwner {\n for (uint256 i = 0; i < _params.length; ++i) {\n SetDefaultExecutorConfigParam calldata param = _params[i];\n\n if (param.config.executor == address(0x0)) revert LZ_MessageLib_InvalidExecutor();\n if (param.config.maxMessageSize == 0) revert LZ_MessageLib_ZeroMessageSize();\n\n executorConfigs[DEFAULT_CONFIG][param.eid] = param.config;\n }\n emit DefaultExecutorConfigsSet(_params);\n }\n\n /// @dev the new value can not be greater than the old value, i.e. down only\n function setTreasuryNativeFeeCap(uint256 _newTreasuryNativeFeeCap) external onlyOwner {\n // assert the new value is no greater than the old value\n if (_newTreasuryNativeFeeCap > treasuryNativeFeeCap)\n revert LZ_MessageLib_InvalidAmount(_newTreasuryNativeFeeCap, treasuryNativeFeeCap);\n treasuryNativeFeeCap = _newTreasuryNativeFeeCap;\n emit TreasuryNativeFeeCapSet(_newTreasuryNativeFeeCap);\n }\n\n // ============================ View ===================================\n // @dev get the executor config and if not set, return the default config\n function getExecutorConfig(address _oapp, uint32 _remoteEid) public view returns (ExecutorConfig memory rtnConfig) {\n ExecutorConfig storage defaultConfig = executorConfigs[DEFAULT_CONFIG][_remoteEid];\n ExecutorConfig storage customConfig = executorConfigs[_oapp][_remoteEid];\n\n uint32 maxMessageSize = customConfig.maxMessageSize;\n rtnConfig.maxMessageSize = maxMessageSize != 0 ? maxMessageSize : defaultConfig.maxMessageSize;\n\n address executor = customConfig.executor;\n rtnConfig.executor = executor != address(0x0) ? executor : defaultConfig.executor;\n }\n\n // ======================= Internal =======================\n function _assertMessageSize(uint256 _actual, uint256 _max) internal pure {\n if (_actual > _max) revert LZ_MessageLib_InvalidMessageSize(_actual, _max);\n }\n\n function _payExecutor(\n address _executor,\n uint32 _dstEid,\n address _sender,\n uint256 _msgSize,\n bytes memory _executorOptions\n ) internal returns (uint256 executorFee) {\n executorFee = ILayerZeroExecutor(_executor).assignJob(_dstEid, _sender, _msgSize, _executorOptions);\n if (executorFee > 0) {\n fees[_executor] += executorFee;\n }\n emit ExecutorFeePaid(_executor, executorFee);\n }\n\n function _payTreasury(\n address _sender,\n uint32 _dstEid,\n uint256 _totalNativeFee,\n bool _payInLzToken\n ) internal returns (uint256 treasuryNativeFee, uint256 lzTokenFee) {\n if (treasury != address(0x0)) {\n bytes memory callData = abi.encodeCall(\n ILayerZeroTreasury.payFee,\n (_sender, _dstEid, _totalNativeFee, _payInLzToken)\n );\n (bool success, bytes memory result) = treasury.safeCall(treasuryGasLimit, 0, TREASURY_MAX_COPY, callData);\n\n (treasuryNativeFee, lzTokenFee) = _parseTreasuryResult(_totalNativeFee, _payInLzToken, success, result);\n // fee should be in lzTokenFee if payInLzToken, otherwise in native\n if (treasuryNativeFee > 0) {\n fees[treasury] += treasuryNativeFee;\n }\n }\n }\n\n /// @dev the abstract process for quote() is:\n /// 0/ split out the executor options and options of other workers\n /// 1/ quote workers\n /// 2/ quote executor\n /// 3/ quote treasury\n /// @return nativeFee, lzTokenFee\n function _quote(\n address _sender,\n uint32 _dstEid,\n uint256 _msgSize,\n bool _payInLzToken,\n bytes calldata _options\n ) internal view returns (uint256, uint256) {\n (bytes memory executorOptions, WorkerOptions[] memory validationOptions) = _splitOptions(_options);\n\n // quote the verifier used in the library. for ULN, it is a list of DVNs\n uint256 nativeFee = _quoteVerifier(_sender, _dstEid, validationOptions);\n\n // quote executor\n ExecutorConfig memory config = getExecutorConfig(_sender, _dstEid);\n // assert msg size\n _assertMessageSize(_msgSize, config.maxMessageSize);\n\n nativeFee += ILayerZeroExecutor(config.executor).getFee(_dstEid, _sender, _msgSize, executorOptions);\n\n // quote treasury\n (uint256 treasuryNativeFee, uint256 lzTokenFee) = _quoteTreasury(_sender, _dstEid, nativeFee, _payInLzToken);\n nativeFee += treasuryNativeFee;\n\n return (nativeFee, lzTokenFee);\n }\n\n /// @dev this interface should be DoS-free if the user is paying with native. properties\n /// 1/ treasury can return an overly high lzToken fee\n /// 2/ if treasury returns an overly high native fee, it will be capped by maxNativeFee,\n /// which can be reasoned with the configurations\n /// 3/ the owner can not configure the treasury in a way that force this function to revert\n function _quoteTreasury(\n address _sender,\n uint32 _dstEid,\n uint256 _totalNativeFee,\n bool _payInLzToken\n ) internal view returns (uint256 nativeFee, uint256 lzTokenFee) {\n // treasury must be set, and it has to be a contract\n if (treasury != address(0x0)) {\n bytes memory callData = abi.encodeCall(\n ILayerZeroTreasury.getFee,\n (_sender, _dstEid, _totalNativeFee, _payInLzToken)\n );\n (bool success, bytes memory result) = treasury.safeStaticCall(\n treasuryGasLimit,\n TREASURY_MAX_COPY,\n callData\n );\n\n return _parseTreasuryResult(_totalNativeFee, _payInLzToken, success, result);\n }\n }\n\n function _parseTreasuryResult(\n uint256 _totalNativeFee,\n bool _payInLzToken,\n bool _success,\n bytes memory _result\n ) internal view returns (uint256 nativeFee, uint256 lzTokenFee) {\n // failure, charges nothing\n if (!_success || _result.length < TREASURY_MAX_COPY) return (0, 0);\n\n // parse the result\n uint256 treasureFeeQuote = abi.decode(_result, (uint256));\n if (_payInLzToken) {\n lzTokenFee = treasureFeeQuote;\n } else {\n // pay in native\n // we must prevent high-treasuryFee Dos attack\n // nativeFee = min(treasureFeeQuote, maxNativeFee)\n // opportunistically raise the maxNativeFee to be the same as _totalNativeFee\n // can't use the _totalNativeFee alone because the oapp can use custom workers to force the fee to 0.\n // maxNativeFee = max (_totalNativeFee, treasuryNativeFeeCap)\n uint256 maxNativeFee = _totalNativeFee > treasuryNativeFeeCap ? _totalNativeFee : treasuryNativeFeeCap;\n\n // min (treasureFeeQuote, nativeFeeCap)\n nativeFee = treasureFeeQuote > maxNativeFee ? maxNativeFee : treasureFeeQuote;\n }\n }\n\n /// @dev authenticated by msg.sender only\n function _debitFee(uint256 _amount) internal {\n uint256 fee = fees[msg.sender];\n if (_amount > fee) revert LZ_MessageLib_InvalidAmount(_amount, fee);\n unchecked {\n fees[msg.sender] = fee - _amount;\n }\n }\n\n function _setTreasury(address _treasury) internal {\n treasury = _treasury;\n emit TreasurySet(_treasury);\n }\n\n function _setExecutorConfig(uint32 _remoteEid, address _oapp, ExecutorConfig memory _config) internal {\n executorConfigs[_oapp][_remoteEid] = _config;\n emit ExecutorConfigSet(_oapp, _remoteEid, _config);\n }\n\n // ======================= Virtual =======================\n /// @dev these two functions will be overridden with specific logics of the library function\n function _quoteVerifier(\n address _oapp,\n uint32 _eid,\n WorkerOptions[] memory _options\n ) internal view virtual returns (uint256 nativeFee);\n\n /// @dev this function will split the options into executorOptions and validationOptions\n function _splitOptions(\n bytes calldata _options\n ) internal view virtual returns (bytes memory executorOptions, WorkerOptions[] memory validationOptions);\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/libs/DVNOptions.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { BytesLib } from \"solidity-bytes-utils/contracts/BytesLib.sol\";\n\nimport { BitMap256 } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/BitMaps.sol\";\nimport { CalldataBytesLib } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/CalldataBytesLib.sol\";\n\nlibrary DVNOptions {\n using CalldataBytesLib for bytes;\n using BytesLib for bytes;\n\n uint8 internal constant WORKER_ID = 2;\n uint8 internal constant OPTION_TYPE_PRECRIME = 1;\n\n error DVN_InvalidDVNIdx();\n error DVN_InvalidDVNOptions(uint256 cursor);\n\n /// @dev group dvn options by its idx\n /// @param _options [dvn_id][dvn_option][dvn_id][dvn_option]...\n /// dvn_option = [option_size][dvn_idx][option_type][option]\n /// option_size = len(dvn_idx) + len(option_type) + len(option)\n /// dvn_id: uint8, dvn_idx: uint8, option_size: uint16, option_type: uint8, option: bytes\n /// @return dvnOptions the grouped options, still share the same format of _options\n /// @return dvnIndices the dvn indices\n function groupDVNOptionsByIdx(\n bytes memory _options\n ) internal pure returns (bytes[] memory dvnOptions, uint8[] memory dvnIndices) {\n if (_options.length == 0) return (dvnOptions, dvnIndices);\n\n uint8 numDVNs = getNumDVNs(_options);\n\n // if there is only 1 dvn, we can just return the whole options\n if (numDVNs == 1) {\n dvnOptions = new bytes[](1);\n dvnOptions[0] = _options;\n\n dvnIndices = new uint8[](1);\n dvnIndices[0] = _options.toUint8(3); // dvn idx\n return (dvnOptions, dvnIndices);\n }\n\n // otherwise, we need to group the options by dvn_idx\n dvnIndices = new uint8[](numDVNs);\n dvnOptions = new bytes[](numDVNs);\n unchecked {\n uint256 cursor = 0;\n uint256 start = 0;\n uint8 lastDVNIdx = 255; // 255 is an invalid dvn_idx\n\n while (cursor < _options.length) {\n ++cursor; // skip worker_id\n\n // optionLength asserted in getNumDVNs (skip check)\n uint16 optionLength = _options.toUint16(cursor);\n cursor += 2;\n\n // dvnIdx asserted in getNumDVNs (skip check)\n uint8 dvnIdx = _options.toUint8(cursor);\n\n // dvnIdx must equal to the lastDVNIdx for the first option\n // so it is always skipped in the first option\n // this operation slices out options whenever the scan finds a different lastDVNIdx\n if (lastDVNIdx == 255) {\n lastDVNIdx = dvnIdx;\n } else if (dvnIdx != lastDVNIdx) {\n uint256 len = cursor - start - 3; // 3 is for worker_id and option_length\n bytes memory opt = _options.slice(start, len);\n _insertDVNOptions(dvnOptions, dvnIndices, lastDVNIdx, opt);\n\n // reset the start and lastDVNIdx\n start += len;\n lastDVNIdx = dvnIdx;\n }\n\n cursor += optionLength;\n }\n\n // skip check the cursor here because the cursor is asserted in getNumDVNs\n // if we have reached the end of the options, we need to process the last dvn\n uint256 size = cursor - start;\n bytes memory op = _options.slice(start, size);\n _insertDVNOptions(dvnOptions, dvnIndices, lastDVNIdx, op);\n\n // revert dvnIndices to start from 0\n for (uint8 i = 0; i < numDVNs; ++i) {\n --dvnIndices[i];\n }\n }\n }\n\n function _insertDVNOptions(\n bytes[] memory _dvnOptions,\n uint8[] memory _dvnIndices,\n uint8 _dvnIdx,\n bytes memory _newOptions\n ) internal pure {\n // dvnIdx starts from 0 but default value of dvnIndices is 0,\n // so we tell if the slot is empty by adding 1 to dvnIdx\n if (_dvnIdx == 255) revert DVN_InvalidDVNIdx();\n uint8 dvnIdxAdj = _dvnIdx + 1;\n\n for (uint256 j = 0; j < _dvnIndices.length; ++j) {\n uint8 index = _dvnIndices[j];\n if (dvnIdxAdj == index) {\n _dvnOptions[j] = abi.encodePacked(_dvnOptions[j], _newOptions);\n break;\n } else if (index == 0) {\n // empty slot, that means it is the first time we see this dvn\n _dvnIndices[j] = dvnIdxAdj;\n _dvnOptions[j] = _newOptions;\n break;\n }\n }\n }\n\n /// @dev get the number of unique dvns\n /// @param _options the format is the same as groupDVNOptionsByIdx\n function getNumDVNs(bytes memory _options) internal pure returns (uint8 numDVNs) {\n uint256 cursor = 0;\n BitMap256 bitmap;\n\n // find number of unique dvn_idx\n unchecked {\n while (cursor < _options.length) {\n ++cursor; // skip worker_id\n\n uint16 optionLength = _options.toUint16(cursor);\n cursor += 2;\n if (optionLength < 2) revert DVN_InvalidDVNOptions(cursor); // at least 1 byte for dvn_idx and 1 byte for option_type\n\n uint8 dvnIdx = _options.toUint8(cursor);\n\n // if dvnIdx is not set, increment numDVNs\n // max num of dvns is 255, 255 is an invalid dvn_idx\n // The order of the dvnIdx is not required to be sequential, as enforcing the order may weaken\n // the composability of the options. e.g. if we refrain from enforcing the order, an OApp that has\n // already enforced certain options can append additional options to the end of the enforced\n // ones without restrictions.\n if (dvnIdx == 255) revert DVN_InvalidDVNIdx();\n if (!bitmap.get(dvnIdx)) {\n ++numDVNs;\n bitmap = bitmap.set(dvnIdx);\n }\n\n cursor += optionLength;\n }\n }\n if (cursor != _options.length) revert DVN_InvalidDVNOptions(cursor);\n }\n\n /// @dev decode the next dvn option from _options starting from the specified cursor\n /// @param _options the format is the same as groupDVNOptionsByIdx\n /// @param _cursor the cursor to start decoding\n /// @return optionType the type of the option\n /// @return option the option\n /// @return cursor the cursor to start decoding the next option\n function nextDVNOption(\n bytes calldata _options,\n uint256 _cursor\n ) internal pure returns (uint8 optionType, bytes calldata option, uint256 cursor) {\n unchecked {\n // skip worker id\n cursor = _cursor + 1;\n\n // read option size\n uint16 size = _options.toU16(cursor);\n cursor += 2;\n\n // read option type\n optionType = _options.toU8(cursor + 1); // skip dvn_idx\n\n // startCursor and endCursor are used to slice the option from _options\n uint256 startCursor = cursor + 2; // skip option type and dvn_idx\n uint256 endCursor = cursor + size;\n option = _options[startCursor:endCursor];\n cursor += size;\n }\n }\n}\n" + }, + "@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/libs/UlnOptions.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { SafeCast } from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\n\nimport { ExecutorOptions } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/ExecutorOptions.sol\";\n\nimport { DVNOptions } from \"./DVNOptions.sol\";\n\nlibrary UlnOptions {\n using SafeCast for uint256;\n\n uint16 internal constant TYPE_1 = 1; // legacy options type 1\n uint16 internal constant TYPE_2 = 2; // legacy options type 2\n uint16 internal constant TYPE_3 = 3;\n\n error LZ_ULN_InvalidWorkerOptions(uint256 cursor);\n error LZ_ULN_InvalidWorkerId(uint8 workerId);\n error LZ_ULN_InvalidLegacyType1Option();\n error LZ_ULN_InvalidLegacyType2Option();\n error LZ_ULN_UnsupportedOptionType(uint16 optionType);\n\n /// @dev decode the options into executorOptions and dvnOptions\n /// @param _options the options can be either legacy options (type 1 or 2) or type 3 options\n /// @return executorOptions the executor options, share the same format of type 3 options\n /// @return dvnOptions the dvn options, share the same format of type 3 options\n function decode(\n bytes calldata _options\n ) internal pure returns (bytes memory executorOptions, bytes memory dvnOptions) {\n // at least 2 bytes for the option type, but can have no options\n if (_options.length < 2) revert LZ_ULN_InvalidWorkerOptions(0);\n\n uint16 optionsType = uint16(bytes2(_options[0:2]));\n uint256 cursor = 2;\n\n // type3 options: [worker_option][worker_option]...\n // worker_option: [worker_id][option_size][option]\n // worker_id: uint8, option_size: uint16, option: bytes\n if (optionsType == TYPE_3) {\n unchecked {\n uint256 start = cursor;\n uint8 lastWorkerId; // worker_id starts from 1, so 0 is an invalid worker_id\n\n // heuristic: we assume that the options are mostly EXECUTOR options only\n // checking the workerID can reduce gas usage for most cases\n while (cursor < _options.length) {\n uint8 workerId = uint8(bytes1(_options[cursor:cursor + 1]));\n if (workerId == 0) revert LZ_ULN_InvalidWorkerId(0);\n\n // workerId must equal to the lastWorkerId for the first option\n // so it is always skipped in the first option\n // this operation slices out options whenever the the scan finds a different workerId\n if (lastWorkerId == 0) {\n lastWorkerId = workerId;\n } else if (workerId != lastWorkerId) {\n bytes calldata op = _options[start:cursor]; // slice out the last worker's options\n (executorOptions, dvnOptions) = _insertWorkerOptions(\n executorOptions,\n dvnOptions,\n lastWorkerId,\n op\n );\n\n // reset the start cursor and lastWorkerId\n start = cursor;\n lastWorkerId = workerId;\n }\n\n ++cursor; // for workerId\n\n uint16 size = uint16(bytes2(_options[cursor:cursor + 2]));\n if (size == 0) revert LZ_ULN_InvalidWorkerOptions(cursor);\n cursor += size + 2;\n }\n\n // the options length must be the same as the cursor at the end\n if (cursor != _options.length) revert LZ_ULN_InvalidWorkerOptions(cursor);\n\n // if we have reached the end of the options and the options are not empty\n // we need to process the last worker's options\n if (_options.length > 2) {\n bytes calldata op = _options[start:cursor];\n (executorOptions, dvnOptions) = _insertWorkerOptions(executorOptions, dvnOptions, lastWorkerId, op);\n }\n }\n } else {\n executorOptions = decodeLegacyOptions(optionsType, _options);\n }\n }\n\n function _insertWorkerOptions(\n bytes memory _executorOptions,\n bytes memory _dvnOptions,\n uint8 _workerId,\n bytes calldata _newOptions\n ) private pure returns (bytes memory, bytes memory) {\n if (_workerId == ExecutorOptions.WORKER_ID) {\n _executorOptions = _executorOptions.length == 0\n ? _newOptions\n : abi.encodePacked(_executorOptions, _newOptions);\n } else if (_workerId == DVNOptions.WORKER_ID) {\n _dvnOptions = _dvnOptions.length == 0 ? _newOptions : abi.encodePacked(_dvnOptions, _newOptions);\n } else {\n revert LZ_ULN_InvalidWorkerId(_workerId);\n }\n return (_executorOptions, _dvnOptions);\n }\n\n /// @dev decode the legacy options (type 1 or 2) into executorOptions\n /// @param _optionType the legacy option type\n /// @param _options the legacy options, which still has the option type in the first 2 bytes\n /// @return executorOptions the executor options, share the same format of type 3 options\n /// Data format:\n /// legacy type 1: [extraGas]\n /// legacy type 2: [extraGas][dstNativeAmt][dstNativeAddress]\n /// extraGas: uint256, dstNativeAmt: uint256, dstNativeAddress: bytes\n function decodeLegacyOptions(\n uint16 _optionType,\n bytes calldata _options\n ) internal pure returns (bytes memory executorOptions) {\n if (_optionType == TYPE_1) {\n if (_options.length != 34) revert LZ_ULN_InvalidLegacyType1Option();\n\n // execution gas\n uint128 executionGas = uint256(bytes32(_options[2:2 + 32])).toUint128();\n\n // dont use the encode function in the ExecutorOptions lib for saving gas by calling abi.encodePacked once\n // the result is a lzReceive option: [executor_id][option_size][option_type][execution_gas]\n // option_type: uint8, execution_gas: uint128\n // option_size = len(option_type) + len(execution_gas) = 1 + 16 = 17\n executorOptions = abi.encodePacked(\n ExecutorOptions.WORKER_ID,\n uint16(17), // 16 + 1, 16 for option_length, + 1 for option_type\n ExecutorOptions.OPTION_TYPE_LZRECEIVE,\n executionGas\n );\n } else if (_optionType == TYPE_2) {\n // receiver size <= 32\n if (_options.length <= 66 || _options.length > 98) revert LZ_ULN_InvalidLegacyType2Option();\n\n // execution gas\n uint128 executionGas = uint256(bytes32(_options[2:2 + 32])).toUint128();\n\n // nativeDrop (amount + receiver)\n uint128 amount = uint256(bytes32(_options[34:34 + 32])).toUint128(); // offset 2 + 32\n bytes32 receiver;\n unchecked {\n uint256 receiverLen = _options.length - 66; // offset 2 + 32 + 32\n receiver = bytes32(_options[66:]);\n receiver = receiver >> (8 * (32 - receiverLen)); // padding 0 to the left\n }\n\n // dont use the encode function in the ExecutorOptions lib for saving gas by calling abi.encodePacked once\n // the result has one lzReceive option and one nativeDrop option:\n // [executor_id][lzReceive_option_size][option_type][execution_gas] +\n // [executor_id][nativeDrop_option_size][option_type][nativeDrop_amount][receiver]\n // option_type: uint8, execution_gas: uint128, nativeDrop_amount: uint128, receiver: bytes32\n // lzReceive_option_size = len(option_type) + len(execution_gas) = 1 + 16 = 17\n // nativeDrop_option_size = len(option_type) + len(nativeDrop_amount) + len(receiver) = 1 + 16 + 32 = 49\n executorOptions = abi.encodePacked(\n ExecutorOptions.WORKER_ID,\n uint16(17), // 16 + 1, 16 for option_length, + 1 for option_type\n ExecutorOptions.OPTION_TYPE_LZRECEIVE,\n executionGas,\n ExecutorOptions.WORKER_ID,\n uint16(49), // 48 + 1, 32 + 16 for option_length, + 1 for option_type\n ExecutorOptions.OPTION_TYPE_NATIVE_DROP,\n amount,\n receiver\n );\n } else {\n revert LZ_ULN_UnsupportedOptionType(_optionType);\n }\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppCore.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { ILayerZeroEndpointV2 } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\n\n/**\n * @title IOAppCore\n */\ninterface IOAppCore {\n // Custom error messages\n error OnlyPeer(uint32 eid, bytes32 sender);\n error NoPeer(uint32 eid);\n error InvalidEndpointCall();\n error InvalidDelegate();\n\n // Event emitted when a peer (OApp) is set for a corresponding endpoint\n event PeerSet(uint32 eid, bytes32 peer);\n\n /**\n * @notice Retrieves the OApp version information.\n * @return senderVersion The version of the OAppSender.sol contract.\n * @return receiverVersion The version of the OAppReceiver.sol contract.\n */\n function oAppVersion() external view returns (uint64 senderVersion, uint64 receiverVersion);\n\n /**\n * @notice Retrieves the LayerZero endpoint associated with the OApp.\n * @return iEndpoint The LayerZero endpoint as an interface.\n */\n function endpoint() external view returns (ILayerZeroEndpointV2 iEndpoint);\n\n /**\n * @notice Retrieves the peer (OApp) associated with a corresponding endpoint.\n * @param _eid The endpoint ID.\n * @return peer The peer address (OApp instance) associated with the corresponding endpoint.\n */\n function peers(uint32 _eid) external view returns (bytes32 peer);\n\n /**\n * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\n * @param _eid The endpoint ID.\n * @param _peer The address of the peer to be associated with the corresponding endpoint.\n */\n function setPeer(uint32 _eid, bytes32 _peer) external;\n\n /**\n * @notice Sets the delegate address for the OApp Core.\n * @param _delegate The address of the delegate to be set.\n */\n function setDelegate(address _delegate) external;\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppMsgInspector.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\n/**\n * @title IOAppMsgInspector\n * @dev Interface for the OApp Message Inspector, allowing examination of message and options contents.\n */\ninterface IOAppMsgInspector {\n // Custom error message for inspection failure\n error InspectionFailed(bytes message, bytes options);\n\n /**\n * @notice Allows the inspector to examine LayerZero message contents and optionally throw a revert if invalid.\n * @param _message The message payload to be inspected.\n * @param _options Additional options or parameters for inspection.\n * @return valid A boolean indicating whether the inspection passed (true) or failed (false).\n *\n * @dev Optionally done as a revert, OR use the boolean provided to handle the failure.\n */\n function inspect(bytes calldata _message, bytes calldata _options) external view returns (bool valid);\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppOptionsType3.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Struct representing enforced option parameters.\n */\nstruct EnforcedOptionParam {\n uint32 eid; // Endpoint ID\n uint16 msgType; // Message Type\n bytes options; // Additional options\n}\n\n/**\n * @title IOAppOptionsType3\n * @dev Interface for the OApp with Type 3 Options, allowing the setting and combining of enforced options.\n */\ninterface IOAppOptionsType3 {\n // Custom error message for invalid options\n error InvalidOptions(bytes options);\n\n // Event emitted when enforced options are set\n event EnforcedOptionSet(EnforcedOptionParam[] _enforcedOptions);\n\n /**\n * @notice Sets enforced options for specific endpoint and message type combinations.\n * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\n */\n function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) external;\n\n /**\n * @notice Combines options for a given endpoint and message type.\n * @param _eid The endpoint ID.\n * @param _msgType The OApp message type.\n * @param _extraOptions Additional options passed by the caller.\n * @return options The combination of caller specified options AND enforced options.\n */\n function combineOptions(\n uint32 _eid,\n uint16 _msgType,\n bytes calldata _extraOptions\n ) external view returns (bytes memory options);\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppReceiver.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport { ILayerZeroReceiver, Origin } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol\";\n\ninterface IOAppReceiver is ILayerZeroReceiver {\n /**\n * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint.\n * @param _origin The origin information containing the source endpoint and sender address.\n * - srcEid: The source chain endpoint ID.\n * - sender: The sender address on the src chain.\n * - nonce: The nonce of the message.\n * @param _message The lzReceive payload.\n * @param _sender The sender address.\n * @return isSender Is a valid sender.\n *\n * @dev Applications can optionally choose to implement a separate composeMsg sender that is NOT the bridging layer.\n * @dev The default sender IS the OAppReceiver implementer.\n */\n function isComposeMsgSender(\n Origin calldata _origin,\n bytes calldata _message,\n address _sender\n ) external view returns (bool isSender);\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OAppOptionsType3.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { IOAppOptionsType3, EnforcedOptionParam } from \"../interfaces/IOAppOptionsType3.sol\";\n\n/**\n * @title OAppOptionsType3\n * @dev Abstract contract implementing the IOAppOptionsType3 interface with type 3 options.\n */\nabstract contract OAppOptionsType3 is IOAppOptionsType3, Ownable {\n uint16 internal constant OPTION_TYPE_3 = 3;\n\n // @dev The \"msgType\" should be defined in the child contract.\n mapping(uint32 eid => mapping(uint16 msgType => bytes enforcedOption)) public enforcedOptions;\n\n /**\n * @dev Sets the enforced options for specific endpoint and message type combinations.\n * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\n *\n * @dev Only the owner/admin of the OApp can call this function.\n * @dev Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.\n * @dev These enforced options can vary as the potential options/execution on the remote may differ as per the msgType.\n * eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay\n * if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().\n */\n function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) public virtual onlyOwner {\n _setEnforcedOptions(_enforcedOptions);\n }\n\n /**\n * @dev Sets the enforced options for specific endpoint and message type combinations.\n * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options.\n *\n * @dev Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.\n * @dev These enforced options can vary as the potential options/execution on the remote may differ as per the msgType.\n * eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay\n * if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().\n */\n function _setEnforcedOptions(EnforcedOptionParam[] memory _enforcedOptions) internal virtual {\n for (uint256 i = 0; i < _enforcedOptions.length; i++) {\n // @dev Enforced options are only available for optionType 3, as type 1 and 2 dont support combining.\n _assertOptionsType3(_enforcedOptions[i].options);\n enforcedOptions[_enforcedOptions[i].eid][_enforcedOptions[i].msgType] = _enforcedOptions[i].options;\n }\n\n emit EnforcedOptionSet(_enforcedOptions);\n }\n\n /**\n * @notice Combines options for a given endpoint and message type.\n * @param _eid The endpoint ID.\n * @param _msgType The OAPP message type.\n * @param _extraOptions Additional options passed by the caller.\n * @return options The combination of caller specified options AND enforced options.\n *\n * @dev If there is an enforced lzReceive option:\n * - {gasLimit: 200k, msg.value: 1 ether} AND a caller supplies a lzReceive option: {gasLimit: 100k, msg.value: 0.5 ether}\n * - The resulting options will be {gasLimit: 300k, msg.value: 1.5 ether} when the message is executed on the remote lzReceive() function.\n * @dev This presence of duplicated options is handled off-chain in the verifier/executor.\n */\n function combineOptions(\n uint32 _eid,\n uint16 _msgType,\n bytes calldata _extraOptions\n ) public view virtual returns (bytes memory) {\n bytes memory enforced = enforcedOptions[_eid][_msgType];\n\n // No enforced options, pass whatever the caller supplied, even if it's empty or legacy type 1/2 options.\n if (enforced.length == 0) return _extraOptions;\n\n // No caller options, return enforced\n if (_extraOptions.length == 0) return enforced;\n\n // @dev If caller provided _extraOptions, must be type 3 as its the ONLY type that can be combined.\n if (_extraOptions.length >= 2) {\n _assertOptionsType3(_extraOptions);\n // @dev Remove the first 2 bytes containing the type from the _extraOptions and combine with enforced.\n return bytes.concat(enforced, _extraOptions[2:]);\n }\n\n // No valid set of options was found.\n revert InvalidOptions(_extraOptions);\n }\n\n /**\n * @dev Internal function to assert that options are of type 3.\n * @param _options The options to be checked.\n */\n function _assertOptionsType3(bytes memory _options) internal pure virtual {\n uint16 optionsType;\n assembly {\n optionsType := mload(add(_options, 2))\n }\n if (optionsType != OPTION_TYPE_3) revert InvalidOptions(_options);\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppCore.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { IOAppCore, ILayerZeroEndpointV2 } from \"./interfaces/IOAppCore.sol\";\n\n/**\n * @title OAppCore\n * @dev Abstract contract implementing the IOAppCore interface with basic OApp configurations.\n */\nabstract contract OAppCore is IOAppCore, Ownable {\n // The LayerZero endpoint associated with the given OApp\n ILayerZeroEndpointV2 public immutable endpoint;\n\n // Mapping to store peers associated with corresponding endpoints\n mapping(uint32 eid => bytes32 peer) public peers;\n\n /**\n * @dev Constructor to initialize the OAppCore with the provided endpoint and delegate.\n * @param _endpoint The address of the LOCAL Layer Zero endpoint.\n * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n *\n * @dev The delegate typically should be set as the owner of the contract.\n */\n constructor(address _endpoint, address _delegate) {\n endpoint = ILayerZeroEndpointV2(_endpoint);\n\n if (_delegate == address(0)) revert InvalidDelegate();\n endpoint.setDelegate(_delegate);\n }\n\n /**\n * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\n * @param _eid The endpoint ID.\n * @param _peer The address of the peer to be associated with the corresponding endpoint.\n *\n * @dev Only the owner/admin of the OApp can call this function.\n * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.\n * @dev Set this to bytes32(0) to remove the peer address.\n * @dev Peer is a bytes32 to accommodate non-evm chains.\n */\n function setPeer(uint32 _eid, bytes32 _peer) public virtual onlyOwner {\n _setPeer(_eid, _peer);\n }\n\n /**\n * @notice Sets the peer address (OApp instance) for a corresponding endpoint.\n * @param _eid The endpoint ID.\n * @param _peer The address of the peer to be associated with the corresponding endpoint.\n *\n * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.\n * @dev Set this to bytes32(0) to remove the peer address.\n * @dev Peer is a bytes32 to accommodate non-evm chains.\n */\n function _setPeer(uint32 _eid, bytes32 _peer) internal virtual {\n peers[_eid] = _peer;\n emit PeerSet(_eid, _peer);\n }\n\n /**\n * @notice Internal function to get the peer address associated with a specific endpoint; reverts if NOT set.\n * ie. the peer is set to bytes32(0).\n * @param _eid The endpoint ID.\n * @return peer The address of the peer associated with the specified endpoint.\n */\n function _getPeerOrRevert(uint32 _eid) internal view virtual returns (bytes32) {\n bytes32 peer = peers[_eid];\n if (peer == bytes32(0)) revert NoPeer(_eid);\n return peer;\n }\n\n /**\n * @notice Sets the delegate address for the OApp.\n * @param _delegate The address of the delegate to be set.\n *\n * @dev Only the owner/admin of the OApp can call this function.\n * @dev Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.\n */\n function setDelegate(address _delegate) public onlyOwner {\n endpoint.setDelegate(_delegate);\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppReceiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { IOAppReceiver, Origin } from \"./interfaces/IOAppReceiver.sol\";\nimport { OAppCore } from \"./OAppCore.sol\";\n\n/**\n * @title OAppReceiver\n * @dev Abstract contract implementing the ILayerZeroReceiver interface and extending OAppCore for OApp receivers.\n */\nabstract contract OAppReceiver is IOAppReceiver, OAppCore {\n // Custom error message for when the caller is not the registered endpoint/\n error OnlyEndpoint(address addr);\n\n // @dev The version of the OAppReceiver implementation.\n // @dev Version is bumped when changes are made to this contract.\n uint64 internal constant RECEIVER_VERSION = 2;\n\n /**\n * @notice Retrieves the OApp version information.\n * @return senderVersion The version of the OAppSender.sol contract.\n * @return receiverVersion The version of the OAppReceiver.sol contract.\n *\n * @dev Providing 0 as the default for OAppSender version. Indicates that the OAppSender is not implemented.\n * ie. this is a RECEIVE only OApp.\n * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions.\n */\n function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\n return (0, RECEIVER_VERSION);\n }\n\n /**\n * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint.\n * @dev _origin The origin information containing the source endpoint and sender address.\n * - srcEid: The source chain endpoint ID.\n * - sender: The sender address on the src chain.\n * - nonce: The nonce of the message.\n * @dev _message The lzReceive payload.\n * @param _sender The sender address.\n * @return isSender Is a valid sender.\n *\n * @dev Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer.\n * @dev The default sender IS the OAppReceiver implementer.\n */\n function isComposeMsgSender(\n Origin calldata /*_origin*/,\n bytes calldata /*_message*/,\n address _sender\n ) public view virtual returns (bool) {\n return _sender == address(this);\n }\n\n /**\n * @notice Checks if the path initialization is allowed based on the provided origin.\n * @param origin The origin information containing the source endpoint and sender address.\n * @return Whether the path has been initialized.\n *\n * @dev This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received.\n * @dev This defaults to assuming if a peer has been set, its initialized.\n * Can be overridden by the OApp if there is other logic to determine this.\n */\n function allowInitializePath(Origin calldata origin) public view virtual returns (bool) {\n return peers[origin.srcEid] == origin.sender;\n }\n\n /**\n * @notice Retrieves the next nonce for a given source endpoint and sender address.\n * @dev _srcEid The source endpoint ID.\n * @dev _sender The sender address.\n * @return nonce The next nonce.\n *\n * @dev The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement.\n * @dev Is required by the off-chain executor to determine the OApp expects msg execution is ordered.\n * @dev This is also enforced by the OApp.\n * @dev By default this is NOT enabled. ie. nextNonce is hardcoded to return 0.\n */\n function nextNonce(uint32 /*_srcEid*/, bytes32 /*_sender*/) public view virtual returns (uint64 nonce) {\n return 0;\n }\n\n /**\n * @dev Entry point for receiving messages or packets from the endpoint.\n * @param _origin The origin information containing the source endpoint and sender address.\n * - srcEid: The source chain endpoint ID.\n * - sender: The sender address on the src chain.\n * - nonce: The nonce of the message.\n * @param _guid The unique identifier for the received LayerZero message.\n * @param _message The payload of the received message.\n * @param _executor The address of the executor for the received message.\n * @param _extraData Additional arbitrary data provided by the corresponding executor.\n *\n * @dev Entry point for receiving msg/packet from the LayerZero endpoint.\n */\n function lzReceive(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address _executor,\n bytes calldata _extraData\n ) public payable virtual {\n // Ensures that only the endpoint can attempt to lzReceive() messages to this OApp.\n if (address(endpoint) != msg.sender) revert OnlyEndpoint(msg.sender);\n\n // Ensure that the sender matches the expected peer for the source endpoint.\n if (_getPeerOrRevert(_origin.srcEid) != _origin.sender) revert OnlyPeer(_origin.srcEid, _origin.sender);\n\n // Call the internal OApp implementation of lzReceive.\n _lzReceive(_origin, _guid, _message, _executor, _extraData);\n }\n\n /**\n * @dev Internal function to implement lzReceive logic without needing to copy the basic parameter validation.\n */\n function _lzReceive(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address _executor,\n bytes calldata _extraData\n ) internal virtual;\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppSender.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { SafeERC20, IERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { MessagingParams, MessagingFee, MessagingReceipt } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport { OAppCore } from \"./OAppCore.sol\";\n\n/**\n * @title OAppSender\n * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.\n */\nabstract contract OAppSender is OAppCore {\n using SafeERC20 for IERC20;\n\n // Custom error messages\n error NotEnoughNative(uint256 msgValue);\n error LzTokenUnavailable();\n\n // @dev The version of the OAppSender implementation.\n // @dev Version is bumped when changes are made to this contract.\n uint64 internal constant SENDER_VERSION = 1;\n\n /**\n * @notice Retrieves the OApp version information.\n * @return senderVersion The version of the OAppSender.sol contract.\n * @return receiverVersion The version of the OAppReceiver.sol contract.\n *\n * @dev Providing 0 as the default for OAppReceiver version. Indicates that the OAppReceiver is not implemented.\n * ie. this is a SEND only OApp.\n * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions\n */\n function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\n return (SENDER_VERSION, 0);\n }\n\n /**\n * @dev Internal function to interact with the LayerZero EndpointV2.quote() for fee calculation.\n * @param _dstEid The destination endpoint ID.\n * @param _message The message payload.\n * @param _options Additional options for the message.\n * @param _payInLzToken Flag indicating whether to pay the fee in LZ tokens.\n * @return fee The calculated MessagingFee for the message.\n * - nativeFee: The native fee for the message.\n * - lzTokenFee: The LZ token fee for the message.\n */\n function _quote(\n uint32 _dstEid,\n bytes memory _message,\n bytes memory _options,\n bool _payInLzToken\n ) internal view virtual returns (MessagingFee memory fee) {\n return\n endpoint.quote(\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken),\n address(this)\n );\n }\n\n /**\n * @dev Internal function to interact with the LayerZero EndpointV2.send() for sending a message.\n * @param _dstEid The destination endpoint ID.\n * @param _message The message payload.\n * @param _options Additional options for the message.\n * @param _fee The calculated LayerZero fee for the message.\n * - nativeFee: The native fee.\n * - lzTokenFee: The lzToken fee.\n * @param _refundAddress The address to receive any excess fee values sent to the endpoint.\n * @return receipt The receipt for the sent message.\n * - guid: The unique identifier for the sent message.\n * - nonce: The nonce of the sent message.\n * - fee: The LayerZero fee incurred for the message.\n */\n function _lzSend(\n uint32 _dstEid,\n bytes memory _message,\n bytes memory _options,\n MessagingFee memory _fee,\n address _refundAddress\n ) internal virtual returns (MessagingReceipt memory receipt) {\n // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint.\n uint256 messageValue = _payNative(_fee.nativeFee);\n if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);\n\n return\n // solhint-disable-next-line check-send-result\n endpoint.send{ value: messageValue }(\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0),\n _refundAddress\n );\n }\n\n /**\n * @dev Internal function to pay the native fee associated with the message.\n * @param _nativeFee The native fee to be paid.\n * @return nativeFee The amount of native currency paid.\n *\n * @dev If the OApp needs to initiate MULTIPLE LayerZero messages in a single transaction,\n * this will need to be overridden because msg.value would contain multiple lzFees.\n * @dev Should be overridden in the event the LayerZero endpoint requires a different native currency.\n * @dev Some EVMs use an ERC20 as a method for paying transactions/gasFees.\n * @dev The endpoint is EITHER/OR, ie. it will NOT support both types of native payment at a time.\n */\n function _payNative(uint256 _nativeFee) internal virtual returns (uint256 nativeFee) {\n if (msg.value != _nativeFee) revert NotEnoughNative(msg.value);\n return _nativeFee;\n }\n\n /**\n * @dev Internal function to pay the LZ token fee associated with the message.\n * @param _lzTokenFee The LZ token fee to be paid.\n *\n * @dev If the caller is trying to pay in the specified lzToken, then the lzTokenFee is passed to the endpoint.\n * @dev Any excess sent, is passed back to the specified _refundAddress in the _lzSend().\n */\n function _payLzToken(uint256 _lzTokenFee) internal virtual {\n // @dev Cannot cache the token because it is not immutable in the endpoint.\n address lzToken = endpoint.lzToken();\n if (lzToken == address(0)) revert LzTokenUnavailable();\n\n // Pay LZ token fee by sending tokens to the endpoint.\n IERC20(lzToken).safeTransferFrom(msg.sender, address(endpoint), _lzTokenFee);\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { MessagingReceipt, MessagingFee } from \"../../oapp/OAppSender.sol\";\n\n/**\n * @dev Struct representing token parameters for the OFT send() operation.\n */\nstruct SendParam {\n uint32 dstEid; // Destination endpoint ID.\n bytes32 to; // Recipient address.\n uint256 amountLD; // Amount to send in local decimals.\n uint256 minAmountLD; // Minimum amount to send in local decimals.\n bytes extraOptions; // Additional options supplied by the caller to be used in the LayerZero message.\n bytes composeMsg; // The composed message for the send() operation.\n bytes oftCmd; // The OFT command to be executed, unused in default OFT implementations.\n}\n\n/**\n * @dev Struct representing OFT limit information.\n * @dev These amounts can change dynamically and are up the the specific oft implementation.\n */\nstruct OFTLimit {\n uint256 minAmountLD; // Minimum amount in local decimals that can be sent to the recipient.\n uint256 maxAmountLD; // Maximum amount in local decimals that can be sent to the recipient.\n}\n\n/**\n * @dev Struct representing OFT receipt information.\n */\nstruct OFTReceipt {\n uint256 amountSentLD; // Amount of tokens ACTUALLY debited from the sender in local decimals.\n // @dev In non-default implementations, the amountReceivedLD COULD differ from this value.\n uint256 amountReceivedLD; // Amount of tokens to be received on the remote side.\n}\n\n/**\n * @dev Struct representing OFT fee details.\n * @dev Future proof mechanism to provide a standardized way to communicate fees to things like a UI.\n */\nstruct OFTFeeDetail {\n int256 feeAmountLD; // Amount of the fee in local decimals.\n string description; // Description of the fee.\n}\n\n/**\n * @title IOFT\n * @dev Interface for the OftChain (OFT) token.\n * @dev Does not inherit ERC20 to accommodate usage by OFTAdapter as well.\n * @dev This specific interface ID is '0x02e49c2c'.\n */\ninterface IOFT {\n // Custom error messages\n error InvalidLocalDecimals();\n error SlippageExceeded(uint256 amountLD, uint256 minAmountLD);\n\n // Events\n event OFTSent(\n bytes32 indexed guid, // GUID of the OFT message.\n uint32 dstEid, // Destination Endpoint ID.\n address indexed fromAddress, // Address of the sender on the src chain.\n uint256 amountSentLD, // Amount of tokens sent in local decimals.\n uint256 amountReceivedLD // Amount of tokens received in local decimals.\n );\n event OFTReceived(\n bytes32 indexed guid, // GUID of the OFT message.\n uint32 srcEid, // Source Endpoint ID.\n address indexed toAddress, // Address of the recipient on the dst chain.\n uint256 amountReceivedLD // Amount of tokens received in local decimals.\n );\n\n /**\n * @notice Retrieves interfaceID and the version of the OFT.\n * @return interfaceId The interface ID.\n * @return version The version.\n *\n * @dev interfaceId: This specific interface ID is '0x02e49c2c'.\n * @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.\n * @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.\n * ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\n */\n function oftVersion() external view returns (bytes4 interfaceId, uint64 version);\n\n /**\n * @notice Retrieves the address of the token associated with the OFT.\n * @return token The address of the ERC20 token implementation.\n */\n function token() external view returns (address);\n\n /**\n * @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\n * @return requiresApproval Needs approval of the underlying token implementation.\n *\n * @dev Allows things like wallet implementers to determine integration requirements,\n * without understanding the underlying token implementation.\n */\n function approvalRequired() external view returns (bool);\n\n /**\n * @notice Retrieves the shared decimals of the OFT.\n * @return sharedDecimals The shared decimals of the OFT.\n */\n function sharedDecimals() external view returns (uint8);\n\n /**\n * @notice Provides a quote for OFT-related operations.\n * @param _sendParam The parameters for the send operation.\n * @return limit The OFT limit information.\n * @return oftFeeDetails The details of OFT fees.\n * @return receipt The OFT receipt information.\n */\n function quoteOFT(\n SendParam calldata _sendParam\n ) external view returns (OFTLimit memory, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory);\n\n /**\n * @notice Provides a quote for the send() operation.\n * @param _sendParam The parameters for the send() operation.\n * @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.\n * @return fee The calculated LayerZero messaging fee from the send() operation.\n *\n * @dev MessagingFee: LayerZero msg fee\n * - nativeFee: The native fee.\n * - lzTokenFee: The lzToken fee.\n */\n function quoteSend(SendParam calldata _sendParam, bool _payInLzToken) external view returns (MessagingFee memory);\n\n /**\n * @notice Executes the send() operation.\n * @param _sendParam The parameters for the send operation.\n * @param _fee The fee information supplied by the caller.\n * - nativeFee: The native fee.\n * - lzTokenFee: The lzToken fee.\n * @param _refundAddress The address to receive any excess funds from fees etc. on the src.\n * @return receipt The LayerZero messaging receipt from the send() operation.\n * @return oftReceipt The OFT receipt information.\n *\n * @dev MessagingReceipt: LayerZero msg receipt\n * - guid: The unique identifier for the sent message.\n * - nonce: The nonce of the sent message.\n * - fee: The LayerZero fee incurred for the message.\n */\n function send(\n SendParam calldata _sendParam,\n MessagingFee calldata _fee,\n address _refundAddress\n ) external payable returns (MessagingReceipt memory, OFTReceipt memory);\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/libs/OFTComposeMsgCodec.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nlibrary OFTComposeMsgCodec {\n // Offset constants for decoding composed messages\n uint8 private constant NONCE_OFFSET = 8;\n uint8 private constant SRC_EID_OFFSET = 12;\n uint8 private constant AMOUNT_LD_OFFSET = 44;\n uint8 private constant COMPOSE_FROM_OFFSET = 76;\n\n /**\n * @dev Encodes a OFT composed message.\n * @param _nonce The nonce value.\n * @param _srcEid The source endpoint ID.\n * @param _amountLD The amount in local decimals.\n * @param _composeMsg The composed message.\n * @return _msg The encoded Composed message.\n */\n function encode(\n uint64 _nonce,\n uint32 _srcEid,\n uint256 _amountLD,\n bytes memory _composeMsg // 0x[composeFrom][composeMsg]\n ) internal pure returns (bytes memory _msg) {\n _msg = abi.encodePacked(_nonce, _srcEid, _amountLD, _composeMsg);\n }\n\n /**\n * @dev Retrieves the nonce from the composed message.\n * @param _msg The message.\n * @return The nonce value.\n */\n function nonce(bytes calldata _msg) internal pure returns (uint64) {\n return uint64(bytes8(_msg[:NONCE_OFFSET]));\n }\n\n /**\n * @dev Retrieves the source endpoint ID from the composed message.\n * @param _msg The message.\n * @return The source endpoint ID.\n */\n function srcEid(bytes calldata _msg) internal pure returns (uint32) {\n return uint32(bytes4(_msg[NONCE_OFFSET:SRC_EID_OFFSET]));\n }\n\n /**\n * @dev Retrieves the amount in local decimals from the composed message.\n * @param _msg The message.\n * @return The amount in local decimals.\n */\n function amountLD(bytes calldata _msg) internal pure returns (uint256) {\n return uint256(bytes32(_msg[SRC_EID_OFFSET:AMOUNT_LD_OFFSET]));\n }\n\n /**\n * @dev Retrieves the composeFrom value from the composed message.\n * @param _msg The message.\n * @return The composeFrom value.\n */\n function composeFrom(bytes calldata _msg) internal pure returns (bytes32) {\n return bytes32(_msg[AMOUNT_LD_OFFSET:COMPOSE_FROM_OFFSET]);\n }\n\n /**\n * @dev Retrieves the composed message.\n * @param _msg The message.\n * @return The composed message.\n */\n function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\n return _msg[COMPOSE_FROM_OFFSET:];\n }\n\n /**\n * @dev Converts an address to bytes32.\n * @param _addr The address to convert.\n * @return The bytes32 representation of the address.\n */\n function addressToBytes32(address _addr) internal pure returns (bytes32) {\n return bytes32(uint256(uint160(_addr)));\n }\n\n /**\n * @dev Converts bytes32 to an address.\n * @param _b The bytes32 value to convert.\n * @return The address representation of bytes32.\n */\n function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\n return address(uint160(uint256(_b)));\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/oft/libs/OFTMsgCodec.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nlibrary OFTMsgCodec {\n // Offset constants for encoding and decoding OFT messages\n uint8 private constant SEND_TO_OFFSET = 32;\n uint8 private constant SEND_AMOUNT_SD_OFFSET = 40;\n\n /**\n * @dev Encodes an OFT LayerZero message.\n * @param _sendTo The recipient address.\n * @param _amountShared The amount in shared decimals.\n * @param _composeMsg The composed message.\n * @return _msg The encoded message.\n * @return hasCompose A boolean indicating whether the message has a composed payload.\n */\n function encode(\n bytes32 _sendTo,\n uint64 _amountShared,\n bytes memory _composeMsg\n ) internal view returns (bytes memory _msg, bool hasCompose) {\n hasCompose = _composeMsg.length > 0;\n // @dev Remote chains will want to know the composed function caller ie. msg.sender on the src.\n _msg = hasCompose\n ? abi.encodePacked(_sendTo, _amountShared, addressToBytes32(msg.sender), _composeMsg)\n : abi.encodePacked(_sendTo, _amountShared);\n }\n\n /**\n * @dev Checks if the OFT message is composed.\n * @param _msg The OFT message.\n * @return A boolean indicating whether the message is composed.\n */\n function isComposed(bytes calldata _msg) internal pure returns (bool) {\n return _msg.length > SEND_AMOUNT_SD_OFFSET;\n }\n\n /**\n * @dev Retrieves the recipient address from the OFT message.\n * @param _msg The OFT message.\n * @return The recipient address.\n */\n function sendTo(bytes calldata _msg) internal pure returns (bytes32) {\n return bytes32(_msg[:SEND_TO_OFFSET]);\n }\n\n /**\n * @dev Retrieves the amount in shared decimals from the OFT message.\n * @param _msg The OFT message.\n * @return The amount in shared decimals.\n */\n function amountSD(bytes calldata _msg) internal pure returns (uint64) {\n return uint64(bytes8(_msg[SEND_TO_OFFSET:SEND_AMOUNT_SD_OFFSET]));\n }\n\n /**\n * @dev Retrieves the composed message from the OFT message.\n * @param _msg The OFT message.\n * @return The composed message.\n */\n function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\n return _msg[SEND_AMOUNT_SD_OFFSET:];\n }\n\n /**\n * @dev Converts an address to bytes32.\n * @param _addr The address to convert.\n * @return The bytes32 representation of the address.\n */\n function addressToBytes32(address _addr) internal pure returns (bytes32) {\n return bytes32(uint256(uint160(_addr)));\n }\n\n /**\n * @dev Converts bytes32 to an address.\n * @param _b The bytes32 value to convert.\n * @return The address representation of bytes32.\n */\n function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\n return address(uint160(uint256(_b)));\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/interfaces/IOAppPreCrimeSimulator.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\n// @dev Import the Origin so it's exposed to OAppPreCrimeSimulator implementers.\n// solhint-disable-next-line no-unused-import\nimport { InboundPacket, Origin } from \"../libs/Packet.sol\";\n\n/**\n * @title IOAppPreCrimeSimulator Interface\n * @dev Interface for the preCrime simulation functionality in an OApp.\n */\ninterface IOAppPreCrimeSimulator {\n // @dev simulation result used in PreCrime implementation\n error SimulationResult(bytes result);\n error OnlySelf();\n\n /**\n * @dev Emitted when the preCrime contract address is set.\n * @param preCrimeAddress The address of the preCrime contract.\n */\n event PreCrimeSet(address preCrimeAddress);\n\n /**\n * @dev Retrieves the address of the preCrime contract implementation.\n * @return The address of the preCrime contract.\n */\n function preCrime() external view returns (address);\n\n /**\n * @dev Retrieves the address of the OApp contract.\n * @return The address of the OApp contract.\n */\n function oApp() external view returns (address);\n\n /**\n * @dev Sets the preCrime contract address.\n * @param _preCrime The address of the preCrime contract.\n */\n function setPreCrime(address _preCrime) external;\n\n /**\n * @dev Mocks receiving a packet, then reverts with a series of data to infer the state/result.\n * @param _packets An array of LayerZero InboundPacket objects representing received packets.\n */\n function lzReceiveAndRevert(InboundPacket[] calldata _packets) external payable;\n\n /**\n * @dev checks if the specified peer is considered 'trusted' by the OApp.\n * @param _eid The endpoint Id to check.\n * @param _peer The peer to check.\n * @return Whether the peer passed is considered 'trusted' by the OApp.\n */\n function isPeer(uint32 _eid, bytes32 _peer) external view returns (bool);\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/interfaces/IPreCrime.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\nstruct PreCrimePeer {\n uint32 eid;\n bytes32 preCrime;\n bytes32 oApp;\n}\n\n// TODO not done yet\ninterface IPreCrime {\n error OnlyOffChain();\n\n // for simulate()\n error PacketOversize(uint256 max, uint256 actual);\n error PacketUnsorted();\n error SimulationFailed(bytes reason);\n\n // for preCrime()\n error SimulationResultNotFound(uint32 eid);\n error InvalidSimulationResult(uint32 eid, bytes reason);\n error CrimeFound(bytes crime);\n\n function getConfig(bytes[] calldata _packets, uint256[] calldata _packetMsgValues) external returns (bytes memory);\n\n function simulate(\n bytes[] calldata _packets,\n uint256[] calldata _packetMsgValues\n ) external payable returns (bytes memory);\n\n function buildSimulationResult() external view returns (bytes memory);\n\n function preCrime(\n bytes[] calldata _packets,\n uint256[] calldata _packetMsgValues,\n bytes[] calldata _simulations\n ) external;\n\n function version() external view returns (uint64 major, uint8 minor);\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/libs/Packet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { Origin } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport { PacketV1Codec } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol\";\n\n/**\n * @title InboundPacket\n * @dev Structure representing an inbound packet received by the contract.\n */\nstruct InboundPacket {\n Origin origin; // Origin information of the packet.\n uint32 dstEid; // Destination endpointId of the packet.\n address receiver; // Receiver address for the packet.\n bytes32 guid; // Unique identifier of the packet.\n uint256 value; // msg.value of the packet.\n address executor; // Executor address for the packet.\n bytes message; // Message payload of the packet.\n bytes extraData; // Additional arbitrary data for the packet.\n}\n\n/**\n * @title PacketDecoder\n * @dev Library for decoding LayerZero packets.\n */\nlibrary PacketDecoder {\n using PacketV1Codec for bytes;\n\n /**\n * @dev Decode an inbound packet from the given packet data.\n * @param _packet The packet data to decode.\n * @return packet An InboundPacket struct representing the decoded packet.\n */\n function decode(bytes calldata _packet) internal pure returns (InboundPacket memory packet) {\n packet.origin = Origin(_packet.srcEid(), _packet.sender(), _packet.nonce());\n packet.dstEid = _packet.dstEid();\n packet.receiver = _packet.receiverB20();\n packet.guid = _packet.guid();\n packet.message = _packet.message();\n }\n\n /**\n * @dev Decode multiple inbound packets from the given packet data and associated message values.\n * @param _packets An array of packet data to decode.\n * @param _packetMsgValues An array of associated message values for each packet.\n * @return packets An array of InboundPacket structs representing the decoded packets.\n */\n function decode(\n bytes[] calldata _packets,\n uint256[] memory _packetMsgValues\n ) internal pure returns (InboundPacket[] memory packets) {\n packets = new InboundPacket[](_packets.length);\n for (uint256 i = 0; i < _packets.length; i++) {\n bytes calldata packet = _packets[i];\n packets[i] = PacketDecoder.decode(packet);\n // @dev Allows the verifier to specify the msg.value that gets passed in lzReceive.\n packets[i].value = _packetMsgValues[i];\n }\n }\n}\n" + }, + "@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/OAppPreCrimeSimulator.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.20;\n\nimport { Ownable } from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport { IPreCrime } from \"./interfaces/IPreCrime.sol\";\nimport { IOAppPreCrimeSimulator, InboundPacket, Origin } from \"./interfaces/IOAppPreCrimeSimulator.sol\";\n\n/**\n * @title OAppPreCrimeSimulator\n * @dev Abstract contract serving as the base for preCrime simulation functionality in an OApp.\n */\nabstract contract OAppPreCrimeSimulator is IOAppPreCrimeSimulator, Ownable {\n // The address of the preCrime implementation.\n address public preCrime;\n\n /**\n * @dev Retrieves the address of the OApp contract.\n * @return The address of the OApp contract.\n *\n * @dev The simulator contract is the base contract for the OApp by default.\n * @dev If the simulator is a separate contract, override this function.\n */\n function oApp() external view virtual returns (address) {\n return address(this);\n }\n\n /**\n * @dev Sets the preCrime contract address.\n * @param _preCrime The address of the preCrime contract.\n */\n function setPreCrime(address _preCrime) public virtual onlyOwner {\n preCrime = _preCrime;\n emit PreCrimeSet(_preCrime);\n }\n\n /**\n * @dev Interface for pre-crime simulations. Always reverts at the end with the simulation results.\n * @param _packets An array of InboundPacket objects representing received packets to be delivered.\n *\n * @dev WARNING: MUST revert at the end with the simulation results.\n * @dev Gives the preCrime implementation the ability to mock sending packets to the lzReceive function,\n * WITHOUT actually executing them.\n */\n function lzReceiveAndRevert(InboundPacket[] calldata _packets) public payable virtual {\n for (uint256 i = 0; i < _packets.length; i++) {\n InboundPacket calldata packet = _packets[i];\n\n // Ignore packets that are not from trusted peers.\n if (!isPeer(packet.origin.srcEid, packet.origin.sender)) continue;\n\n // @dev Because a verifier is calling this function, it doesnt have access to executor params:\n // - address _executor\n // - bytes calldata _extraData\n // preCrime will NOT work for OApps that rely on these two parameters inside of their _lzReceive().\n // They are instead stubbed to default values, address(0) and bytes(\"\")\n // @dev Calling this.lzReceiveSimulate removes ability for assembly return 0 callstack exit,\n // which would cause the revert to be ignored.\n this.lzReceiveSimulate{ value: packet.value }(\n packet.origin,\n packet.guid,\n packet.message,\n packet.executor,\n packet.extraData\n );\n }\n\n // @dev Revert with the simulation results. msg.sender must implement IPreCrime.buildSimulationResult().\n revert SimulationResult(IPreCrime(msg.sender).buildSimulationResult());\n }\n\n /**\n * @dev Is effectively an internal function because msg.sender must be address(this).\n * Allows resetting the call stack for 'internal' calls.\n * @param _origin The origin information containing the source endpoint and sender address.\n * - srcEid: The source chain endpoint ID.\n * - sender: The sender address on the src chain.\n * - nonce: The nonce of the message.\n * @param _guid The unique identifier of the packet.\n * @param _message The message payload of the packet.\n * @param _executor The executor address for the packet.\n * @param _extraData Additional data for the packet.\n */\n function lzReceiveSimulate(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address _executor,\n bytes calldata _extraData\n ) external payable virtual {\n // @dev Ensure ONLY can be called 'internally'.\n if (msg.sender != address(this)) revert OnlySelf();\n _lzReceiveSimulate(_origin, _guid, _message, _executor, _extraData);\n }\n\n /**\n * @dev Internal function to handle the OAppPreCrimeSimulator simulated receive.\n * @param _origin The origin information.\n * - srcEid: The source chain endpoint ID.\n * - sender: The sender address from the src chain.\n * - nonce: The nonce of the LayerZero message.\n * @param _guid The GUID of the LayerZero message.\n * @param _message The LayerZero message.\n * @param _executor The address of the off-chain executor.\n * @param _extraData Arbitrary data passed by the msg executor.\n *\n * @dev Enables the preCrime simulator to mock sending lzReceive() messages,\n * routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver.\n */\n function _lzReceiveSimulate(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address _executor,\n bytes calldata _extraData\n ) internal virtual;\n\n /**\n * @dev checks if the specified peer is considered 'trusted' by the OApp.\n * @param _eid The endpoint Id to check.\n * @param _peer The peer to check.\n * @return Whether the peer passed is considered 'trusted' by the OApp.\n */\n function isPeer(uint32 _eid, bytes32 _peer) public view virtual returns (bool);\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/EndpointV2ViewUpgradeable.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { Initializable } from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\n\nimport \"./interfaces/ILayerZeroEndpointV2.sol\";\n\nenum ExecutionState {\n NotExecutable, // executor: waits for PayloadVerified event and starts polling for executable\n VerifiedButNotExecutable, // executor: starts active polling for executable\n Executable,\n Executed\n}\n\ncontract EndpointV2ViewUpgradeable is Initializable {\n bytes32 public constant EMPTY_PAYLOAD_HASH = bytes32(0);\n bytes32 public constant NIL_PAYLOAD_HASH = bytes32(type(uint256).max);\n\n ILayerZeroEndpointV2 public endpoint;\n\n function __EndpointV2View_init(address _endpoint) internal onlyInitializing {\n __EndpointV2View_init_unchained(_endpoint);\n }\n\n function __EndpointV2View_init_unchained(address _endpoint) internal onlyInitializing {\n endpoint = ILayerZeroEndpointV2(_endpoint);\n }\n\n function initializable(Origin memory _origin, address _receiver) public view returns (bool) {\n try endpoint.initializable(_origin, _receiver) returns (bool _initializable) {\n return _initializable;\n } catch {\n return false;\n }\n }\n\n /// @dev check if a message is verifiable.\n function verifiable(\n Origin memory _origin,\n address _receiver,\n address _receiveLib,\n bytes32 _payloadHash\n ) public view returns (bool) {\n if (!endpoint.isValidReceiveLibrary(_receiver, _origin.srcEid, _receiveLib)) return false;\n\n if (!endpoint.verifiable(_origin, _receiver)) return false;\n\n // checked in _inbound for verify\n if (_payloadHash == EMPTY_PAYLOAD_HASH) return false;\n\n return true;\n }\n\n /// @dev check if a message is executable.\n /// @return ExecutionState of Executed, Executable, or NotExecutable\n function executable(Origin memory _origin, address _receiver) public view returns (ExecutionState) {\n bytes32 payloadHash = endpoint.inboundPayloadHash(_receiver, _origin.srcEid, _origin.sender, _origin.nonce);\n\n // executed if the payload hash has been cleared and the nonce is less than or equal to lazyInboundNonce\n if (\n payloadHash == EMPTY_PAYLOAD_HASH &&\n _origin.nonce <= endpoint.lazyInboundNonce(_receiver, _origin.srcEid, _origin.sender)\n ) {\n return ExecutionState.Executed;\n }\n\n // executable if nonce has not been executed and has not been nilified and nonce is less than or equal to inboundNonce\n if (\n payloadHash != NIL_PAYLOAD_HASH &&\n _origin.nonce <= endpoint.inboundNonce(_receiver, _origin.srcEid, _origin.sender)\n ) {\n return ExecutionState.Executable;\n }\n\n // only start active executable polling if payload hash is not empty nor nil\n if (payloadHash != EMPTY_PAYLOAD_HASH && payloadHash != NIL_PAYLOAD_HASH) {\n return ExecutionState.VerifiedButNotExecutable;\n }\n\n // return NotExecutable as a catch-all\n return ExecutionState.NotExecutable;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { IMessageLibManager } from \"./IMessageLibManager.sol\";\nimport { IMessagingComposer } from \"./IMessagingComposer.sol\";\nimport { IMessagingChannel } from \"./IMessagingChannel.sol\";\nimport { IMessagingContext } from \"./IMessagingContext.sol\";\n\nstruct MessagingParams {\n uint32 dstEid;\n bytes32 receiver;\n bytes message;\n bytes options;\n bool payInLzToken;\n}\n\nstruct MessagingReceipt {\n bytes32 guid;\n uint64 nonce;\n MessagingFee fee;\n}\n\nstruct MessagingFee {\n uint256 nativeFee;\n uint256 lzTokenFee;\n}\n\nstruct Origin {\n uint32 srcEid;\n bytes32 sender;\n uint64 nonce;\n}\n\ninterface ILayerZeroEndpointV2 is IMessageLibManager, IMessagingComposer, IMessagingChannel, IMessagingContext {\n event PacketSent(bytes encodedPayload, bytes options, address sendLibrary);\n\n event PacketVerified(Origin origin, address receiver, bytes32 payloadHash);\n\n event PacketDelivered(Origin origin, address receiver);\n\n event LzReceiveAlert(\n address indexed receiver,\n address indexed executor,\n Origin origin,\n bytes32 guid,\n uint256 gas,\n uint256 value,\n bytes message,\n bytes extraData,\n bytes reason\n );\n\n event LzTokenSet(address token);\n\n event DelegateSet(address sender, address delegate);\n\n function quote(MessagingParams calldata _params, address _sender) external view returns (MessagingFee memory);\n\n function send(\n MessagingParams calldata _params,\n address _refundAddress\n ) external payable returns (MessagingReceipt memory);\n\n function verify(Origin calldata _origin, address _receiver, bytes32 _payloadHash) external;\n\n function verifiable(Origin calldata _origin, address _receiver) external view returns (bool);\n\n function initializable(Origin calldata _origin, address _receiver) external view returns (bool);\n\n function lzReceive(\n Origin calldata _origin,\n address _receiver,\n bytes32 _guid,\n bytes calldata _message,\n bytes calldata _extraData\n ) external payable;\n\n // oapp can burn messages partially by calling this function with its own business logic if messages are verified in order\n function clear(address _oapp, Origin calldata _origin, bytes32 _guid, bytes calldata _message) external;\n\n function setLzToken(address _lzToken) external;\n\n function lzToken() external view returns (address);\n\n function nativeToken() external view returns (address);\n\n function setDelegate(address _delegate) external;\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { Origin } from \"./ILayerZeroEndpointV2.sol\";\n\ninterface ILayerZeroReceiver {\n function allowInitializePath(Origin calldata _origin) external view returns (bool);\n\n function nextNonce(uint32 _eid, bytes32 _sender) external view returns (uint64);\n\n function lzReceive(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address _executor,\n bytes calldata _extraData\n ) external payable;\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLib.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { IERC165 } from \"@openzeppelin/contracts/utils/introspection/IERC165.sol\";\n\nimport { SetConfigParam } from \"./IMessageLibManager.sol\";\n\nenum MessageLibType {\n Send,\n Receive,\n SendAndReceive\n}\n\ninterface IMessageLib is IERC165 {\n function setConfig(address _oapp, SetConfigParam[] calldata _config) external;\n\n function getConfig(uint32 _eid, address _oapp, uint32 _configType) external view returns (bytes memory config);\n\n function isSupportedEid(uint32 _eid) external view returns (bool);\n\n // message libs of same major version are compatible\n function version() external view returns (uint64 major, uint8 minor, uint8 endpointVersion);\n\n function messageLibType() external view returns (MessageLibType);\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nstruct SetConfigParam {\n uint32 eid;\n uint32 configType;\n bytes config;\n}\n\ninterface IMessageLibManager {\n struct Timeout {\n address lib;\n uint256 expiry;\n }\n\n event LibraryRegistered(address newLib);\n event DefaultSendLibrarySet(uint32 eid, address newLib);\n event DefaultReceiveLibrarySet(uint32 eid, address newLib);\n event DefaultReceiveLibraryTimeoutSet(uint32 eid, address oldLib, uint256 expiry);\n event SendLibrarySet(address sender, uint32 eid, address newLib);\n event ReceiveLibrarySet(address receiver, uint32 eid, address newLib);\n event ReceiveLibraryTimeoutSet(address receiver, uint32 eid, address oldLib, uint256 timeout);\n\n function registerLibrary(address _lib) external;\n\n function isRegisteredLibrary(address _lib) external view returns (bool);\n\n function getRegisteredLibraries() external view returns (address[] memory);\n\n function setDefaultSendLibrary(uint32 _eid, address _newLib) external;\n\n function defaultSendLibrary(uint32 _eid) external view returns (address);\n\n function setDefaultReceiveLibrary(uint32 _eid, address _newLib, uint256 _gracePeriod) external;\n\n function defaultReceiveLibrary(uint32 _eid) external view returns (address);\n\n function setDefaultReceiveLibraryTimeout(uint32 _eid, address _lib, uint256 _expiry) external;\n\n function defaultReceiveLibraryTimeout(uint32 _eid) external view returns (address lib, uint256 expiry);\n\n function isSupportedEid(uint32 _eid) external view returns (bool);\n\n function isValidReceiveLibrary(address _receiver, uint32 _eid, address _lib) external view returns (bool);\n\n /// ------------------- OApp interfaces -------------------\n function setSendLibrary(address _oapp, uint32 _eid, address _newLib) external;\n\n function getSendLibrary(address _sender, uint32 _eid) external view returns (address lib);\n\n function isDefaultSendLibrary(address _sender, uint32 _eid) external view returns (bool);\n\n function setReceiveLibrary(address _oapp, uint32 _eid, address _newLib, uint256 _gracePeriod) external;\n\n function getReceiveLibrary(address _receiver, uint32 _eid) external view returns (address lib, bool isDefault);\n\n function setReceiveLibraryTimeout(address _oapp, uint32 _eid, address _lib, uint256 _expiry) external;\n\n function receiveLibraryTimeout(address _receiver, uint32 _eid) external view returns (address lib, uint256 expiry);\n\n function setConfig(address _oapp, address _lib, SetConfigParam[] calldata _params) external;\n\n function getConfig(\n address _oapp,\n address _lib,\n uint32 _eid,\n uint32 _configType\n ) external view returns (bytes memory config);\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingChannel.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IMessagingChannel {\n event InboundNonceSkipped(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce);\n event PacketNilified(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);\n event PacketBurnt(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);\n\n function eid() external view returns (uint32);\n\n // this is an emergency function if a message cannot be verified for some reasons\n // required to provide _nextNonce to avoid race condition\n function skip(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce) external;\n\n function nilify(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;\n\n function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;\n\n function nextGuid(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (bytes32);\n\n function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);\n\n function outboundNonce(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (uint64);\n\n function inboundPayloadHash(\n address _receiver,\n uint32 _srcEid,\n bytes32 _sender,\n uint64 _nonce\n ) external view returns (bytes32);\n\n function lazyInboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingComposer.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IMessagingComposer {\n event ComposeSent(address from, address to, bytes32 guid, uint16 index, bytes message);\n event ComposeDelivered(address from, address to, bytes32 guid, uint16 index);\n event LzComposeAlert(\n address indexed from,\n address indexed to,\n address indexed executor,\n bytes32 guid,\n uint16 index,\n uint256 gas,\n uint256 value,\n bytes message,\n bytes extraData,\n bytes reason\n );\n\n function composeQueue(\n address _from,\n address _to,\n bytes32 _guid,\n uint16 _index\n ) external view returns (bytes32 messageHash);\n\n function sendCompose(address _to, bytes32 _guid, uint16 _index, bytes calldata _message) external;\n\n function lzCompose(\n address _from,\n address _to,\n bytes32 _guid,\n uint16 _index,\n bytes calldata _message,\n bytes calldata _extraData\n ) external payable;\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessagingContext.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\ninterface IMessagingContext {\n function isSendingMessage() external view returns (bool);\n\n function getSendContext() external view returns (uint32 dstEid, address sender);\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.0;\n\nimport { MessagingFee } from \"./ILayerZeroEndpointV2.sol\";\nimport { IMessageLib } from \"./IMessageLib.sol\";\n\nstruct Packet {\n uint64 nonce;\n uint32 srcEid;\n address sender;\n uint32 dstEid;\n bytes32 receiver;\n bytes32 guid;\n bytes message;\n}\n\ninterface ISendLib is IMessageLib {\n function send(\n Packet calldata _packet,\n bytes calldata _options,\n bool _payInLzToken\n ) external returns (MessagingFee memory, bytes memory encodedPacket);\n\n function quote(\n Packet calldata _packet,\n bytes calldata _options,\n bool _payInLzToken\n ) external view returns (MessagingFee memory);\n\n function setTreasury(address _treasury) external;\n\n function withdrawFee(address _to, uint256 _amount) external;\n\n function withdrawLzTokenFee(address _lzToken, address _to, uint256 _amount) external;\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/AddressCast.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nlibrary AddressCast {\n error AddressCast_InvalidSizeForAddress();\n error AddressCast_InvalidAddress();\n\n function toBytes32(bytes calldata _addressBytes) internal pure returns (bytes32 result) {\n if (_addressBytes.length > 32) revert AddressCast_InvalidAddress();\n result = bytes32(_addressBytes);\n unchecked {\n uint256 offset = 32 - _addressBytes.length;\n result = result >> (offset * 8);\n }\n }\n\n function toBytes32(address _address) internal pure returns (bytes32 result) {\n result = bytes32(uint256(uint160(_address)));\n }\n\n function toBytes(bytes32 _addressBytes32, uint256 _size) internal pure returns (bytes memory result) {\n if (_size == 0 || _size > 32) revert AddressCast_InvalidSizeForAddress();\n result = new bytes(_size);\n unchecked {\n uint256 offset = 256 - _size * 8;\n assembly {\n mstore(add(result, 32), shl(offset, _addressBytes32))\n }\n }\n }\n\n function toAddress(bytes32 _addressBytes32) internal pure returns (address result) {\n result = address(uint160(uint256(_addressBytes32)));\n }\n\n function toAddress(bytes calldata _addressBytes) internal pure returns (address result) {\n if (_addressBytes.length != 20) revert AddressCast_InvalidAddress();\n result = address(bytes20(_addressBytes));\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/CalldataBytesLib.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nlibrary CalldataBytesLib {\n function toU8(bytes calldata _bytes, uint256 _start) internal pure returns (uint8) {\n return uint8(_bytes[_start]);\n }\n\n function toU16(bytes calldata _bytes, uint256 _start) internal pure returns (uint16) {\n unchecked {\n uint256 end = _start + 2;\n return uint16(bytes2(_bytes[_start:end]));\n }\n }\n\n function toU32(bytes calldata _bytes, uint256 _start) internal pure returns (uint32) {\n unchecked {\n uint256 end = _start + 4;\n return uint32(bytes4(_bytes[_start:end]));\n }\n }\n\n function toU64(bytes calldata _bytes, uint256 _start) internal pure returns (uint64) {\n unchecked {\n uint256 end = _start + 8;\n return uint64(bytes8(_bytes[_start:end]));\n }\n }\n\n function toU128(bytes calldata _bytes, uint256 _start) internal pure returns (uint128) {\n unchecked {\n uint256 end = _start + 16;\n return uint128(bytes16(_bytes[_start:end]));\n }\n }\n\n function toU256(bytes calldata _bytes, uint256 _start) internal pure returns (uint256) {\n unchecked {\n uint256 end = _start + 32;\n return uint256(bytes32(_bytes[_start:end]));\n }\n }\n\n function toAddr(bytes calldata _bytes, uint256 _start) internal pure returns (address) {\n unchecked {\n uint256 end = _start + 20;\n return address(bytes20(_bytes[_start:end]));\n }\n }\n\n function toB32(bytes calldata _bytes, uint256 _start) internal pure returns (bytes32) {\n unchecked {\n uint256 end = _start + 32;\n return bytes32(_bytes[_start:end]);\n }\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Errors.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nlibrary Errors {\n error LZ_LzTokenUnavailable();\n error LZ_InvalidReceiveLibrary();\n error LZ_InvalidNonce(uint64 nonce);\n error LZ_InvalidArgument();\n error LZ_InvalidExpiry();\n error LZ_InvalidAmount(uint256 required, uint256 supplied);\n error LZ_OnlyRegisteredOrDefaultLib();\n error LZ_OnlyRegisteredLib();\n error LZ_OnlyNonDefaultLib();\n error LZ_Unauthorized();\n error LZ_DefaultSendLibUnavailable();\n error LZ_DefaultReceiveLibUnavailable();\n error LZ_PathNotInitializable();\n error LZ_PathNotVerifiable();\n error LZ_OnlySendLib();\n error LZ_OnlyReceiveLib();\n error LZ_UnsupportedEid();\n error LZ_UnsupportedInterface();\n error LZ_AlreadyRegistered();\n error LZ_SameValue();\n error LZ_InvalidPayloadHash();\n error LZ_PayloadHashNotFound(bytes32 expected, bytes32 actual);\n error LZ_ComposeNotFound(bytes32 expected, bytes32 actual);\n error LZ_ComposeExists();\n error LZ_SendReentrancy();\n error LZ_NotImplemented();\n error LZ_InsufficientFee(\n uint256 requiredNative,\n uint256 suppliedNative,\n uint256 requiredLzToken,\n uint256 suppliedLzToken\n );\n error LZ_ZeroLzTokenFee();\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/GUID.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { AddressCast } from \"./AddressCast.sol\";\n\nlibrary GUID {\n using AddressCast for address;\n\n function generate(\n uint64 _nonce,\n uint32 _srcEid,\n address _sender,\n uint32 _dstEid,\n bytes32 _receiver\n ) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(_nonce, _srcEid, _sender.toBytes32(), _dstEid, _receiver));\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Transfer.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { SafeERC20 } from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nlibrary Transfer {\n using SafeERC20 for IERC20;\n\n address internal constant ADDRESS_ZERO = address(0);\n\n error Transfer_NativeFailed(address _to, uint256 _value);\n error Transfer_ToAddressIsZero();\n\n function native(address _to, uint256 _value) internal {\n if (_to == ADDRESS_ZERO) revert Transfer_ToAddressIsZero();\n (bool success, ) = _to.call{ value: _value }(\"\");\n if (!success) revert Transfer_NativeFailed(_to, _value);\n }\n\n function token(address _token, address _to, uint256 _value) internal {\n if (_to == ADDRESS_ZERO) revert Transfer_ToAddressIsZero();\n IERC20(_token).safeTransfer(_to, _value);\n }\n\n function nativeOrToken(address _token, address _to, uint256 _value) internal {\n if (_token == ADDRESS_ZERO) {\n native(_to, _value);\n } else {\n token(_token, _to, _value);\n }\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/BitMaps.sol": { + "content": "// SPDX-License-Identifier: MIT\n\n// modified from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/structs/BitMaps.sol\npragma solidity ^0.8.20;\n\ntype BitMap256 is uint256;\n\nusing BitMaps for BitMap256 global;\n\nlibrary BitMaps {\n /**\n * @dev Returns whether the bit at `index` is set.\n */\n function get(BitMap256 bitmap, uint8 index) internal pure returns (bool) {\n uint256 mask = 1 << index;\n return BitMap256.unwrap(bitmap) & mask != 0;\n }\n\n /**\n * @dev Sets the bit at `index`.\n */\n function set(BitMap256 bitmap, uint8 index) internal pure returns (BitMap256) {\n uint256 mask = 1 << index;\n return BitMap256.wrap(BitMap256.unwrap(bitmap) | mask);\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/ExecutorOptions.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { CalldataBytesLib } from \"../../libs/CalldataBytesLib.sol\";\n\nlibrary ExecutorOptions {\n using CalldataBytesLib for bytes;\n\n uint8 internal constant WORKER_ID = 1;\n\n uint8 internal constant OPTION_TYPE_LZRECEIVE = 1;\n uint8 internal constant OPTION_TYPE_NATIVE_DROP = 2;\n uint8 internal constant OPTION_TYPE_LZCOMPOSE = 3;\n uint8 internal constant OPTION_TYPE_ORDERED_EXECUTION = 4;\n\n error Executor_InvalidLzReceiveOption();\n error Executor_InvalidNativeDropOption();\n error Executor_InvalidLzComposeOption();\n\n /// @dev decode the next executor option from the options starting from the specified cursor\n /// @param _options [executor_id][executor_option][executor_id][executor_option]...\n /// executor_option = [option_size][option_type][option]\n /// option_size = len(option_type) + len(option)\n /// executor_id: uint8, option_size: uint16, option_type: uint8, option: bytes\n /// @param _cursor the cursor to start decoding from\n /// @return optionType the type of the option\n /// @return option the option of the executor\n /// @return cursor the cursor to start decoding the next executor option\n function nextExecutorOption(\n bytes calldata _options,\n uint256 _cursor\n ) internal pure returns (uint8 optionType, bytes calldata option, uint256 cursor) {\n unchecked {\n // skip worker id\n cursor = _cursor + 1;\n\n // read option size\n uint16 size = _options.toU16(cursor);\n cursor += 2;\n\n // read option type\n optionType = _options.toU8(cursor);\n\n // startCursor and endCursor are used to slice the option from _options\n uint256 startCursor = cursor + 1; // skip option type\n uint256 endCursor = cursor + size;\n option = _options[startCursor:endCursor];\n cursor += size;\n }\n }\n\n function decodeLzReceiveOption(bytes calldata _option) internal pure returns (uint128 gas, uint128 value) {\n if (_option.length != 16 && _option.length != 32) revert Executor_InvalidLzReceiveOption();\n gas = _option.toU128(0);\n value = _option.length == 32 ? _option.toU128(16) : 0;\n }\n\n function decodeNativeDropOption(bytes calldata _option) internal pure returns (uint128 amount, bytes32 receiver) {\n if (_option.length != 48) revert Executor_InvalidNativeDropOption();\n amount = _option.toU128(0);\n receiver = _option.toB32(16);\n }\n\n function decodeLzComposeOption(\n bytes calldata _option\n ) internal pure returns (uint16 index, uint128 gas, uint128 value) {\n if (_option.length != 18 && _option.length != 34) revert Executor_InvalidLzComposeOption();\n index = _option.toU16(0);\n gas = _option.toU128(2);\n value = _option.length == 34 ? _option.toU128(18) : 0;\n }\n\n function encodeLzReceiveOption(uint128 _gas, uint128 _value) internal pure returns (bytes memory) {\n return _value == 0 ? abi.encodePacked(_gas) : abi.encodePacked(_gas, _value);\n }\n\n function encodeNativeDropOption(uint128 _amount, bytes32 _receiver) internal pure returns (bytes memory) {\n return abi.encodePacked(_amount, _receiver);\n }\n\n function encodeLzComposeOption(uint16 _index, uint128 _gas, uint128 _value) internal pure returns (bytes memory) {\n return _value == 0 ? abi.encodePacked(_index, _gas) : abi.encodePacked(_index, _gas, _value);\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { Packet } from \"../../interfaces/ISendLib.sol\";\nimport { AddressCast } from \"../../libs/AddressCast.sol\";\n\nlibrary PacketV1Codec {\n using AddressCast for address;\n using AddressCast for bytes32;\n\n uint8 internal constant PACKET_VERSION = 1;\n\n // header (version + nonce + path)\n // version\n uint256 private constant PACKET_VERSION_OFFSET = 0;\n // nonce\n uint256 private constant NONCE_OFFSET = 1;\n // path\n uint256 private constant SRC_EID_OFFSET = 9;\n uint256 private constant SENDER_OFFSET = 13;\n uint256 private constant DST_EID_OFFSET = 45;\n uint256 private constant RECEIVER_OFFSET = 49;\n // payload (guid + message)\n uint256 private constant GUID_OFFSET = 81; // keccak256(nonce + path)\n uint256 private constant MESSAGE_OFFSET = 113;\n\n function encode(Packet memory _packet) internal pure returns (bytes memory encodedPacket) {\n encodedPacket = abi.encodePacked(\n PACKET_VERSION,\n _packet.nonce,\n _packet.srcEid,\n _packet.sender.toBytes32(),\n _packet.dstEid,\n _packet.receiver,\n _packet.guid,\n _packet.message\n );\n }\n\n function encodePacketHeader(Packet memory _packet) internal pure returns (bytes memory) {\n return\n abi.encodePacked(\n PACKET_VERSION,\n _packet.nonce,\n _packet.srcEid,\n _packet.sender.toBytes32(),\n _packet.dstEid,\n _packet.receiver\n );\n }\n\n function encodePayload(Packet memory _packet) internal pure returns (bytes memory) {\n return abi.encodePacked(_packet.guid, _packet.message);\n }\n\n function header(bytes calldata _packet) internal pure returns (bytes calldata) {\n return _packet[0:GUID_OFFSET];\n }\n\n function version(bytes calldata _packet) internal pure returns (uint8) {\n return uint8(bytes1(_packet[PACKET_VERSION_OFFSET:NONCE_OFFSET]));\n }\n\n function nonce(bytes calldata _packet) internal pure returns (uint64) {\n return uint64(bytes8(_packet[NONCE_OFFSET:SRC_EID_OFFSET]));\n }\n\n function srcEid(bytes calldata _packet) internal pure returns (uint32) {\n return uint32(bytes4(_packet[SRC_EID_OFFSET:SENDER_OFFSET]));\n }\n\n function sender(bytes calldata _packet) internal pure returns (bytes32) {\n return bytes32(_packet[SENDER_OFFSET:DST_EID_OFFSET]);\n }\n\n function senderAddressB20(bytes calldata _packet) internal pure returns (address) {\n return sender(_packet).toAddress();\n }\n\n function dstEid(bytes calldata _packet) internal pure returns (uint32) {\n return uint32(bytes4(_packet[DST_EID_OFFSET:RECEIVER_OFFSET]));\n }\n\n function receiver(bytes calldata _packet) internal pure returns (bytes32) {\n return bytes32(_packet[RECEIVER_OFFSET:GUID_OFFSET]);\n }\n\n function receiverB20(bytes calldata _packet) internal pure returns (address) {\n return receiver(_packet).toAddress();\n }\n\n function guid(bytes calldata _packet) internal pure returns (bytes32) {\n return bytes32(_packet[GUID_OFFSET:MESSAGE_OFFSET]);\n }\n\n function message(bytes calldata _packet) internal pure returns (bytes calldata) {\n return bytes(_packet[MESSAGE_OFFSET:]);\n }\n\n function payload(bytes calldata _packet) internal pure returns (bytes calldata) {\n return bytes(_packet[GUID_OFFSET:]);\n }\n\n function payloadHash(bytes calldata _packet) internal pure returns (bytes32) {\n return keccak256(payload(_packet));\n }\n}\n" + }, + "@layerzerolabs/lz-evm-protocol-v2/contracts/MessagingContext.sol": { + "content": "// SPDX-License-Identifier: LZBL-1.2\n\npragma solidity ^0.8.20;\n\nimport { IMessagingContext } from \"./interfaces/IMessagingContext.sol\";\nimport { Errors } from \"./libs/Errors.sol\";\n\n/// this contract acts as a non-reentrancy guard and a source of messaging context\n/// the context includes the remote eid and the sender address\n/// it separates the send and receive context to allow messaging receipts (send back on receive())\nabstract contract MessagingContext is IMessagingContext {\n uint256 private constant NOT_ENTERED = 1;\n uint256 private _sendContext = NOT_ENTERED;\n\n /// @dev the sendContext is set to 8 bytes 0s + 4 bytes eid + 20 bytes sender\n modifier sendContext(uint32 _dstEid, address _sender) {\n if (_sendContext != NOT_ENTERED) revert Errors.LZ_SendReentrancy();\n _sendContext = (uint256(_dstEid) << 160) | uint160(_sender);\n _;\n _sendContext = NOT_ENTERED;\n }\n\n /// @dev returns true if sending message\n function isSendingMessage() public view returns (bool) {\n return _sendContext != NOT_ENTERED;\n }\n\n /// @dev returns (eid, sender) if sending message, (0, 0) otherwise\n function getSendContext() external view returns (uint32, address) {\n return isSendingMessage() ? _getSendContext(_sendContext) : (0, address(0));\n }\n\n function _getSendContext(uint256 _context) internal pure returns (uint32, address) {\n return (uint32(_context >> 160), address(uint160(_context)));\n }\n}\n" + }, + "@layerzerolabs/test-devtools-evm-hardhat/contracts/mocks/EndpointV2Mock.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.22;\n\nimport { SafeCast } from \"@openzeppelin/contracts/utils/math/SafeCast.sol\";\nimport { ILayerZeroEndpointV2, MessagingParams, MessagingReceipt, MessagingFee, Origin } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport { ExecutionState } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/EndpointV2ViewUpgradeable.sol\";\nimport { ILayerZeroReceiver } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol\";\nimport { SetConfigParam } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/IMessageLibManager.sol\";\nimport { MessagingContext } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/MessagingContext.sol\";\nimport { Packet } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ISendLib.sol\";\nimport { OFTMsgCodec } from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/libs/OFTMsgCodec.sol\";\nimport { Origin } from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppReceiver.sol\";\nimport { Errors } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/Errors.sol\";\nimport { GUID } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/GUID.sol\";\nimport { ExecutorOptions } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/ExecutorOptions.sol\";\nimport { PacketV1Codec } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol\";\nimport { WorkerOptions } from \"@layerzerolabs/lz-evm-messagelib-v2/contracts/SendLibBase.sol\";\nimport { IExecutorFeeLib } from \"@layerzerolabs/lz-evm-messagelib-v2/contracts/interfaces/IExecutorFeeLib.sol\";\nimport { DVNOptions } from \"@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/libs/DVNOptions.sol\";\nimport { UlnOptions } from \"@layerzerolabs/lz-evm-messagelib-v2/contracts/uln/libs/UlnOptions.sol\";\nimport { CalldataBytesLib } from \"@layerzerolabs/lz-evm-protocol-v2/contracts/libs/CalldataBytesLib.sol\";\n\ncontract EndpointV2Mock is ILayerZeroEndpointV2, MessagingContext {\n using ExecutorOptions for bytes;\n using OFTMsgCodec for bytes;\n using OFTMsgCodec for bytes32;\n using OFTMsgCodec for address;\n using SafeCast for uint256;\n using CalldataBytesLib for bytes;\n\n bytes32 public constant EMPTY_PAYLOAD_HASH = bytes32(0);\n\n uint32 public immutable eid;\n mapping(address => address) public lzEndpointLookup;\n\n mapping(address receiver => mapping(uint32 srcEid => mapping(bytes32 sender => uint64 nonce)))\n public lazyInboundNonce;\n mapping(address receiver => mapping(uint32 srcEid => mapping(bytes32 sender => mapping(uint64 inboundNonce => bytes32 payloadHash))))\n public inboundPayloadHash;\n mapping(address sender => mapping(uint32 dstEid => mapping(bytes32 receiver => uint64 nonce))) public outboundNonce;\n\n RelayerFeeConfig public relayerFeeConfig;\n ProtocolFeeConfig protocolFeeConfig;\n uint256 public verifierFee;\n\n struct ProtocolFeeConfig {\n uint256 zroFee;\n uint256 nativeBP;\n }\n\n struct RelayerFeeConfig {\n uint128 dstPriceRatio; // 10^10\n uint128 dstGasPriceInWei;\n uint128 dstNativeAmtCap;\n uint64 baseGas;\n uint64 gasPerByte;\n }\n\n uint8 internal constant _NOT_ENTERED = 1;\n uint8 internal constant _ENTERED = 2;\n uint8 internal _receive_entered_state = 1;\n modifier receiveNonReentrant() {\n require(_receive_entered_state == _NOT_ENTERED, \"LayerZeroMock: no receive reentrancy\");\n _receive_entered_state = _ENTERED;\n _;\n _receive_entered_state = _NOT_ENTERED;\n }\n\n event ValueTransferFailed(address indexed to, uint256 indexed quantity);\n\n constructor(uint32 _eid) {\n eid = _eid;\n // init config\n relayerFeeConfig = RelayerFeeConfig({\n dstPriceRatio: 1e10, // 1:1, same chain, same native coin\n dstGasPriceInWei: 1e10,\n dstNativeAmtCap: 1e19,\n baseGas: 100,\n gasPerByte: 1\n });\n protocolFeeConfig = ProtocolFeeConfig({ zroFee: 1e18, nativeBP: 1000 }); // BP 0.1\n verifierFee = 1e16;\n }\n\n function send(\n MessagingParams calldata _params,\n address _refundAddress\n ) public payable sendContext(_params.dstEid, msg.sender) returns (MessagingReceipt memory receipt) {\n if (_params.payInLzToken) revert Errors.LZ_LzTokenUnavailable();\n\n address lzEndpoint = lzEndpointLookup[_params.receiver.bytes32ToAddress()];\n require(lzEndpoint != address(0), \"LayerZeroMock: destination LayerZero Endpoint not found\");\n\n // get the correct outbound nonce\n uint64 latestNonce = _outbound(msg.sender, _params.dstEid, _params.receiver);\n\n Packet memory packet = Packet({\n nonce: latestNonce,\n srcEid: eid,\n sender: msg.sender,\n dstEid: _params.dstEid,\n receiver: _params.receiver,\n guid: GUID.generate(latestNonce, eid, msg.sender, _params.dstEid, _params.receiver),\n message: _params.message\n });\n receipt.guid = packet.guid;\n receipt.nonce = packet.nonce;\n receipt.fee = _quote(_params, msg.sender);\n require(msg.value >= receipt.fee.nativeFee, \"LayerZeroMock: not enough native for fees\");\n\n // refund if they send too much\n uint256 amount = msg.value - receipt.fee.nativeFee;\n if (amount > 0) {\n (bool success, ) = _refundAddress.call{ value: amount }(\"\");\n require(success, \"LayerZeroMock: failed to refund\");\n }\n\n uint256 totalGas;\n uint256 dstAmount;\n (totalGas, dstAmount) = executeNativeAirDropAndReturnLzGas(_params.options);\n\n // TODO fix\n // composed calls with correct gas\n\n Origin memory origin = Origin({\n srcEid: packet.srcEid,\n sender: packet.sender.addressToBytes32(),\n nonce: packet.nonce\n });\n\n bytes memory payload = PacketV1Codec.encodePayload(packet);\n bytes32 payloadHash = keccak256(payload);\n\n EndpointV2Mock(lzEndpoint).receivePayload{ value: dstAmount }(\n origin,\n packet.receiver.bytes32ToAddress(),\n payloadHash,\n packet.message,\n totalGas,\n dstAmount,\n packet.guid\n );\n }\n\n function receivePayload(\n Origin calldata _origin,\n address _receiver,\n bytes32 _payloadHash,\n bytes calldata _message,\n uint256 _gas,\n uint256 _msgValue,\n bytes32 _guid\n ) external payable receiveNonReentrant {\n inboundPayloadHash[_receiver][_origin.srcEid][_origin.sender][_origin.nonce] = _payloadHash;\n if (_msgValue > 0) {\n try\n ILayerZeroReceiver(_receiver).lzReceive{ value: _msgValue, gas: _gas }(\n _origin,\n _guid,\n _message,\n address(0),\n \"\"\n )\n {} catch (bytes memory /*reason*/) {}\n } else {\n try\n ILayerZeroReceiver(_receiver).lzReceive{ gas: _gas }(_origin, _guid, _message, address(0), \"\")\n {} catch (bytes memory /*reason*/) {}\n }\n }\n\n function getExecutorFee(uint256 _payloadSize, bytes calldata _options) public view returns (uint256) {\n uint256 nativeFee;\n // 2) get Executor fee\n // a) decodeLzReceiveOption\n // b) decodeNativeDropOption\n // c) decodeLzComposeOption\n (uint256 totalDstAmount, uint256 totalGas) = _decodeExecutorOptions(_options);\n uint256 remoteGasTotal = relayerFeeConfig.dstGasPriceInWei * (relayerFeeConfig.baseGas + totalGas);\n nativeFee += totalDstAmount + remoteGasTotal;\n\n // tokenConversionRate = dstPrice / localPrice\n // basePrice = totalRemoteToken * tokenConversionRate\n uint256 basePrice = (nativeFee * relayerFeeConfig.dstPriceRatio) / 10 ** 10;\n\n // pricePerByte = (dstGasPriceInWei * gasPerBytes) * tokenConversionRate\n uint256 pricePerByte = ((relayerFeeConfig.dstGasPriceInWei *\n relayerFeeConfig.gasPerByte *\n relayerFeeConfig.dstPriceRatio) / 10 ** 10) * _payloadSize;\n\n return basePrice + pricePerByte;\n }\n\n function _quote(\n MessagingParams calldata _params,\n address /*_sender*/\n ) internal view returns (MessagingFee memory messagingFee) {\n (bytes memory executorOptions, ) = splitOptions(_params.options);\n\n // 2) get Executor fee\n uint256 executorFee = this.getExecutorFee(_params.message.length, executorOptions);\n\n // 1) get Verifier fee\n // 3) get Treasury fee\n uint256 treasuryAndVerifierFee = _getTreasuryAndVerifierFees(executorFee, verifierFee);\n\n messagingFee.lzTokenFee = 0;\n messagingFee.nativeFee = executorFee + treasuryAndVerifierFee;\n }\n\n function _getTreasuryAndVerifierFees(uint256 _executorFee, uint256 _verifierFee) internal view returns (uint256) {\n return ((_executorFee + _verifierFee) * protocolFeeConfig.nativeBP) / 10000;\n }\n\n function _outbound(address _sender, uint32 _dstEid, bytes32 _receiver) internal returns (uint64 nonce) {\n unchecked {\n nonce = ++outboundNonce[_sender][_dstEid][_receiver];\n }\n }\n\n function setDestLzEndpoint(address destAddr, address lzEndpointAddr) external {\n lzEndpointLookup[destAddr] = lzEndpointAddr;\n }\n\n function _decodeExecutorOptions(\n bytes calldata _options\n ) internal view returns (uint256 dstAmount, uint256 totalGas) {\n if (_options.length == 0) {\n revert IExecutorFeeLib.Executor_NoOptions();\n }\n\n uint256 cursor = 0;\n totalGas = relayerFeeConfig.baseGas;\n\n while (cursor < _options.length) {\n (uint8 optionType, bytes calldata option, uint256 newCursor) = _options.nextExecutorOption(cursor);\n cursor = newCursor;\n\n if (optionType == ExecutorOptions.OPTION_TYPE_LZRECEIVE) {\n (uint128 gas, uint128 value) = ExecutorOptions.decodeLzReceiveOption(option);\n dstAmount += value;\n totalGas += gas;\n } else if (optionType == ExecutorOptions.OPTION_TYPE_NATIVE_DROP) {\n (uint128 nativeDropAmount, ) = ExecutorOptions.decodeNativeDropOption(option);\n dstAmount += nativeDropAmount;\n } else if (optionType == ExecutorOptions.OPTION_TYPE_LZCOMPOSE) {\n (, uint128 gas, uint128 value) = ExecutorOptions.decodeLzComposeOption(option);\n dstAmount += value;\n totalGas += gas;\n } else {\n revert IExecutorFeeLib.Executor_UnsupportedOptionType(optionType);\n }\n }\n\n if (cursor != _options.length) revert IExecutorFeeLib.Executor_InvalidExecutorOptions(cursor);\n if (dstAmount > relayerFeeConfig.dstNativeAmtCap)\n revert IExecutorFeeLib.Executor_NativeAmountExceedsCap(dstAmount, relayerFeeConfig.dstNativeAmtCap);\n }\n\n function splitOptions(bytes calldata _options) internal pure returns (bytes memory, WorkerOptions[] memory) {\n (bytes memory executorOpts, bytes memory dvnOpts) = decode(_options);\n\n if (dvnOpts.length == 0) {\n return (executorOpts, new WorkerOptions[](0));\n }\n\n WorkerOptions[] memory workerOpts = new WorkerOptions[](1);\n workerOpts[0] = WorkerOptions(DVNOptions.WORKER_ID, dvnOpts);\n return (executorOpts, workerOpts);\n }\n\n function decode(\n bytes calldata _options\n ) internal pure returns (bytes memory executorOptions, bytes memory dvnOptions) {\n // at least 2 bytes for the option type, but can have no options\n if (_options.length < 2) revert UlnOptions.LZ_ULN_InvalidWorkerOptions(0);\n\n uint16 optionsType = uint16(bytes2(_options[0:2]));\n uint256 cursor = 2;\n\n // type3 options: [worker_option][worker_option]...\n // worker_option: [worker_id][option_size][option]\n // worker_id: uint8, option_size: uint16, option: bytes\n if (optionsType == UlnOptions.TYPE_3) {\n unchecked {\n uint256 start = cursor;\n uint8 lastWorkerId; // worker_id starts from 1, so 0 is an invalid worker_id\n\n // heuristic: we assume that the options are mostly EXECUTOR options only\n // checking the workerID can reduce gas usage for most cases\n while (cursor < _options.length) {\n uint8 workerId = uint8(bytes1(_options[cursor:cursor + 1]));\n if (workerId == 0) revert UlnOptions.LZ_ULN_InvalidWorkerId(0);\n\n // workerId must equal to the lastWorkerId for the first option\n // so it is always skipped in the first option\n // this operation slices out options whenever the scan finds a different workerId\n if (lastWorkerId == 0) {\n lastWorkerId = workerId;\n } else if (workerId != lastWorkerId) {\n bytes calldata op = _options[start:cursor]; // slice out the last worker's options\n (executorOptions, dvnOptions) = _insertWorkerOptions(\n executorOptions,\n dvnOptions,\n lastWorkerId,\n op\n );\n\n // reset the start cursor and lastWorkerId\n start = cursor;\n lastWorkerId = workerId;\n }\n\n ++cursor; // for workerId\n\n uint16 size = uint16(bytes2(_options[cursor:cursor + 2]));\n if (size == 0) revert UlnOptions.LZ_ULN_InvalidWorkerOptions(cursor);\n cursor += size + 2;\n }\n\n // the options length must be the same as the cursor at the end\n if (cursor != _options.length) revert UlnOptions.LZ_ULN_InvalidWorkerOptions(cursor);\n\n // if we have reached the end of the options and the options are not empty\n // we need to process the last worker's options\n if (_options.length > 2) {\n bytes calldata op = _options[start:cursor];\n (executorOptions, dvnOptions) = _insertWorkerOptions(executorOptions, dvnOptions, lastWorkerId, op);\n }\n }\n } else {\n executorOptions = decodeLegacyOptions(optionsType, _options);\n }\n }\n\n function _insertWorkerOptions(\n bytes memory _executorOptions,\n bytes memory _dvnOptions,\n uint8 _workerId,\n bytes calldata _newOptions\n ) private pure returns (bytes memory, bytes memory) {\n if (_workerId == ExecutorOptions.WORKER_ID) {\n _executorOptions = _executorOptions.length == 0\n ? _newOptions\n : abi.encodePacked(_executorOptions, _newOptions);\n } else if (_workerId == DVNOptions.WORKER_ID) {\n _dvnOptions = _dvnOptions.length == 0 ? _newOptions : abi.encodePacked(_dvnOptions, _newOptions);\n } else {\n revert UlnOptions.LZ_ULN_InvalidWorkerId(_workerId);\n }\n return (_executorOptions, _dvnOptions);\n }\n\n function decodeLegacyOptions(\n uint16 _optionType,\n bytes calldata _options\n ) internal pure returns (bytes memory executorOptions) {\n if (_optionType == UlnOptions.TYPE_1) {\n if (_options.length != 34) revert UlnOptions.LZ_ULN_InvalidLegacyType1Option();\n\n // execution gas\n uint128 executionGas = uint256(bytes32(_options[2:2 + 32])).toUint128();\n\n // dont use the encode function in the ExecutorOptions lib for saving gas by calling abi.encodePacked once\n // the result is a lzReceive option: [executor_id][option_size][option_type][execution_gas]\n // option_type: uint8, execution_gas: uint128\n // option_size = len(option_type) + len(execution_gas) = 1 + 16 = 17\n executorOptions = abi.encodePacked(\n ExecutorOptions.WORKER_ID,\n uint16(17), // 16 + 1, 16 for option_length, + 1 for option_type\n ExecutorOptions.OPTION_TYPE_LZRECEIVE,\n executionGas\n );\n } else if (_optionType == UlnOptions.TYPE_2) {\n // receiver size <= 32\n if (_options.length <= 66 || _options.length > 98) revert UlnOptions.LZ_ULN_InvalidLegacyType2Option();\n\n // execution gas\n uint128 executionGas = uint256(bytes32(_options[2:2 + 32])).toUint128();\n\n // nativeDrop (amount + receiver)\n uint128 amount = uint256(bytes32(_options[34:34 + 32])).toUint128(); // offset 2 + 32\n bytes32 receiver;\n unchecked {\n uint256 receiverLen = _options.length - 66; // offset 2 + 32 + 32\n receiver = bytes32(_options[66:]);\n receiver = receiver >> (8 * (32 - receiverLen)); // padding 0 to the left\n }\n\n // dont use the encode function in the ExecutorOptions lib for saving gas by calling abi.encodePacked once\n // the result has one lzReceive option and one nativeDrop option:\n // [executor_id][lzReceive_option_size][option_type][execution_gas] +\n // [executor_id][nativeDrop_option_size][option_type][nativeDrop_amount][receiver]\n // option_type: uint8, execution_gas: uint128, nativeDrop_amount: uint128, receiver: bytes32\n // lzReceive_option_size = len(option_type) + len(execution_gas) = 1 + 16 = 17\n // nativeDrop_option_size = len(option_type) + len(nativeDrop_amount) + len(receiver) = 1 + 16 + 32 = 49\n executorOptions = abi.encodePacked(\n ExecutorOptions.WORKER_ID,\n uint16(17), // 16 + 1, 16 for option_length, + 1 for option_type\n ExecutorOptions.OPTION_TYPE_LZRECEIVE,\n executionGas,\n ExecutorOptions.WORKER_ID,\n uint16(49), // 48 + 1, 32 + 16 for option_length, + 1 for option_type\n ExecutorOptions.OPTION_TYPE_NATIVE_DROP,\n amount,\n receiver\n );\n } else {\n revert UlnOptions.LZ_ULN_UnsupportedOptionType(_optionType);\n }\n }\n\n // NOT IMPLEMENTING\n function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external {}\n\n function clear(address _oapp, Origin calldata _origin, bytes32 _guid, bytes calldata _message) external {}\n\n mapping(address from => mapping(address to => mapping(bytes32 guid => mapping(uint16 index => bytes32 messageHash))))\n public composeQueue;\n\n function defaultReceiveLibrary(uint32 /*_eid*/) external pure returns (address) {\n return address(0);\n }\n\n function defaultReceiveLibraryTimeout(uint32 /*_eid*/) external pure returns (address lib, uint256 expiry) {\n return (address(0), 0);\n }\n\n function defaultSendLibrary(uint32 /*_eid*/) external pure returns (address) {\n return address(0);\n }\n\n function executable(Origin calldata /*_origin*/, address /*receiver*/) external pure returns (ExecutionState) {\n return ExecutionState.NotExecutable;\n }\n\n function getConfig(\n address /*_oapp*/,\n address /*_lib*/,\n uint32 /*_eid*/,\n uint32 /*_configType*/\n ) external pure returns (bytes memory config) {\n return bytes(\"0x\");\n }\n\n function getReceiveLibrary(\n address /*receiver*/,\n uint32 /*_eid*/\n ) external pure returns (address lib, bool isDefault) {\n return (address(0), false);\n }\n\n function getRegisteredLibraries() external pure returns (address[] memory) {\n address[] memory addresses = new address[](1);\n addresses[0] = address(0);\n return addresses;\n }\n\n function getSendLibrary(address /*_sender*/, uint32 /*_eid*/) external pure returns (address lib) {\n return address(0);\n }\n\n function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64) {\n return lazyInboundNonce[_receiver][_srcEid][_sender];\n }\n\n function isDefaultSendLibrary(address /*_sender*/, uint32 /*_eid*/) external pure returns (bool) {\n return false;\n }\n\n function isRegisteredLibrary(address /*_lib*/) external pure returns (bool) {\n return false;\n }\n\n function isSupportedEid(uint32 /*_eid*/) external pure returns (bool) {\n return false;\n }\n\n function lzCompose(\n address /*_from,*/,\n address /*_to,*/,\n bytes32 /*_guid,*/,\n uint16 /*_index,*/,\n bytes calldata /*_message,*/,\n bytes calldata /*_extraData*/\n ) external payable {}\n\n function lzReceive(\n Origin calldata /*_origin,*/,\n address /*_receiver,*/,\n bytes32 /*_guid,*/,\n bytes calldata /*_message,*/,\n bytes calldata /*_extraData*/\n ) external payable {}\n\n function lzToken() external pure returns (address) {\n return address(0);\n }\n\n function nativeToken() external pure returns (address) {\n return address(0);\n }\n\n function nextGuid(\n address /*_sender,*/,\n uint32 /*_dstEid,*/,\n bytes32 /*_receiver*/\n ) external pure returns (bytes32) {\n return 0;\n }\n\n function nilify(\n address /*_oapp,*/,\n uint32 /*_srcEid,*/,\n bytes32 /*_sender,*/,\n uint64 /*_nonce,*/,\n bytes32 /*_payloadHash*/\n ) external {}\n\n function quote(MessagingParams calldata _params, address _sender) external view returns (MessagingFee memory) {\n return _quote(_params, _sender);\n }\n\n mapping(address receiver => mapping(uint32 srcEid => Timeout)) public receiveLibraryTimeout;\n\n function registerLibrary(address /*_lib*/) public {}\n\n function sendCompose(address, /*_to*/ bytes32, /*_guid*/ uint16, /*_index*/ bytes calldata /*_message*/) external {}\n\n function setConfig(address, /*_oapp*/ address, /*_lib*/ SetConfigParam[] calldata /*_params*/) external {}\n\n function setDefaultReceiveLibrary(uint32 /*_eid*/, address /*_newLib*/, uint256 /*_gracePeriod*/) external {}\n\n function setDefaultReceiveLibraryTimeout(uint32 /*_eid*/, address /*_lib*/, uint256 /*_expiry*/) external {}\n\n function setDefaultSendLibrary(uint32 /*_eid*/, address /*_newLib*/) external {}\n\n function setDelegate(address /*_delegate*/) external {}\n\n function setLzToken(address /*_lzToken*/) external {}\n\n function setReceiveLibrary(\n address,\n /*_oapp*/ uint32,\n /*_eid*/ address,\n /*_newLib*/ uint256 /*_gracePeriod*/\n ) external {}\n\n function setReceiveLibraryTimeout(\n address,\n /*_oapp*/ uint32,\n /*_eid*/ address,\n /*_lib*/ uint256 /*_gracePeriod*/\n ) external {}\n\n function setSendLibrary(address, /*_oapp*/ uint32, /*_eid*/ address /*_newLib*/) external {}\n\n function skip(address, /*_oapp*/ uint32, /*_srcEid*/ bytes32, /*_sender*/ uint64 /*_nonce*/) external {}\n\n function verifiable(\n Origin calldata /*_origin*/,\n address /*_receiver*/,\n address /*_receiveLib*/,\n bytes32 /*_payloadHash*/\n ) external pure returns (bool) {\n return false;\n }\n\n function verify(Origin calldata /*origin*/, address /*_receiver*/, bytes32 /*_payloadHash*/) external {}\n\n // Helper Functions\n function executeNativeAirDropAndReturnLzGas(\n bytes calldata _options\n ) public returns (uint256 totalGas, uint256 dstAmount) {\n (bytes memory executorOpts, ) = decode(_options);\n return this._executeNativeAirDropAndReturnLzGas(executorOpts);\n }\n\n function _executeNativeAirDropAndReturnLzGas(\n bytes calldata _options\n ) public returns (uint256 totalGas, uint256 dstAmount) {\n if (_options.length == 0) {\n revert IExecutorFeeLib.Executor_NoOptions();\n }\n\n uint256 cursor = 0;\n while (cursor < _options.length) {\n (uint8 optionType, bytes calldata option, uint256 newCursor) = _options.nextExecutorOption(cursor);\n cursor = newCursor;\n\n if (optionType == ExecutorOptions.OPTION_TYPE_LZRECEIVE) {\n (uint128 gas, uint128 value) = ExecutorOptions.decodeLzReceiveOption(option);\n totalGas += gas;\n dstAmount += value;\n } else if (optionType == ExecutorOptions.OPTION_TYPE_NATIVE_DROP) {\n (uint128 nativeDropAmount, bytes32 receiver) = ExecutorOptions.decodeNativeDropOption(option);\n (bool success, ) = receiver.bytes32ToAddress().call{ value: nativeDropAmount }(\"\");\n if (!success) {\n emit ValueTransferFailed(receiver.bytes32ToAddress(), nativeDropAmount);\n }\n } else {\n revert IExecutorFeeLib.Executor_UnsupportedOptionType(optionType);\n }\n }\n\n if (cursor != _options.length) revert IExecutorFeeLib.Executor_InvalidExecutorOptions(cursor);\n }\n\n function _initializable(\n Origin calldata _origin,\n address _receiver,\n uint64 _lazyInboundNonce\n ) internal view returns (bool) {\n return\n _lazyInboundNonce > 0 || // allowInitializePath already checked\n ILayerZeroReceiver(_receiver).allowInitializePath(_origin);\n }\n\n /// @dev bytes(0) payloadHash can never be submitted\n function _verifiable(\n Origin calldata _origin,\n address _receiver,\n uint64 _lazyInboundNonce\n ) internal view returns (bool) {\n return\n _origin.nonce > _lazyInboundNonce || // either initializing an empty slot or reverifying\n inboundPayloadHash[_receiver][_origin.srcEid][_origin.sender][_origin.nonce] != EMPTY_PAYLOAD_HASH; // only allow reverifying if it hasn't been executed\n }\n\n // ========================= VIEW FUNCTIONS FOR OFFCHAIN ONLY =========================\n // Not involved in any state transition function.\n // ====================================================================================\n function initializable(Origin calldata _origin, address _receiver) external view returns (bool) {\n return _initializable(_origin, _receiver, lazyInboundNonce[_receiver][_origin.srcEid][_origin.sender]);\n }\n\n function verifiable(Origin calldata _origin, address _receiver) external view returns (bool) {\n return _verifiable(_origin, _receiver, lazyInboundNonce[_receiver][_origin.srcEid][_origin.sender]);\n }\n\n /// @dev called when the endpoint checks if the msgLib attempting to verify the msg is the configured msgLib of the Oapp\n /// @dev this check provides the ability for Oapp to lock in a trusted msgLib\n /// @dev it will fist check if the msgLib is the currently configured one. then check if the msgLib is the one in grace period of msgLib versioning upgrade\n function isValidReceiveLibrary(\n address _receiver,\n uint32 _srcEid,\n address _actualReceiveLib\n ) public view returns (bool) {\n return true;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Storage of the initializable contract.\n *\n * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n * when using with upgradeable contracts.\n *\n * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n */\n struct InitializableStorage {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n uint64 _initialized;\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool _initializing;\n }\n\n // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n /**\n * @dev The contract is already initialized.\n */\n error InvalidInitialization();\n\n /**\n * @dev The contract is not initializing.\n */\n error NotInitializing();\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint64 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n * production.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n // solhint-disable-next-line var-name-mixedcase\n InitializableStorage storage $ = _getInitializableStorage();\n\n // Cache values to avoid duplicated sloads\n bool isTopLevelCall = !$._initializing;\n uint64 initialized = $._initialized;\n\n // Allowed calls:\n // - initialSetup: the contract is not in the initializing state and no previous version was\n // initialized\n // - construction: the contract is initialized at version 1 (no reininitialization) and the\n // current contract is just being deployed\n bool initialSetup = initialized == 0 && isTopLevelCall;\n bool construction = initialized == 1 && address(this).code.length == 0;\n\n if (!initialSetup && !construction) {\n revert InvalidInitialization();\n }\n $._initialized = 1;\n if (isTopLevelCall) {\n $._initializing = true;\n }\n _;\n if (isTopLevelCall) {\n $._initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint64 version) {\n // solhint-disable-next-line var-name-mixedcase\n InitializableStorage storage $ = _getInitializableStorage();\n\n if ($._initializing || $._initialized >= version) {\n revert InvalidInitialization();\n }\n $._initialized = version;\n $._initializing = true;\n _;\n $._initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n _checkInitializing();\n _;\n }\n\n /**\n * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n */\n function _checkInitializing() internal view virtual {\n if (!_isInitializing()) {\n revert NotInitializing();\n }\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n // solhint-disable-next-line var-name-mixedcase\n InitializableStorage storage $ = _getInitializableStorage();\n\n if ($._initializing) {\n revert InvalidInitialization();\n }\n if ($._initialized != type(uint64).max) {\n $._initialized = type(uint64).max;\n emit Initialized(type(uint64).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint64) {\n return _getInitializableStorage()._initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _getInitializableStorage()._initializing;\n }\n\n /**\n * @dev Returns a pointer to the storage namespace.\n */\n // solhint-disable-next-line var-name-mixedcase\n function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n assembly {\n $.slot := INITIALIZABLE_STORAGE\n }\n }\n}\n" + }, + "@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/interfaces/draft-IERC6093.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 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 ERC721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 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 EIP-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 ERC1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 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/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../token/ERC20/IERC20.sol\";\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\nimport {IERC20Permit} from \"../extensions/IERC20Permit.sol\";\nimport {Address} from \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance < requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 && !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\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 AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\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 * {FailedInnerCall} 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 AddressInsufficientBalance(address(this));\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 {FailedInnerCall}) in case of an\n * 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 {FailedInnerCall} 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 {FailedInnerCall}.\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 /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\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/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\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[EIP 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/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.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 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" + }, + "@sandbox-smart-contracts/oft-sand/contracts/interfaces/IERC20Extended.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.23;\n\nimport {IERC20} from \"@openzeppelin/contracts/interfaces/IERC20.sol\";\n\ninterface IERC20Extended is IERC20 {\n function burnFor(address from, uint256 amount) external;\n\n function burn(uint256 amount) external;\n\n function approveFor(address owner, address spender, uint256 amount) external returns (bool success);\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/interfaces/IErrors.sol": { + "content": "//SPDX-License-Identifier: MIT\n\npragma solidity 0.8.23;\n\n/// @title Errors\n/// @author The Sandbox\n/// @custom:security-contact contact-blockchain@sandbox.game\n/// @notice Common errors\ninterface IErrors {\n /// @notice Error for overflow conditions\n error Overflow();\n\n /// @notice Error for unauthorized access\n error NotAuthorized();\n\n /// @notice Error for invalid sender\n error InvalidSender();\n\n /// @notice Error for invalid amount\n error InvalidAmount();\n\n /// @notice Error for invalid owner or spender\n error InvalidOwnerOrSpender();\n\n /// @notice Error for mismatched first parameter and sender address\n error FirstParamNotSender();\n\n /// @notice Error for failed calls, containing the error message\n /// @param message error message returned from the failed call\n error CallFailed(string message);\n\n /// @notice Error for admin-only access\n error OnlyAdmin();\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/libraries/BytesUtil.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nlibrary BytesUtil {\n uint256 private constant DATA_MIN_LENGTH = 68;\n\n /// @dev Check if the data == _address.\n /// @param data The bytes passed to the function.\n /// @param _address The address to compare to.\n /// @return Whether the first param == _address.\n function doFirstParamEqualsAddress(bytes memory data, address _address) internal pure returns (bool) {\n if (data.length < DATA_MIN_LENGTH) {\n return false;\n }\n uint256 value;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n value := mload(add(data, 36))\n }\n return value == uint256(uint160(_address));\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/mock/EndpointMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.23;\n\nimport {EndpointV2Mock} from \"@layerzerolabs/test-devtools-evm-hardhat/contracts/mocks/EndpointV2Mock.sol\";\n\ncontract EndpointMock is EndpointV2Mock {\n constructor(uint32 eid) EndpointV2Mock(eid) {}\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/oft/libraries/OFTMsgCodec.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nlibrary OFTMsgCodec {\n // Offset constants for encoding and decoding OFT messages\n uint8 private constant SEND_TO_OFFSET = 32;\n uint8 private constant SEND_AMOUNT_SD_OFFSET = 40;\n\n /**\n * @dev Encodes an OFT LayerZero message.\n * @param _sendTo The recipient address.\n * @param _amountShared The amount in shared decimals.\n * @param _composeMsg The composed message.\n * @param _sender The msg sender\n * @return _msg The encoded message.\n * @return hasCompose A boolean indicating whether the message has a composed payload.\n */\n function encode(\n bytes32 _sendTo,\n uint64 _amountShared,\n bytes memory _composeMsg,\n address _sender\n ) internal pure returns (bytes memory _msg, bool hasCompose) {\n hasCompose = _composeMsg.length > 0;\n // @dev Remote chains will want to know the composed function caller ie. msg.sender on the src.\n _msg = hasCompose\n ? abi.encodePacked(_sendTo, _amountShared, addressToBytes32(_sender), _composeMsg)\n : abi.encodePacked(_sendTo, _amountShared);\n }\n\n /**\n * @dev Checks if the OFT message is composed.\n * @param _msg The OFT message.\n * @return A boolean indicating whether the message is composed.\n */\n function isComposed(bytes calldata _msg) internal pure returns (bool) {\n return _msg.length > SEND_AMOUNT_SD_OFFSET;\n }\n\n /**\n * @dev Retrieves the recipient address from the OFT message.\n * @param _msg The OFT message.\n * @return The recipient address.\n */\n function sendTo(bytes calldata _msg) internal pure returns (bytes32) {\n return bytes32(_msg[:SEND_TO_OFFSET]);\n }\n\n /**\n * @dev Retrieves the amount in shared decimals from the OFT message.\n * @param _msg The OFT message.\n * @return The amount in shared decimals.\n */\n function amountSD(bytes calldata _msg) internal pure returns (uint64) {\n return uint64(bytes8(_msg[SEND_TO_OFFSET:SEND_AMOUNT_SD_OFFSET]));\n }\n\n /**\n * @dev Retrieves the composed message from the OFT message.\n * @param _msg The OFT message.\n * @return The composed message.\n */\n function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) {\n return _msg[SEND_AMOUNT_SD_OFFSET:];\n }\n\n /**\n * @dev Converts an address to bytes32.\n * @param _addr The address to convert.\n * @return The bytes32 representation of the address.\n */\n function addressToBytes32(address _addr) internal pure returns (bytes32) {\n return bytes32(uint256(uint160(_addr)));\n }\n\n /**\n * @dev Converts bytes32 to an address.\n * @param _b The bytes32 value to convert.\n * @return The address representation of bytes32.\n */\n function bytes32ToAddress(bytes32 _b) internal pure returns (address) {\n return address(uint160(uint256(_b)));\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/oft/oapp/OApp.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\n// @dev Import the 'MessagingFee' and 'MessagingReceipt' so it's exposed to OApp implementers\n// solhint-disable-next-line no-unused-import\nimport {OAppSender, MessagingFee, MessagingReceipt} from \"./OAppSender.sol\";\n// @dev Import the 'Origin' so it's exposed to OApp implementers\n// solhint-disable-next-line no-unused-import\nimport {OAppReceiver, Origin} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppReceiver.sol\";\nimport {OAppCore} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppCore.sol\";\n\n/**\n * @title OApp\n * @dev Abstract contract serving as the base for OApp implementation, combining OAppSender and OAppReceiver functionality.\n * @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OApp.sol'\n * but has been modified to support ERC2771 compatibility.\n */\nabstract contract OApp is OAppSender, OAppReceiver {\n /**\n * @dev Constructor to initialize the OApp with the provided endpoint and owner.\n * @param _endpoint The address of the LOCAL LayerZero endpoint.\n * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n */\n constructor(address _endpoint, address _delegate) OAppCore(_endpoint, _delegate) {}\n\n /**\n * @notice Retrieves the OApp version information.\n * @return senderVersion The version of the OAppSender.sol implementation.\n * @return receiverVersion The version of the OAppReceiver.sol implementation.\n */\n function oAppVersion()\n public\n pure\n virtual\n override(OAppSender, OAppReceiver)\n returns (uint64 senderVersion, uint64 receiverVersion)\n {\n return (SENDER_VERSION, RECEIVER_VERSION);\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/oft/oapp/OAppSender.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport {SafeERC20, IERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {MessagingParams, MessagingFee, MessagingReceipt} from \"@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol\";\nimport {OAppCore} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppCore.sol\";\n/**\n * @title OAppSender\n * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint.\n * @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/OAppSender.sol'\n * but has been modified to support ERC2771 compatibility.\n */\nabstract contract OAppSender is OAppCore {\n using SafeERC20 for IERC20;\n\n // Custom error messages\n error NotEnoughNative(uint256 msgValue);\n error LzTokenUnavailable();\n\n // @dev The version of the OAppSender implementation.\n // @dev Version is bumped when changes are made to this contract.\n uint64 internal constant SENDER_VERSION = 1;\n\n /**\n * @notice Retrieves the OApp version information.\n * @return senderVersion The version of the OAppSender.sol contract.\n * @return receiverVersion The version of the OAppReceiver.sol contract.\n *\n * @dev Providing 0 as the default for OAppReceiver version. Indicates that the OAppReceiver is not implemented.\n * ie. this is a SEND only OApp.\n * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions\n */\n function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) {\n return (SENDER_VERSION, 0);\n }\n\n /**\n * @dev Internal function to interact with the LayerZero EndpointV2.quote() for fee calculation.\n * @param _dstEid The destination endpoint ID.\n * @param _message The message payload.\n * @param _options Additional options for the message.\n * @param _payInLzToken Flag indicating whether to pay the fee in LZ tokens.\n * @return fee The calculated MessagingFee for the message.\n * - nativeFee: The native fee for the message.\n * - lzTokenFee: The LZ token fee for the message.\n */\n function _quote(\n uint32 _dstEid,\n bytes memory _message,\n bytes memory _options,\n bool _payInLzToken\n ) internal view virtual returns (MessagingFee memory fee) {\n return\n endpoint.quote(\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken),\n address(this)\n );\n }\n\n /**\n * @dev Internal function to interact with the LayerZero EndpointV2.send() for sending a message.\n * @param _dstEid The destination endpoint ID.\n * @param _message The message payload.\n * @param _options Additional options for the message.\n * @param _fee The calculated LayerZero fee for the message.\n * - nativeFee: The native fee.\n * - lzTokenFee: The lzToken fee.\n * @param _refundAddress The address to receive any excess fee values sent to the endpoint.\n * @return receipt The receipt for the sent message.\n * - guid: The unique identifier for the sent message.\n * - nonce: The nonce of the sent message.\n * - fee: The LayerZero fee incurred for the message.\n */\n function _lzSend(\n uint32 _dstEid,\n bytes memory _message,\n bytes memory _options,\n MessagingFee memory _fee,\n address _refundAddress\n ) internal virtual returns (MessagingReceipt memory receipt) {\n // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint.\n uint256 messageValue = _payNative(_fee.nativeFee);\n if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee);\n\n return\n // solhint-disable-next-line check-send-result\n endpoint.send{value: messageValue}(\n MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0),\n _refundAddress\n );\n }\n\n /**\n * @dev Internal function to pay the native fee associated with the message.\n * @param _nativeFee The native fee to be paid.\n * @return nativeFee The amount of native currency paid.\n *\n * @dev If the OApp needs to initiate MULTIPLE LayerZero messages in a single transaction,\n * this will need to be overridden because msg.value would contain multiple lzFees.\n * @dev Should be overridden in the event the LayerZero endpoint requires a different native currency.\n * @dev Some EVMs use an ERC20 as a method for paying transactions/gasFees.\n * @dev The endpoint is EITHER/OR, ie. it will NOT support both types of native payment at a time.\n */\n function _payNative(uint256 _nativeFee) internal virtual returns (uint256 nativeFee) {\n if (msg.value != _nativeFee) revert NotEnoughNative(msg.value);\n return _nativeFee;\n }\n\n /**\n * @dev Internal function to pay the LZ token fee associated with the message.\n * @param _lzTokenFee The LZ token fee to be paid.\n *\n * @dev If the caller is trying to pay in the specified lzToken, then the lzTokenFee is passed to the endpoint.\n * @dev Any excess sent, is passed back to the specified _refundAddress in the _lzSend().\n */\n function _payLzToken(uint256 _lzTokenFee) internal virtual {\n // @dev Cannot cache the token because it is not immutable in the endpoint.\n address lzToken = endpoint.lzToken();\n if (lzToken == address(0)) revert LzTokenUnavailable();\n\n // Pay LZ token fee by sending tokens to the endpoint.\n IERC20(lzToken).safeTransferFrom(_msgSender(), address(endpoint), _lzTokenFee);\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/oft/OFTAdapter.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport {IERC20Metadata, IERC20} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {OFTCore} from \"./OFTCore.sol\";\n\n/// @title OFTAdapter Contract\n/// @dev OFTAdapter is a contract that adapts an ERC-20 token to the OFT functionality.\n/// @dev For existing ERC20 tokens, this can be used to convert the token to crosschain compatibility.\n/// @dev WARNING: ONLY 1 of these should exist for a given global mesh,\n/// unless you make a NON-default implementation of OFT and needs to be done very carefully.\n/// @dev WARNING: The default OFTAdapter implementation assumes LOSSLESS transfers, ie. 1 token in, 1 token out.\n/// IF the 'innerToken' applies something like a transfer fee, the default will NOT work...\n/// a pre/post balance check will need to be done to calculate the amountSentLD/amountReceivedLD.\n/// @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFTAdapter.sol'\n/// but has been modified to support ERC2771 compatibility.\nabstract contract OFTAdapter is OFTCore {\n using SafeERC20 for IERC20;\n\n IERC20 internal immutable innerToken;\n\n /// @dev Constructor for the OFTAdapter contract.\n /// @param _token The address of the ERC-20 token to be adapted.\n /// @param _lzEndpoint The LayerZero endpoint address.\n /// @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n constructor(\n address _token,\n address _lzEndpoint,\n address _delegate\n ) OFTCore(IERC20Metadata(_token).decimals(), _lzEndpoint, _delegate) {\n innerToken = IERC20(_token);\n }\n\n /// @dev Retrieves the address of the underlying ERC20 implementation.\n /// @return The address of the adapted ERC-20 token.\n /// @dev In the case of OFTAdapter, address(this) and erc20 are NOT the same contract.\n function token() public view returns (address) {\n return address(innerToken);\n }\n\n /// @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\n /// @return requiresApproval Needs approval of the underlying token implementation.\n /// @dev In the case of default OFTAdapter, approval is required.\n /// @dev In non-default OFTAdapter contracts with something like mint and burn privileges, it would NOT need approval.\n function approvalRequired() external pure virtual returns (bool) {\n return true;\n }\n\n /// @dev Burns tokens from the sender's specified balance, ie. pull method.\n /// @param _from The address to debit from.\n /// @param _amountLD The amount of tokens to send in local decimals.\n /// @param _minAmountLD The minimum amount to send in local decimals.\n /// @param _dstEid The destination chain ID.\n /// @return amountSentLD The amount sent in local decimals.\n /// @return amountReceivedLD The amount received in local decimals on the remote.\n /// @dev msg.sender will need to approve this _amountLD of tokens to be locked inside of the contract.\n /// @dev WARNING: The default OFTAdapter implementation assumes LOSSLESS transfers, ie. 1 token in, 1 token out.\n /// IF the 'innerToken' applies something like a transfer fee, the default will NOT work...\n /// a pre/post balance check will need to be done to calculate the amountReceivedLD.\n function _debit(\n address _from,\n uint256 _amountLD,\n uint256 _minAmountLD,\n uint32 _dstEid\n ) internal virtual override returns (uint256 amountSentLD, uint256 amountReceivedLD) {\n (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid);\n // @dev Lock tokens by moving them into this contract from the caller.\n innerToken.safeTransferFrom(_from, address(this), amountSentLD);\n }\n\n /// @dev Credits tokens to the specified address.\n /// @param _to The address to credit the tokens to.\n /// @param _amountLD The amount of tokens to credit in local decimals.\n /// @dev _srcEid The source chain ID.\n /// @return amountReceivedLD The amount of tokens ACTUALLY received in local decimals.\n /// @dev WARNING: The default OFTAdapter implementation assumes LOSSLESS transfers, ie. 1 token in, 1 token out.\n /// IF the 'innerToken' applies something like a transfer fee, the default will NOT work...\n /// a pre/post balance check will need to be done to calculate the amountReceivedLD.\n function _credit(\n address _to,\n uint256 _amountLD,\n uint32 /*_srcEid*/\n ) internal virtual override returns (uint256 amountReceivedLD) {\n // @dev Unlock the tokens and transfer to the recipient.\n innerToken.safeTransfer(_to, _amountLD);\n // @dev In the case of NON-default OFTAdapter, the amountLD MIGHT not be == amountReceivedLD.\n return _amountLD;\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/oft/OFTCore.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport {OApp, Origin} from \"./oapp/OApp.sol\";\nimport {OAppOptionsType3} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/libs/OAppOptionsType3.sol\";\nimport {IOAppMsgInspector} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oapp/interfaces/IOAppMsgInspector.sol\";\n\nimport {OAppPreCrimeSimulator} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/precrime/OAppPreCrimeSimulator.sol\";\n\nimport {IOFT, SendParam, OFTLimit, OFTReceipt, OFTFeeDetail, MessagingReceipt, MessagingFee} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol\";\nimport {OFTMsgCodec} from \"./libraries/OFTMsgCodec.sol\";\nimport {OFTComposeMsgCodec} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/libs/OFTComposeMsgCodec.sol\";\n\n/// @title OFTCore\n/// @dev Abstract contract for the OftChain (OFT) token.\n/// @dev This contract is based on '@layerzerolabs/lz-evm-oapp-v2/contracts/oft/OFTCore.sol'\n/// but has been modified to support ERC2771 compatibility.\nabstract contract OFTCore is IOFT, OApp, OAppPreCrimeSimulator, OAppOptionsType3 {\n using OFTMsgCodec for bytes;\n using OFTMsgCodec for bytes32;\n\n // @notice Provides a conversion rate when swapping between denominations of SD and LD\n // - shareDecimals == SD == shared Decimals\n // - localDecimals == LD == local decimals\n // @dev Considers that tokens have different decimal amounts on various chains.\n // @dev eg.\n // For a token\n // - locally with 4 decimals --> 1.2345 => uint(12345)\n // - remotely with 2 decimals --> 1.23 => uint(123)\n // - The conversion rate would be 10 ** (4 - 2) = 100\n // @dev If you want to send 1.2345 -> (uint 12345), you CANNOT represent that value on the remote,\n // you can only display 1.23 -> uint(123).\n // @dev To preserve the dust that would otherwise be lost on that conversion,\n // we need to unify a denomination that can be represented on ALL chains inside of the OFT mesh\n uint256 public immutable decimalConversionRate;\n\n // @notice Msg types that are used to identify the various OFT operations.\n // @dev This can be extended in child contracts for non-default oft operations\n // @dev These values are used in things like combineOptions() in OAppOptionsType3.sol.\n uint16 public constant SEND = 1;\n uint16 public constant SEND_AND_CALL = 2;\n\n // Address of an optional contract to inspect both 'message' and 'options'\n address public msgInspector;\n event MsgInspectorSet(address inspector);\n\n /// @dev Constructor.\n /// @param _localDecimals The decimals of the token on the local chain (this chain).\n /// @param _endpoint The address of the LayerZero endpoint.\n /// @param _delegate The delegate capable of making OApp configurations inside of the endpoint.\n constructor(uint8 _localDecimals, address _endpoint, address _delegate) OApp(_endpoint, _delegate) {\n if (_localDecimals < sharedDecimals()) revert InvalidLocalDecimals();\n decimalConversionRate = 10 ** (_localDecimals - sharedDecimals());\n }\n\n /// @notice Retrieves interfaceID and the version of the OFT.\n /// @return interfaceId The interface ID.\n /// @return version The version.\n /// @dev interfaceId: This specific interface ID is '0x02e49c2c'.\n /// @dev version: Indicates a cross-chain compatible msg encoding with other OFTs.\n /// @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented.\n /// ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1)\n function oftVersion() external pure virtual returns (bytes4 interfaceId, uint64 version) {\n return (type(IOFT).interfaceId, 1);\n }\n\n /// @dev Retrieves the shared decimals of the OFT.\n /// @return The shared decimals of the OFT.\n /// @dev Sets an implicit cap on the amount of tokens, over uint64.max() will need some sort of outbound cap / totalSupply cap\n /// Lowest common decimal denominator between chains.\n /// Defaults to 6 decimal places to provide up to 18,446,744,073,709.551615 units (max uint64).\n /// For tokens exceeding this totalSupply(), they will need to override the sharedDecimals function with something smaller.\n /// ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615\n function sharedDecimals() public view virtual returns (uint8) {\n return 6;\n }\n\n /// @dev Sets the message inspector address for the OFT.\n /// @param _msgInspector The address of the message inspector.\n /// @dev This is an optional contract that can be used to inspect both 'message' and 'options'.\n /// @dev Set it to address(0) to disable it, or set it to a contract address to enable it.\n function setMsgInspector(address _msgInspector) public virtual onlyOwner {\n msgInspector = _msgInspector;\n emit MsgInspectorSet(_msgInspector);\n }\n\n /// @notice Provides a quote for OFT-related operations.\n /// @param _sendParam The parameters for the send operation.\n /// @return oftLimit The OFT limit information.\n /// @return oftFeeDetails The details of OFT fees.\n /// @return oftReceipt The OFT receipt information.\n function quoteOFT(\n SendParam calldata _sendParam\n )\n external\n view\n virtual\n returns (OFTLimit memory oftLimit, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory oftReceipt)\n {\n uint256 minAmountLD = 0; // Unused in the default implementation.\n uint256 maxAmountLD = type(uint64).max; // Unused in the default implementation.\n oftLimit = OFTLimit(minAmountLD, maxAmountLD);\n\n // Unused in the default implementation; reserved for future complex fee details.\n oftFeeDetails = new OFTFeeDetail[](0);\n\n // @dev This is the same as the send() operation, but without the actual send.\n // - amountSentLD is the amount in local decimals that would be sent from the sender.\n // - amountReceivedLD is the amount in local decimals that will be credited to the recipient on the remote OFT instance.\n // @dev The amountSentLD MIGHT not equal the amount the user actually receives. HOWEVER, the default does.\n (uint256 amountSentLD, uint256 amountReceivedLD) = _debitView(\n _sendParam.amountLD,\n _sendParam.minAmountLD,\n _sendParam.dstEid\n );\n oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD);\n }\n\n /// @notice Provides a quote for the send() operation.\n /// @param _sendParam The parameters for the send() operation.\n /// @param _payInLzToken Flag indicating whether the caller is paying in the LZ token.\n /// @return msgFee The calculated LayerZero messaging fee from the send() operation.\n /// @dev MessagingFee: LayerZero msg fee\n /// - nativeFee: The native fee.\n /// - lzTokenFee: The lzToken fee.\n function quoteSend(\n SendParam calldata _sendParam,\n bool _payInLzToken\n ) external view virtual returns (MessagingFee memory msgFee) {\n // @dev mock the amount to receive, this is the same operation used in the send().\n // The quote is as similar as possible to the actual send() operation.\n (, uint256 amountReceivedLD) = _debitView(_sendParam.amountLD, _sendParam.minAmountLD, _sendParam.dstEid);\n\n // @dev Builds the options and OFT message to quote in the endpoint.\n (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD);\n\n // @dev Calculates the LayerZero fee for the send() operation.\n return _quote(_sendParam.dstEid, message, options, _payInLzToken);\n }\n\n /// @dev Executes the send operation.\n /// @param _sendParam The parameters for the send operation.\n /// @param _fee The calculated fee for the send() operation.\n /// - nativeFee: The native fee.\n /// - lzTokenFee: The lzToken fee.\n /// @param _refundAddress The address to receive any excess funds.\n /// @return msgReceipt The receipt for the send operation.\n /// @return oftReceipt The OFT receipt information.\n /// @dev MessagingReceipt: LayerZero msg receipt\n /// - guid: The unique identifier for the sent message.\n /// - nonce: The nonce of the sent message.\n /// - fee: The LayerZero fee incurred for the message.\n function send(\n SendParam calldata _sendParam,\n MessagingFee calldata _fee,\n address _refundAddress\n ) public payable virtual returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) {\n // @dev Applies the token transfers regarding this send() operation.\n // - amountSentLD is the amount in local decimals that was ACTUALLY sent/debited from the sender.\n // - amountReceivedLD is the amount in local decimals that will be received/credited to the recipient on the remote OFT instance.\n (uint256 amountSentLD, uint256 amountReceivedLD) = _debit(\n _msgSender(),\n _sendParam.amountLD,\n _sendParam.minAmountLD,\n _sendParam.dstEid\n );\n\n // @dev Builds the options and OFT message to quote in the endpoint.\n (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD);\n\n // @dev Sends the message to the LayerZero endpoint and returns the LayerZero msg receipt.\n msgReceipt = _lzSend(_sendParam.dstEid, message, options, _fee, _refundAddress);\n // @dev Formulate the OFT receipt.\n oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD);\n\n emit OFTSent(msgReceipt.guid, _sendParam.dstEid, _msgSender(), amountSentLD, amountReceivedLD);\n }\n\n /// @dev Internal function to build the message and options.\n /// @param _sendParam The parameters for the send() operation.\n /// @param _amountLD The amount in local decimals.\n /// @return message The encoded message.\n /// @return options The encoded options.\n function _buildMsgAndOptions(\n SendParam calldata _sendParam,\n uint256 _amountLD\n ) internal view virtual returns (bytes memory message, bytes memory options) {\n bool hasCompose;\n // @dev This generated message has the msg.sender encoded into the payload so the remote knows who the caller is.\n (message, hasCompose) = OFTMsgCodec.encode(\n _sendParam.to,\n _toSD(_amountLD),\n // @dev Must be include a non empty bytes if you want to compose, EVEN if you dont need it on the remote.\n // EVEN if you dont require an arbitrary payload to be sent... eg. '0x01'\n _sendParam.composeMsg,\n _msgSender()\n );\n // @dev Change the msg type depending if its composed or not.\n uint16 msgType = hasCompose ? SEND_AND_CALL : SEND;\n // @dev Combine the callers _extraOptions with the enforced options via the OAppOptionsType3.\n options = combineOptions(_sendParam.dstEid, msgType, _sendParam.extraOptions);\n\n // @dev Optionally inspect the message and options depending if the OApp owner has set a msg inspector.\n // @dev If it fails inspection, needs to revert in the implementation. ie. does not rely on return boolean\n if (msgInspector != address(0)) IOAppMsgInspector(msgInspector).inspect(message, options);\n }\n\n /// @dev Internal function to handle the receive on the LayerZero endpoint.\n /// @param _origin The origin information.\n /// - srcEid: The source chain endpoint ID.\n /// - sender: The sender address from the src chain.\n /// - nonce: The nonce of the LayerZero message.\n /// @param _guid The unique identifier for the received LayerZero message.\n /// @param _message The encoded message.\n /// @dev _executor The address of the executor.\n /// @dev _extraData Additional data.\n\n function _lzReceive(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address /*_executor*/, // @dev unused in the default implementation.\n bytes calldata /*_extraData*/ // @dev unused in the default implementation.\n ) internal virtual override {\n // @dev The src sending chain doesnt know the address length on this chain (potentially non-evm)\n // Thus everything is bytes32() encoded in flight.\n address toAddress = _message.sendTo().bytes32ToAddress();\n // @dev Credit the amountLD to the recipient and return the ACTUAL amount the recipient received in local decimals\n uint256 amountReceivedLD = _credit(toAddress, _toLD(_message.amountSD()), _origin.srcEid);\n\n if (_message.isComposed()) {\n // @dev Proprietary composeMsg format for the OFT.\n bytes memory composeMsg = OFTComposeMsgCodec.encode(\n _origin.nonce,\n _origin.srcEid,\n amountReceivedLD,\n _message.composeMsg()\n );\n\n // @dev Stores the lzCompose payload that will be executed in a separate tx.\n // Standardizes functionality for executing arbitrary contract invocation on some non-evm chains.\n // @dev The off-chain executor will listen and process the msg based on the src-chain-callers compose options passed.\n // @dev The index is used when a OApp needs to compose multiple msgs on lzReceive.\n // For default OFT implementation there is only 1 compose msg per lzReceive, thus its always 0.\n endpoint.sendCompose(toAddress, _guid, 0 /* the index of the composed message*/, composeMsg);\n }\n\n emit OFTReceived(_guid, _origin.srcEid, toAddress, amountReceivedLD);\n }\n\n /// @dev Internal function to handle the OAppPreCrimeSimulator simulated receive.\n /// @param _origin The origin information.\n /// - srcEid: The source chain endpoint ID.\n /// - sender: The sender address from the src chain.\n /// - nonce: The nonce of the LayerZero message.\n /// @param _guid The unique identifier for the received LayerZero message.\n /// @param _message The LayerZero message.\n /// @param _executor The address of the off-chain executor.\n /// @param _extraData Arbitrary data passed by the msg executor.\n /// @dev Enables the preCrime simulator to mock sending lzReceive() messages,\n /// routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver.\n function _lzReceiveSimulate(\n Origin calldata _origin,\n bytes32 _guid,\n bytes calldata _message,\n address _executor,\n bytes calldata _extraData\n ) internal virtual override {\n _lzReceive(_origin, _guid, _message, _executor, _extraData);\n }\n\n /// @dev Check if the peer is considered 'trusted' by the OApp.\n /// @param _eid The endpoint ID to check.\n /// @param _peer The peer to check.\n /// @return Whether the peer passed is considered 'trusted' by the OApp.\n /// @dev Enables OAppPreCrimeSimulator to check whether a potential Inbound Packet is from a trusted source.\n function isPeer(uint32 _eid, bytes32 _peer) public view virtual override returns (bool) {\n return peers[_eid] == _peer;\n }\n\n /// @dev Internal function to remove dust from the given local decimal amount.\n /// @param _amountLD The amount in local decimals.\n /// @return amountLD The amount after removing dust.\n /// @dev Prevents the loss of dust when moving amounts between chains with different decimals.\n /// @dev eg. uint(123) with a conversion rate of 100 becomes uint(100).\n function _removeDust(uint256 _amountLD) internal view virtual returns (uint256 amountLD) {\n return (_amountLD / decimalConversionRate) * decimalConversionRate;\n }\n\n /// @dev Internal function to convert an amount from shared decimals into local decimals.\n /// @param _amountSD The amount in shared decimals.\n /// @return amountLD The amount in local decimals.\n function _toLD(uint64 _amountSD) internal view virtual returns (uint256 amountLD) {\n return _amountSD * decimalConversionRate;\n }\n\n /// @dev Internal function to convert an amount from local decimals into shared decimals.\n /// @param _amountLD The amount in local decimals.\n /// @return amountSD The amount in shared decimals.\n function _toSD(uint256 _amountLD) internal view virtual returns (uint64 amountSD) {\n return uint64(_amountLD / decimalConversionRate);\n }\n\n /// @dev Internal function to mock the amount mutation from a OFT debit() operation.\n /// @param _amountLD The amount to send in local decimals.\n /// @param _minAmountLD The minimum amount to send in local decimals.\n /// @dev _dstEid The destination endpoint ID.\n /// @return amountSentLD The amount sent, in local decimals.\n /// @return amountReceivedLD The amount to be received on the remote chain, in local decimals.\n /// @dev This is where things like fees would be calculated and deducted from the amount to be received on the remote.\n function _debitView(\n uint256 _amountLD,\n uint256 _minAmountLD,\n uint32 /*_dstEid*/\n ) internal view virtual returns (uint256 amountSentLD, uint256 amountReceivedLD) {\n // @dev Remove the dust so nothing is lost on the conversion between chains with different decimals for the token.\n amountSentLD = _removeDust(_amountLD);\n // @dev The amount to send is the same as amount received in the default implementation.\n amountReceivedLD = amountSentLD;\n\n // @dev Check for slippage.\n if (amountReceivedLD < _minAmountLD) {\n revert SlippageExceeded(amountReceivedLD, _minAmountLD);\n }\n }\n\n /// @dev Internal function to perform a debit operation.\n /// @param _from The address to debit.\n /// @param _amountLD The amount to send in local decimals.\n /// @param _minAmountLD The minimum amount to send in local decimals.\n /// @param _dstEid The destination endpoint ID.\n /// @return amountSentLD The amount sent in local decimals.\n /// @return amountReceivedLD The amount received in local decimals on the remote.\n /// @dev Defined here but are intended to be overriden depending on the OFT implementation.\n /// @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD.\n function _debit(\n address _from,\n uint256 _amountLD,\n uint256 _minAmountLD,\n uint32 _dstEid\n ) internal virtual returns (uint256 amountSentLD, uint256 amountReceivedLD);\n\n /// @dev Internal function to perform a credit operation.\n /// @param _to The address to credit.\n /// @param _amountLD The amount to credit in local decimals.\n /// @param _srcEid The source endpoint ID.\n /// @return amountReceivedLD The amount ACTUALLY received in local decimals.\n /// @dev Defined here but are intended to be overriden depending on the OFT implementation.\n /// @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD.\n\n function _credit(\n address _to,\n uint256 _amountLD,\n uint32 _srcEid\n ) internal virtual returns (uint256 amountReceivedLD);\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/OFTAdapterForSand.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport {SendParam, OFTReceipt, MessagingReceipt, MessagingFee} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol\";\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport {Context} from \"@openzeppelin/contracts/utils/Context.sol\";\nimport {OFTAdapter} from \"./oft/OFTAdapter.sol\";\nimport {WithAdmin} from \"./sand/WithAdmin.sol\";\nimport {ERC2771Handler} from \"./sand/ERC2771Handler.sol\";\n\n/// @title OFTAdapterForSand\n/// @author The Sandbox\n/// @dev contract to be used with non-upgradable SAND contract\ncontract OFTAdapterForSand is OFTAdapter, WithAdmin, ERC2771Handler {\n bool internal _enabled;\n\n /// @notice Emitted when the enabled state changes\n /// @param enabled The new enabled state\n event Enabled(bool enabled);\n\n /// @notice Custom error thrown when the send function is called while disabled\n error SendFunctionDisabled();\n\n /// @param sandToken SAND token address on the same network as the OFT Adapter\n /// @param layerZeroEndpoint local endpoint address\n /// @param owner owner used as a delegate in LayerZero Endpoint\n /// @param trustedForwarder trusted forwarder address\n constructor(\n address sandToken,\n address layerZeroEndpoint,\n address owner,\n address trustedForwarder,\n address admin\n ) OFTAdapter(sandToken, layerZeroEndpoint, owner) Ownable(owner) {\n __ERC2771Handler_initialize(trustedForwarder);\n _changeAdmin(admin);\n _enable(true);\n }\n\n /// @notice Change the address of the trusted forwarder for meta-TX.\n /// @param trustedForwarder The new trustedForwarder.\n function setTrustedForwarder(address trustedForwarder) external onlyOwner {\n _trustedForwarder = trustedForwarder;\n }\n\n function enable(bool enabled) external onlyAdmin {\n _enable(enabled);\n }\n\n function getEnabled() external view returns (bool) {\n return _enabled;\n }\n\n function send(\n SendParam calldata _sendParam,\n MessagingFee calldata _fee,\n address _refundAddress\n ) public payable virtual override returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) {\n if (!_enabled) {\n revert SendFunctionDisabled();\n }\n\n super.send(_sendParam, _fee, _refundAddress);\n }\n\n function _enable(bool enabled) internal {\n _enabled = enabled;\n emit Enabled(_enabled);\n }\n\n function _msgSender() internal view override(ERC2771Handler, Context) returns (address sender) {\n return ERC2771Handler._msgSender();\n }\n\n function _msgData() internal view override(ERC2771Handler, Context) returns (bytes calldata) {\n return ERC2771Handler._msgData();\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/OFTSand.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport {SendParam, OFTReceipt, MessagingReceipt, MessagingFee} from \"@layerzerolabs/lz-evm-oapp-v2/contracts/oft/interfaces/IOFT.sol\";\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\nimport {Context} from \"@openzeppelin/contracts/utils/Context.sol\";\nimport {OFTCore} from \"./oft/OFTCore.sol\";\nimport {ERC2771Handler} from \"./sand/ERC2771Handler.sol\";\nimport {SandBaseToken} from \"./sand/SandBaseToken.sol\";\n\n/// @title OFTSand\n/// @author The Sandbox\n/// @dev OFTSand is a contract that combines SandBaseToken, ERC2771Handler, and OFTCore functionalities.\n/// @dev It provides a token contract implementation of Sand token with LayerZero compatibility.\ncontract OFTSand is SandBaseToken, ERC2771Handler, OFTCore {\n bool internal _enabled;\n\n /// @notice Emitted when the enabled state changes\n /// @param enabled The new enabled state\n event Enabled(bool enabled);\n\n /// @notice Custom error thrown when the send function is called while disabled\n error SendFunctionDisabled();\n\n constructor(\n address trustedForwarder,\n address sandAdmin,\n address executionAdmin,\n address layerZeroEndpoint,\n address owner\n ) SandBaseToken(sandAdmin, executionAdmin, address(0), 0) OFTCore(18, layerZeroEndpoint, owner) Ownable(owner) {\n __ERC2771Handler_initialize(trustedForwarder);\n _enable(true);\n }\n\n /// @notice Change the address of the trusted forwarder for meta-TX.\n /// @param trustedForwarder The new trustedForwarder.\n function setTrustedForwarder(address trustedForwarder) external onlyOwner {\n _trustedForwarder = trustedForwarder;\n }\n\n function enable(bool enabled) external onlyAdmin {\n _enable(enabled);\n }\n\n function getEnabled() external view returns (bool) {\n return _enabled;\n }\n\n /// @notice Indicates whether the OFT contract requires approval of the 'token()' to send.\n /// @return requiresApproval Needs approval of the underlying token implementation.\n /// @dev In the case of OFT where the contract IS the token, approval is NOT required.\n function approvalRequired() external pure virtual returns (bool) {\n return false;\n }\n\n /// @dev Retrieves the address of the underlying ERC20 implementation.\n /// @return The address of the OFT token.\n /// @dev In the case of OFT, address(this) and erc20 are the same contract.\n function token() external view returns (address) {\n return address(this);\n }\n\n function send(\n SendParam calldata _sendParam,\n MessagingFee calldata _fee,\n address _refundAddress\n ) public payable virtual override returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) {\n if (!_enabled) {\n revert SendFunctionDisabled();\n }\n\n super.send(_sendParam, _fee, _refundAddress);\n }\n\n function _enable(bool enabled) internal {\n _enabled = enabled;\n emit Enabled(_enabled);\n }\n\n /// @dev Burns tokens from the sender's specified balance.\n /// @param _from The address to debit the tokens from.\n /// @param _amountLD The amount of tokens to send in local decimals.\n /// @param _minAmountLD The minimum amount to send in local decimals.\n /// @param _dstEid The destination chain ID.\n /// @return amountSentLD The amount sent in local decimals.\n /// @return amountReceivedLD The amount received in local decimals on the remote.\n function _debit(\n address _from,\n uint256 _amountLD,\n uint256 _minAmountLD,\n uint32 _dstEid\n ) internal virtual override returns (uint256 amountSentLD, uint256 amountReceivedLD) {\n (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid);\n\n // @dev In NON-default OFT, amountSentLD could be 100, with a 10% fee, the amountReceivedLD amount is 90,\n // therefore amountSentLD CAN differ from amountReceivedLD.\n\n // @dev Default OFT burns on src.\n _burn(_from, amountSentLD);\n }\n\n /// @dev Credits tokens to the specified address.\n /// @param _to The address to credit the tokens to.\n /// @param _amountLD The amount of tokens to credit in local decimals.\n /// @dev _srcEid The source chain ID.\n /// @return amountReceivedLD The amount of tokens ACTUALLY received in local decimals.\n function _credit(\n address _to,\n uint256 _amountLD,\n uint32 /*_srcEid*/\n ) internal virtual override returns (uint256 amountReceivedLD) {\n // @dev Default OFT mints on dst.\n _mint(_to, _amountLD);\n // @dev In the case of NON-default OFT, the _amountLD MIGHT not be == amountReceivedLD.\n return _amountLD;\n }\n\n function _msgSender() internal view override(ERC2771Handler, Context) returns (address sender) {\n return ERC2771Handler._msgSender();\n }\n\n function _msgData() internal view override(ERC2771Handler, Context) returns (bytes calldata) {\n return ERC2771Handler._msgData();\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/ERC20BaseToken.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport {Context} from \"@openzeppelin/contracts/utils/Context.sol\";\nimport {IERC20Errors} from \"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\";\nimport {ERC20Internal} from \"./ERC20Internal.sol\";\nimport {IErrors} from \"../interfaces/IErrors.sol\";\nimport {IERC20, IERC20Extended} from \"../interfaces/IERC20Extended.sol\";\nimport {WithSuperOperators} from \"./WithSuperOperators.sol\";\n\nabstract contract ERC20BaseToken is\n IErrors,\n WithSuperOperators,\n IERC20,\n IERC20Extended,\n IERC20Errors,\n ERC20Internal,\n Context\n{\n string internal _name;\n string internal _symbol;\n address internal immutable _operator;\n uint256 internal _totalSupply;\n mapping(address => uint256) internal _balances;\n mapping(address => mapping(address => uint256)) internal _allowances;\n\n constructor(string memory tokenName, string memory tokenSymbol, address admin, address operator) {\n _name = tokenName;\n _symbol = tokenSymbol;\n _admin = admin;\n _operator = operator;\n }\n\n /// @notice Transfer `amount` tokens to `to`.\n /// @param to The recipient address of the tokens being transfered.\n /// @param amount The number of tokens being transfered.\n /// @return success Whether or not the transfer succeeded.\n function transfer(address to, uint256 amount) external override returns (bool success) {\n _transfer(_msgSender(), to, amount);\n return true;\n }\n\n /// @notice Transfer `amount` tokens from `from` to `to`.\n /// @param from The origin address of the tokens being transferred.\n /// @param to The recipient address of the tokensbeing transfered.\n /// @param amount The number of tokens transfered.\n /// @return success Whether or not the transfer succeeded.\n function transferFrom(address from, address to, uint256 amount) external override returns (bool success) {\n if (_msgSender() != from && !_superOperators[_msgSender()] && _msgSender() != _operator) {\n uint256 currentAllowance = _allowances[from][_msgSender()];\n if (currentAllowance != ~uint256(0)) {\n // save gas when allowance is maximal by not reducing it (see https://github.com/ethereum/EIPs/issues/717)\n if (currentAllowance < amount) {\n revert ERC20InsufficientAllowance(_msgSender(), currentAllowance, amount);\n }\n _allowances[from][_msgSender()] = currentAllowance - amount;\n }\n }\n _transfer(from, to, amount);\n return true;\n }\n\n /// @notice Burn `amount` tokens.\n /// @param amount The number of tokens to burn.\n function burn(uint256 amount) external override {\n _burn(_msgSender(), amount);\n }\n\n /// @notice Burn `amount` tokens from `owner`.\n /// @param from The address whose token to burn.\n /// @param amount The number of tokens to burn.\n function burnFor(address from, uint256 amount) external override {\n _burn(from, amount);\n }\n\n /// @notice Approve `spender` to transfer `amount` tokens.\n /// @param spender The address to be given rights to transfer.\n /// @param amount The number of tokens allowed.\n /// @return success Whether or not the call succeeded.\n function approve(address spender, uint256 amount) external override returns (bool success) {\n _approveFor(_msgSender(), spender, amount);\n return true;\n }\n\n /// @notice Get the name of the token collection.\n /// @return The name of the token collection.\n function name() external view virtual returns (string memory) {\n //added virtual\n return _name;\n }\n\n /// @notice Get the symbol for the token collection.\n /// @return The symbol of the token collection.\n function symbol() external view virtual returns (string memory) {\n //added virtual\n return _symbol;\n }\n\n /// @notice Get the total number of tokens in existence.\n /// @return The total number of tokens in existence.\n function totalSupply() external view override returns (uint256) {\n return _totalSupply;\n }\n\n /// @notice Get the balance of `owner`.\n /// @param owner The address to query the balance of.\n /// @return The amount owned by `owner`.\n function balanceOf(address owner) external view override returns (uint256) {\n return _balances[owner];\n }\n\n /// @notice Get the allowance of `spender` for `owner`'s tokens.\n /// @param owner The address whose token is allowed.\n /// @param spender The address allowed to transfer.\n /// @return remaining The amount of token `spender` is allowed to transfer on behalf of `owner`.\n function allowance(address owner, address spender) external view override returns (uint256 remaining) {\n return _allowances[owner][spender];\n }\n\n /// @notice Get the number of decimals for the token collection.\n /// @return The number of decimals.\n function decimals() external pure virtual returns (uint8) {\n return uint8(18);\n }\n\n /// @notice Approve `spender` to transfer `amount` tokens from `owner`.\n /// @param owner The address whose token is allowed.\n /// @param spender The address to be given rights to transfer.\n /// @param amount The number of tokens allowed.\n /// @return success Whether or not the call succeeded.\n function approveFor(address owner, address spender, uint256 amount) public override returns (bool success) {\n if (!(_msgSender() == owner || _superOperators[_msgSender()] || _msgSender() == _operator)) {\n revert NotAuthorized();\n }\n _approveFor(owner, spender, amount);\n return true;\n }\n\n /// @notice Increase the allowance for the spender if needed\n /// @param owner The address of the owner of the tokens\n /// @param spender The address wanting to spend tokens\n /// @param amountNeeded The amount requested to spend\n /// @return success Whether or not the call succeeded.\n function addAllowanceIfNeeded(address owner, address spender, uint256 amountNeeded) public returns (bool success) {\n if (!(_msgSender() == owner || _superOperators[_msgSender()] || _msgSender() == _operator)) {\n revert InvalidSender();\n }\n _addAllowanceIfNeeded(owner, spender, amountNeeded);\n return true;\n }\n\n /// @dev See addAllowanceIfNeeded.\n function _addAllowanceIfNeeded(\n address owner,\n address spender,\n uint256 amountNeeded /*(ERC20Internal, ERC20ExecuteExtension, ERC20BasicApproveExtension)*/\n ) internal virtual override {\n if (amountNeeded > 0 && !isSuperOperator(spender) && spender != _operator) {\n uint256 currentAllowance = _allowances[owner][spender];\n if (currentAllowance < amountNeeded) {\n _approveFor(owner, spender, amountNeeded);\n }\n }\n }\n\n /// @dev See approveFor.\n function _approveFor(\n address owner,\n address spender,\n uint256 amount /*(ERC20BasicApproveExtension, ERC20Internal)*/\n ) internal virtual override {\n if (owner == address(0) || spender == address(0)) {\n revert InvalidOwnerOrSpender();\n }\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /// @dev See transfer.\n function _transfer(\n address from,\n address to,\n uint256 amount /*(ERC20Internal, ERC20ExecuteExtension)*/\n ) internal virtual override {\n if (to == address(0) || to == address(this)) {\n revert ERC20InvalidReceiver(to);\n }\n uint256 currentBalance = _balances[from];\n if (currentBalance < amount) {\n revert ERC20InsufficientBalance(from, currentBalance, amount);\n }\n _balances[from] = currentBalance - amount;\n _balances[to] += amount;\n emit Transfer(from, to, amount);\n }\n\n /// @dev Mint tokens for a recipient.\n /// @param to The recipient address.\n /// @param amount The number of token to mint.\n function _mint(address to, uint256 amount) internal {\n if (to == address(0)) {\n revert ERC20InvalidReceiver(to);\n }\n if (amount == 0) {\n revert InvalidAmount();\n }\n uint256 currentTotalSupply = _totalSupply;\n uint256 newTotalSupply = currentTotalSupply + amount;\n if (newTotalSupply <= currentTotalSupply) {\n revert Overflow();\n }\n _totalSupply = newTotalSupply;\n _balances[to] += amount;\n emit Transfer(address(0), to, amount);\n }\n\n /// @dev Burn tokens from an address.\n /// @param from The address whose tokens to burn.\n /// @param amount The number of token to burn.\n function _burn(address from, uint256 amount) internal {\n if (amount == 0) {\n revert InvalidAmount();\n }\n if (_msgSender() != from && !_superOperators[_msgSender()] && _msgSender() != _operator) {\n uint256 currentAllowance = _allowances[from][_msgSender()];\n if (currentAllowance != ~uint256(0)) {\n // save gas when allowance is maximal by not reducing it (see https://github.com/ethereum/EIPs/issues/717)\n if (currentAllowance < amount) {\n revert ERC20InsufficientAllowance(_msgSender(), currentAllowance, amount);\n }\n _allowances[from][_msgSender()] = currentAllowance - amount;\n }\n }\n\n uint256 currentBalance = _balances[from];\n if (currentBalance < amount) {\n revert ERC20InsufficientBalance(from, currentBalance, amount);\n }\n _balances[from] = currentBalance - amount;\n _totalSupply -= amount;\n emit Transfer(from, address(0), amount);\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/ERC20BasicApproveExtension.sol": { + "content": "//SPDX-License-Identifier: MIT\n\npragma solidity 0.8.23;\n\nimport {Context} from \"@openzeppelin/contracts/utils/Context.sol\";\nimport {ERC20Internal} from \"./ERC20Internal.sol\";\nimport {IErrors} from \"../interfaces/IErrors.sol\";\nimport {BytesUtil} from \"../libraries/BytesUtil.sol\";\n\nabstract contract ERC20BasicApproveExtension is IErrors, ERC20Internal, Context {\n /// @notice Approve `target` to spend `amount` and call it with data.\n /// @param target The address to be given rights to transfer and destination of the call.\n /// @param amount The number of tokens allowed.\n /// @param data The bytes for the call.\n /// @return The data of the call.\n function approveAndCall(\n address target,\n uint256 amount,\n bytes calldata data\n ) external payable returns (bytes memory) {\n if (!BytesUtil.doFirstParamEqualsAddress(data, _msgSender())) {\n revert FirstParamNotSender();\n }\n\n _approveFor(_msgSender(), target, amount);\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returnData) = target.call{value: msg.value}(data);\n if (!success) {\n revert CallFailed(string(returnData));\n }\n return returnData;\n }\n\n /// @notice Temporarily approve `target` to spend `amount` and call it with data.\n /// Previous approvals remains unchanged.\n /// @param target The destination of the call, allowed to spend the amount specified\n /// @param amount The number of tokens allowed to spend.\n /// @param data The bytes for the call.\n /// @return The data of the call.\n function paidCall(address target, uint256 amount, bytes calldata data) external payable returns (bytes memory) {\n if (!BytesUtil.doFirstParamEqualsAddress(data, _msgSender())) {\n revert FirstParamNotSender();\n }\n\n if (amount > 0) {\n _addAllowanceIfNeeded(_msgSender(), target, amount);\n }\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returnData) = target.call{value: msg.value}(data);\n if (!success) {\n revert CallFailed(string(returnData));\n }\n\n return returnData;\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/ERC20Internal.sol": { + "content": "//SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nabstract contract ERC20Internal {\n function _approveFor(address owner, address target, uint256 amount) internal virtual;\n\n function _addAllowanceIfNeeded(address owner, address spender, uint256 amountNeeded) internal virtual;\n\n function _transfer(address from, address to, uint256 amount) internal virtual;\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/ERC2771Handler.sol": { + "content": "// SPDX-License-Identifier: MIT\n// solhint-disable-next-line compiler-version\npragma solidity 0.8.23;\n\n/// @title ERC2771Handler\n/// @author The Sandbox\n/// @notice Handle meta-transactions\n/// @dev minimal ERC2771 handler to keep bytecode-size down\n/// based on: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.6.0/contracts/metatx/ERC2771Context.sol\n/// with an initializer for proxies and a mutable forwarder\nabstract contract ERC2771Handler {\n address internal _trustedForwarder;\n\n event TrustedForwarderSet(address indexed newForwarder);\n\n /// @dev Initializes the contract\n /// @param forwarder trusted forwarder address\n function __ERC2771Handler_initialize(address forwarder) internal {\n _trustedForwarder = forwarder;\n emit TrustedForwarderSet(_trustedForwarder);\n }\n\n /// @notice Checks if an address is a trusted forwarder\n /// @param forwarder address to check\n /// @return is trusted\n function isTrustedForwarder(address forwarder) public view returns (bool) {\n return forwarder == _trustedForwarder;\n }\n\n /// @notice Get the current trusted forwarder\n /// @return trustedForwarder address of the trusted forwarder\n function getTrustedForwarder() external view returns (address) {\n return _trustedForwarder;\n }\n\n /// @dev if the call comes from the trusted forwarder, it gets the real sender by checking the encoded address in the data\n /// @return sender address of the real sender\n function _msgSender() internal view virtual returns (address sender) {\n if (isTrustedForwarder(msg.sender)) {\n // The assembly code is more direct than the Solidity version using `abi.decode`.\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sender := shr(96, calldataload(sub(calldatasize(), 20)))\n }\n } else {\n return msg.sender;\n }\n }\n\n /// @dev if the call comes from the trusted forwarder, it substracts the sender address from `msg.data` to get the real `msg.data`\n /// @return the real `msg.data`\n function _msgData() internal view virtual returns (bytes calldata) {\n if (isTrustedForwarder(msg.sender)) {\n return msg.data[:msg.data.length - 20];\n } else {\n return msg.data;\n }\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/SandBaseToken.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.23;\n\nimport {ERC20BasicApproveExtension} from \"./ERC20BasicApproveExtension.sol\";\nimport {ERC20BaseToken} from \"./ERC20BaseToken.sol\";\n\ncontract SandBaseToken is ERC20BaseToken, ERC20BasicApproveExtension {\n constructor(\n address sandAdmin,\n address executionAdmin,\n address beneficiary,\n uint256 amount\n ) ERC20BaseToken(\"SAND\", \"SAND\", sandAdmin, executionAdmin) {\n _changeAdmin(sandAdmin);\n if (beneficiary != address(0)) {\n uint256 initialSupply = amount * (1 ether);\n _mint(beneficiary, initialSupply);\n }\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/WithAdmin.sol": { + "content": "//SPDX-License-Identifier: MIT\n// solhint-disable-next-line compiler-version\npragma solidity 0.8.23;\n\nimport {IErrors} from \"../interfaces/IErrors.sol\";\n\ncontract WithAdmin is IErrors {\n address internal _admin;\n\n /// @dev Emits when the contract administrator is changed.\n /// @param oldAdmin The address of the previous administrator.\n /// @param newAdmin The address of the new administrator.\n event AdminChanged(address indexed oldAdmin, address indexed newAdmin);\n\n modifier onlyAdmin() {\n if (msg.sender != _admin) {\n revert OnlyAdmin();\n }\n _;\n }\n\n /// @dev Get the current administrator of this contract.\n /// @return The current administrator of this contract.\n function getAdmin() external view returns (address) {\n return _admin;\n }\n\n /// @dev Change the administrator to be `newAdmin`.\n /// @param newAdmin The address of the new administrator.\n function changeAdmin(address newAdmin) external onlyAdmin {\n _changeAdmin(newAdmin);\n }\n\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_admin, newAdmin);\n _admin = newAdmin;\n }\n}\n" + }, + "@sandbox-smart-contracts/oft-sand/contracts/sand/WithSuperOperators.sol": { + "content": "//SPDX-License-Identifier: MIT\n// solhint-disable-next-line compiler-version\npragma solidity 0.8.23;\n\nimport {IErrors} from \"../interfaces/IErrors.sol\";\nimport {WithAdmin} from \"./WithAdmin.sol\";\n\ncontract WithSuperOperators is IErrors, WithAdmin {\n mapping(address => bool) internal _superOperators;\n\n event SuperOperator(address indexed superOperator, bool indexed enabled);\n\n /// @notice Enable or disable the ability of `superOperator` to transfer tokens of all (superOperator rights).\n /// @param superOperator address that will be given/removed superOperator right.\n /// @param enabled set whether the superOperator is enabled or disabled.\n function setSuperOperator(address superOperator, bool enabled) external onlyAdmin {\n _superOperators[superOperator] = enabled;\n emit SuperOperator(superOperator, enabled);\n }\n\n /// @notice check whether address `who` is given superOperator rights.\n /// @param who The address to query.\n /// @return whether the address has superOperator rights.\n function isSuperOperator(address who) public view returns (bool) {\n return _superOperators[who];\n }\n}\n" + }, + "solidity-bytes-utils/contracts/BytesLib.sol": { + "content": "// SPDX-License-Identifier: Unlicense\n/*\n * @title Solidity Bytes Arrays Utils\n * @author Gonçalo Sá \n *\n * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.\n * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.\n */\npragma solidity >=0.8.0 <0.9.0;\n\n\nlibrary BytesLib {\n function concat(\n bytes memory _preBytes,\n bytes memory _postBytes\n )\n internal\n pure\n returns (bytes memory)\n {\n bytes memory tempBytes;\n\n assembly {\n // Get a location of some free memory and store it in tempBytes as\n // Solidity does for memory variables.\n tempBytes := mload(0x40)\n\n // Store the length of the first bytes array at the beginning of\n // the memory for tempBytes.\n let length := mload(_preBytes)\n mstore(tempBytes, length)\n\n // Maintain a memory counter for the current write location in the\n // temp bytes array by adding the 32 bytes for the array length to\n // the starting location.\n let mc := add(tempBytes, 0x20)\n // Stop copying when the memory counter reaches the length of the\n // first bytes array.\n let end := add(mc, length)\n\n for {\n // Initialize a copy counter to the start of the _preBytes data,\n // 32 bytes into its memory.\n let cc := add(_preBytes, 0x20)\n } lt(mc, end) {\n // Increase both counters by 32 bytes each iteration.\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n // Write the _preBytes data into the tempBytes memory 32 bytes\n // at a time.\n mstore(mc, mload(cc))\n }\n\n // Add the length of _postBytes to the current length of tempBytes\n // and store it as the new length in the first 32 bytes of the\n // tempBytes memory.\n length := mload(_postBytes)\n mstore(tempBytes, add(length, mload(tempBytes)))\n\n // Move the memory counter back from a multiple of 0x20 to the\n // actual end of the _preBytes data.\n mc := end\n // Stop copying when the memory counter reaches the new combined\n // length of the arrays.\n end := add(mc, length)\n\n for {\n let cc := add(_postBytes, 0x20)\n } lt(mc, end) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n mstore(mc, mload(cc))\n }\n\n // Update the free-memory pointer by padding our last write location\n // to 32 bytes: add 31 bytes to the end of tempBytes to move to the\n // next 32 byte block, then round down to the nearest multiple of\n // 32. If the sum of the length of the two arrays is zero then add\n // one before rounding down to leave a blank 32 bytes (the length block with 0).\n mstore(0x40, and(\n add(add(end, iszero(add(length, mload(_preBytes)))), 31),\n not(31) // Round down to the nearest 32 bytes.\n ))\n }\n\n return tempBytes;\n }\n\n function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {\n assembly {\n // Read the first 32 bytes of _preBytes storage, which is the length\n // of the array. (We don't need to use the offset into the slot\n // because arrays use the entire slot.)\n let fslot := sload(_preBytes.slot)\n // Arrays of 31 bytes or less have an even value in their slot,\n // while longer arrays have an odd value. The actual length is\n // the slot divided by two for odd values, and the lowest order\n // byte divided by two for even values.\n // If the slot is even, bitwise and the slot with 255 and divide by\n // two to get the length. If the slot is odd, bitwise and the slot\n // with -1 and divide by two.\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\n let mlength := mload(_postBytes)\n let newlength := add(slength, mlength)\n // slength can contain both the length and contents of the array\n // if length < 32 bytes so let's prepare for that\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\n switch add(lt(slength, 32), lt(newlength, 32))\n case 2 {\n // Since the new array still fits in the slot, we just need to\n // update the contents of the slot.\n // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length\n sstore(\n _preBytes.slot,\n // all the modifications to the slot are inside this\n // next block\n add(\n // we can just add to the slot contents because the\n // bytes we want to change are the LSBs\n fslot,\n add(\n mul(\n div(\n // load the bytes from memory\n mload(add(_postBytes, 0x20)),\n // zero all bytes to the right\n exp(0x100, sub(32, mlength))\n ),\n // and now shift left the number of bytes to\n // leave space for the length in the slot\n exp(0x100, sub(32, newlength))\n ),\n // increase length by the double of the memory\n // bytes length\n mul(mlength, 2)\n )\n )\n )\n }\n case 1 {\n // The stored value fits in the slot, but the combined value\n // will exceed it.\n // get the keccak hash to get the contents of the array\n mstore(0x0, _preBytes.slot)\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\n\n // save new length\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\n\n // The contents of the _postBytes array start 32 bytes into\n // the structure. Our first read should obtain the `submod`\n // bytes that can fit into the unused space in the last word\n // of the stored array. To get this, we read 32 bytes starting\n // from `submod`, so the data we read overlaps with the array\n // contents by `submod` bytes. Masking the lowest-order\n // `submod` bytes allows us to add that value directly to the\n // stored value.\n\n let submod := sub(32, slength)\n let mc := add(_postBytes, submod)\n let end := add(_postBytes, mlength)\n let mask := sub(exp(0x100, submod), 1)\n\n sstore(\n sc,\n add(\n and(\n fslot,\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\n ),\n and(mload(mc), mask)\n )\n )\n\n for {\n mc := add(mc, 0x20)\n sc := add(sc, 1)\n } lt(mc, end) {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } {\n sstore(sc, mload(mc))\n }\n\n mask := exp(0x100, sub(mc, end))\n\n sstore(sc, mul(div(mload(mc), mask), mask))\n }\n default {\n // get the keccak hash to get the contents of the array\n mstore(0x0, _preBytes.slot)\n // Start copying to the last used word of the stored array.\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\n\n // save new length\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\n\n // Copy over the first `submod` bytes of the new data as in\n // case 1 above.\n let slengthmod := mod(slength, 32)\n let mlengthmod := mod(mlength, 32)\n let submod := sub(32, slengthmod)\n let mc := add(_postBytes, submod)\n let end := add(_postBytes, mlength)\n let mask := sub(exp(0x100, submod), 1)\n\n sstore(sc, add(sload(sc), and(mload(mc), mask)))\n\n for {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } lt(mc, end) {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } {\n sstore(sc, mload(mc))\n }\n\n mask := exp(0x100, sub(mc, end))\n\n sstore(sc, mul(div(mload(mc), mask), mask))\n }\n }\n }\n\n function slice(\n bytes memory _bytes,\n uint256 _start,\n uint256 _length\n )\n internal\n pure\n returns (bytes memory)\n {\n require(_length + 31 >= _length, \"slice_overflow\");\n require(_bytes.length >= _start + _length, \"slice_outOfBounds\");\n\n bytes memory tempBytes;\n\n assembly {\n switch iszero(_length)\n case 0 {\n // Get a location of some free memory and store it in tempBytes as\n // Solidity does for memory variables.\n tempBytes := mload(0x40)\n\n // The first word of the slice result is potentially a partial\n // word read from the original array. To read it, we calculate\n // the length of that partial word and start copying that many\n // bytes into the array. The first word we copy will start with\n // data we don't care about, but the last `lengthmod` bytes will\n // land at the beginning of the contents of the new array. When\n // we're done copying, we overwrite the full first word with\n // the actual length of the slice.\n let lengthmod := and(_length, 31)\n\n // The multiplication in the next line is necessary\n // because when slicing multiples of 32 bytes (lengthmod == 0)\n // the following copy loop was copying the origin's length\n // and then ending prematurely not copying everything it should.\n let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))\n let end := add(mc, _length)\n\n for {\n // The multiplication in the next line has the same exact purpose\n // as the one above.\n let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)\n } lt(mc, end) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n mstore(mc, mload(cc))\n }\n\n mstore(tempBytes, _length)\n\n //update free-memory pointer\n //allocating the array padded to 32 bytes like the compiler does now\n mstore(0x40, and(add(mc, 31), not(31)))\n }\n //if we want a zero-length slice let's just return a zero-length array\n default {\n tempBytes := mload(0x40)\n //zero out the 32 bytes slice we are about to return\n //we need to do it because Solidity does not garbage collect\n mstore(tempBytes, 0)\n\n mstore(0x40, add(tempBytes, 0x20))\n }\n }\n\n return tempBytes;\n }\n\n function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {\n require(_bytes.length >= _start + 20, \"toAddress_outOfBounds\");\n address tempAddress;\n\n assembly {\n tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\n }\n\n return tempAddress;\n }\n\n function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {\n require(_bytes.length >= _start + 1 , \"toUint8_outOfBounds\");\n uint8 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x1), _start))\n }\n\n return tempUint;\n }\n\n function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) {\n require(_bytes.length >= _start + 2, \"toUint16_outOfBounds\");\n uint16 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x2), _start))\n }\n\n return tempUint;\n }\n\n function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) {\n require(_bytes.length >= _start + 4, \"toUint32_outOfBounds\");\n uint32 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x4), _start))\n }\n\n return tempUint;\n }\n\n function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) {\n require(_bytes.length >= _start + 8, \"toUint64_outOfBounds\");\n uint64 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x8), _start))\n }\n\n return tempUint;\n }\n\n function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) {\n require(_bytes.length >= _start + 12, \"toUint96_outOfBounds\");\n uint96 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0xc), _start))\n }\n\n return tempUint;\n }\n\n function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {\n require(_bytes.length >= _start + 16, \"toUint128_outOfBounds\");\n uint128 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x10), _start))\n }\n\n return tempUint;\n }\n\n function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {\n require(_bytes.length >= _start + 32, \"toUint256_outOfBounds\");\n uint256 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x20), _start))\n }\n\n return tempUint;\n }\n\n function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) {\n require(_bytes.length >= _start + 32, \"toBytes32_outOfBounds\");\n bytes32 tempBytes32;\n\n assembly {\n tempBytes32 := mload(add(add(_bytes, 0x20), _start))\n }\n\n return tempBytes32;\n }\n\n function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\n bool success = true;\n\n assembly {\n let length := mload(_preBytes)\n\n // if lengths don't match the arrays are not equal\n switch eq(length, mload(_postBytes))\n case 1 {\n // cb is a circuit breaker in the for loop since there's\n // no said feature for inline assembly loops\n // cb = 1 - don't breaker\n // cb = 0 - break\n let cb := 1\n\n let mc := add(_preBytes, 0x20)\n let end := add(mc, length)\n\n for {\n let cc := add(_postBytes, 0x20)\n // the next line is the loop condition:\n // while(uint256(mc < end) + cb == 2)\n } eq(add(lt(mc, end), cb), 2) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n // if any of these checks fails then arrays are not equal\n if iszero(eq(mload(mc), mload(cc))) {\n // unsuccess:\n success := 0\n cb := 0\n }\n }\n }\n default {\n // unsuccess:\n success := 0\n }\n }\n\n return success;\n }\n\n function equal_nonAligned(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\n bool success = true;\n\n assembly {\n let length := mload(_preBytes)\n\n // if lengths don't match the arrays are not equal\n switch eq(length, mload(_postBytes))\n case 1 {\n // cb is a circuit breaker in the for loop since there's\n // no said feature for inline assembly loops\n // cb = 1 - don't breaker\n // cb = 0 - break\n let cb := 1\n\n let endMinusWord := add(_preBytes, length)\n let mc := add(_preBytes, 0x20)\n let cc := add(_postBytes, 0x20)\n\n for {\n // the next line is the loop condition:\n // while(uint256(mc < endWord) + cb == 2)\n } eq(add(lt(mc, endMinusWord), cb), 2) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n // if any of these checks fails then arrays are not equal\n if iszero(eq(mload(mc), mload(cc))) {\n // unsuccess:\n success := 0\n cb := 0\n }\n }\n\n // Only if still successful\n // For <1 word tail bytes\n if gt(success, 0) {\n // Get the remainder of length/32\n // length % 32 = AND(length, 32 - 1)\n let numTailBytes := and(length, 0x1f)\n let mcRem := mload(mc)\n let ccRem := mload(cc)\n for {\n let i := 0\n // the next line is the loop condition:\n // while(uint256(i < numTailBytes) + cb == 2)\n } eq(add(lt(i, numTailBytes), cb), 2) {\n i := add(i, 1)\n } {\n if iszero(eq(byte(i, mcRem), byte(i, ccRem))) {\n // unsuccess:\n success := 0\n cb := 0\n }\n }\n }\n }\n default {\n // unsuccess:\n success := 0\n }\n }\n\n return success;\n }\n\n function equalStorage(\n bytes storage _preBytes,\n bytes memory _postBytes\n )\n internal\n view\n returns (bool)\n {\n bool success = true;\n\n assembly {\n // we know _preBytes_offset is 0\n let fslot := sload(_preBytes.slot)\n // Decode the length of the stored array like in concatStorage().\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\n let mlength := mload(_postBytes)\n\n // if lengths don't match the arrays are not equal\n switch eq(slength, mlength)\n case 1 {\n // slength can contain both the length and contents of the array\n // if length < 32 bytes so let's prepare for that\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\n if iszero(iszero(slength)) {\n switch lt(slength, 32)\n case 1 {\n // blank the last byte which is the length\n fslot := mul(div(fslot, 0x100), 0x100)\n\n if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {\n // unsuccess:\n success := 0\n }\n }\n default {\n // cb is a circuit breaker in the for loop since there's\n // no said feature for inline assembly loops\n // cb = 1 - don't breaker\n // cb = 0 - break\n let cb := 1\n\n // get the keccak hash to get the contents of the array\n mstore(0x0, _preBytes.slot)\n let sc := keccak256(0x0, 0x20)\n\n let mc := add(_postBytes, 0x20)\n let end := add(mc, mlength)\n\n // the next line is the loop condition:\n // while(uint256(mc < end) + cb == 2)\n for {} eq(add(lt(mc, end), cb), 2) {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } {\n if iszero(eq(sload(sc), mload(mc))) {\n // unsuccess:\n success := 0\n cb := 0\n }\n }\n }\n }\n }\n default {\n // unsuccess:\n success := 0\n }\n }\n\n return success;\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 2000 + }, + "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/packages/deploy/hardhat.config.ts b/packages/deploy/hardhat.config.ts index 3cc49cd216..6047b20373 100644 --- a/packages/deploy/hardhat.config.ts +++ b/packages/deploy/hardhat.config.ts @@ -78,7 +78,7 @@ const importedPackages = { const namedAccounts = { deployer: { default: 1, - mainnet: '0xe19ae8F9B36Ca43D12741288D0e311396140DF6F', + mainnet: '0xCba49d154b4Bb9a9aD7F5Dad396CB9a0a3a62ABc', polygon: '0xCba49d154b4Bb9a9aD7F5Dad396CB9a0a3a62ABc', goerli: '0xA796AE911621E00809E0E7C8f0AD6BF118E5139e', sepolia: '0xA796AE911621E00809E0E7C8f0AD6BF118E5139e', @@ -86,6 +86,8 @@ const namedAccounts = { mumbai: '0x5F890c9522dCE5670d741D4277BFCC2d9cA8Af02', amoy: '0x5F890c9522dCE5670d741D4277BFCC2d9cA8Af02', baseSepolia: '0xA796AE911621E00809E0E7C8f0AD6BF118E5139e', + base: '0xCba49d154b4Bb9a9aD7F5Dad396CB9a0a3a62ABc', + bscMainnet: '0xCba49d154b4Bb9a9aD7F5Dad396CB9a0a3a62ABc', }, // deploy contracts and make sure they are set up correctly sandAdmin: { @@ -98,6 +100,8 @@ const namedAccounts = { mumbai: '0x49c4D4C94829B9c44052C5f5Cb164Fc612181165', amoy: '0x49c4D4C94829B9c44052C5f5Cb164Fc612181165', baseSepolia: '0x39D01ecc951C2c1f20ba0549e62212659c4d1e06', + base: '0x18987794f808eE72Ae9127058F1C7d079736Ca45', + bscMainnet: '0x47032F58129341B90c83E312eE22d2e74D584B4A', }, // can add super operators and change admin operationsAdmin: { From 81c4460801de9b0892f0b28285b055beec05a51a Mon Sep 17 00:00:00 2001 From: wojciech-turek Date: Fri, 2 Aug 2024 11:45:07 +0200 Subject: [PATCH 2/4] Fix base lz setup script --- .../deploy/deploy/800_oft_sand/803_oft_sand_setup_base.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/deploy/deploy/800_oft_sand/803_oft_sand_setup_base.ts b/packages/deploy/deploy/800_oft_sand/803_oft_sand_setup_base.ts index 60b3e2c4ca..29fa2a0a33 100644 --- a/packages/deploy/deploy/800_oft_sand/803_oft_sand_setup_base.ts +++ b/packages/deploy/deploy/800_oft_sand/803_oft_sand_setup_base.ts @@ -34,13 +34,12 @@ const func: DeployFunction = async function ( if (OFTAdapterForSand && OFTSandBsc) { const isPeerForEthereum = await read( - 'OFTAdapterForSand', + 'OFTSand', 'isPeer', eidEthereum, ethers.zeroPadValue(OFTAdapterForSand.address, 32) ); if (!isPeerForEthereum) { - // setting OFTAdapterForSand as peer to OFTSand(base) using eidEthereum await execute( 'OFTSand', {from: deployer, log: true}, @@ -51,7 +50,7 @@ const func: DeployFunction = async function ( } const isPeerForBsc = await read( - 'OFTAdapterForSand', + 'OFTSand', 'isPeer', eidBsc, ethers.zeroPadValue(OFTSandBsc.address, 32) From f678bdd4f3ee71d178515e41e01cfb3ca37b500f Mon Sep 17 00:00:00 2001 From: wojciech-turek Date: Thu, 8 Aug 2024 19:20:29 +0200 Subject: [PATCH 3/4] Align on smart contract name --- .../800_oft_sand/800_deploy_oft_adapter.ts | 2 +- .../800_oft_sand/801_deploy_oft_sand.ts | 2 +- .../deploy_mocks/1000_deploy_lz_endpoint.ts | 2 +- .../deploy/deployments/base/EndPointV2.json | 2357 ++++++++++++++++- .../deployments/bscMainnet/EndPointV2.json | 2355 +++++++++++++++- .../deployments/mainnet/EndpointV2.json | 2353 +++++++++++++++- 6 files changed, 7062 insertions(+), 9 deletions(-) diff --git a/packages/deploy/deploy/800_oft_sand/800_deploy_oft_adapter.ts b/packages/deploy/deploy/800_oft_sand/800_deploy_oft_adapter.ts index 7a0fa68ddb..93fc754bef 100644 --- a/packages/deploy/deploy/800_oft_sand/800_deploy_oft_adapter.ts +++ b/packages/deploy/deploy/800_oft_sand/800_deploy_oft_adapter.ts @@ -1,5 +1,5 @@ -import {HardhatRuntimeEnvironment} from 'hardhat/types'; import {DeployFunction} from 'hardhat-deploy/types'; +import {HardhatRuntimeEnvironment} from 'hardhat/types'; const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const {deployments, getNamedAccounts} = hre; diff --git a/packages/deploy/deploy/800_oft_sand/801_deploy_oft_sand.ts b/packages/deploy/deploy/800_oft_sand/801_deploy_oft_sand.ts index d3dc7a564a..89c7cba65b 100644 --- a/packages/deploy/deploy/800_oft_sand/801_deploy_oft_sand.ts +++ b/packages/deploy/deploy/800_oft_sand/801_deploy_oft_sand.ts @@ -7,7 +7,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const {deployer, sandAdmin, sandExecutionAdmin} = await getNamedAccounts(); const TRUSTED_FORWARDER_V2 = await deployments.get('TRUSTED_FORWARDER_V2'); - const EndpointV2 = await deployments.get('EndPointV2'); + const EndpointV2 = await deployments.get('EndpointV2'); await deploy('OFTSand', { from: deployer, diff --git a/packages/deploy/deploy_mocks/1000_deploy_lz_endpoint.ts b/packages/deploy/deploy_mocks/1000_deploy_lz_endpoint.ts index fd446a32f0..e9dc4fc6ed 100644 --- a/packages/deploy/deploy_mocks/1000_deploy_lz_endpoint.ts +++ b/packages/deploy/deploy_mocks/1000_deploy_lz_endpoint.ts @@ -1,5 +1,5 @@ -import {HardhatRuntimeEnvironment} from 'hardhat/types'; import {DeployFunction} from 'hardhat-deploy/types'; +import {HardhatRuntimeEnvironment} from 'hardhat/types'; const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const {deployments, getNamedAccounts} = hre; diff --git a/packages/deploy/deployments/base/EndPointV2.json b/packages/deploy/deployments/base/EndPointV2.json index af3d28e025..572508be4f 100644 --- a/packages/deploy/deployments/base/EndPointV2.json +++ b/packages/deploy/deployments/base/EndPointV2.json @@ -1,4 +1,2355 @@ { - "address": "0x1a44076050125825900e736c501f859c50fE728c", - "abi": [] - } \ No newline at end of file + "address": "0x1a44076050125825900e736c501f859c50fE728c", + "abi": [ + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "LZ_AlreadyRegistered", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_ComposeExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "LZ_ComposeNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_DefaultReceiveLibUnavailable", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_DefaultSendLibUnavailable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requiredNative", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "suppliedNative", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLzToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "suppliedLzToken", + "type": "uint256" + } + ], + "name": "LZ_InsufficientFee", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_InvalidExpiry", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "name": "LZ_InvalidNonce", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_InvalidPayloadHash", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_InvalidReceiveLibrary", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_LzTokenUnavailable", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_OnlyNonDefaultLib", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_OnlyReceiveLib", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_OnlyRegisteredLib", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_OnlyRegisteredOrDefaultLib", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_OnlySendLib", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_PathNotInitializable", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_PathNotVerifiable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "LZ_PayloadHashNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_SameValue", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_SendReentrancy", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_UnsupportedEid", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_UnsupportedInterface", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_ZeroLzTokenFee", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + } + ], + "name": "Transfer_NativeFailed", + "type": "error" + }, + { + "inputs": [], + "name": "Transfer_ToAddressIsZero", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "index", + "type": "uint16" + } + ], + "name": "ComposeDelivered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "index", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "message", + "type": "bytes" + } + ], + "name": "ComposeSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "newLib", + "type": "address" + } + ], + "name": "DefaultReceiveLibrarySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldLib", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + } + ], + "name": "DefaultReceiveLibraryTimeoutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "newLib", + "type": "address" + } + ], + "name": "DefaultSendLibrarySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "DelegateSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "name": "InboundNonceSkipped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newLib", + "type": "address" + } + ], + "name": "LibraryRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "executor", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "index", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "reason", + "type": "bytes" + } + ], + "name": "LzComposeAlert", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "executor", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "indexed": false, + "internalType": "struct Origin", + "name": "origin", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "reason", + "type": "bytes" + } + ], + "name": "LzReceiveAlert", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "LzTokenSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "payloadHash", + "type": "bytes32" + } + ], + "name": "PacketBurnt", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "indexed": false, + "internalType": "struct Origin", + "name": "origin", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "PacketDelivered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "payloadHash", + "type": "bytes32" + } + ], + "name": "PacketNilified", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "encodedPayload", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "options", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "address", + "name": "sendLibrary", + "type": "address" + } + ], + "name": "PacketSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "indexed": false, + "internalType": "struct Origin", + "name": "origin", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "payloadHash", + "type": "bytes32" + } + ], + "name": "PacketVerified", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "newLib", + "type": "address" + } + ], + "name": "ReceiveLibrarySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldLib", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timeout", + "type": "uint256" + } + ], + "name": "ReceiveLibraryTimeoutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "newLib", + "type": "address" + } + ], + "name": "SendLibrarySet", + "type": "event" + }, + { + "inputs": [], + "name": "EMPTY_PAYLOAD_HASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NIL_PAYLOAD_HASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "blockedLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_payloadHash", + "type": "bytes32" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + } + ], + "name": "clear", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "internalType": "uint16", + "name": "index", + "type": "uint16" + } + ], + "name": "composeQueue", + "outputs": [ + { + "internalType": "bytes32", + "name": "messageHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + } + ], + "name": "defaultReceiveLibrary", + "outputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + } + ], + "name": "defaultReceiveLibraryTimeout", + "outputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + } + ], + "name": "defaultSendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oapp", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eid", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "address", + "name": "_lib", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_configType", + "type": "uint32" + } + ], + "name": "getConfig", + "outputs": [ + { + "internalType": "bytes", + "name": "config", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_srcEid", + "type": "uint32" + } + ], + "name": "getReceiveLibrary", + "outputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + }, + { + "internalType": "bool", + "name": "isDefault", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRegisteredLibraries", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSendContext", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_dstEid", + "type": "uint32" + } + ], + "name": "getSendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_sender", + "type": "bytes32" + } + ], + "name": "inboundNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "inboundNonce", + "type": "uint64" + } + ], + "name": "inboundPayloadHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "payloadHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "initializable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_dstEid", + "type": "uint32" + } + ], + "name": "isDefaultSendLibrary", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + } + ], + "name": "isRegisteredLibrary", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isSendingMessage", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + } + ], + "name": "isSupportedEid", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_srcEid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_actualReceiveLib", + "type": "address" + } + ], + "name": "isValidReceiveLibrary", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + } + ], + "name": "lazyInboundNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "uint16", + "name": "_index", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "lzCompose", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "uint16", + "name": "_index", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "_gas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_reason", + "type": "bytes" + } + ], + "name": "lzComposeAlert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "lzReceive", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_gas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_reason", + "type": "bytes" + } + ], + "name": "lzReceiveAlert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lzToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nativeToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_receiver", + "type": "bytes32" + } + ], + "name": "nextGuid", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_payloadHash", + "type": "bytes32" + } + ], + "name": "nilify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "receiver", + "type": "bytes32" + } + ], + "name": "outboundNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "receiver", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "options", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "payInLzToken", + "type": "bool" + } + ], + "internalType": "struct MessagingParams", + "name": "_params", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_sender", + "type": "address" + } + ], + "name": "quote", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lzTokenFee", + "type": "uint256" + } + ], + "internalType": "struct MessagingFee", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + } + ], + "name": "receiveLibraryTimeout", + "outputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "recoverToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_lib", + "type": "address" + } + ], + "name": "registerLibrary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "receiver", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "options", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "payInLzToken", + "type": "bool" + } + ], + "internalType": "struct MessagingParams", + "name": "_params", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_refundAddress", + "type": "address" + } + ], + "name": "send", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lzTokenFee", + "type": "uint256" + } + ], + "internalType": "struct MessagingFee", + "name": "fee", + "type": "tuple" + } + ], + "internalType": "struct MessagingReceipt", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "uint16", + "name": "_index", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + } + ], + "name": "sendCompose", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "address", + "name": "_lib", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "configType", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "config", + "type": "bytes" + } + ], + "internalType": "struct SetConfigParam[]", + "name": "_params", + "type": "tuple[]" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_newLib", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_gracePeriod", + "type": "uint256" + } + ], + "name": "setDefaultReceiveLibrary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_lib", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_expiry", + "type": "uint256" + } + ], + "name": "setDefaultReceiveLibraryTimeout", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_newLib", + "type": "address" + } + ], + "name": "setDefaultSendLibrary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_lzToken", + "type": "address" + } + ], + "name": "setLzToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_newLib", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_gracePeriod", + "type": "uint256" + } + ], + "name": "setReceiveLibrary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_lib", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_expiry", + "type": "uint256" + } + ], + "name": "setReceiveLibraryTimeout", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_newLib", + "type": "address" + } + ], + "name": "setSendLibrary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + } + ], + "name": "skip", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "verifiable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_payloadHash", + "type": "bytes32" + } + ], + "name": "verify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/packages/deploy/deployments/bscMainnet/EndPointV2.json b/packages/deploy/deployments/bscMainnet/EndPointV2.json index b1f41e9f38..572508be4f 100644 --- a/packages/deploy/deployments/bscMainnet/EndPointV2.json +++ b/packages/deploy/deployments/bscMainnet/EndPointV2.json @@ -1,4 +1,2355 @@ { "address": "0x1a44076050125825900e736c501f859c50fE728c", - "abi": [] -} \ No newline at end of file + "abi": [ + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "LZ_AlreadyRegistered", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_ComposeExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "LZ_ComposeNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_DefaultReceiveLibUnavailable", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_DefaultSendLibUnavailable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requiredNative", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "suppliedNative", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLzToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "suppliedLzToken", + "type": "uint256" + } + ], + "name": "LZ_InsufficientFee", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_InvalidExpiry", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "name": "LZ_InvalidNonce", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_InvalidPayloadHash", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_InvalidReceiveLibrary", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_LzTokenUnavailable", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_OnlyNonDefaultLib", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_OnlyReceiveLib", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_OnlyRegisteredLib", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_OnlyRegisteredOrDefaultLib", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_OnlySendLib", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_PathNotInitializable", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_PathNotVerifiable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "LZ_PayloadHashNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_SameValue", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_SendReentrancy", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_UnsupportedEid", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_UnsupportedInterface", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_ZeroLzTokenFee", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + } + ], + "name": "Transfer_NativeFailed", + "type": "error" + }, + { + "inputs": [], + "name": "Transfer_ToAddressIsZero", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "index", + "type": "uint16" + } + ], + "name": "ComposeDelivered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "index", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "message", + "type": "bytes" + } + ], + "name": "ComposeSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "newLib", + "type": "address" + } + ], + "name": "DefaultReceiveLibrarySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldLib", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + } + ], + "name": "DefaultReceiveLibraryTimeoutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "newLib", + "type": "address" + } + ], + "name": "DefaultSendLibrarySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "DelegateSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "name": "InboundNonceSkipped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newLib", + "type": "address" + } + ], + "name": "LibraryRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "executor", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "index", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "reason", + "type": "bytes" + } + ], + "name": "LzComposeAlert", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "executor", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "indexed": false, + "internalType": "struct Origin", + "name": "origin", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "reason", + "type": "bytes" + } + ], + "name": "LzReceiveAlert", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "LzTokenSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "payloadHash", + "type": "bytes32" + } + ], + "name": "PacketBurnt", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "indexed": false, + "internalType": "struct Origin", + "name": "origin", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "PacketDelivered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "payloadHash", + "type": "bytes32" + } + ], + "name": "PacketNilified", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "encodedPayload", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "options", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "address", + "name": "sendLibrary", + "type": "address" + } + ], + "name": "PacketSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "indexed": false, + "internalType": "struct Origin", + "name": "origin", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "payloadHash", + "type": "bytes32" + } + ], + "name": "PacketVerified", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "newLib", + "type": "address" + } + ], + "name": "ReceiveLibrarySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldLib", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timeout", + "type": "uint256" + } + ], + "name": "ReceiveLibraryTimeoutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "newLib", + "type": "address" + } + ], + "name": "SendLibrarySet", + "type": "event" + }, + { + "inputs": [], + "name": "EMPTY_PAYLOAD_HASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NIL_PAYLOAD_HASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "blockedLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_payloadHash", + "type": "bytes32" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + } + ], + "name": "clear", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "internalType": "uint16", + "name": "index", + "type": "uint16" + } + ], + "name": "composeQueue", + "outputs": [ + { + "internalType": "bytes32", + "name": "messageHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + } + ], + "name": "defaultReceiveLibrary", + "outputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + } + ], + "name": "defaultReceiveLibraryTimeout", + "outputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + } + ], + "name": "defaultSendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oapp", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eid", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "address", + "name": "_lib", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_configType", + "type": "uint32" + } + ], + "name": "getConfig", + "outputs": [ + { + "internalType": "bytes", + "name": "config", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_srcEid", + "type": "uint32" + } + ], + "name": "getReceiveLibrary", + "outputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + }, + { + "internalType": "bool", + "name": "isDefault", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRegisteredLibraries", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSendContext", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_dstEid", + "type": "uint32" + } + ], + "name": "getSendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_sender", + "type": "bytes32" + } + ], + "name": "inboundNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "inboundNonce", + "type": "uint64" + } + ], + "name": "inboundPayloadHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "payloadHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "initializable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_dstEid", + "type": "uint32" + } + ], + "name": "isDefaultSendLibrary", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + } + ], + "name": "isRegisteredLibrary", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isSendingMessage", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + } + ], + "name": "isSupportedEid", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_srcEid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_actualReceiveLib", + "type": "address" + } + ], + "name": "isValidReceiveLibrary", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + } + ], + "name": "lazyInboundNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "uint16", + "name": "_index", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "lzCompose", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "uint16", + "name": "_index", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "_gas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_reason", + "type": "bytes" + } + ], + "name": "lzComposeAlert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "lzReceive", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_gas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_reason", + "type": "bytes" + } + ], + "name": "lzReceiveAlert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lzToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nativeToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_receiver", + "type": "bytes32" + } + ], + "name": "nextGuid", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_payloadHash", + "type": "bytes32" + } + ], + "name": "nilify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "receiver", + "type": "bytes32" + } + ], + "name": "outboundNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "receiver", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "options", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "payInLzToken", + "type": "bool" + } + ], + "internalType": "struct MessagingParams", + "name": "_params", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_sender", + "type": "address" + } + ], + "name": "quote", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lzTokenFee", + "type": "uint256" + } + ], + "internalType": "struct MessagingFee", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + } + ], + "name": "receiveLibraryTimeout", + "outputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "recoverToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_lib", + "type": "address" + } + ], + "name": "registerLibrary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "receiver", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "options", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "payInLzToken", + "type": "bool" + } + ], + "internalType": "struct MessagingParams", + "name": "_params", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_refundAddress", + "type": "address" + } + ], + "name": "send", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lzTokenFee", + "type": "uint256" + } + ], + "internalType": "struct MessagingFee", + "name": "fee", + "type": "tuple" + } + ], + "internalType": "struct MessagingReceipt", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "uint16", + "name": "_index", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + } + ], + "name": "sendCompose", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "address", + "name": "_lib", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "configType", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "config", + "type": "bytes" + } + ], + "internalType": "struct SetConfigParam[]", + "name": "_params", + "type": "tuple[]" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_newLib", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_gracePeriod", + "type": "uint256" + } + ], + "name": "setDefaultReceiveLibrary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_lib", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_expiry", + "type": "uint256" + } + ], + "name": "setDefaultReceiveLibraryTimeout", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_newLib", + "type": "address" + } + ], + "name": "setDefaultSendLibrary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_lzToken", + "type": "address" + } + ], + "name": "setLzToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_newLib", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_gracePeriod", + "type": "uint256" + } + ], + "name": "setReceiveLibrary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_lib", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_expiry", + "type": "uint256" + } + ], + "name": "setReceiveLibraryTimeout", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_newLib", + "type": "address" + } + ], + "name": "setSendLibrary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + } + ], + "name": "skip", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "verifiable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_payloadHash", + "type": "bytes32" + } + ], + "name": "verify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/packages/deploy/deployments/mainnet/EndpointV2.json b/packages/deploy/deployments/mainnet/EndpointV2.json index deac9662c6..572508be4f 100644 --- a/packages/deploy/deployments/mainnet/EndpointV2.json +++ b/packages/deploy/deployments/mainnet/EndpointV2.json @@ -1,4 +1,2355 @@ { "address": "0x1a44076050125825900e736c501f859c50fE728c", - "abi": [] + "abi": [ + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "LZ_AlreadyRegistered", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_ComposeExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "LZ_ComposeNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_DefaultReceiveLibUnavailable", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_DefaultSendLibUnavailable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requiredNative", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "suppliedNative", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLzToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "suppliedLzToken", + "type": "uint256" + } + ], + "name": "LZ_InsufficientFee", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_InvalidExpiry", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "name": "LZ_InvalidNonce", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_InvalidPayloadHash", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_InvalidReceiveLibrary", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_LzTokenUnavailable", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_OnlyNonDefaultLib", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_OnlyReceiveLib", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_OnlyRegisteredLib", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_OnlyRegisteredOrDefaultLib", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_OnlySendLib", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_PathNotInitializable", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_PathNotVerifiable", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "expected", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "actual", + "type": "bytes32" + } + ], + "name": "LZ_PayloadHashNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_SameValue", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_SendReentrancy", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_UnsupportedEid", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_UnsupportedInterface", + "type": "error" + }, + { + "inputs": [], + "name": "LZ_ZeroLzTokenFee", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + } + ], + "name": "Transfer_NativeFailed", + "type": "error" + }, + { + "inputs": [], + "name": "Transfer_ToAddressIsZero", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "index", + "type": "uint16" + } + ], + "name": "ComposeDelivered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "index", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "message", + "type": "bytes" + } + ], + "name": "ComposeSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "newLib", + "type": "address" + } + ], + "name": "DefaultReceiveLibrarySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldLib", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + } + ], + "name": "DefaultReceiveLibraryTimeoutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "newLib", + "type": "address" + } + ], + "name": "DefaultSendLibrarySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "name": "DelegateSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "name": "InboundNonceSkipped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newLib", + "type": "address" + } + ], + "name": "LibraryRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "executor", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "index", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "reason", + "type": "bytes" + } + ], + "name": "LzComposeAlert", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "executor", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "indexed": false, + "internalType": "struct Origin", + "name": "origin", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "extraData", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "reason", + "type": "bytes" + } + ], + "name": "LzReceiveAlert", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "LzTokenSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "payloadHash", + "type": "bytes32" + } + ], + "name": "PacketBurnt", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "indexed": false, + "internalType": "struct Origin", + "name": "origin", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "PacketDelivered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "payloadHash", + "type": "bytes32" + } + ], + "name": "PacketNilified", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "encodedPayload", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "options", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "address", + "name": "sendLibrary", + "type": "address" + } + ], + "name": "PacketSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "indexed": false, + "internalType": "struct Origin", + "name": "origin", + "type": "tuple" + }, + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "payloadHash", + "type": "bytes32" + } + ], + "name": "PacketVerified", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "newLib", + "type": "address" + } + ], + "name": "ReceiveLibrarySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldLib", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timeout", + "type": "uint256" + } + ], + "name": "ReceiveLibraryTimeoutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "address", + "name": "newLib", + "type": "address" + } + ], + "name": "SendLibrarySet", + "type": "event" + }, + { + "inputs": [], + "name": "EMPTY_PAYLOAD_HASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "NIL_PAYLOAD_HASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "blockedLibrary", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_payloadHash", + "type": "bytes32" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + } + ], + "name": "clear", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "internalType": "uint16", + "name": "index", + "type": "uint16" + } + ], + "name": "composeQueue", + "outputs": [ + { + "internalType": "bytes32", + "name": "messageHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + } + ], + "name": "defaultReceiveLibrary", + "outputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + } + ], + "name": "defaultReceiveLibraryTimeout", + "outputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + } + ], + "name": "defaultSendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oapp", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "delegate", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eid", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "address", + "name": "_lib", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_configType", + "type": "uint32" + } + ], + "name": "getConfig", + "outputs": [ + { + "internalType": "bytes", + "name": "config", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_srcEid", + "type": "uint32" + } + ], + "name": "getReceiveLibrary", + "outputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + }, + { + "internalType": "bool", + "name": "isDefault", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRegisteredLibraries", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSendContext", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_dstEid", + "type": "uint32" + } + ], + "name": "getSendLibrary", + "outputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_sender", + "type": "bytes32" + } + ], + "name": "inboundNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "inboundNonce", + "type": "uint64" + } + ], + "name": "inboundPayloadHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "payloadHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "initializable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_dstEid", + "type": "uint32" + } + ], + "name": "isDefaultSendLibrary", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + } + ], + "name": "isRegisteredLibrary", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isSendingMessage", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + } + ], + "name": "isSupportedEid", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_srcEid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_actualReceiveLib", + "type": "address" + } + ], + "name": "isValidReceiveLibrary", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + } + ], + "name": "lazyInboundNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "uint16", + "name": "_index", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "lzCompose", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "uint16", + "name": "_index", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "_gas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_reason", + "type": "bytes" + } + ], + "name": "lzComposeAlert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + } + ], + "name": "lzReceive", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_gas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_extraData", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "_reason", + "type": "bytes" + } + ], + "name": "lzReceiveAlert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lzToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nativeToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sender", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_receiver", + "type": "bytes32" + } + ], + "name": "nextGuid", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "_payloadHash", + "type": "bytes32" + } + ], + "name": "nilify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "receiver", + "type": "bytes32" + } + ], + "name": "outboundNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "receiver", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "options", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "payInLzToken", + "type": "bool" + } + ], + "internalType": "struct MessagingParams", + "name": "_params", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_sender", + "type": "address" + } + ], + "name": "quote", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lzTokenFee", + "type": "uint256" + } + ], + "internalType": "struct MessagingFee", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + } + ], + "name": "receiveLibraryTimeout", + "outputs": [ + { + "internalType": "address", + "name": "lib", + "type": "address" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "recoverToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_lib", + "type": "address" + } + ], + "name": "registerLibrary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "dstEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "receiver", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "options", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "payInLzToken", + "type": "bool" + } + ], + "internalType": "struct MessagingParams", + "name": "_params", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_refundAddress", + "type": "address" + } + ], + "name": "send", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "guid", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "nativeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lzTokenFee", + "type": "uint256" + } + ], + "internalType": "struct MessagingFee", + "name": "fee", + "type": "tuple" + } + ], + "internalType": "struct MessagingReceipt", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_guid", + "type": "bytes32" + }, + { + "internalType": "uint16", + "name": "_index", + "type": "uint16" + }, + { + "internalType": "bytes", + "name": "_message", + "type": "bytes" + } + ], + "name": "sendCompose", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "address", + "name": "_lib", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint32", + "name": "eid", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "configType", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "config", + "type": "bytes" + } + ], + "internalType": "struct SetConfigParam[]", + "name": "_params", + "type": "tuple[]" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_newLib", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_gracePeriod", + "type": "uint256" + } + ], + "name": "setDefaultReceiveLibrary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_lib", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_expiry", + "type": "uint256" + } + ], + "name": "setDefaultReceiveLibraryTimeout", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_newLib", + "type": "address" + } + ], + "name": "setDefaultSendLibrary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_delegate", + "type": "address" + } + ], + "name": "setDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_lzToken", + "type": "address" + } + ], + "name": "setLzToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_newLib", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_gracePeriod", + "type": "uint256" + } + ], + "name": "setReceiveLibrary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_lib", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_expiry", + "type": "uint256" + } + ], + "name": "setReceiveLibraryTimeout", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_eid", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_newLib", + "type": "address" + } + ], + "name": "setSendLibrary", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_oapp", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "_sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + } + ], + "name": "skip", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + } + ], + "name": "verifiable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint32", + "name": "srcEid", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "internalType": "struct Origin", + "name": "_origin", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_receiver", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_payloadHash", + "type": "bytes32" + } + ], + "name": "verify", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] } From b1a1e868bd96d6b13e385640af877628e0ba146d Mon Sep 17 00:00:00 2001 From: wojciech-turek Date: Thu, 8 Aug 2024 20:36:25 +0200 Subject: [PATCH 4/4] Fix the scripts so they pass integration tests --- .../deploy/800_oft_sand/802_oft_adapter_setup_ethereum.ts | 3 +++ packages/deploy/deploy/800_oft_sand/803_oft_sand_setup_base.ts | 3 +++ packages/deploy/deploy/800_oft_sand/804_oft_sand_setup_bsc.ts | 3 +++ 3 files changed, 9 insertions(+) diff --git a/packages/deploy/deploy/800_oft_sand/802_oft_adapter_setup_ethereum.ts b/packages/deploy/deploy/800_oft_sand/802_oft_adapter_setup_ethereum.ts index 757982617c..f03b014c7f 100644 --- a/packages/deploy/deploy/800_oft_sand/802_oft_adapter_setup_ethereum.ts +++ b/packages/deploy/deploy/800_oft_sand/802_oft_adapter_setup_ethereum.ts @@ -18,6 +18,9 @@ const func: DeployFunction = async function ( } else if (hre.network.name == 'sepolia') { eidBase = process.env[`EID_${'BASESEPOLIA'}`]; eidBsc = process.env[`EID_${'BSCTESTNET'}`]; + } else if (hre.network.name == 'hardhat') { + eidBsc = 0; + eidBase = 0; } else { throw new Error('Cannot find EID for network'); } diff --git a/packages/deploy/deploy/800_oft_sand/803_oft_sand_setup_base.ts b/packages/deploy/deploy/800_oft_sand/803_oft_sand_setup_base.ts index 29fa2a0a33..9405d0e452 100644 --- a/packages/deploy/deploy/800_oft_sand/803_oft_sand_setup_base.ts +++ b/packages/deploy/deploy/800_oft_sand/803_oft_sand_setup_base.ts @@ -18,6 +18,9 @@ const func: DeployFunction = async function ( } else if (hre.network.name == 'baseSepolia') { eidEthereum = process.env[`EID_${'SEPOLIA'}`]; eidBsc = process.env[`EID_${'BSCTESTNET'}`]; + } else if (hre.network.name == 'hardhat') { + eidEthereum = 0; + eidBsc = 0; } else { throw new Error('Cannot find EID for network'); } diff --git a/packages/deploy/deploy/800_oft_sand/804_oft_sand_setup_bsc.ts b/packages/deploy/deploy/800_oft_sand/804_oft_sand_setup_bsc.ts index 2517d70a79..8d9276a2c0 100644 --- a/packages/deploy/deploy/800_oft_sand/804_oft_sand_setup_bsc.ts +++ b/packages/deploy/deploy/800_oft_sand/804_oft_sand_setup_bsc.ts @@ -18,6 +18,9 @@ const func: DeployFunction = async function ( } else if (hre.network.name == 'bscTestnet') { eidEthereum = process.env[`EID_${'SEPOLIA'}`]; eidBase = process.env[`EID_${'BASESEPOLIA'}`]; + } else if (hre.network.name == 'hardhat') { + eidEthereum = 0; + eidBase = 0; } else { throw new Error('Cannot find EID for network'); }