Skip to content

Commit a3a6e39

Browse files
committed
Auto-fix: Update breadcrumbs, spelling dictionary and other automated fixes
1 parent 71fbe70 commit a3a6e39

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

pages/interop/tutorials/bridge-crosschain-eth.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ The tutorial uses these primary tools:
203203

204204
3. Place this in `src/transfer-eth.mts`:
205205

206-
```typescript file=<rootDir>/public/tutorials/transfer-eth.mts hash=f71ba1d6d6b4adf8cb3283792abac853
206+
```typescript file=<rootDir>/public/tutorials/transfer-eth.mts hash=9f19c28046ed792e3f04aefd8fb4453e
207207
```
208208

209209
<details>

pages/interop/tutorials/relay-messages-cast.mdx

+8-8
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ import { Callout } from 'nextra/components'
2424
import { Steps } from 'nextra/components'
2525

2626
<Callout>
27-
The SuperchainERC20 standard is ready for production deployments.
28-
Please note that the OP Stack interoperability upgrade, required for crosschain messaging, is currently still in active development.
27+
The SuperchainERC20 standard is ready for production deployments.
28+
Please note that the OP Stack interoperability upgrade, required for crosschain messaging, is currently still in active development.
2929
</Callout>
3030

3131
# Relaying interop messages using `cast`
3232

33-
This tutorial walks through how to form a [message identifier](https://specs.optimism.io/interop/messaging.html?utm_source=op-docs&utm_medium=docs#message-identifier) to relay a [L2ToL2CrossDomainMessenger](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol) cross-chain call.
33+
This tutorial walks through how to form a [message identifier](https://specs.optimism.io/interop/messaging.html?utm_source=op-docs\&utm_medium=docs#message-identifier) to relay a [L2ToL2CrossDomainMessenger](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol) cross-chain call.
3434

3535
We'll perform the SuperchainERC20 interop transfer in [Supersim first steps](/app-developers/tutorials/supersim/getting-started/first-steps##send-an-interoperable-superchainerc20-token-from-chain-901-to-902-l2-to-l2-message-passing) by manually relaying the message without the autorelayer.
3636

@@ -59,7 +59,7 @@ Sending an interop message using the `L2ToL2CrossDomainMessenger`:
5959
## Message identifier
6060

6161
A message identifier uniquely identifies a log emitted on a chain.
62-
The sequencer and smart contracts (CrossL2Inbox) use the identifier to perform [invariant checks](https://specs.optimism.io/interop/messaging.html?utm_source=op-docs&utm_medium=docs#messaging-invariants) to confirm that the message is valid.
62+
The sequencer and smart contracts (CrossL2Inbox) use the identifier to perform [invariant checks](https://specs.optimism.io/interop/messaging.html?utm_source=op-docs\&utm_medium=docs#messaging-invariants) to confirm that the message is valid.
6363

6464
```solidity
6565
struct Identifier {
@@ -169,15 +169,15 @@ struct Identifier {
169169

170170
An access list must be passed along with the relay message tx. There are two admin RPC methods that can be used to construct the access list: `admin_getAccessListByMsgHash` and `admin_getAccessListForIdentifier` and.
171171

172-
a. To get the access list using the `admin_getAccessListByMsgHash` RPC method, call the method with the message hash.
172+
a. To get the access list using the `admin_getAccessListByMsgHash` RPC method, call the method with the message hash.
173173

174-
1. Retrieve the message hash from the supersim logs
174+
1. Retrieve the message hash from the supersim logs
175175

176176
```sh
177177
INFO [04-04|14:21:15.587] L2ToL2CrossChainMessenger#SentMessage sourceChainID=901 destinationChainID=902 nonce=0 sender=0x4200000000000000000000000000000000000028 target=0x4200000000000000000000000000000000000028 msgHash=0xccff97c17ef11d659d319cbc5780235ea03ef34b0fa34f40b208a9519f257379 txHash=0x746a3e8a3a0ed0787367c3476269fa3050a2f9113637b563a4579fbc03efe5c4
178178
```
179179

180-
2. Call `admin_getAccessListByMsgHash` with the message hash.
180+
2. Call `admin_getAccessListByMsgHash` with the message hash.
181181

182182
```sh
183183
cast rpc admin_getAccessListByMsgHash 0xccff97c17ef11d659d319cbc5780235ea03ef34b0fa34f40b208a9519f257379 --rpc-url http://localhost:8420
@@ -229,7 +229,7 @@ struct Identifier {
229229
]
230230
}
231231
```
232-
232+
233233
### Send the relayMessage transaction
234234

235235
Call `relayMessage` on the [L2ToL2CrossDomainMessenger](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol) with the access list.

public/tutorials/transfer-eth.mts

+14-14
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import {
2020
import {
2121
walletActionsL2,
2222
publicActionsL2,
23-
createInteropSentL2ToL2Messages,
2423
contracts as optimismContracts
2524
} from '@eth-optimism/viem'
2625

@@ -46,8 +45,8 @@ const destinationWallet = createWalletClient({
4645
}).extend(publicActions)
4746
.extend(publicActionsL2())
4847
.extend(walletActionsL2())
49-
50-
const wethOnSource = await getContract({
48+
49+
const ethBridgeOnSource = await getContract({
5150
address: optimismContracts.superchainETHBridge.address,
5251
abi: superchainEthBridgeAbi,
5352
client: sourceWallet
@@ -71,29 +70,30 @@ const reportBalance = async (address: string): Promise<void> => {
7170
console.log("Before transfer")
7271
await reportBalance(account.address)
7372

74-
const sourceHash = await wethOnSource.write.sendETH({
73+
const sourceHash = await ethBridgeOnSource.write.sendETH({
7574
value: parseEther('0.001'),
7675
args: [account.address, destinationChain.id]
7776
})
7877
const sourceReceipt = await sourceWallet.waitForTransactionReceipt({
79-
hash: sourceHash
78+
hash: sourceHash
8079
})
8180

8281

8382
console.log("After transfer on source chain")
8483
await reportBalance(account.address)
8584

8685

87-
const sentMessage =
88-
(await createInteropSentL2ToL2Messages(sourceWallet, { receipt: sourceReceipt }))
89-
.sentMessages[0]
90-
const relayMsgTxnHash = await destinationWallet.interop.relayMessage({
91-
sentMessageId: sentMessage.id,
92-
sentMessagePayload: sentMessage.payload,
86+
const sentMessages = await sourceWallet.interop.getCrossDomainMessages({
87+
logs: sourceReceipt.logs,
9388
})
94-
89+
const sentMessage = sentMessages[0]
90+
const relayMessageParams = await sourceWallet.interop.buildExecutingMessage({
91+
log: sentMessage.log,
92+
})
93+
94+
const relayMsgTxnHash = await destinationWallet.interop.relayCrossDomainMessage(relayMessageParams)
9595
const receiptRelay = await destinationWallet.waitForTransactionReceipt(
96-
{hash: relayMsgTxnHash})
97-
96+
{hash: relayMsgTxnHash})
97+
9898
console.log("After relaying message to destination chain")
9999
await reportBalance(account.address)

0 commit comments

Comments
 (0)