Skip to content

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.

Stores the total number of remote proposals

uint256 proposalCount

Execution hashes of failed messages

mapping(uint256 => bytes32) storedExecutionHashes

LayerZero endpoint for sending messages to remote chains

contract ILayerZeroEndpoint LZ_ENDPOINT

Specifies the allowed path for sending messages (remote chainId => remote app address + local app address)

mapping(uint16 => bytes) trustedRemoteLookup

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)
NameTypeDescription
remoteChainId_uint16The LayerZero id of a remote chain
payload_bytesThe 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_boolBool that indicates whether to pay in ZRO tokens or not
adapterParams_bytesThe params used to specify the custom amount of gas required for the execution on the destination
NameTypeDescription
[0]uint256nativeFee The amount of fee in the native gas token (e.g. ETH)
[1]uint256zroFee The amount of fee in ZRO token

Remove trusted remote from storage

function removeTrustedRemote(uint16 remoteChainId_) external
NameTypeDescription
remoteChainId_uint16The chain’s id corresponds to setting the trusted remote to empty
  • Emit TrustedRemoteRemoved with remote chain id
  • Controlled by Access Control Manager

Sends a message to execute a remote proposal

function execute(uint16 remoteChainId_, bytes payload_, bytes adapterParams_, address zroPaymentAddress_) external payable
NameTypeDescription
remoteChainId_uint16The LayerZero id of the remote chain
payload_bytesThe payload to be sent to the remote chain It’s computed as follows: payload = abi.encode(targets, values, signatures, calldatas, proposalType)
adapterParams_bytesThe params used to specify the custom amount of gas required for the execution on the destination
zroPaymentAddress_addressThe address of the ZRO token holder who would pay for the transaction. This must be either address(this) or tx.origin
  • 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
  • Controlled by Access Control Manager

Resends a previously failed message

function retryExecute(uint256 pId_, uint16 remoteChainId_, bytes payload_, bytes adapterParams_, address zroPaymentAddress_, uint256 originalValue_) external payable
NameTypeDescription
pId_uint256The proposal ID to identify a failed message
remoteChainId_uint16The LayerZero id of the remote chain
payload_bytesThe 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_bytesThe params used to specify the custom amount of gas required for the execution on the destination
zroPaymentAddress_addressThe address of the ZRO token holder who would pay for the transaction.
originalValue_uint256The msg.value passed when execute() function was called
  • Emits ClearPayload with proposal ID and hash
  • Controlled by Access Control Manager

Clear previously failed message

function fallbackWithdraw(address to_, uint256 pId_, uint16 remoteChainId_, bytes payload_, bytes adapterParams_, uint256 originalValue_) external
NameTypeDescription
to_addressAddress of the receiver
pId_uint256The proposal ID to identify a failed message
remoteChainId_uint16The LayerZero id of the remote chain
payload_bytesThe 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_bytesThe params used to specify the custom amount of gas required for the execution on the destination
originalValue_uint256The msg.value passed when execute() function was called
  • Emits ClearPayload with proposal ID and hash
  • Emits FallbackWithdraw with receiver and amount
  • Only owner

Sets the remote message receiver address

function setTrustedRemoteAddress(uint16 remoteChainId_, bytes newRemoteAddress_) external
NameTypeDescription
remoteChainId_uint16The LayerZero id of a remote chain
newRemoteAddress_bytesThe address of the contract on the remote chain to receive messages sent by this contract
  • Emits SetTrustedRemoteAddress with remote chain Id and remote address
  • Controlled by AccessControlManager

Sets the configuration of the LayerZero messaging library of the specified version

function setConfig(uint16 version_, uint16 chainId_, uint256 configType_, bytes config_) external
NameTypeDescription
version_uint16Messaging library version
chainId_uint16The LayerZero chainId for the pending config change
configType_uint256The type of configuration. Every messaging library has its own convention
config_bytesThe configuration in bytes. It can encode arbitrary content
  • Controlled by AccessControlManager

Sets the configuration of the LayerZero messaging library of the specified version

function setSendVersion(uint16 version_) external
NameTypeDescription
version_uint16New messaging library version
  • Controlled by AccessControlManager

Gets the configuration of the LayerZero messaging library of the specified version

function getConfig(uint16 version_, uint16 chainId_, uint256 configType_) external view returns (bytes)
NameTypeDescription
version_uint16Messaging library version
chainId_uint16The LayerZero chainId
configType_uint256Type of configuration. Every messaging library has its own convention