OmnichainProposalSender

OmnichainProposalSender

OmnichainProposalSender contract builds upon the functionality of its parent contract , BaseOmnichainControllerSrc It sends a proposal's data to remote chains for execution after the proposal passes on the main chain when used with GovernorBravo, the owner of this contract must be set to the Timelock contract

Solidity API

proposalCount

Stores the total number of remote proposals

uint256 proposalCount

storedExecutionHashes

Execution hashes of failed messages

mapping(uint256 => bytes32) storedExecutionHashes

LZ_ENDPOINT

LayerZero endpoint for sending messages to remote chains

contract ILayerZeroEndpoint LZ_ENDPOINT

trustedRemoteLookup

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

mapping(uint16 => bytes) trustedRemoteLookup

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

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

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

Remove trusted remote from storage

function removeTrustedRemote(uint16 remoteChainId_) external

Parameters

Name
Type
Description

remoteChainId_

uint16

The chain's id corresponds to setting the trusted remote to empty

📅 Events

  • Emit TrustedRemoteRemoved with remote chain id

⛔️ Access Requirements

  • Controlled by Access Control Manager


execute

Sends a message to execute a remote proposal

function execute(uint16 remoteChainId_, bytes payload_, bytes adapterParams_, address zroPaymentAddress_) external payable

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

  • 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

  • Controlled by Access Control Manager


retryExecute

Resends a previously failed message

function retryExecute(uint256 pId_, uint16 remoteChainId_, bytes payload_, bytes adapterParams_, address zroPaymentAddress_, uint256 originalValue_) external payable

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

  • Emits ClearPayload with proposal ID and hash

⛔️ Access Requirements

  • Controlled by Access Control Manager


fallbackWithdraw

Clear previously failed message

function fallbackWithdraw(address to_, uint256 pId_, uint16 remoteChainId_, bytes payload_, bytes adapterParams_, uint256 originalValue_) external

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

  • Emits ClearPayload with proposal ID and hash

  • Emits FallbackWithdraw with receiver and amount

⛔️ Access Requirements

  • Only owner


setTrustedRemoteAddress

Sets the remote message receiver address

function setTrustedRemoteAddress(uint16 remoteChainId_, bytes newRemoteAddress_) external

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

  • Emits SetTrustedRemoteAddress with remote chain Id and remote address

⛔️ Access Requirements

  • Controlled by AccessControlManager


setConfig

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

function setConfig(uint16 version_, uint16 chainId_, uint256 configType_, bytes config_) external

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

  • Controlled by AccessControlManager


setSendVersion

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

function setSendVersion(uint16 version_) external

Parameters

Name
Type
Description

version_

uint16

New messaging library version

⛔️ Access Requirements

  • Controlled by AccessControlManager


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

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


Last updated