Repository navigation
Expand file tree
/
Copy pathITelepathy.sol
More file actions
70 lines (59 loc) · 1.84 KB
/
Copy pathITelepathy.sol
File metadata and controls
70 lines (59 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
pragma solidity ^0.8.0;
enum MessageStatus {
NOT_EXECUTED,
EXECUTION_FAILED,
EXECUTION_SUCCEEDED
}
struct Message {
uint8 version;
uint64 nonce;
uint32 sourceChainId;
address senderAddress;
uint32 recipientChainId;
bytes32 recipientAddress;
bytes data;
}
interface ITelepathyRouter {
event SentMessage(uint64 indexed nonce, bytes32 indexed msgHash, bytes message);
function send(uint32 recipientChainId, bytes32 recipientAddress, bytes calldata data)
external
returns (bytes32);
function send(uint32 recipientChainId, address recipientAddress, bytes calldata data)
external
returns (bytes32);
function sendViaStorage(uint32 recipientChainId, bytes32 recipientAddress, bytes calldata data)
external
returns (bytes32);
function sendViaStorage(uint32 recipientChainId, address recipientAddress, bytes calldata data)
external
returns (bytes32);
}
interface ITelepathyReceiver {
event ExecutedMessage(
uint32 indexed sourceChainId,
uint64 indexed nonce,
bytes32 indexed msgHash,
bytes message,
bool status
);
function executeMessage(
uint64 slot,
bytes calldata message,
bytes[] calldata accountProof,
bytes[] calldata storageProof
) external;
function executeMessageFromLog(
bytes calldata srcSlotTxSlotPack,
bytes calldata messageBytes,
bytes32[] calldata receiptsRootProof,
bytes32 receiptsRoot,
bytes[] calldata receiptProof, // receipt proof against receipt root
bytes memory txIndexRLPEncoded,
uint256 logIndex
) external;
}
interface ITelepathyHandler {
function handleTelepathy(uint32 _sourceChainId, address _senderAddress, bytes memory _data)
external
returns (bytes4);
}