axelar-gmp-sdk-solidity

Solidity API

InterchainMultisig

Weighted Multisig executor to call functions on any contract

INTERCHAIN_MULTISIG_SLOT

bytes32 INTERCHAIN_MULTISIG_SLOT

chainNameHash

bytes32 chainNameHash

Returns the hash of the chain name

Return Values

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

InterchainMultisigStorage

struct InterchainMultisigStorage {
  mapping(bytes32 => bool) isBatchExecuted;
}

constructor

constructor(string chainName, bytes32 domainSeparator_, struct WeightedSigners signers) public

Contract constructor

Sets the initial list of signers and corresponding threshold.

Parameters

Name Type Description
chainName string The name of the chain
domainSeparator_ bytes32  
signers struct WeightedSigners The weighted signers payload

onlySelf

modifier onlySelf()

isBatchExecuted

function isBatchExecuted(bytes32 batchId) external view returns (bool)

Checks if a payload has been executed

Parameters

Name Type Description
batchId bytes32 The hash of the payload payload

Return Values

Name Type Description
[0] bool True if the payload has been executed

executeCalls

function executeCalls(bytes32 batchId, struct IInterchainMultisig.Call[] calls, struct Proof proof) external payable

Executes an external contract call. This function is protected by the onlySigners requirement.

Executes a batch of calls with specified target addresses, calldata and native value. The proof data should have signers, weights, threshold and signatures encoded The signers and signatures should be sorted by signer address in ascending order

Parameters

Name Type Description
batchId bytes32 The batchId of the multisig
calls struct IInterchainMultisig.Call[] The batch of calls to execute
proof struct Proof The multisig proof data

validateProof

function validateProof(bytes32 dataHash, struct Proof proof) external view returns (bool isLatestSigners)

This function takes dataHash and proof data and reverts if proof is invalid

Parameters

Name Type Description
dataHash bytes32 The hash of the message that was signed
proof struct Proof The data containing signers with signatures

Return Values

Name Type Description
isLatestSigners bool True if provided signers are the current ones

rotateSigners

function rotateSigners(struct WeightedSigners newSigners) external

Rotates the signers of the multisig This function is protected by the onlySelf modifier.

This function is only callable by the contract itself after signature verification

Parameters

Name Type Description
newSigners struct WeightedSigners The new weighted signers encoded as bytes

withdraw

function withdraw(address recipient, uint256 amount) external

Withdraws native token from the contract. This function is protected by the onlySelf modifier.

This function is only callable by the contract itself after signature verification

Parameters

Name Type Description
recipient address The recipient of the native value
amount uint256 The amount of native value to withdraw

noop

function noop() external view

This function can be used to void a batch id from being executed in the future. This can be helpful to void an already signed but not yet executed batch. This function is protected by the onlySelf modifier.

This function is only callable by the contract itself after signature verification

receive

receive() external payable

Allow contract to be able to receive native value