Message Sender Adapters
The IMessageSenderAdapter provides a sender adapter contract that connects MultiBridgeMessageSender with each AMB endpoint.
IMessageSenderAdapter
The IMessageSenderAdapter extends the SingleMessageDispatcher interface (EIP-5164 standard) and defines the following functions:
name
This function returns the name of the message bridge.
function name() external view returns (string memory);updateReceiverAdapter
This function is used to update the address of the receiver adapter on a destination chain.
function updateReceiverAdapter(uint256[] calldata _dstChainIds, address[] calldata _receiverAdapters) external;receiverAdapters
This function is used to retrieve the receiver adapter address for a given destination chain ID.
function receiverAdapters(uint256 _chainId) external view returns (address);The interface defines the following event:
ReceiverAdapterUpdated
event ReceiverAdapterUpdated(uint256 indexed dstChainId, address indexed oldReceiver, address indexed newReceiver);Emitted when the sender's corresponding receiver adapter on a destination chain is changed through the updateReceiverAdapter() function.
SingleMessageDispatcher
interface SingleMessageDispatcher is MessageDispatcherThe SingleMessageDispatcher interface extends the MessageDispatcher interface and defines an additional method, dispatchMessage()
function dispatchMessage(
uint256 _toChainId,
address _to,
bytes calldata _data
) external payable returns (bytes32 messageId);dispatchMessage() dispatches an individual message to be executed on the toChainId.
MessageDispatcher
MessageDispatcher interface defines the following event:
event MessageDispatched(
bytes32 indexed _messageId,
address indexed _from,
uint256 indexed _toChainId,
address _to,
bytes _data
);This event is emitted by aMessageDispatcher contract when an individual message is dispatched. It includes the following parameters:
_messageId: A bytes32 value representing the unique identifier for the message._from: The address of the sender of the message._toChainId: A uint256 value representing the chain ID of the chain where the message is being dispatched._to: The address of the recipient of the message._data: The data of the message being dispatched.
Last updated