L2CrossDomainMessenger

Blast

0x4200000000000000000000000000000000000007

Proxy implementation: 0x5f7b80cbea82dd18852e3e771e6b43e6f3ef8cbf

Solidity v0.8.15+commit.e14f2714

🤖
Query this contract from your AI
Reference: 0x4200000000000000000000000000000000000007
Sample prompt: "Tell me the current state of blast/0x4200000000000000000000000000000000000007"
No AI wired up yet? → mcp.smarts.md
Blast is a docs-only chain on Smarts: source code and ABI are indexed, but live on-chain data (state, recent events, admin profile) is not currently available. AI agents can still query get_contract_info and get_contract_source via MCP.

Overview

Read Functions
16
Write Functions
3
Events
5

Read Functions

MESSAGE_VERSION() view

Returns

Name Type Description
uint16
MIN_GAS_CALLDATA_OVERHEAD() view

Returns

Name Type Description
uint64
MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR() view

Returns

Name Type Description
uint64
MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR() view

Returns

Name Type Description
uint64
OTHER_MESSENGER() view

Returns

Name Type Description
address
RELAY_CALL_OVERHEAD() view

Returns

Name Type Description
uint64
RELAY_CONSTANT_OVERHEAD() view

Returns

Name Type Description
uint64
RELAY_GAS_CHECK_BUFFER() view

Returns

Name Type Description
uint64
RELAY_RESERVED_GAS() view

Returns

Name Type Description
uint64
baseGas(_message: bytes, _minGasLimit: uint32) pure

Computes the amount of gas required to guarantee that a given message will be received on the other chain without running out of gas. Guaranteeing that a message will not run out of gas is important because this ensures that a message can always be replayed on the other chain if it fails to execute completely.

Parameters

Name Type Description
_message bytes Message to compute the amount of required gas for.
_minGasLimit uint32 Minimum desired gas limit when message goes to target.

Returns

Name Type Description
uint64 Amount of gas required to guarantee message receipt.
failedMessages(bytes32) view

Parameters

Name Type Description
bytes32

Returns

Name Type Description
bool
l1CrossDomainMessenger() view

Legacy getter for the remote messenger. Use otherMessenger going forward.

Returns

Name Type Description
address Address of the L1CrossDomainMessenger contract.
messageNonce() view

Retrieves the next message nonce. Message version will be added to the upper two bytes of the message nonce. Message version allows us to treat messages as having different structures.

Returns

Name Type Description
uint256 Nonce of the next message to be sent, with added message version.
successfulMessages(bytes32) view

Parameters

Name Type Description
bytes32

Returns

Name Type Description
bool
version() view

Getter for the semantic version of the contract. This is not meant to be used onchain but instead meant to be used by offchain tooling.

Returns

Name Type Description
string Semver contract version as a string.
xDomainMessageSender() view

Retrieves the address of the contract or wallet that initiated the currently executing message on the other chain. Will throw an error if there is no message currently being executed. Allows the recipient of a call to see who triggered it.

Returns

Name Type Description
address Address of the sender of the currently executing message on the other chain.

Write Functions

initialize() nonpayable

Initializer.

relayMessage(_nonce: uint256, _sender: address, _target: address, _value: uint256, _minGasLimit: uint256, _message: bytes) payable

Relays a message that was sent by the other CrossDomainMessenger contract. Can only be executed via cross-chain call from the other messenger OR if the message was already received once and is currently being replayed.

Parameters

Name Type Description
_nonce uint256 Nonce of the message being relayed.
_sender address Address of the user who sent the message.
_target address Address that the message is targeted at.
_value uint256 ETH value to send with the message.
_minGasLimit uint256 Minimum amount of gas that the message can be executed with.
_message bytes Message to send to the target.
sendMessage(_target: address, _message: bytes, _minGasLimit: uint32) payable

Sends a message to some target address on the other chain. Note that if the call always reverts, then the message will be unrelayable, and any ETH sent will be permanently locked. The same will occur if the target on the other chain is considered unsafe (see the _isUnsafeTarget() function).

Parameters

Name Type Description
_target address Target contract or wallet address.
_message bytes Message to trigger the target address with.
_minGasLimit uint32 Minimum gas limit that the message can be executed with.

Events

FailedRelayedMessage(msgHash: bytes32)

Emitted whenever a message fails to be relayed on this chain.

Name Type Indexed Description
msgHash bytes32 Hash of the message that failed to be relayed.
Initialized(version: uint8)
Name Type Indexed Description
version uint8
RelayedMessage(msgHash: bytes32)

Emitted whenever a message is successfully relayed on this chain.

Name Type Indexed Description
msgHash bytes32 Hash of the message that was relayed.
SentMessage(target: address, sender: address, message: bytes, messageNonce: uint256, gasLimit: uint256)

Emitted whenever a message is sent to the other chain.

Name Type Indexed Description
target address Address of the recipient of the message.
sender address Address of the sender of the message.
message bytes Message to trigger the recipient address with.
messageNonce uint256 Unique nonce attached to the message.
gasLimit uint256 Minimum gas limit that the message can be executed with.
SentMessageExtension1(sender: address, value: uint256)

Additional event data to emit, required as of Bedrock. Cannot be merged with the SentMessage event without breaking the ABI of this contract, this is good enough.

Name Type Indexed Description
sender address Address of the sender of the message.
value uint256 ETH value sent along with the message to the recipient.