This contract is part of the Axelar Governance system, it inherits the Interchain Governance contract with added functionality to approve and execute operator proposals.
enum ServiceGovernanceCommand {
ScheduleTimeLockProposal,
CancelTimeLockProposal,
ApproveOperatorProposal,
CancelOperatorApproval
}
address operator
mapping(bytes32 => bool) operatorApprovals
Returns whether an operator proposal has been approved
| Name | Type | Description | | —- | —- | ———– |
| Name | Type | Description | | —- | —- | ———– |
modifier onlyOperator()
modifier onlyOperatorOrSelf()
constructor(address gateway_, string governanceChain_, string governanceAddress_, uint256 minimumTimeDelay, address operator_) public
Initializes the contract.
Name | Type | Description |
---|---|---|
gateway_ | address | The address of the Axelar gateway contract |
governanceChain_ | string | The name of the governance chain |
governanceAddress_ | string | The address of the governance contract |
minimumTimeDelay | uint256 | The minimum time delay for timelock operations |
operator_ | address | The operator address |
function isOperatorProposalApproved(address target, bytes callData, uint256 nativeValue) external view returns (bool)
Returns whether an operator proposal has been approved
Name | Type | Description |
---|---|---|
target | address | The address of the contract targeted by the proposal |
callData | bytes | The call data to be sent to the target contract |
nativeValue | uint256 | The amount of native tokens to be sent to the target contract |
Name | Type | Description |
---|---|---|
[0] | bool | bool True if the proposal has been approved, False otherwise |
function executeOperatorProposal(address target, bytes callData, uint256 nativeValue) external payable
Executes an operator proposal.
Name | Type | Description |
---|---|---|
target | address | The target address the proposal will call |
callData | bytes | The data that encodes the function and arguments to call on the target contract |
nativeValue | uint256 | The value of native token to be sent to the target contract |
function transferOperatorship(address newOperator) external
Transfers the operator address to a new address
Only the current operator or the governance can call this function
Name | Type | Description |
---|---|---|
newOperator | address | The new operator address |
function _processCommand(uint256 commandType, address target, bytes callData, uint256 nativeValue, uint256 eta) internal
Internal function to process a governance command
Name | Type | Description |
---|---|---|
commandType | uint256 | The type of the command |
target | address | The target address the proposal will call |
callData | bytes | The data the encodes the function and arguments to call on the target contract |
nativeValue | uint256 | The value of native token to be sent to the target contract |
eta | uint256 | The time after which the proposal can be executed |