Skip to content

Commit 313f73d

Browse files
committed
Update readme files
1 parent 087bfa4 commit 313f73d

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,23 @@ uint32 payloadLen // Length of the payload
205205
bytes payload // The full payload, the keccak of which was sent to `endpoint.sendMessage`
206206
```
207207

208+
##### NTT v1 Request
209+
210+
```solidity
211+
bytes4 prefix = "ERN1" // 4-byte prefix for this struct
212+
uint16 srcChain
213+
bytes32 srcManager
214+
bytes32 messageId
215+
```
216+
217+
##### CCTP v1 Request
218+
219+
```solidity
220+
bytes4 prefix = "ERC1" // 4-byte prefix for this struct
221+
uint32 sourceDomain
222+
uint64 nonce
223+
```
224+
208225
#### Relay Instructions
209226

210227
##### Gas Instruction

evm/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,54 @@ executor.requestExecution{value: executionAmount}(
4646

4747
<!-- cspell:enable -->
4848

49+
#### Example v1 NTT Request
50+
51+
<!-- cspell:disable -->
52+
53+
```solidity
54+
import "example-messaging-executor/evm/src/interfaces/IExecutor.sol";
55+
import "example-messaging-executor/evm/src/libraries/ExecutorMessages.sol";
56+
...
57+
uint64 msgId = nttm.transfer{value: msg.value - executorArgs.value}(
58+
amount, recipientChain, recipientAddress, refundAddress, shouldQueue, encodedInstructions
59+
);
60+
61+
executor.requestExecution{value: executorArgs.value}(
62+
recipientChain,
63+
nttm.getPeer(recipientChain).peerAddress,
64+
executorArgs.refundAddress,
65+
executorArgs.signedQuote,
66+
ExecutorMessages.makeNTTv1Request(
67+
chainId, bytes32(uint256(uint160(address(nttm)))), bytes32(uint256(msgId))
68+
),
69+
executorArgs.instructions
70+
);
71+
```
72+
73+
<!-- cspell:enable -->
74+
75+
#### Example v1 CCTP Request
76+
77+
<!-- cspell:disable -->
78+
79+
```solidity
80+
import "example-messaging-executor/evm/src/interfaces/IExecutor.sol";
81+
import "example-messaging-executor/evm/src/libraries/ExecutorMessages.sol";
82+
...
83+
uint64 nonce = circleTokenMessenger.depositForBurn(amount, destinationDomain, mintRecipient, burnToken);
84+
85+
executor.requestExecution{value: executorArgs.value}(
86+
0,
87+
bytes32(0),
88+
executorArgs.refundAddress,
89+
executorArgs.signedQuote,
90+
ExecutorMessages.makeCCTPv1Request(sourceDomain, nonce),
91+
executorArgs.instructions
92+
);
93+
```
94+
95+
<!-- cspell:enable -->
96+
4997
### Execution Support
5098

5199
#### v1 VAA Execution
@@ -56,6 +104,22 @@ Your contract must implement the following function.
56104
function receiveMessage(bytes calldata encodedTransferMessage) public payable
57105
```
58106

107+
#### v1 NTT Execution
108+
109+
The NTT Transceiver contract implements the following function.
110+
111+
```solidity
112+
function receiveMessage(bytes memory encodedMessage) external
113+
```
114+
115+
#### v1 CCTP Execution
116+
117+
The Circle Message Transmitter contract implements the following function.
118+
119+
```solidity
120+
function receiveMessage(bytes calldata message,bytes calldata attestation) external override whenNotPaused returns (bool success)
121+
```
122+
59123
## Executor Development
60124

61125
### Testing

0 commit comments

Comments
 (0)