axelar-gmp-sdk-solidity

Solidity API

Operators

This contract provides an access control mechanism, where an owner can register operator accounts that can call arbitrary contracts on behalf of this contract.

The owner account is initially set as the deployer address.

operators

mapping(address => bool) operators

constructor

constructor(address initialOwner) public

Sets the initial owner of the contract.

onlyOperator

modifier onlyOperator()

Modifier that requires the msg.sender to be an operator.

Reverts with a NotOperator error if the condition is not met.

isOperator

function isOperator(address account) external view returns (bool)

Returns whether an address is an operator.

Parameters

Name Type Description
account address Address to check

Return Values

Name Type Description
[0] bool boolean whether the address is an operator

addOperator

function addOperator(address operator) external

Adds an address as an operator.

Can only be called by the current owner.

Parameters

Name Type Description
operator address address to be added as operator

removeOperator

function removeOperator(address operator) external

Removes an address as an operator.

Can only be called by the current owner.

Parameters

Name Type Description
operator address address to be removed as operator

executeContract

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

Allows an operator to execute arbitrary functions on any smart contract.

Can only be called by an operator.

Parameters

Name Type Description
target address address of the contract to execute the function on. Existence is not checked.
callData bytes ABI encoded function call to execute on target
nativeValue uint256 The amount of native asset to send with the call. If nativeValue is set to 0, then msg.value is forwarded instead.

Return Values

Name Type Description
[0] bytes data return data from executed function call

receive

receive() external payable

This function enables the contract to accept native value transfers.