> ## Documentation Index
> Fetch the complete documentation index at: https://docs.layerzero.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Debugging Messages

> Frequently asked questions about Debugging Messages. Troubleshooting tips, common issues, and solutions for LayerZero V2 development. Essential information f...

export const InteractiveContract = ({contractName, functionName, abi: abiProp, description = null, showDeployments = true, disableChainSelection = true}) => {
  const {useState, useEffect, useRef, useMemo} = React;
  const EMBEDDED_ABIS = {
    EndpointV2: [{
      "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": "_eid",
        "type": "uint32"
      }],
      "name": "defaultReceiveLibrary",
      "outputs": [{
        "internalType": "address",
        "name": "",
        "type": "address"
      }],
      "stateMutability": "view",
      "type": "function"
    }, {
      "inputs": [{
        "internalType": "uint32",
        "name": "_eid",
        "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": "_eid",
        "type": "uint32"
      }],
      "name": "defaultSendLibrary",
      "outputs": [{
        "internalType": "address",
        "name": "",
        "type": "address"
      }],
      "stateMutability": "view",
      "type": "function"
    }, {
      "inputs": [{
        "internalType": "address",
        "name": "oapp",
        "type": "address"
      }],
      "name": "delegates",
      "outputs": [{
        "internalType": "address",
        "name": "",
        "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": "_eid",
        "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": "dstEid",
        "type": "uint32"
      }, {
        "internalType": "address",
        "name": "sender",
        "type": "address"
      }],
      "stateMutability": "view",
      "type": "function"
    }, {
      "inputs": [{
        "internalType": "address",
        "name": "_sender",
        "type": "address"
      }, {
        "internalType": "uint32",
        "name": "_eid",
        "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": "_nonce",
        "type": "uint64"
      }],
      "name": "inboundPayloadHash",
      "outputs": [{
        "internalType": "bytes32",
        "name": "",
        "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": "_eid",
        "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": "_eid",
        "type": "uint32"
      }, {
        "internalType": "address",
        "name": "_lib",
        "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": "",
        "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": [{
        "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": [],
      "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": "",
        "type": "uint64"
      }],
      "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": "_eid",
        "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": "_lib",
        "type": "address"
      }],
      "name": "registerLibrary",
      "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": [{
        "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"
    }],
    OApp: [{
      "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": "endpoint",
      "outputs": [{
        "internalType": "contract ILayerZeroEndpointV2",
        "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": [{
        "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": [{
        "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": "oAppVersion",
      "outputs": [{
        "internalType": "uint64",
        "name": "senderVersion",
        "type": "uint64"
      }, {
        "internalType": "uint64",
        "name": "receiverVersion",
        "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": "renounceOwnership",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    }, {
      "inputs": [{
        "internalType": "address",
        "name": "_delegate",
        "type": "address"
      }],
      "name": "setDelegate",
      "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": "newOwner",
        "type": "address"
      }],
      "name": "transferOwnership",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    }],
    OAppRead: [{
      "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": "endpoint",
      "outputs": [{
        "internalType": "contract ILayerZeroEndpointV2",
        "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": [{
        "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": [{
        "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": "oAppVersion",
      "outputs": [{
        "internalType": "uint64",
        "name": "senderVersion",
        "type": "uint64"
      }, {
        "internalType": "uint64",
        "name": "receiverVersion",
        "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": "renounceOwnership",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    }, {
      "inputs": [{
        "internalType": "address",
        "name": "_delegate",
        "type": "address"
      }],
      "name": "setDelegate",
      "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": "uint32",
        "name": "_channelId",
        "type": "uint32"
      }, {
        "internalType": "bool",
        "name": "_active",
        "type": "bool"
      }],
      "name": "setReadChannel",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    }, {
      "inputs": [{
        "internalType": "address",
        "name": "newOwner",
        "type": "address"
      }],
      "name": "transferOwnership",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    }],
    OFT: [{
      "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": [{
        "internalType": "address",
        "name": "owner",
        "type": "address"
      }, {
        "internalType": "address",
        "name": "spender",
        "type": "address"
      }],
      "name": "allowance",
      "outputs": [{
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }],
      "stateMutability": "view",
      "type": "function"
    }, {
      "inputs": [],
      "name": "approvalRequired",
      "outputs": [{
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }],
      "stateMutability": "pure",
      "type": "function"
    }, {
      "inputs": [{
        "internalType": "address",
        "name": "spender",
        "type": "address"
      }, {
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      }],
      "name": "approve",
      "outputs": [{
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }],
      "stateMutability": "nonpayable",
      "type": "function"
    }, {
      "inputs": [{
        "internalType": "address",
        "name": "account",
        "type": "address"
      }],
      "name": "balanceOf",
      "outputs": [{
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }],
      "stateMutability": "view",
      "type": "function"
    }, {
      "inputs": [{
        "internalType": "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": "view",
      "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": [{
        "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": [{
        "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": "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": [],
      "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": "value",
        "type": "uint256"
      }],
      "name": "transfer",
      "outputs": [{
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }],
      "stateMutability": "nonpayable",
      "type": "function"
    }, {
      "inputs": [{
        "internalType": "address",
        "name": "from",
        "type": "address"
      }, {
        "internalType": "address",
        "name": "to",
        "type": "address"
      }, {
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      }],
      "name": "transferFrom",
      "outputs": [{
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }],
      "stateMutability": "nonpayable",
      "type": "function"
    }, {
      "inputs": [{
        "internalType": "address",
        "name": "newOwner",
        "type": "address"
      }],
      "name": "transferOwnership",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    }],
    OFTAdapter: [{
      "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": "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": "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": [{
        "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": [{
        "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": [],
      "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"
    }],
    Executor: [{
      "inputs": [{
        "internalType": "uint32",
        "name": "_dstEid",
        "type": "uint32"
      }, {
        "internalType": "address",
        "name": "_sender",
        "type": "address"
      }, {
        "internalType": "uint256",
        "name": "_calldataSize",
        "type": "uint256"
      }, {
        "internalType": "bytes",
        "name": "_options",
        "type": "bytes"
      }],
      "name": "getFee",
      "outputs": [{
        "internalType": "uint256",
        "name": "fee",
        "type": "uint256"
      }],
      "stateMutability": "view",
      "type": "function"
    }, {
      "inputs": [{
        "internalType": "uint32",
        "name": "_dstEid",
        "type": "uint32"
      }],
      "name": "dstConfig",
      "outputs": [{
        "components": [{
          "internalType": "uint64",
          "name": "baseGas",
          "type": "uint64"
        }, {
          "internalType": "uint16",
          "name": "multiplierBps",
          "type": "uint16"
        }, {
          "internalType": "uint128",
          "name": "floorMarginUSD",
          "type": "uint128"
        }, {
          "internalType": "uint128",
          "name": "nativeCap",
          "type": "uint128"
        }],
        "internalType": "struct IExecutor.DstConfig",
        "name": "",
        "type": "tuple"
      }],
      "stateMutability": "view",
      "type": "function"
    }]
  };
  const EMBEDDED_CHAINS = [{
    chainId: 1,
    name: 'Ethereum',
    chainKey: 'ethereum',
    rpc: 'https://eth.llamarpc.com',
    endpointV2: '0x1a44076050125825900e736c501f859c50fE728c'
  }, {
    chainId: 56,
    name: 'BNB Chain',
    chainKey: 'bsc',
    rpc: 'https://bsc-dataseed.binance.org',
    endpointV2: '0x1a44076050125825900e736c501f859c50fE728c'
  }, {
    chainId: 137,
    name: 'Polygon',
    chainKey: 'polygon',
    rpc: 'https://polygon-rpc.com',
    endpointV2: '0x1a44076050125825900e736c501f859c50fE728c'
  }, {
    chainId: 42161,
    name: 'Arbitrum One',
    chainKey: 'arbitrum',
    rpc: 'https://arb1.arbitrum.io/rpc',
    endpointV2: '0x1a44076050125825900e736c501f859c50fE728c'
  }, {
    chainId: 10,
    name: 'Optimism',
    chainKey: 'optimism',
    rpc: 'https://mainnet.optimism.io',
    endpointV2: '0x1a44076050125825900e736c501f859c50fE728c'
  }, {
    chainId: 8453,
    name: 'Base',
    chainKey: 'base',
    rpc: 'https://mainnet.base.org',
    endpointV2: '0x1a44076050125825900e736c501f859c50fE728c'
  }, {
    chainId: 43114,
    name: 'Avalanche',
    chainKey: 'avalanche',
    rpc: 'https://api.avax.network/ext/bc/C/rpc',
    endpointV2: '0x1a44076050125825900e736c501f859c50fE728c'
  }, {
    chainId: 250,
    name: 'Fantom',
    chainKey: 'fantom',
    rpc: 'https://rpc.ftm.tools',
    endpointV2: '0x1a44076050125825900e736c501f859c50fE728c'
  }, {
    chainId: 324,
    name: 'zkSync Era',
    chainKey: 'zksync',
    rpc: 'https://mainnet.era.zksync.io',
    endpointV2: '0xd07C30aF3Ff30D96BDc9c6044958230Eb797DDBF'
  }, {
    chainId: 59144,
    name: 'Linea',
    chainKey: 'linea',
    rpc: 'https://rpc.linea.build',
    endpointV2: '0x1a44076050125825900e736c501f859c50fE728c'
  }, {
    chainId: 5000,
    name: 'Mantle',
    chainKey: 'mantle',
    rpc: 'https://rpc.mantle.xyz',
    endpointV2: '0x1a44076050125825900e736c501f859c50fE728c'
  }, {
    chainId: 534352,
    name: 'Scroll',
    chainKey: 'scroll',
    rpc: 'https://rpc.scroll.io',
    endpointV2: '0x1a44076050125825900e736c501f859c50fE728c'
  }, {
    chainId: 1101,
    name: 'Polygon zkEVM',
    chainKey: 'polygon-zkevm',
    rpc: 'https://zkevm-rpc.com',
    endpointV2: '0x1a44076050125825900e736c501f859c50fE728c'
  }, {
    chainId: 81457,
    name: 'Blast',
    chainKey: 'blast',
    rpc: 'https://rpc.blast.io',
    endpointV2: '0x1a44076050125825900e736c501f859c50fE728c'
  }, {
    chainId: 34443,
    name: 'Mode',
    chainKey: 'mode',
    rpc: 'https://mainnet.mode.network',
    endpointV2: '0x1a44076050125825900e736c501f859c50fE728c'
  }];
  const contractDeployments = {
    OApp: [{
      chainId: 1,
      address: '0x6985884c4392d348587b19cb9eaaf157f13271cd',
      name: 'ZRO Token'
    }, {
      chainId: 10,
      address: '0x6985884c4392d348587b19cb9eaaf157f13271cd',
      name: 'ZRO Token'
    }, {
      chainId: 56,
      address: '0x6985884c4392d348587b19cb9eaaf157f13271cd',
      name: 'ZRO Token'
    }, {
      chainId: 137,
      address: '0x6985884c4392d348587b19cb9eaaf157f13271cd',
      name: 'ZRO Token'
    }, {
      chainId: 8453,
      address: '0x6985884c4392d348587b19cb9eaaf157f13271cd',
      name: 'ZRO Token'
    }, {
      chainId: 42161,
      address: '0x6985884c4392d348587b19cb9eaaf157f13271cd',
      name: 'ZRO Token'
    }, {
      chainId: 43114,
      address: '0x6985884c4392d348587b19cb9eaaf157f13271cd',
      name: 'ZRO Token'
    }],
    OAppRead: [],
    OFT: [{
      chainId: 1,
      address: '0x6985884c4392d348587b19cb9eaaf157f13271cd',
      name: 'ZRO Token'
    }, {
      chainId: 10,
      address: '0x6985884c4392d348587b19cb9eaaf157f13271cd',
      name: 'ZRO Token'
    }, {
      chainId: 56,
      address: '0x6985884c4392d348587b19cb9eaaf157f13271cd',
      name: 'ZRO Token'
    }, {
      chainId: 137,
      address: '0x6985884c4392d348587b19cb9eaaf157f13271cd',
      name: 'ZRO Token'
    }, {
      chainId: 8453,
      address: '0x6985884c4392d348587b19cb9eaaf157f13271cd',
      name: 'ZRO Token'
    }, {
      chainId: 42161,
      address: '0x6985884c4392d348587b19cb9eaaf157f13271cd',
      name: 'ZRO Token'
    }, {
      chainId: 43114,
      address: '0x6985884c4392d348587b19cb9eaaf157f13271cd',
      name: 'ZRO Token'
    }],
    OFTAdapter: [],
    EndpointV2: [{
      chainId: 1,
      address: '0x1a44076050125825900e736c501f859c50fE728c',
      name: 'Endpoint V2'
    }, {
      chainId: 56,
      address: '0x1a44076050125825900e736c501f859c50fE728c',
      name: 'Endpoint V2'
    }, {
      chainId: 42161,
      address: '0x1a44076050125825900e736c501f859c50fE728c',
      name: 'Endpoint V2'
    }, {
      chainId: 10,
      address: '0x1a44076050125825900e736c501f859c50fE728c',
      name: 'Endpoint V2'
    }, {
      chainId: 137,
      address: '0x1a44076050125825900e736c501f859c50fE728c',
      name: 'Endpoint V2'
    }, {
      chainId: 8453,
      address: '0x1a44076050125825900e736c501f859c50fE728c',
      name: 'Endpoint V2'
    }],
    Executor: [{
      chainId: 1,
      address: '0x173272739Bd7Aa6e4e214714048a9fE699453059',
      name: 'LZ Executor'
    }, {
      chainId: 56,
      address: '0x173272739Bd7Aa6e4e214714048a9fE699453059',
      name: 'LZ Executor'
    }, {
      chainId: 42161,
      address: '0x173272739Bd7Aa6e4e214714048a9fE699453059',
      name: 'LZ Executor'
    }, {
      chainId: 10,
      address: '0x173272739Bd7Aa6e4e214714048a9fE699453059',
      name: 'LZ Executor'
    }, {
      chainId: 137,
      address: '0x173272739Bd7Aa6e4e214714048a9fE699453059',
      name: 'LZ Executor'
    }, {
      chainId: 8453,
      address: '0x173272739Bd7Aa6e4e214714048a9fE699453059',
      name: 'LZ Executor'
    }]
  };
  const getPlaceholderForType = type => {
    if (type.includes('address')) return '0x...';
    if (type.includes('uint')) return '0';
    if (type.includes('int')) return '0';
    if (type.includes('bool')) return 'true or false';
    if (type.includes('bytes32')) return '0x... (32 bytes)';
    if (type.includes('bytes')) return '0x...';
    if (type.includes('string')) return 'text';
    return 'value';
  };
  const [isDark, setIsDark] = useState(true);
  const [selectedChain, setSelectedChain] = useState(disableChainSelection ? null : 1);
  const [contract, setContract] = useState(null);
  const [inputs, setInputs] = useState({});
  const [result, setResult] = useState(null);
  const [loading, setLoading] = useState(false);
  const [error, setError] = useState(null);
  const [walletConnected, setWalletConnected] = useState(false);
  const [isExpanded, setIsExpanded] = useState(false);
  const [isChainDropdownOpen, setIsChainDropdownOpen] = useState(false);
  const [chainSearchTerm, setChainSearchTerm] = useState('');
  const [customAddress, setCustomAddress] = useState('');
  const [isTruncated, setIsTruncated] = useState(false);
  const [ethersLib, setEthersLib] = useState(null);
  const [isLoadingData, setIsLoadingData] = useState(false);
  const [iconErrors, setIconErrors] = useState({});
  const [loadedAbi, setLoadedAbi] = useState(null);
  const [signer, setSigner] = useState(null);
  const abi = abiProp || loadedAbi;
  const chainDropdownRef = useRef(null);
  const codeRef = useRef(null);
  useEffect(() => {
    if (typeof window === 'undefined') return;
    const checkTheme = () => setIsDark(document.documentElement.classList.contains('dark'));
    checkTheme();
    const observer = new MutationObserver(checkTheme);
    observer.observe(document.documentElement, {
      attributes: true,
      attributeFilter: ['class']
    });
    return () => observer.disconnect();
  }, []);
  useEffect(() => {
    if (typeof window === 'undefined') return;
    if (window.ethers) {
      setEthersLib(window.ethers);
      return;
    }
    const script = document.createElement('script');
    script.src = 'https://cdnjs.cloudflare.com/ajax/libs/ethers/5.7.2/ethers.umd.min.js';
    script.async = true;
    script.onload = () => {
      if (window.ethers) {
        setEthersLib(window.ethers);
      }
    };
    document.head.appendChild(script);
  }, []);
  useEffect(() => {
    if (abiProp) return;
    const embeddedAbi = EMBEDDED_ABIS[contractName];
    if (embeddedAbi) {
      setLoadedAbi(embeddedAbi);
    } else {
      setError('No ABI available for ' + contractName);
    }
  }, [contractName, abiProp]);
  const availableChains = useMemo(() => {
    if (disableChainSelection) return [];
    return EMBEDDED_CHAINS.slice().sort((a, b) => a.name.localeCompare(b.name));
  }, [disableChainSelection]);
  const currentChain = availableChains.find(chain => chain.chainId === selectedChain);
  const chainDisplayName = currentChain?.name || 'Select Chain';
  const chainKey = currentChain?.chainKey || 'default';
  const functionAbi = abi?.find(item => item.type === 'function' && item.name === functionName);
  const getDeploymentAddress = () => {
    if (contractName === 'EndpointV2') {
      const chain = EMBEDDED_CHAINS.find(c => c.chainId === selectedChain);
      return chain?.endpointV2;
    }
    const deployments = contractDeployments[contractName] || [];
    const dep = deployments.find(d => d.chainId === selectedChain);
    return dep?.address;
  };
  const defaultDeploymentAddress = getDeploymentAddress();
  const deploymentAddress = defaultDeploymentAddress || customAddress;
  useEffect(() => {
    if (availableChains.length > 0 && !currentChain) {
      setSelectedChain(availableChains[0].chainId);
    }
  }, [availableChains, currentChain]);
  useEffect(() => {
    if (defaultDeploymentAddress) setCustomAddress('');
  }, [selectedChain, defaultDeploymentAddress]);
  useEffect(() => {
    const checkTruncation = () => {
      if (codeRef.current) {
        setIsTruncated(codeRef.current.scrollWidth > codeRef.current.clientWidth);
      }
    };
    checkTruncation();
    const timeout = setTimeout(checkTruncation, 100);
    return () => clearTimeout(timeout);
  }, [functionAbi, isExpanded]);
  const isReadOnly = functionAbi && (functionAbi.stateMutability === 'view' || functionAbi.stateMutability === 'pure');
  const NetworkIcon = ({chainKey, size = 20}) => {
    const hasError = iconErrors['network-' + chainKey];
    const iconUrl = hasError ? 'https://icons-ckg.pages.dev/lz-scan/networks/default.svg' : 'https://icons-ckg.pages.dev/lz-scan/networks/' + chainKey + '.svg';
    return <span style={{
      display: 'inline-block',
      width: size,
      height: size,
      flexShrink: 0,
      backgroundImage: 'url(' + iconUrl + ')',
      backgroundSize: 'contain',
      backgroundRepeat: 'no-repeat',
      backgroundPosition: 'center',
      borderRadius: 4
    }} className={isDark ? '' : 'invert brightness-110 contrast-100'} />;
  };
  const connectWallet = async () => {
    if (!ethersLib) {
      setError('Ethers library not loaded yet');
      return;
    }
    try {
      if (!window.ethereum) {
        setError('Please install MetaMask or another Web3 wallet');
        return;
      }
      const accounts = await window.ethereum.request({
        method: 'eth_requestAccounts'
      });
      if (accounts.length > 0) {
        try {
          await window.ethereum.request({
            method: 'wallet_switchEthereumChain',
            params: [{
              chainId: '0x' + selectedChain.toString(16)
            }]
          });
        } catch (switchError) {
          if (switchError.code === 4902 && currentChain) {
            const chainRpcData = chainlistRPCs.find(c => c.chainId === selectedChain);
            await window.ethereum.request({
              method: 'wallet_addEthereumChain',
              params: [{
                chainId: '0x' + selectedChain.toString(16),
                chainName: currentChain.name,
                rpcUrls: [currentChain.rpc],
                nativeCurrency: chainRpcData?.nativeCurrency,
                blockExplorerUrls: chainRpcData?.explorers?.map(e => e.url) || []
              }]
            });
          }
        }
        const web3Provider = new ethersLib.providers.Web3Provider(window.ethereum);
        const web3Signer = web3Provider.getSigner();
        setSigner(web3Signer);
        setWalletConnected(true);
        setError(null);
      }
    } catch (err) {
      setError(err.message);
    }
  };
  useEffect(() => {
    if (!ethersLib || !deploymentAddress || !currentChain || !currentChain.rpc || !abi) return;
    try {
      if (signer) {
        const contractInstance = new ethersLib.Contract(deploymentAddress, abi, signer);
        setContract(contractInstance);
      } else if (isReadOnly) {
        const readProvider = new ethersLib.providers.JsonRpcProvider(currentChain.rpc);
        const contractInstance = new ethersLib.Contract(deploymentAddress, abi, readProvider);
        setContract(contractInstance);
      }
    } catch (err) {
      console.error('Error initializing contract:', err);
    }
  }, [ethersLib, signer, deploymentAddress, abi, currentChain, isReadOnly]);
  useEffect(() => {
    const handleClickOutside = event => {
      if (chainDropdownRef.current && !chainDropdownRef.current.contains(event.target)) {
        setIsChainDropdownOpen(false);
        setChainSearchTerm('');
      }
    };
    if (isChainDropdownOpen) {
      document.addEventListener('mousedown', handleClickOutside);
    }
    return () => document.removeEventListener('mousedown', handleClickOutside);
  }, [isChainDropdownOpen]);
  const handleInputChange = (paramPath, value) => {
    setInputs(prev => ({
      ...prev,
      [paramPath]: value
    }));
  };
  const parseValue = (value, type) => {
    const val = (value || '').trim();
    if (type.endsWith('[]')) {
      if (!val || val === '[]') return [];
      try {
        return JSON.parse(val);
      } catch {
        return val.split(',').map(v => parseValue(v.trim(), type.slice(0, -2)));
      }
    }
    if (type === 'bool') {
      return val.toLowerCase() === 'true' || val === '1';
    }
    if (type.startsWith('uint') || type.startsWith('int')) {
      return val || '0';
    }
    if (type === 'address') {
      return val || '0x0000000000000000000000000000000000000000';
    }
    if (type === 'bytes32') {
      return val || '0x0000000000000000000000000000000000000000000000000000000000000000';
    }
    if (type.match(/^bytes\d+$/)) {
      const size = parseInt(type.slice(5));
      return val || '0x' + ('00').repeat(size);
    }
    if (type === 'bytes') {
      return val || '0x';
    }
    return val;
  };
  const prepareArguments = () => {
    const args = [];
    functionAbi.inputs.forEach((input, index) => {
      if (input.type.startsWith('tuple')) {
        const tupleValues = [];
        if (input.components) {
          input.components.forEach((component, compIndex) => {
            const path = (input.name || index) + '.' + (component.name || compIndex);
            tupleValues.push(parseValue(inputs[path], component.type));
          });
        }
        args.push(tupleValues);
      } else {
        const path = input.name || index.toString();
        args.push(parseValue(inputs[path], input.type));
      }
    });
    return args;
  };
  const executeFunction = async () => {
    if (!functionAbi) return;
    if (!isReadOnly && !walletConnected) {
      setError('Please connect your wallet to send transactions');
      return;
    }
    if (!contract) {
      setError('Contract not initialized. Please check the network connection.');
      return;
    }
    setLoading(true);
    setError(null);
    setResult(null);
    try {
      const args = prepareArguments();
      let tx;
      if (isReadOnly) {
        tx = await contract[functionName](...args);
        setResult({
          type: 'read',
          data: tx,
          formatted: formatResult(tx)
        });
      } else {
        tx = await contract[functionName](...args);
        setResult({
          type: 'write',
          hash: tx.hash,
          status: 'pending'
        });
        const receipt = await tx.wait();
        setResult({
          type: 'write',
          hash: tx.hash,
          status: 'confirmed',
          blockNumber: receipt.blockNumber
        });
      }
    } catch (err) {
      setError(err.message);
    } finally {
      setLoading(false);
    }
  };
  const formatResult = data => {
    if (data === null || data === undefined) return 'null';
    if (typeof data === 'object' && data._isBigNumber) return data.toString();
    if (Array.isArray(data)) return data.map(formatResult);
    if (typeof data === 'object') {
      const result = {};
      Object.keys(data).forEach(key => {
        if (isNaN(parseInt(key))) result[key] = formatResult(data[key]);
      });
      return result;
    }
    return data;
  };
  const renderOutputType = (output, depth = 0) => {
    if (output.type.startsWith('tuple') && output.components) {
      return <div key={output.name || 'tuple-' + depth} style={{
        marginLeft: depth * 16
      }}>
          <span className={isDark ? 'text-purple-400' : 'text-purple-600'}>
            {output.name && output.name + ': '}{'struct {'}
          </span>
          {output.components.map((comp, idx) => renderOutputType(comp, depth + 1))}
          <div style={{
        marginLeft: depth * 16
      }}>
            <span className={isDark ? 'text-purple-400' : 'text-purple-600'}>{'}'}</span>
            {output.type.endsWith('[]') && <span className={isDark ? 'text-zinc-400' : 'text-zinc-500'}>[]</span>}
          </div>
        </div>;
    }
    return <div key={output.name || 'field-' + depth} style={{
      marginLeft: depth * 16
    }}>
        {output.name && <span className={isDark ? 'text-zinc-300' : 'text-zinc-600'}>{output.name}: </span>}
        <span style={{
      color: isDark ? '#f1df38' : '#e36209'
    }}>{output.type}</span>
      </div>;
  };
  if (typeof window === 'undefined') {
    return <div className="p-4 text-center text-zinc-500">Loading...</div>;
  }
  if (error && !abi) {
    return <div className="p-4 rounded-lg border border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 mb-4">
        <div className="font-medium mb-1">Error loading {contractName}</div>
        <div className="text-sm">{error}</div>
      </div>;
  }
  if (isLoadingData) {
    return <div className="p-4 rounded-lg border border-zinc-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 mb-4">
        <div className="text-center text-zinc-500">Loading chain data...</div>
      </div>;
  }
  if (!abi) {
    return <div className="p-4 rounded-lg border border-zinc-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 mb-4">
        <div className="text-center text-zinc-500">Loading {contractName} ABI...</div>
      </div>;
  }
  if (!functionAbi) {
    return <div className="p-4 rounded-lg border border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 mb-4">
        Function {functionName} not found in {contractName} ABI
      </div>;
  }
  const renderInputFields = () => {
    const fields = [];
    functionAbi.inputs.forEach((input, index) => {
      if (input.type.startsWith('tuple') && input.components) {
        fields.push(<div key={'tuple-' + index} className="mb-4">
            <div className={'text-xs font-semibold uppercase tracking-wide mb-2 ' + (isDark ? 'text-purple-400' : 'text-purple-600')}>
              {input.name || 'Param ' + index} (tuple)
            </div>
            <div className={'pl-4 border-l-2 ' + (isDark ? 'border-purple-500/30' : 'border-purple-300')}>
              {input.components.map((component, compIndex) => {
          const path = (input.name || index) + '.' + (component.name || compIndex);
          return <div key={path} className="mb-3">
                    <label className={'flex items-center gap-2 text-sm mb-1 ' + (isDark ? 'text-zinc-300' : 'text-zinc-700')}>
                      {component.name || 'field' + compIndex}
                      <span className={'text-xs ' + (isDark ? 'text-zinc-500' : 'text-zinc-400')}>({component.type})</span>
                    </label>
                    <input type="text" placeholder={getPlaceholderForType(component.type)} value={inputs[path] || ''} onChange={e => handleInputChange(path, e.target.value)} className={'w-full px-3 py-2 rounded-lg border text-sm font-mono focus:outline-none focus:ring-1 focus:ring-blue-500 ' + (isDark ? 'bg-zinc-800 border-zinc-700 text-white placeholder-zinc-500' : 'bg-white border-zinc-300 text-zinc-900 placeholder-zinc-400')} />
                  </div>;
        })}
            </div>
          </div>);
      } else {
        const path = input.name || index.toString();
        fields.push(<div key={path} className="mb-3">
            <label className={'flex items-center gap-2 text-sm mb-1 ' + (isDark ? 'text-zinc-300' : 'text-zinc-700')}>
              {input.name || 'param' + index}
              <span className={'text-xs ' + (isDark ? 'text-zinc-500' : 'text-zinc-400')}>({input.type})</span>
            </label>
            <input type="text" placeholder={getPlaceholderForType(input.type)} value={inputs[path] || ''} onChange={e => handleInputChange(path, e.target.value)} className={'w-full px-3 py-2 rounded-lg border text-sm font-mono focus:outline-none focus:ring-1 focus:ring-blue-500 ' + (isDark ? 'bg-zinc-800 border-zinc-700 text-white placeholder-zinc-500' : 'bg-white border-zinc-300 text-zinc-900 placeholder-zinc-400')} />
          </div>);
      }
    });
    return fields;
  };
  return <div className="rounded-xl border border-zinc-200 dark:border-zinc-700 bg-white dark:bg-zinc-900 overflow-hidden mb-4">
      {}
      <div className={'flex items-center justify-between p-3 cursor-pointer transition-colors ' + (isDark ? 'bg-zinc-800 hover:bg-zinc-700' : 'bg-zinc-100 hover:bg-zinc-200')} onClick={() => setIsExpanded(!isExpanded)}>
        <div className="flex items-center gap-3 flex-1 min-w-0">
          <span className="px-2 py-1 rounded text-xs font-semibold text-white" style={{
    backgroundColor: isReadOnly ? '#6366f1' : '#22c55e'
  }}>
            {isReadOnly ? 'CALL' : 'SEND'}
          </span>
          <code ref={codeRef} className={'text-sm truncate ' + (isDark ? 'text-zinc-200' : 'text-zinc-800')} title={functionName + '(' + functionAbi.inputs.map(i => i.name + ': ' + i.type).join(', ') + ')'}>
            <span style={{
    color: '#6cadf5'
  }}>{functionName}</span>
            <span className={isDark ? 'text-zinc-500' : 'text-zinc-400'}>(</span>
            {functionAbi.inputs.map((input, idx) => <span key={idx}>
                <span className={isDark ? 'text-zinc-300' : 'text-zinc-600'}>{input.name}</span>
                <span className={isDark ? 'text-zinc-500' : 'text-zinc-400'}>: </span>
                <span style={{
    color: isDark ? '#f1df38' : '#e36209'
  }}>{input.type}</span>
                {idx < functionAbi.inputs.length - 1 && <span className={isDark ? 'text-zinc-500' : 'text-zinc-400'}>, </span>}
              </span>)}
            <span className={isDark ? 'text-zinc-500' : 'text-zinc-400'}>)</span>
          </code>
        </div>
        <div className={'transition-transform ' + (isExpanded ? 'rotate-180' : '')} style={{
    color: isDark ? '#71717a' : '#a1a1aa'
  }}>
          <svg viewBox="0 0 24 24" fill="none" width="20" height="20">
            <path d="M6 9L12 15L18 9" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
          </svg>
        </div>
      </div>

      {}
      {isExpanded && <div className="p-4">
          {description && <div className={'text-sm mb-4 pb-4 border-b ' + (isDark ? 'text-zinc-400 border-zinc-800' : 'text-zinc-600 border-zinc-200')}>
              {description}
            </div>}

          {}
          <div className="mb-4">
            <label className={'text-xs font-semibold uppercase tracking-wide mb-2 block ' + (isDark ? 'text-zinc-500' : 'text-zinc-400')}>CHAIN</label>
            <div ref={chainDropdownRef} className="relative">
              <div onClick={() => setIsChainDropdownOpen(!isChainDropdownOpen)} className={'flex items-center justify-between px-3 py-2 rounded-lg border cursor-pointer ' + (isDark ? 'bg-zinc-800 border-zinc-700 hover:border-zinc-600' : 'bg-white border-zinc-300 hover:border-zinc-400')}>
                <div className="flex items-center gap-2">
                  {currentChain && <NetworkIcon chainKey={chainKey} size={20} />}
                  <span className={isDark ? 'text-white' : 'text-zinc-900'}>{chainDisplayName}</span>
                </div>
                <svg width="10" height="6" viewBox="0 0 10 6" fill="none" className={isDark ? 'text-zinc-400' : 'text-zinc-500'}>
                  <path d="M1 1L5 5L9 1" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
                </svg>
              </div>

              {isChainDropdownOpen && <div className="absolute z-50 w-full mt-1 rounded-lg border shadow-lg" style={{
    backgroundColor: isDark ? '#27272a' : '#ffffff',
    borderColor: isDark ? '#3f3f46' : '#d4d4d8'
  }}>
                  <input type="text" placeholder="Search chains..." value={chainSearchTerm} onChange={e => setChainSearchTerm(e.target.value)} onClick={e => e.stopPropagation()} autoFocus className={'w-full px-3 py-2 text-sm border-b focus:outline-none ' + (isDark ? 'bg-transparent border-zinc-700 text-white placeholder-zinc-500' : 'bg-transparent border-zinc-200 text-zinc-900 placeholder-zinc-400')} />
                  <div style={{
    maxHeight: '240px',
    overflowY: 'auto',
    backgroundColor: isDark ? '#27272a' : '#ffffff'
  }}>
                    {availableChains.length === 0 ? <div className={'px-3 py-4 text-sm text-center ' + (isDark ? 'text-zinc-500' : 'text-zinc-400')}>
                        No chains available
                      </div> : availableChains.filter(chain => chain.name.toLowerCase().includes(chainSearchTerm.toLowerCase())).map(chain => <div key={chain.chainId} onClick={() => {
    setSelectedChain(chain.chainId);
    setIsChainDropdownOpen(false);
    setChainSearchTerm('');
  }} className={'flex items-center gap-2 px-3 py-2 cursor-pointer ' + (selectedChain === chain.chainId ? isDark ? 'bg-blue-600/20 text-blue-400' : 'bg-blue-50 text-blue-600' : isDark ? 'hover:bg-zinc-700 text-white' : 'hover:bg-zinc-100 text-zinc-900')}>
                            <NetworkIcon chainKey={chain.chainKey} size={16} />
                            <span className="text-sm">{chain.name}</span>
                          </div>)}
                  </div>
                </div>}
            </div>
          </div>

          {}
          {showDeployments && <div className="mb-4">
              <label className={'text-xs font-semibold uppercase tracking-wide mb-2 block ' + (isDark ? 'text-zinc-500' : 'text-zinc-400')}>
                {defaultDeploymentAddress ? 'CONTRACT' : 'CONTRACT ADDRESS'}
              </label>
              {defaultDeploymentAddress ? <div className={'px-3 py-2 rounded-lg text-sm font-mono ' + (isDark ? 'bg-zinc-800 text-zinc-300' : 'bg-zinc-100 text-zinc-700')}>
                  {defaultDeploymentAddress}
                </div> : <>
                  <input type="text" placeholder="0x..." value={customAddress} onChange={e => setCustomAddress(e.target.value)} className={'w-full px-3 py-2 rounded-lg border text-sm font-mono focus:outline-none focus:ring-1 focus:ring-blue-500 ' + (isDark ? 'bg-zinc-800 border-zinc-700 text-white placeholder-zinc-500' : 'bg-white border-zinc-300 text-zinc-900 placeholder-zinc-400')} />
                  <div className={'text-xs mt-1 ' + (isDark ? 'text-zinc-500' : 'text-zinc-400')}>
                    Enter your {contractName} contract address
                  </div>
                </>}
            </div>}

          {}
          {functionAbi.inputs.length > 0 && <div className="mb-4">
              <div className={'text-xs font-semibold uppercase tracking-wide mb-3 ' + (isDark ? 'text-zinc-500' : 'text-zinc-400')}>PARAMETERS</div>
              {renderInputFields()}
            </div>}

          {}
          {functionAbi.outputs && functionAbi.outputs.length > 0 && <div className="mb-4">
              <div className={'text-xs font-semibold uppercase tracking-wide mb-2 ' + (isDark ? 'text-zinc-500' : 'text-zinc-400')}>RETURNS</div>
              <div className={'p-3 rounded-lg text-sm font-mono ' + (isDark ? 'bg-zinc-800' : 'bg-zinc-100')}>
                {functionAbi.outputs.map((output, idx) => renderOutputType(output, 0))}
              </div>
            </div>}

          {}
          <div className="mb-4">
            {!walletConnected && !isReadOnly ? <button onClick={connectWallet} className="w-full px-4 py-2 rounded-lg font-medium text-sm bg-blue-600 hover:bg-blue-700 text-white transition-colors">
                Connect Wallet
              </button> : <button onClick={executeFunction} disabled={loading || !deploymentAddress} className="w-full px-4 py-2 rounded-lg font-medium text-sm transition-colors text-white disabled:opacity-50 disabled:cursor-not-allowed" style={{
    backgroundColor: loading || !deploymentAddress ? '#52525b' : '#6cadf5'
  }}>
                {loading ? 'Processing...' : isReadOnly ? 'Send Request' : 'Send Transaction'}
              </button>}
          </div>

          {}
          {error && <div className={'p-3 rounded-lg text-sm mb-4 ' + (isDark ? 'bg-red-900/20 text-red-400' : 'bg-red-50 text-red-600')}>
              {error}
            </div>}

          {}
          {result && <div className="mb-4">
              <div className={'text-xs font-semibold uppercase tracking-wide mb-2 ' + (isDark ? 'text-zinc-500' : 'text-zinc-400')}>RESPONSE</div>
              <div className={'p-3 rounded-lg text-sm font-mono overflow-auto ' + (isDark ? 'bg-zinc-800' : 'bg-zinc-100')}>
                {result.type === 'read' ? <pre style={{
    margin: 0,
    whiteSpace: 'pre-wrap',
    color: isDark ? '#9EFC7E' : '#166534'
  }}>
                    {JSON.stringify(result.formatted, null, 2)}
                  </pre> : <div className={isDark ? 'text-zinc-300' : 'text-zinc-700'}>
                    <div>Tx: {result.hash}</div>
                    <div>Status: <span className={result.status === 'confirmed' ? 'text-green-500' : 'text-yellow-500'}>{result.status}</span></div>
                    {result.blockNumber && <div>Block: {result.blockNumber}</div>}
                  </div>}
              </div>
            </div>}

          {}
          {!deploymentAddress && <div className={'p-3 rounded-lg text-sm ' + (isDark ? 'bg-yellow-900/20 text-yellow-400' : 'bg-yellow-50 text-yellow-700')}>
              No deployment found for {contractName} on {chainDisplayName}
            </div>}
        </div>}
    </div>;
};

The V2 protocol now splits the verification and contract logic execution of messages into two separate, distinct phases:

**`Verified`**: the destination chain has received verification from all configured [DVNs](../../../concepts/modular-security/security-stack-dvns) and the message nonce has been committed to the [Endpoint](../../../concepts/protocol/layerzero-endpoint)'s messaging channel.

**`Delivered`**: the message has been successfully executed by the [Executor](../../../concepts/permissionless-execution/executors).

Because verification and execution are separate, LayerZero can provide specific error handling for each message state.

General debugging steps can be found [here](../../../concepts/troubleshooting/debugging-messages).

## Message Execution

When your message is successfully delivered to the destination chain, the protocol attempts to execute the message with the execution parameters defined by the sender. Message execution can result in two possible states:

* **Success**: If the execution is successful, an event (`PacketReceived`) is emitted.

* **Failure**: If the execution fails, the contract reverses the clearing of the payload (re-inserts the payload) and emits an event (`LzReceiveAlert`) to signal the failure.

  * **Out of Gas**: The message fails because the transaction that contains the message doesn't provide enough gas for execution.

    The [Message Execution Options](../../../tools/sdks/options) applied to a message can be viewed on LayerZero Scan. There are several ways to determine the optimal gas values for these options. See [Determining Gas Costs](../../../tools/sdks/options#determining-gas-costs) for more details.

  * **Logic Error**: There's an error in either the contract code or the message parameters passed that prevents the message from being executed correctly.

### Retry Message

Because LayerZero separates the verification of a message from its execution, if a message fails to execute due to either of the reasons above, the message can be retried without having to resend it from the origin chain.

This is possible because the message has already been confirmed by the DVNs as a valid message packet, meaning execution can be retried at anytime, by anyone.

Here's how an OApp contract owner or user can retry a message:

* **Using LayerZero Scan**: For users that want a simple frontend interface to interact with, LayerZero Scan provides both message failure detection and in-browser message retrying.

* **Calling `lzReceive` Directly**: If message execution fails, any user can retry the call on the Endpoint's `lzReceive` function via the block explorer or any popular library for interacting with the blockchain like [ethers](https://docs.ethers.org/v5/), [viem](https://viem.sh/docs/getting-started.html), etc.

#### lzReceive() - Receive Messages

<InteractiveContract contractName="EndpointV2" functionName="lzReceive" description="Receives a crosschain message from a source endpoint. The message will be delivered to the recipient contract implementing ILayerZeroReceiver.lzReceive." />

Note: In the event of an `lzCompose` failure, the resolution process is similar. Any user can simply retry the call by invoking the Endpoint’s `lzCompose` function.

#### lzCompose() - Execute Compose Messages

<InteractiveContract contractName="EndpointV2" functionName="lzCompose" description="Executes a previously queued compose message. Called by the executor to deliver compose messages to contracts implementing ILayerZeroComposer. This enables complex multi-contract interactions within a single crosschain transaction." />

### Skipping Nonce

Occasionally, an [OApp delegate](../oapp/overview#setting-delegates) may want to cancel the verification of an in-flight message. This might be due to a variety of reasons, such as:

* **Race Conditions**: conditions where multiple transactions are being processed in parallel, and some might become invalid or redundant before they are processed.

* **Error Handling**: In scenarios where a message cannot be delivered (for example, due to being invalid or because prerequisites are not met), the skip function provides a way to bypass it and continue with subsequent messages.

By allowing the OApp to skip the problematic message, the OApp can maintain efficiency and avoid getting stuck by a single bottleneck.

<Warning>
  The `skip` function should be used only in instances where either message **verification** fails or must be stopped, not message **execution**. LayerZero provides separate handling for retrying or removing messages that have successfully been verified, but fail to execute.
</Warning>

<Warning>
  It is crucial to use this function with caution because once a payload is skipped, it cannot be recovered.
</Warning>

<br />

An OApp's delegate can call the `skip` method via the Endpoint to stop message delivery:

#### skip()

<InteractiveContract contractName="EndpointV2" functionName="skip" description="Skips a specific nonce to prevent the message from being verified or executed. Useful in race conditions or when a message is flagged as malicious by PreCrime. Updates the lazy inbound nonce after skipping." />

**Example for calling `skip`**

1. **Set up Dependencies and Define the ABI**

```js wrap theme={null}
// using ethers v5
const {ethers} = require('ethers');
const skipFunctionABI = [
  'function skip(address _oapp,uint32 _srcEid, bytes32 _sender, uint64 _nonce)',
];
```

2. **Configure the Contract Instance**

```js wrap theme={null}
// Example Endpoint Address
const ENDPOINT_CONTRACT_ADDRESS = '0xb6319cC6c8c27A8F5dAF0dD3DF91EA35C4720dd7';

const provider = new ethers.providers.JsonRpcProvider(YOUR_RPC_URL);
const signer = new ethers.Wallet(YOUR_PRIVATE_KEY, provider);
const endpointContract = new ethers.Contract(ENDPOINT_CONTRACT_ADDRESS, skipFunctionABI, signer);
```

3. **Prepare Function Parameters**

```js wrap theme={null}
// Example Oapp Address
const oAppAddress = '0x123123123678afecb367f032d93F642f64180aa3';

// Parameters for the skip function
const srcEid = 50121; // srcEid example

// padding an example address to bytes32
const sender = ethers.zeroPadValue(`0x5FbDB2315678afecb367f032d93F642f64180aa3`, 32);
const nonce = 3; // uint64 nonce example

const tx = await endpointContract.skip(oAppAddress, srcEid, sender, nonce);
```

4. **Send the Transaction**

```js wrap theme={null}
const tx = await endpointContract.skip(oAppAddress, srcEid, sender, nonce);
await tx.wait();
```

### Clearing Message

As a last resort, an OApp contract owner may want to force eject a message packet, either due to an unrecoverable error or to prevent a malicious packet from being executed:

* When logic errors exist and the message can't be retried successfully.
* When a malicious message needs to be avoided.

**Using the `clear` Function**: This function exists on the Endpoint and allows an OApp contract delegate to burn the message payload so it can never be retried again.

<Warning>
  It is crucial to use this function with caution because once a payload is cleared, it cannot be recovered.
</Warning>

#### clear() - Clear Stored Message

<InteractiveContract contractName="EndpointV2" functionName="clear" description="Clears a stored message payload and updates the lazy inbound nonce. Used to remove messages that have been verified but not executed. The OApp must know the original payload to clear it." />

**Example for calling `clear`**

1. **Set up Dependencies and Define the ABI**

```js wrap theme={null}
// using ethers v5
const {ethers} = require('ethers');
const clearFunctionABI = [
  {
    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'},
    ],
    name: 'clear',
    outputs: [],
    stateMutability: 'nonpayable',
    type: 'function',
  },
];
```

2. **Configure the Contract Instance**

```js wrap theme={null}
// Example Endpoint Address
const ENDPOINT_CONTRACT_ADDRESS = '0xb6319cC6c8c27A8F5dAF0dD3DF91EA35C4720dd7';

const provider = new ethers.providers.JsonRpcProvider(YOUR_RPC_URL);
const signer = new ethers.Wallet(YOUR_PRIVATE_KEY, provider);
const endpointContract = new ethers.Contract(ENDPOINT_CONTRACT_ADDRESS, clearFunctionABI, signer);
```

3. **Prepare Function Parameters**

```js wrap theme={null}
// Example Oapp Address
const oAppAddress = '0x123123123678afecb367f032d93F642f64180aa3';

// Parameters for the skip function
const origin = {
  srcEid: 10111, // example source chain endpoint Id
  sender: ethers.zeroPadValue(`0x5FbDB2315678afecb367f032d93F642f64180aa3`, 32), // bytes32 representation of an address
  nonce: 3, // example nonce
};

const _guid = '0x0af522cbed56c0e67988a3eab0e83fc576d501659ffe7743ffa4a0a76b40419d'; // example _guid
const _message =
  '0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000064849484948490000000000000000000000000000000000000000000000000000'; //example _message
```

4. **Send the Transaction**

```js wrap theme={null}
const tx = await endpointContract.clear(oAppAddress, origin, _guid, _message);
await tx.wait();
```

### Nilify and Burn

These two functions exist in the Endpoint contract and are used in very specific cases to avoid malicious acts by DVNs. These two functions are infrequently utilized and serve as precautionary design measures.

<Tip>
  `nilify` and `burn` are called similarly to `clear` and `skip`, refer to those examples if needed.
</Tip>

#### nilify() - Mark Message as Nil

<InteractiveContract contractName="EndpointV2" functionName="nilify" description="Marks a verified packet as nil (0xFFFFFF...), preventing execution until re-verified. Provides a recovery mechanism from disruptions caused by malicious DVNs. The message can be resubmitted through MessageLib for recovery." />

The `nilify` function is designed to transform a non-executed payload hash into NIL value (0xFFFFFF...). This transformation enables the resubmission of these NIL packets via the MessageLib back into the endpoint, providing a recovery mechanism from disruptions caused by malicious DVNs.

#### burn() - Permanently Block Message

<InteractiveContract contractName="EndpointV2" functionName="burn" description="Permanently marks a message as unexecutable and un-verifiable. This irreversible action prevents the message from ever being executed. Used to block messages when malicious DVNs attempt to hide payloads." />

The `burn` function operates similarly to the `clear` function with two key distinctions:

1. The OApp is not required to be aware of the original payload
2. The nonce designated for burning must be less than the `lazyInboundNonce`

This function exists to avoid malicious DVNs from hiding the original payload to avoid the message from being cleared.
