L2CrossDomainMessenger

Blast

0x4200000000000000000000000000000000000007

Proxy 實作合約: 0x5f7b80cbea82dd18852e3e771e6b43e6f3ef8cbf

Solidity v0.8.15+commit.e14f2714

🤖
透過你的 AI 查詢此合約
參考: 0x4200000000000000000000000000000000000007
範例提示詞: "Tell me the current state of blast/0x4200000000000000000000000000000000000007"
還沒有接入 AI?→ mcp.smarts.md
Blast 在 Smarts 上是僅文件鏈:原始碼和 ABI 已索引,但目前不提供即時鏈上資料(狀態、最新事件、管理員概覽)。AI 代理仍可透過 MCP 呼叫 get_contract_info 和 get_contract_source。

概覽

讀取函式
16
寫入函式
3
事件
5

讀取函式

MESSAGE_VERSION() view

Returns the current message protocol version used by the L2CrossDomainMessenger.✨ AI

回傳值

名稱 類型 描述
uint16 The message protocol version (uint16) that identifies the cross-domain message format.✨ AI
MIN_GAS_CALLDATA_OVERHEAD() view

Provides the minimum calldata gas overhead used when estimating gas for cross-domain calls.✨ AI

回傳值

名稱 類型 描述
uint64 The minimum gas overhead (uint64) applied to calldata for cross-domain messages.✨ AI
MIN_GAS_DYNAMIC_OVERHEAD_DENOMINATOR() view

Returns the denominator used to compute the dynamic gas overhead for cross-domain messages.✨ AI

回傳值

名稱 類型 描述
uint64 uint64 denominator used in dynamic gas overhead calculation; a larger value reduces the overhead added to gas estimates.✨ AI
MIN_GAS_DYNAMIC_OVERHEAD_NUMERATOR() view

Returns the numerator used to compute the dynamic gas overhead.✨ AI

回傳值

名稱 類型 描述
uint64 The uint64 numerator component of the dynamic gas overhead ratio.✨ AI
OTHER_MESSENGER() view

Returns the address of the paired cross-domain messenger contract on the other layer.✨ AI

回傳值

名稱 類型 描述
address Address of the paired cross-domain messenger contract on the other layer.✨ AI
RELAY_CALL_OVERHEAD() view

Returns the fixed gas overhead applied when relaying a cross-domain call.✨ AI

回傳值

名稱 類型 描述
uint64 The uint64 value representing the fixed gas overhead (in gas units) added for relay calls.✨ AI
RELAY_CONSTANT_OVERHEAD() view

Returns the constant gas overhead added to relayed cross-domain messages.✨ AI

回傳值

名稱 類型 描述
uint64 Constant uint64 value for the fixed gas overhead applied to relayed messages.✨ AI
RELAY_GAS_CHECK_BUFFER() view

Returns the gas buffer value used when validating relay gas requirements.✨ AI

回傳值

名稱 類型 描述
uint64 The buffer value (uint64) added to relay gas checks to account for execution overhead.✨ AI
RELAY_RESERVED_GAS() view

Returns the reserved gas amount used when relaying cross-domain messages.✨ AI

回傳值

名稱 類型 描述
uint64 The uint64 value representing gas units reserved for message relay.✨ AI
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.

參數

名稱 類型 描述
_message bytes Message to compute the amount of required gas for.
_minGasLimit uint32 Minimum desired gas limit when message goes to target.

回傳值

名稱 類型 描述
uint64 Amount of gas required to guarantee message receipt.
failedMessages(bytes32) view

Returns whether the cross-domain message identified by the given hash has failed.✨ AI

參數

名稱 類型 描述
bytes32

回傳值

名稱 類型 描述
bool True if the message hash corresponds to a previously failed message; otherwise false.✨ AI
l1CrossDomainMessenger() view

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

回傳值

名稱 類型 描述
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.

回傳值

名稱 類型 描述
uint256 Nonce of the next message to be sent, with added message version.
successfulMessages(bytes32) view

Indicates whether the given cross-domain message hash was marked as successfully relayed.✨ AI

參數

名稱 類型 描述
bytes32

回傳值

名稱 類型 描述
bool True if the message hash is recorded as successfully processed; otherwise false.✨ AI
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.

回傳值

名稱 類型 描述
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.

回傳值

名稱 類型 描述
address Address of the sender of the currently executing message on the other chain.

寫入函式

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.

參數

名稱 類型 描述
_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).

參數

名稱 類型 描述
_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.

事件

FailedRelayedMessage(msgHash: bytes32)

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

名稱 類型 已索引 描述
msgHash bytes32 Hash of the message that failed to be relayed.
Initialized(version: uint8)
名稱 類型 已索引 描述
version uint8
RelayedMessage(msgHash: bytes32)

Emitted whenever a message is successfully relayed on this chain.

名稱 類型 已索引 描述
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.

名稱 類型 已索引 描述
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.

名稱 類型 已索引 描述
sender address Address of the sender of the message.
value uint256 ETH value sent along with the message to the recipient.