OmnichainProposalSender
OmnichainProposalSender
Section titled “OmnichainProposalSender”OmnichainProposalSender at v2.15.0 is the BNB-side LayerZero V1 sender. It sends proposal data to configured destination executors after the BNB proposal passes. In the production governance flow its owner is the Normal Timelock, while the exact caller permissions for execute and administrative functions are resolved by AccessControlManager.
The current API includes inherited setMaxDailyLimit, pause, unpause, setAccessControlManager, owner, and transferOwnership selectors. Ownership renunciation is deliberately disabled. retryExecute is for sends that failed before LayerZero accepted them; fallbackWithdraw clears a matching stored execution and recovers its original native-token value.
Solidity API
Section titled “Solidity API”proposalCount
Section titled “proposalCount”Stores the total number of remote proposals
uint256 proposalCountstoredExecutionHashes
Section titled “storedExecutionHashes”Execution hashes of failed messages
mapping(uint256 => bytes32) storedExecutionHashesLZ_ENDPOINT
Section titled “LZ_ENDPOINT”LayerZero endpoint for sending messages to remote chains
contract ILayerZeroEndpoint LZ_ENDPOINTtrustedRemoteLookup
Section titled “trustedRemoteLookup”Specifies the allowed path for sending messages (remote chainId => remote app address + local app address)
mapping(uint16 => bytes) trustedRemoteLookupestimateFees
Section titled “estimateFees”Estimates LayerZero fees for cross-chain message delivery to the remote chain
function estimateFees(uint16 remoteChainId_, bytes payload_, bool useZro_, bytes adapterParams_) external view returns (uint256, uint256)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| remoteChainId_ | uint16 | The LayerZero id of a remote chain |
| payload_ | bytes | The payload to be sent to the remote chain. It’s computed as follows: payload = abi.encode(abi.encode(targets, values, signatures, calldatas, proposalType), pId) |
| useZro_ | bool | Bool that indicates whether to pay in ZRO tokens or not |
| adapterParams_ | bytes | The params used to specify the custom amount of gas required for the execution on the destination |
Return Values
Section titled “Return Values”| Name | Type | Description |
|---|---|---|
| [0] | uint256 | nativeFee The amount of fee in the native gas token (e.g. ETH) |
| [1] | uint256 | zroFee The amount of fee in ZRO token |
removeTrustedRemote
Section titled “removeTrustedRemote”Remove trusted remote from storage
function removeTrustedRemote(uint16 remoteChainId_) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| remoteChainId_ | uint16 | The chain’s id corresponds to setting the trusted remote to empty |
📅 Events
Section titled “📅 Events”- Emit TrustedRemoteRemoved with remote chain id
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by Access Control Manager
execute
Section titled “execute”Sends a message to execute a remote proposal
function execute(uint16 remoteChainId_, bytes payload_, bytes adapterParams_, address zroPaymentAddress_) external payableParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| remoteChainId_ | uint16 | The LayerZero id of the remote chain |
| payload_ | bytes | The payload to be sent to the remote chain It’s computed as follows: payload = abi.encode(targets, values, signatures, calldatas, proposalType) |
| adapterParams_ | bytes | The params used to specify the custom amount of gas required for the execution on the destination |
| zroPaymentAddress_ | address | The address of the ZRO token holder who would pay for the transaction. This must be either address(this) or tx.origin |
📅 Events
Section titled “📅 Events”- Emits ExecuteRemoteProposal with remote chain id, proposal ID and payload on success
- Emits StorePayload with last stored payload proposal ID, remote chain id, payload, adapter params, values and reason for failure
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by Access Control Manager
retryExecute
Section titled “retryExecute”Resends a previously failed message
function retryExecute(uint256 pId_, uint16 remoteChainId_, bytes payload_, bytes adapterParams_, address zroPaymentAddress_, uint256 originalValue_) external payableParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| pId_ | uint256 | The proposal ID to identify a failed message |
| remoteChainId_ | uint16 | The LayerZero id of the remote chain |
| payload_ | bytes | The payload to be sent to the remote chain It’s computed as follows: payload = abi.encode(abi.encode(targets, values, signatures, calldatas, proposalType), pId) |
| adapterParams_ | bytes | The params used to specify the custom amount of gas required for the execution on the destination |
| zroPaymentAddress_ | address | The address of the ZRO token holder who would pay for the transaction. |
| originalValue_ | uint256 | The msg.value passed when execute() function was called |
📅 Events
Section titled “📅 Events”- Emits ClearPayload with proposal ID and hash
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by Access Control Manager
fallbackWithdraw
Section titled “fallbackWithdraw”Clear previously failed message
function fallbackWithdraw(address to_, uint256 pId_, uint16 remoteChainId_, bytes payload_, bytes adapterParams_, uint256 originalValue_) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| to_ | address | Address of the receiver |
| pId_ | uint256 | The proposal ID to identify a failed message |
| remoteChainId_ | uint16 | The LayerZero id of the remote chain |
| payload_ | bytes | The payload to be sent to the remote chain It’s computed as follows: payload = abi.encode(abi.encode(targets, values, signatures, calldatas, proposalType), pId) |
| adapterParams_ | bytes | The params used to specify the custom amount of gas required for the execution on the destination |
| originalValue_ | uint256 | The msg.value passed when execute() function was called |
📅 Events
Section titled “📅 Events”- Emits ClearPayload with proposal ID and hash
- Emits FallbackWithdraw with receiver and amount
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Only owner
setTrustedRemoteAddress
Section titled “setTrustedRemoteAddress”Sets the remote message receiver address
function setTrustedRemoteAddress(uint16 remoteChainId_, bytes newRemoteAddress_) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| remoteChainId_ | uint16 | The LayerZero id of a remote chain |
| newRemoteAddress_ | bytes | The address of the contract on the remote chain to receive messages sent by this contract |
📅 Events
Section titled “📅 Events”- Emits SetTrustedRemoteAddress with remote chain Id and remote address
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by AccessControlManager
setConfig
Section titled “setConfig”Sets the configuration of the LayerZero messaging library of the specified version
function setConfig(uint16 version_, uint16 chainId_, uint256 configType_, bytes config_) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| version_ | uint16 | Messaging library version |
| chainId_ | uint16 | The LayerZero chainId for the pending config change |
| configType_ | uint256 | The type of configuration. Every messaging library has its own convention |
| config_ | bytes | The configuration in bytes. It can encode arbitrary content |
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by AccessControlManager
setSendVersion
Section titled “setSendVersion”Sets the configuration of the LayerZero messaging library of the specified version
function setSendVersion(uint16 version_) externalParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| version_ | uint16 | New messaging library version |
⛔️ Access Requirements
Section titled “⛔️ Access Requirements”- Controlled by AccessControlManager
getConfig
Section titled “getConfig”Gets the configuration of the LayerZero messaging library of the specified version
function getConfig(uint16 version_, uint16 chainId_, uint256 configType_) external view returns (bytes)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| version_ | uint16 | Messaging library version |
| chainId_ | uint16 | The LayerZero chainId |
| configType_ | uint256 | Type of configuration. Every messaging library has its own convention |