-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
contracts-bedrock: create ICrossL2Inbox.sol
- Loading branch information
1 parent
35fa4b5
commit 889ff4f
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
/// @title ICrossL2Inbox | ||
/// @notice Interface for the CrossL2Inbox contract. | ||
interface ICrossL2Inbox { | ||
/// @notice The struct for a pointer to a message payload in a remote (or local) chain. | ||
struct Identifier { | ||
address origin; | ||
uint256 blocknumber; | ||
uint256 logIndex; | ||
uint256 timestamp; | ||
uint256 chainId; | ||
} | ||
|
||
/// @notice Returns the origin address of the Identifier. | ||
/// @return _origin The origin address of the Identifier. | ||
function origin() external view returns (address _origin); | ||
|
||
/// @notice Returns the block number of the Identifier. | ||
/// @return _blocknumber The block number of the Identifier. | ||
function blocknumber() external view returns (uint256 _blocknumber); | ||
|
||
/// @notice Returns the log index of the Identifier. | ||
/// @return _logIndex The log index of the Identifier. | ||
function logIndex() external view returns (uint256 _logIndex); | ||
|
||
/// @notice Returns the timestamp of the Identifier. | ||
/// @return _timestamp The timestamp of the Identifier. | ||
function timestamp() external view returns (uint256 _timestamp); | ||
|
||
/// @notice Returns the chain ID of the Identifier. | ||
/// @return _chainId The chain ID of the Identifier. | ||
function chainId() external view returns (uint256 _chainId); | ||
|
||
/// @notice Executes a cross chain message on the destination chain. | ||
/// @param _id An Identifier pointing to the initiating message. | ||
/// @param _target Account that is called with _msg. | ||
/// @param _msg The message payload, matching the initiating message. | ||
function executeMessage( | ||
ICrossL2Inbox.Identifier calldata _id, | ||
address _target, | ||
bytes calldata _msg | ||
) | ||
external | ||
payable; | ||
} |