axelar-gmp-sdk-solidity

Solidity API

IInterchainMultisig

This interface extends IMultisigBase by adding an execute function for multisignature transactions.

InvalidChainName

error InvalidChainName()

NotSelf

error NotSelf()

AlreadyExecuted

error AlreadyExecuted()

InvalidPayloadType

error InvalidPayloadType()

InvalidChainNameHash

error InvalidChainNameHash()

InvalidVoidBatch

error InvalidVoidBatch()

EmptyBatch

error EmptyBatch()

InvalidRecipient

error InvalidRecipient()

Call

struct Call {
  string chainName;
  address executor;
  address target;
  bytes callData;
  uint256 nativeValue;
}

BatchExecuted

event BatchExecuted(bytes32 batchId, bytes32 batchHash, uint256 callsExecuted, uint256 batchLength)

CallExecuted

event CallExecuted(bytes32 batchId, address target, bytes callData, uint256 nativeValue)

chainNameHash

function chainNameHash() external view returns (bytes32)

Returns the hash of the chain name

Return Values

Name Type Description
[0] bytes32 The hash of the chain name

isBatchExecuted

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

Checks if a payload has been executed

Parameters

Name Type Description
batchHash bytes32 The hash of the payload payload

Return Values

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

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

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.

Calls a target address with specified calldata and passing provided native value.

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

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