AMB Implementations

Introduction

AMB (Arbitrary Messaging Bridge) implementations are the individual messaging bridges used to move messages defined in various State Registry contracts.

Core Concepts

All AMB implementations must implement IAmbImplementation , which defines a set of important characteristics to be able to dispatch messages via that particular bridge. Individual AMB Implementations all have different ways of receiving payloads, but other methods are standardized.

dispatchPayload

This function allows the state registry to send a message via the implementation. This function is overridden in individual implementations and can only be called by State Registries the PROTOCOL_ADMIN has given appropriate permissions to.

function dispatchPayload(
        address srcSender_,
        uint64 dstChainId_,
        bytes memory message_,
        bytes memory extraData_
) external payable;
namedescription

srcSender_

address of the caller, used for gas refunds

dstChainId_

uint64 of the EVM chain id to send the message to

message_

bytes message to pass to the given chain

extraData_

bytes AMB override specific to the bridge

retryPayload

This function specifies a method to allow for the permissionless calling of the AMB's retry mechanism if payloads aren't successfully delivered.

function retryPayload(
    bytes memory data_
) external payable
namedescription

data_

bytes encoded data of the appropriate data types to hash in the message to retry, specific on the AMB implementation

estimateFees

This function returns an estimate of gas fees in native tokens to send the message.

function estimateFees(
    uint64 dstChainId_,
    bytes memory message_,
    bytes memory extraData_
) external view returns (uint256 fees);
namedescription

dstChainId_

uint64 of the EVM chain ID to send the message

message_

bytes message to pass to the given chain

extraData_

bytes AMB override specific to the bridge

Last updated