axelar-gmp-sdk-solidity

Solidity API

AxelarServiceGovernance

This contract is part of the Axelar Governance system, it inherits the Interchain Governance contract with added functionality to approve and execute operator proposals.

ServiceGovernanceCommand

enum ServiceGovernanceCommand {
  ScheduleTimeLockProposal,
  CancelTimeLockProposal,
  ApproveOperatorProposal,
  CancelOperatorApproval
}

operator

address operator

operatorApprovals

mapping(bytes32 => bool) operatorApprovals

Returns whether an operator proposal has been approved

Parameters

| Name | Type | Description | | —- | —- | ———– |

Return Values

| Name | Type | Description | | —- | —- | ———– |

onlyOperator

modifier onlyOperator()

onlyOperatorOrSelf

modifier onlyOperatorOrSelf()

constructor

constructor(address gateway_, string governanceChain_, string governanceAddress_, uint256 minimumTimeDelay, address operator_) public

Initializes the contract.

Parameters

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

isOperatorProposalApproved

function isOperatorProposalApproved(address target, bytes callData, uint256 nativeValue) external view returns (bool)

Returns whether an operator proposal has been approved

Parameters

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

Return Values

Name Type Description
[0] bool bool True if the proposal has been approved, False otherwise

executeOperatorProposal

function executeOperatorProposal(address target, bytes callData, uint256 nativeValue) external payable

Executes an operator proposal.

Parameters

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

transferOperatorship

function transferOperatorship(address newOperator) external

Transfers the operator address to a new address

Only the current operator or the governance can call this function

Parameters

Name Type Description
newOperator address The new operator address

_processCommand

function _processCommand(uint256 commandType, address target, bytes callData, uint256 nativeValue, uint256 eta) internal

Internal function to process a governance command

Parameters

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