Skip to content

Commit bda418b

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

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

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

+5-5
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>
@@ -214,25 +214,25 @@ The tutorial uses these primary tools:
214214

215215
Import all chain definitions from `@eth-optimism/viem`.
216216

217-
```typescript file=<rootDir>/public/tutorials/transfer-eth.mts#L29-L32 hash=e8c21357997ea12151305337eced7d71
217+
```typescript file=<rootDir>/public/tutorials/transfer-eth.mts#L29-L32 hash=2c2dd55bc8c8122fe2991ab38cc9c1ac
218218
```
219219

220220
If the address we use is `0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266`, one of the prefunded addresses on `anvil`, assume we're using Supersim.
221221
Otherwise, use Interop devnet.
222222

223-
```typescript file=<rootDir>/public/tutorials/transfer-eth.mts#L78-L80 hash=4933c70a9078c2369ef90bfe163f5fd7
223+
```typescript file=<rootDir>/public/tutorials/transfer-eth.mts#L78-L80 hash=c5c2f87d5f6bb564376016ac62712501
224224
```
225225

226226
To relay a message we need the information in the receipt.
227227
Also, we need to wait until the transaction with the relayed message is actually part of a block.
228228

229-
```typescript file=<rootDir>/public/tutorials/transfer-eth.mts#L87-L89 hash=573f22b2b21415ff51c59c713fda07d1
229+
```typescript file=<rootDir>/public/tutorials/transfer-eth.mts#L86-L89 hash=db8b76c8ca3304dd485f4a33a1dc8580
230230
```
231231

232232
A single transaction can send multiple messages.
233233
But here we know we sent just one, so we look for the first one in the list.
234234

235-
```typescript file=<rootDir>/public/tutorials/transfer-eth.mts#L90-L96 hash=4b26775b46c116262af4c7299d6f1127
235+
```typescript file=<rootDir>/public/tutorials/transfer-eth.mts#L90-L96 hash=d650e8c2b31d75d82ba4c5e4519c028d
236236
```
237237

238238
This is how you use `@eth-optimism/viem` to create an executing message.

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -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.

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ const sendERC20Receipt = await opChainAClient.waitForTransactionReceipt({ hash:
132132

133133
const sentMessages = await opChainAClient.interop.getCrossDomainMessages({ logs: sendERC20Receipt.logs })
134134
const sentMessage = sentMessages[0] // We only sent 1 message
135-
const relayMessageParams = await publicClientA.interop.buildExecutingMessage({ log: sentMessage.log })
135+
const relayMessageParams = await opChainAClient.interop.buildExecutingMessage({ log: sentMessage.log })
136136
```
137137

138138
### Relay the sent message on the destination chain
@@ -256,7 +256,7 @@ const sendERC20Receipt = await opChainAClient.waitForTransactionReceipt({ hash:
256256

257257
const sentMessages = await opChainAClient.interop.getCrossDomainMessages({ logs: sendERC20Receipt.logs })
258258
const sentMessage = sentMessages[0] // We only sent 1 message
259-
const relayMessageParams = await publicClientA.interop.buildExecutingMessage({ log: sentMessage.log })
259+
const relayMessageParams = await opChainAClient.interop.buildExecutingMessage({ log: sentMessage.log })
260260

261261
// ##########
262262
// OP Chain B

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)