L2CrossDomainMessenger
Blast0x4200000000000000000000000000000000000007
Proxy 实现合约: 0x5f7b80cbea82dd18852e3e771e6b43e6f3ef8cbf
Solidity v0.8.15+commit.e14f2714
概览
读取函数
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 |
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 |
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 |
Returns the numerator used to compute the dynamic gas overhead.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint64 | The uint64 numerator component of the dynamic gas overhead ratio.✨ AI |
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 |
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 |
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 |
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 |
Returns the reserved gas amount used when relaying cross-domain messages.✨ AI
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | uint64 | The uint64 value representing gas units reserved for message relay.✨ AI |
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. |
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 |
Legacy getter for the remote messenger. Use otherMessenger going forward.
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
| — | address | Address of the L1CrossDomainMessenger contract. |
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. |
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 |
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. |
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. |
写入函数
Initializer.
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. |
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. |
事件
Emitted whenever a message fails to be relayed on this chain.
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| msgHash | bytes32 | ✓ | Hash of the message that failed to be relayed. |
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| version | uint8 |
Emitted whenever a message is successfully relayed on this chain.
| 名称 | 类型 | 已索引 | 描述 |
|---|---|---|---|
| msgHash | bytes32 | ✓ | Hash of the message that was relayed. |
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. |
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. |