OmnichainGovernanceExecutor
OmnichainGovernanceExecutor
Executes the proposal transactions sent from the main chain
Solidity API
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
}
guardian
A privileged role that can cancel any proposal
address guardian
srcChainId
Stores BNB chain layerzero endpoint id
uint16 srcChainId
lastProposalReceived
Last proposal count received
uint256 lastProposalReceived
proposals
The official record of all proposals ever proposed
mapping(uint256 => struct OmnichainGovernanceExecutor.Proposal) proposals
proposalTimelocks
Mapping containing Timelock addresses for each proposal type
mapping(uint256 => contract ITimelock) proposalTimelocks
queued
Represents queue state of proposal
mapping(uint256 => bool) queued
setSrcChainId
Update source layerzero endpoint id
function setSrcChainId(uint16 srcChainId_) external
Parameters
srcChainId_
uint16
The new source chain id to be set
📅 Events
Emit SetSrcChainId with old and new source id
⛔️ Access Requirements
Only owner
setGuardian
Sets the new executor guardian
function setGuardian(address newGuardian) external
Parameters
newGuardian
address
The address of the new guardian
📅 Events
Emit NewGuardian with old and new guardian address
⛔️ Access Requirements
Must be call by guardian or owner
addTimelocks
Add timelocks to the ProposalTimelocks mapping
function addTimelocks(contract ITimelock[] timelocks_) external
Parameters
timelocks_
contract ITimelock[]
Array of addresses of all 3 timelocks
📅 Events
Emits TimelockAdded with old and new timelock and route type
⛔️ Access Requirements
Only owner
execute
Executes a queued proposal if eta has passed
function execute(uint256 proposalId_) external
Parameters
proposalId_
uint256
Id of proposal that is to be executed
📅 Events
Emits ProposalExecuted with proposal id of executed proposal
cancel
Cancels a proposal only if sender is the guardian and proposal is not executed
function cancel(uint256 proposalId_) external
Parameters
proposalId_
uint256
Id of proposal that is to be canceled
📅 Events
Emits ProposalCanceled with proposal id of the canceled proposal
⛔️ Access Requirements
Sender must be the guardian
setTimelockPendingAdmin
Sets the new pending admin of the Timelock
function setTimelockPendingAdmin(address pendingAdmin_, uint8 proposalType_) external
Parameters
pendingAdmin_
address
Address of new pending admin
proposalType_
uint8
Type of proposal
📅 Events
Emits SetTimelockPendingAdmin with new pending admin and proposal type
⛔️ Access Requirements
Only owner
retryMessage
Resends a previously failed message
function retryMessage(uint16 srcChainId_, bytes srcAddress_, uint64 nonce_, bytes payload_) public payable
Parameters
srcChainId_
uint16
Source chain Id
srcAddress_
bytes
Source address => local app address + remote app address
nonce_
uint64
Nonce to identify failed message
payload_
bytes
The payload of the message to be retried
⛔️ Access Requirements
Only owner
state
Gets the state of a proposal
function state(uint256 proposalId_) public view returns (enum OmnichainGovernanceExecutor.ProposalState)
Parameters
proposalId_
uint256
The id of the proposal
Return Values
[0]
enum OmnichainGovernanceExecutor.ProposalState
Proposal state
Last updated