Skip to main content

IL1MessageManager

RollingHashUpdated

event RollingHashUpdated(uint256 messageNumber, bytes32 rollingHash, bytes32 messageHash)

Emitted when a new message is sent and the rolling hash updated.

Parameters

NameTypeDescription
messageNumberuint256The unique indexed message number for the message.
rollingHashbytes32The indexed rolling hash computed for the current message number.
messageHashbytes32The indexed hash of the message parameters.

L2MerkleRootAdded

event L2MerkleRootAdded(bytes32 l2MerkleRoot, uint256 treeDepth)

Emitted when the L2 Merkle root has been anchored on L1.

There may be more than one of these in a finalization depending on the amount of L2->L1 messages in the finalization.

Parameters

NameTypeDescription
l2MerkleRootbytes32The indexed L2 Merkle root that has been anchored on L1 Ethereum.
treeDepthuint256The indexed tree depth of the Merkle root.

L2MessagingBlockAnchored

event L2MessagingBlockAnchored(uint256 l2Block)

Emitted when the L2 block contains L2 messages during finalization.

This is used externally in the logic for determining which messages belong to which Merkle root when claiming.

Parameters

NameTypeDescription
l2Blockuint256The indexed L2 block containing L2 to L1 messages.

MessageAlreadyClaimed

error MessageAlreadyClaimed(uint256 messageIndex)

Thrown when the message has already been claimed.

L2MerkleRootAlreadyAnchored

error L2MerkleRootAlreadyAnchored(bytes32 merkleRoot)

Thrown when the L2 Merkle root has already been anchored on L1.

BytesLengthNotMultipleOfTwo

error BytesLengthNotMultipleOfTwo(uint256 bytesLength)

Thrown when the L2 messaging blocks offsets bytes length is not a multiple of 2.

isMessageClaimed

function isMessageClaimed(uint256 _messageNumber) external view returns (bool isClaimed)

Checks if the L2->L1 message is claimed or not.

Parameters

NameTypeDescription
_messageNumberuint256The message number on L2.

Return Values

NameTypeDescription
isClaimedboolReturns whether or not the message with _messageNumber has been claimed.