HyperlaneImplementation

Introduction

This contract is used to allow Superform to send messages via Hyperlane.

Core Concepts

Hyperlane builds upon AMBImplementation to formalize certain methods specific to the Hyperlane protocol.

Receiving Payloads

The implemented interface can be found in Hyperlane's MessageRecipient interface here.

handle

This function handles an interchain message sent via Hyperlane. Only the Hyperlane Mailbox may call this function.

function handle(
    uint32 origin_,
    bytes32 sender_,
    bytes calldata body_
) external override

Retrying Payloads

As mentioned in the AMB Implementations section, messages can be retried by calling retryPayload with a bytes hash of relevant data. In the case of Hyperlane, the data is the following:

(bytes32 messageId, uint32 destinationDomain, uint256 gasAmount)

Configuration Setters

There are multiple bridge related configurations to be made on the contract. These configuration functions can only be set by the PROTOCOL_ADMIN.

Other important variables, like the Mailbox and InterchainGasPaymaster, are set in the constructor.

setChainId

This function allows the ProtocolAdmin to map a Hyperlane chain id to Superform's chain id, the EVM id.

function setChainId(
    uint64 superChainId_,
    uint16 ambChainId_) external onlyProtocolAdmin

setReceiver

This function allows the ProtocolAdmin to set receiver implementations on a new chain id.

function setReceiver(
    uint32 domain_,
    address authorizedImpl_) external onlyProtocolAdmin

Last updated