Skip to content

OmnichainGovernanceExecutor

OmnichainGovernanceExecutor at v2.15.0 receives LayerZero V1 messages from the trusted BNB sender, queues each route through its destination TimelockV8, and permits permissionless execution after the timelock ETA. Only the configured guardian can cancel a queued remote proposal.

The deployed surface also inherits LayerZero configuration, trusted-remote, failed-message, pause, ownership, and receive-limit selectors from NonblockingLzApp and BaseOmnichainControllerDest. Administrative calls normally pass through OmnichainExecutorOwner; do not infer direct caller authority from public ABI presence.

enum ProposalType {
NORMAL,
FASTTRACK,
CRITICAL
}
struct Proposal {
uint256 id;
uint256 eta;
address[] targets;
uint256[] values;
string[] signatures;
bytes[] calldatas;
bool canceled;
bool executed;
uint8 proposalType;
}
enum ProposalState {
Canceled,
Queued,
Executed
}

A privileged role that can cancel any proposal

address guardian

Stores BNB chain layerzero endpoint id

uint16 srcChainId

Last proposal count received

uint256 lastProposalReceived

The official record of all proposals ever proposed

mapping(uint256 => struct OmnichainGovernanceExecutor.Proposal) proposals

Mapping containing Timelock addresses for each proposal type

mapping(uint256 => contract ITimelock) proposalTimelocks

Represents queue state of proposal

mapping(uint256 => bool) queued

Update source layerzero endpoint id

function setSrcChainId(uint16 srcChainId_) external
NameTypeDescription
srcChainId_uint16The new source chain id to be set
  • Emit SetSrcChainId with old and new source id
  • Only owner

Sets the new executor guardian

function setGuardian(address newGuardian) external
NameTypeDescription
newGuardianaddressThe address of the new guardian
  • Emit NewGuardian with old and new guardian address
  • Must be call by guardian or owner

Add timelocks to the ProposalTimelocks mapping

function addTimelocks(contract ITimelock[] timelocks_) external
NameTypeDescription
timelocks_contract ITimelock[]Array of addresses of all 3 timelocks
  • Emits TimelockAdded with old and new timelock and route type
  • Only owner

Executes a queued proposal if eta has passed

function execute(uint256 proposalId_) external
NameTypeDescription
proposalId_uint256Id of proposal that is to be executed
  • Emits ProposalExecuted with proposal id of executed proposal

Cancels a proposal only if sender is the guardian and proposal is not executed

function cancel(uint256 proposalId_) external
NameTypeDescription
proposalId_uint256Id of proposal that is to be canceled
  • Emits ProposalCanceled with proposal id of the canceled proposal
  • Sender must be the guardian

Sets the new pending admin of the Timelock

function setTimelockPendingAdmin(address pendingAdmin_, uint8 proposalType_) external
NameTypeDescription
pendingAdmin_addressAddress of new pending admin
proposalType_uint8Type of proposal
  • Emits SetTimelockPendingAdmin with new pending admin and proposal type
  • Only owner

Resends a previously failed message

function retryMessage(uint16 srcChainId_, bytes srcAddress_, uint64 nonce_, bytes payload_) public payable
NameTypeDescription
srcChainId_uint16Source chain Id
srcAddress_bytesSource address => local app address + remote app address
nonce_uint64Nonce to identify failed message
payload_bytesThe payload of the message to be retried
  • Only owner

Gets the state of a proposal

function state(uint256 proposalId_) public view returns (enum OmnichainGovernanceExecutor.ProposalState)
NameTypeDescription
proposalId_uint256The id of the proposal
NameTypeDescription
[0]enum OmnichainGovernanceExecutor.ProposalStateProposal state