Superform v1
  • Introduction
  • Components
    • Protocol
    • Keepers
    • API
    • App
  • E2E Flows
    • Same-chain Deposit
    • Cross-chain Deposit
    • Same-chain Withdrawal
    • Cross-chain Withdrawal
  • Periphery Contracts
    • SuperformRouter
      • SuperformRouterPlus
      • SuperformRouterPlusAsync
    • PayMaster
    • PaymentHelper
    • EmergencyQueue
    • SuperformFactory
    • Forms
      • ERC4626Form
      • ERC5115Form
      • ERC7540Form
    • SuperPositions
      • ERC1155A
    • RewardsDistributor
  • Core Contracts
    • State Registries
      • CoreStateRegistry
      • AsyncStateRegistry
      • PayloadHelper
    • AMB Implementations
      • LayerzeroImplementation
      • LayerzeroV2Implementation
      • WormholeARImplementation
      • HyperlaneImplementation
      • AxelarImplementation
    • Broadcasting
      • BroadcastRegistry
      • WormholeSRImplementation
    • Bridge Validators
      • LiFiValidator
      • SocketValidator
      • SocketOneInchValidator
      • DebridgeValidator (and forwarder)
      • OneInchValidator
    • DstSwapper
    • Settings
      • SuperRBAC
      • SuperRegistry
  • SuperVaults
    • SuperVaults
  • Resources
    • Deployment Addresses
    • Subgraphs
      • Protocol Level Entities
      • Form Related Entities
      • Deposits and Withdrawals
      • SuperPosition Events
      • External Entities
    • Infrastructure Integrations
    • Security & Audits
    • Protocol License
    • Glossary
    • Protocol Multisig
    • Superform Labs Socials
Powered by GitBook
On this page
  • Introduction
  • Core Concepts
  • Receiving Payloads
  • Retrying Payloads
  • Configuration Setters

Was this helpful?

  1. Core Contracts
  2. AMB Implementations

HyperlaneImplementation

Last updated 9 months ago

Was this helpful?

Introduction

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

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 .

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
name
description

origin_

uint32 domain id for the chain where the message came from

sender_

address of the message sender on the src chain

body_

bytes content of the message

Retrying Payloads

(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.

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
name
description

superChainId_

internal chain id used by Superform protocol. block.chainid casted to uint64

ambChainId_

uint16 chain id allocated to each chain by Hyperlane

setReceiver

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

function setReceiver(
    uint32 domain_,
    address authorizedImpl_) external onlyProtocolAdmin
name
description

chainId_

uint16 Hyperlane's chain id

authorizedImpl_

address of the Hyperlane message bridge on the respective chain

As mentioned in the 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:

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

Hyperlane
here
AMB Implementations
Mailbox
InterchainGasPaymaster