Axelar Adapter

Lucid has developed an adapter that integrates with the Axelar messaging bridge to send and receive cross-chain messages. This adapter also integrates with the Axelar Gas Service, allowing fees to be paid at the time a message is sent.

Fees

Axelar does not support on-chain fee quoting. Fees must be calculated off-chain using Axelar’s SDK.

When sending or exporting a transaction through the Lucid App, Lucid automatically calculates the total fee required, including any applicable protocol fees.

Any excess gas fees sent are refunded to the refundAddress specified in the options field.

Interfaces

Each adapter implements the following public functions:

relayMessage

function relayMessage( uint256 destChainId, address destination, bytes memory options, bytes calldata message ) external payable returns (bytes32)

Sends a message through the Axelar bridge, deducts the protocol fee, and pays the required bridge fee via the Axelar Gas Service.

  • Any excess fees are refunded to the refundAddress, which must be an ABI-encoded address in the options bytes.

  • The Ether value sent by the calling contract must include both the Axelar Gas Service fee and the Lucid protocol fee.

  • Axelar does not assign transfer IDs, so an empty bytes32 value is returned.

Input Params:

Type
Name
Description

uint256

destChainId

The destination chain ID.

address

destination

The destination address.

bytes

options

Additional params to be used by each adapter. In Axelar, it's the ABI-encoded refund address.

bytes

message

The message to be relayed.


calculateFee

function calculateFee(uint256 amount) public view returns (uint256)

Calculates the Lucid protocol fee based on the bridge fee provided for the Axelar transfer. Returns the protocol fee in wei.

Input Params:

Type
Name
Description

uint256

amount

The eth value in wei that is passed to the Bridge to pay for the message transfer

Last updated