You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/stack/interop/tutorials/message-passing.mdx
+29-45
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ Before starting this tutorial, ensure you have:
35
35
36
36
Before starting this tutorial, refer to the [Installation Guide](/app-developers/tutorials/supersim/getting-started/installation) to set up **Foundry** and **Supersim** on your system.
37
37
38
-
## Implementing solidity message passing
38
+
## Implementing onchain message passing (in Solidity)
39
39
40
40
This section demonstrates how to deploy smart contracts for cross-chain messaging and send messages between them.
41
41
For now, we will ignore the need for executing messages by turning on autorelay.
@@ -419,7 +419,7 @@ We use [TypeScript](https://www.typescriptlang.org/) to have type safety combine
419
419
"type": "commonjs",
420
420
"description": "",
421
421
"devDependencies": {
422
-
"@eth-optimism/viem": "^0.3.0",
422
+
"@eth-optimism/viem": "^0.3.2",
423
423
"@types/node": "^22.13.1",
424
424
"tsx": "^4.19.2",
425
425
"viem": "^2.22.23"
@@ -435,6 +435,10 @@ We use [TypeScript](https://www.typescriptlang.org/) to have type safety combine
435
435
export GREETER_A_ADDR GREETER_B_ADDR PRIV_KEY
436
436
```
437
437
438
+
<details>
439
+
440
+
<summary>Sanity check</summary>
441
+
438
442
1. Create a simple `src/app.mts` file.
439
443
440
444
```typescript
@@ -448,6 +452,9 @@ We use [TypeScript](https://www.typescriptlang.org/) to have type safety combine
448
452
npm run start
449
453
```
450
454
455
+
</details>
456
+
457
+
451
458
### Send a greeting
452
459
453
460
1. Link the compiled versions of the onchain code, which include the ABI, to the source code.
@@ -459,7 +466,7 @@ We use [TypeScript](https://www.typescriptlang.org/) to have type safety combine
459
466
cd ..
460
467
```
461
468
462
-
1.Replace`src/app.mts` with this code.
469
+
1.Create or replace`src/app.mts` with this code.
463
470
464
471
```typescript
465
472
import {
@@ -715,54 +722,25 @@ You can relay messages in exactly the same way you'd do it on Supersim.
@@ -771,6 +749,12 @@ You can relay messages in exactly the same way you'd do it on Supersim.
771
749
npm start
772
750
```
773
751
752
+
1. You can see the transactions in a block explorer.
753
+
754
+
- The first transaction, which sets the greeting directly, [on the `Greeter` contract on interop1](https://sid.testnet.routescan.io/address/0x1A183FCf61053B7dcd2322BbE766f7E1946d3718).
755
+
- The second transaction, the initiation message for the cross chain greeting change, [on the `GreetingSender` contract on interop0](https://sid.testnet.routescan.io/address/0x9De9f84a4EB3616B44CF1d68cD1A9098Df6cB25f).
756
+
- The third transaction, the executing message for the cross chain greeting change, [on the `Greeter` contract on interop1 as an internal transaction](https://sid.testnet.routescan.io/address/0x1A183FCf61053B7dcd2322BbE766f7E1946d3718/internalTx).
757
+
774
758
### Debugging
775
759
776
760
To see what messages were relayed by a specific transaction you can use this code:
0 commit comments