UNPKG

@layerzerolabs/oapp-alt-evm

Version:

LayerZero Labs reference EVM OmniChain Application (OAppAlt) for EndpointV2Alt implementation

374 lines (373 loc) 20.4 kB
{ "abi": [ { "type": "function", "name": "combineOptions", "inputs": [ { "name": "_eid", "type": "uint32", "internalType": "uint32" }, { "name": "_msgType", "type": "uint16", "internalType": "uint16" }, { "name": "_extraOptions", "type": "bytes", "internalType": "bytes" } ], "outputs": [{ "name": "", "type": "bytes", "internalType": "bytes" }], "stateMutability": "view" }, { "type": "function", "name": "enforcedOptions", "inputs": [ { "name": "eid", "type": "uint32", "internalType": "uint32" }, { "name": "msgType", "type": "uint16", "internalType": "uint16" } ], "outputs": [ { "name": "enforcedOption", "type": "bytes", "internalType": "bytes" } ], "stateMutability": "view" }, { "type": "function", "name": "owner", "inputs": [], "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "renounceOwnership", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setEnforcedOptions", "inputs": [ { "name": "_enforcedOptions", "type": "tuple[]", "internalType": "struct EnforcedOptionParam[]", "components": [ { "name": "eid", "type": "uint32", "internalType": "uint32" }, { "name": "msgType", "type": "uint16", "internalType": "uint16" }, { "name": "options", "type": "bytes", "internalType": "bytes" } ] } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "transferOwnership", "inputs": [ { "name": "newOwner", "type": "address", "internalType": "address" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "event", "name": "EnforcedOptionSet", "inputs": [ { "name": "_enforcedOptions", "type": "tuple[]", "indexed": false, "internalType": "struct EnforcedOptionParam[]", "components": [ { "name": "eid", "type": "uint32", "internalType": "uint32" }, { "name": "msgType", "type": "uint16", "internalType": "uint16" }, { "name": "options", "type": "bytes", "internalType": "bytes" } ] } ], "anonymous": false }, { "type": "event", "name": "OwnershipTransferred", "inputs": [ { "name": "previousOwner", "type": "address", "indexed": true, "internalType": "address" }, { "name": "newOwner", "type": "address", "indexed": true, "internalType": "address" } ], "anonymous": false }, { "type": "error", "name": "InvalidOptions", "inputs": [ { "name": "options", "type": "bytes", "internalType": "bytes" } ] }, { "type": "error", "name": "OwnableInvalidOwner", "inputs": [ { "name": "owner", "type": "address", "internalType": "address" } ] }, { "type": "error", "name": "OwnableUnauthorizedAccount", "inputs": [ { "name": "account", "type": "address", "internalType": "address" } ] } ], "bytecode": { "object": "0x", "sourceMap": "", "linkReferences": {} }, "deployedBytecode": { "object": "0x", "sourceMap": "", "linkReferences": {} }, "methodIdentifiers": { "combineOptions(uint32,uint16,bytes)": "bc70b354", "enforcedOptions(uint32,uint16)": "5535d461", "owner()": "8da5cb5b", "renounceOwnership()": "715018a6", "setEnforcedOptions((uint32,uint16,bytes)[])": "b98bd070", "transferOwnership(address)": "f2fde38b" }, "rawMetadata": "{\"compiler\":{\"version\":\"0.8.22+commit.4fc1097e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"options\",\"type\":\"bytes\"}],\"name\":\"InvalidOptions\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"msgType\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"options\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct EnforcedOptionParam[]\",\"name\":\"_enforcedOptions\",\"type\":\"tuple[]\"}],\"name\":\"EnforcedOptionSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"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\":[{\"internalType\":\"uint32\",\"name\":\"eid\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"msgType\",\"type\":\"uint16\"}],\"name\":\"enforcedOptions\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"enforcedOption\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"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\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Abstract contract implementing the IOAppOptionsType3 interface with type 3 options.\",\"errors\":{\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}]},\"kind\":\"dev\",\"methods\":{\"combineOptions(uint32,uint16,bytes)\":{\"details\":\"If there is an enforced lzReceive option: - {gasLimit: 200k, msg.value: 1 ether} AND a caller supplies a lzReceive option: {gasLimit: 100k, msg.value: 0.5 ether} - The resulting options will be {gasLimit: 300k, msg.value: 1.5 ether} when the message is executed on the remote lzReceive() function.This presence of duplicated options is handled off-chain in the verifier/executor.\",\"params\":{\"_eid\":\"The endpoint ID.\",\"_extraOptions\":\"Additional options passed by the caller.\",\"_msgType\":\"The OAPP message type.\"},\"returns\":{\"_0\":\"options The combination of caller specified options AND enforced options.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"setEnforcedOptions((uint32,uint16,bytes)[])\":{\"details\":\"Sets the enforced options for specific endpoint and message type combinations.Only the owner/admin of the OApp can call this function.Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.These enforced options can vary as the potential options/execution on the remote may differ as per the msgType. eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().\",\"params\":{\"_enforcedOptions\":\"An array of EnforcedOptionParam structures specifying enforced options.\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"OAppOptionsType3\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"combineOptions(uint32,uint16,bytes)\":{\"notice\":\"Combines options for a given endpoint and message type.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/oapp/libs/OAppOptionsType3.sol\":\"OAppOptionsType3\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@layerzerolabs/=node_modules/@layerzerolabs/\",\":@openzeppelin/=node_modules/@openzeppelin/\",\":ds-test/=node_modules/@layerzerolabs/toolbox-foundry/src/ds-test/src/\",\":forge-std/=node_modules/@layerzerolabs/toolbox-foundry/src/forge-std/src/\",\":solidity-bytes-utils/contracts/=node_modules/@layerzerolabs/toolbox-foundry/lib/solidity-bytes-utils/\"]},\"sources\":{\"contracts/oapp/interfaces/IOAppOptionsType3.sol\":{\"keccak256\":\"0x9fc08a51e9d7c9c710c4eb26f84fe77228305ad7da63fa486ff24ebf2f3bc461\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2e2eea8a93bb9fc3f629767118b362e9b4bda2443ff95eae21c6a894f3e334cc\",\"dweb:/ipfs/QmPRRNjAB4U19ke4gr3U7ZJGtdcVBxdXVBZ2BmB1riFkP7\"]},\"contracts/oapp/libs/OAppOptionsType3.sol\":{\"keccak256\":\"0x5275636cd47e660a2fdf6c7fe9d41ff3cc866b785cc8a9d88c1b8ca983509f01\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a59dd6e3cfcc332f45a13d44585eb228588c4b9d470cbb19852df5753a4571af\",\"dweb:/ipfs/QmQJF1QU3MKhvmw42eq61u9z3bzKJJKMsEdQVYyPyYgTVS\"]},\"node_modules/@openzeppelin/contracts/access/Ownable.sol\":{\"keccak256\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8ed324d3920bb545059d66ab97d43e43ee85fd3bd52e03e401f020afb0b120f6\",\"dweb:/ipfs/QmfEckWLmZkDDcoWrkEvMWhms66xwTLff9DDhegYpvHo1a\"]},\"node_modules/@openzeppelin/contracts/utils/Context.sol\":{\"keccak256\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6a708e8a5bdb1011c2c381c9a5cfd8a9a956d7d0a9dc1bd8bcdaf52f76ef2f12\",\"dweb:/ipfs/Qmax9WHBnVsZP46ZxEMNRQpLQnrdE4dK8LehML1Py8FowF\"]}},\"version\":1}", "metadata": { "compiler": { "version": "0.8.22+commit.4fc1097e" }, "language": "Solidity", "output": { "abi": [ { "inputs": [ { "internalType": "bytes", "name": "options", "type": "bytes" } ], "type": "error", "name": "InvalidOptions" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "type": "error", "name": "OwnableInvalidOwner" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" } ], "type": "error", "name": "OwnableUnauthorizedAccount" }, { "inputs": [ { "internalType": "struct EnforcedOptionParam[]", "name": "_enforcedOptions", "type": "tuple[]", "components": [ { "internalType": "uint32", "name": "eid", "type": "uint32" }, { "internalType": "uint16", "name": "msgType", "type": "uint16" }, { "internalType": "bytes", "name": "options", "type": "bytes" } ], "indexed": false } ], "type": "event", "name": "EnforcedOptionSet", "anonymous": false }, { "inputs": [ { "internalType": "address", "name": "previousOwner", "type": "address", "indexed": true }, { "internalType": "address", "name": "newOwner", "type": "address", "indexed": true } ], "type": "event", "name": "OwnershipTransferred", "anonymous": false }, { "inputs": [ { "internalType": "uint32", "name": "_eid", "type": "uint32" }, { "internalType": "uint16", "name": "_msgType", "type": "uint16" }, { "internalType": "bytes", "name": "_extraOptions", "type": "bytes" } ], "stateMutability": "view", "type": "function", "name": "combineOptions", "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }] }, { "inputs": [ { "internalType": "uint32", "name": "eid", "type": "uint32" }, { "internalType": "uint16", "name": "msgType", "type": "uint16" } ], "stateMutability": "view", "type": "function", "name": "enforcedOptions", "outputs": [ { "internalType": "bytes", "name": "enforcedOption", "type": "bytes" } ] }, { "inputs": [], "stateMutability": "view", "type": "function", "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ] }, { "inputs": [], "stateMutability": "nonpayable", "type": "function", "name": "renounceOwnership" }, { "inputs": [ { "internalType": "struct EnforcedOptionParam[]", "name": "_enforcedOptions", "type": "tuple[]", "components": [ { "internalType": "uint32", "name": "eid", "type": "uint32" }, { "internalType": "uint16", "name": "msgType", "type": "uint16" }, { "internalType": "bytes", "name": "options", "type": "bytes" } ] } ], "stateMutability": "nonpayable", "type": "function", "name": "setEnforcedOptions" }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "stateMutability": "nonpayable", "type": "function", "name": "transferOwnership" } ], "devdoc": { "kind": "dev", "methods": { "combineOptions(uint32,uint16,bytes)": { "details": "If there is an enforced lzReceive option: - {gasLimit: 200k, msg.value: 1 ether} AND a caller supplies a lzReceive option: {gasLimit: 100k, msg.value: 0.5 ether} - The resulting options will be {gasLimit: 300k, msg.value: 1.5 ether} when the message is executed on the remote lzReceive() function.This presence of duplicated options is handled off-chain in the verifier/executor.", "params": { "_eid": "The endpoint ID.", "_extraOptions": "Additional options passed by the caller.", "_msgType": "The OAPP message type." }, "returns": { "_0": "options The combination of caller specified options AND enforced options." } }, "owner()": { "details": "Returns the address of the current owner." }, "renounceOwnership()": { "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." }, "setEnforcedOptions((uint32,uint16,bytes)[])": { "details": "Sets the enforced options for specific endpoint and message type combinations.Only the owner/admin of the OApp can call this function.Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc.These enforced options can vary as the potential options/execution on the remote may differ as per the msgType. eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose().", "params": { "_enforcedOptions": "An array of EnforcedOptionParam structures specifying enforced options." } }, "transferOwnership(address)": { "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." } }, "version": 1 }, "userdoc": { "kind": "user", "methods": { "combineOptions(uint32,uint16,bytes)": { "notice": "Combines options for a given endpoint and message type." } }, "version": 1 } }, "settings": { "remappings": [ "@layerzerolabs/=node_modules/@layerzerolabs/", "@openzeppelin/=node_modules/@openzeppelin/", "ds-test/=node_modules/@layerzerolabs/toolbox-foundry/src/ds-test/src/", "forge-std/=node_modules/@layerzerolabs/toolbox-foundry/src/forge-std/src/", "solidity-bytes-utils/contracts/=node_modules/@layerzerolabs/toolbox-foundry/lib/solidity-bytes-utils/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "bytecodeHash": "ipfs" }, "compilationTarget": { "contracts/oapp/libs/OAppOptionsType3.sol": "OAppOptionsType3" }, "evmVersion": "paris", "libraries": {} }, "sources": { "contracts/oapp/interfaces/IOAppOptionsType3.sol": { "keccak256": "0x9fc08a51e9d7c9c710c4eb26f84fe77228305ad7da63fa486ff24ebf2f3bc461", "urls": [ "bzz-raw://2e2eea8a93bb9fc3f629767118b362e9b4bda2443ff95eae21c6a894f3e334cc", "dweb:/ipfs/QmPRRNjAB4U19ke4gr3U7ZJGtdcVBxdXVBZ2BmB1riFkP7" ], "license": "MIT" }, "contracts/oapp/libs/OAppOptionsType3.sol": { "keccak256": "0x5275636cd47e660a2fdf6c7fe9d41ff3cc866b785cc8a9d88c1b8ca983509f01", "urls": [ "bzz-raw://a59dd6e3cfcc332f45a13d44585eb228588c4b9d470cbb19852df5753a4571af", "dweb:/ipfs/QmQJF1QU3MKhvmw42eq61u9z3bzKJJKMsEdQVYyPyYgTVS" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/access/Ownable.sol": { "keccak256": "0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb", "urls": [ "bzz-raw://8ed324d3920bb545059d66ab97d43e43ee85fd3bd52e03e401f020afb0b120f6", "dweb:/ipfs/QmfEckWLmZkDDcoWrkEvMWhms66xwTLff9DDhegYpvHo1a" ], "license": "MIT" }, "node_modules/@openzeppelin/contracts/utils/Context.sol": { "keccak256": "0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2", "urls": [ "bzz-raw://6a708e8a5bdb1011c2c381c9a5cfd8a9a956d7d0a9dc1bd8bcdaf52f76ef2f12", "dweb:/ipfs/Qmax9WHBnVsZP46ZxEMNRQpLQnrdE4dK8LehML1Py8FowF" ], "license": "MIT" } }, "version": 1 }, "id": 9 }