Skip to main content

L1MessageService

systemMigrationBlock

uint256 systemMigrationBlock

This is currently not in use, but is reserved for future upgrades.

__MessageService_init

function __MessageService_init(uint256 _rateLimitPeriod, uint256 _rateLimitAmount) internal

Initialises underlying message service dependencies.

Parameters

NameTypeDescription
_rateLimitPerioduint256The period to rate limit against.
_rateLimitAmountuint256The limit allowed for withdrawing the period.

sendMessage

function sendMessage(address _to, uint256 _fee, bytes _calldata) external payable

Adds a message for sending cross-chain and emits MessageSent.

_The message number is preset (nextMessageNumber) and only incremented at the end if successful for the next caller. This function should be called with a msg.value = _value + fee. The fee will be paid on the destination chain.

Parameters

NameTypeDescription
_toaddressThe address the message is intended for.
_feeuint256The fee being paid for the message delivery.
_calldatabytesThe calldata to pass to the recipient.

claimMessageWithProof

function claimMessageWithProof(struct IL1MessageService.ClaimMessageWithProofParams _params) external

Claims and delivers a cross-chain message using a Merkle proof.

if tree depth is empty, it will revert with L2MerkleRootDoesNotExist. if tree depth is different than proof size, it will revert with ProofLengthDifferentThanMerkleDepth.

Parameters

NameTypeDescription
_paramsstruct IL1MessageService.ClaimMessageWithProofParamsCollection of claim data with proof and supporting data.

sender

function sender() external view returns (address originalSender)

Claims and delivers a cross-chain message.

The message sender address is set temporarily in the transient storage when claiming.

Return Values

NameTypeDescription
originalSenderaddressThe message sender address that is stored temporarily in the transient storage when claiming.