Learn how to transfer ETH across the Superchain interop cluster
Superchain interop is in active development. Some features may be experimental.
This tutorial provides step-by-step instructions for how to send ETH from one chain in the Superchain interop cluster to another.
For a conceptual overview,
see the interoperable ETH explainer.
Crosschain ETH transfers in the Superchain are facilitated through the SuperchainETHBridge contract.
This tutorial walks through how to send ETH from one chain to another.
You can do this on Supersim, the Interop devnet, or production once it is released.
If the address we use is 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266, one of the prefunded addresses on anvil, assume we’re using Supersim.
Otherwise, use Interop devnet.
To relay a message we need the information in the receipt.
Also, we need to wait until the transaction with the relayed message is actually part of a block.
This is how you use @eth-optimism/viem to create an executing message.
5
Run the example
Run the example.
Report incorrect code
Copy
Ask AI
npx tsx src/transfer-eth.mts
Read the results.
Report incorrect code
Copy
Ask AI
Before transfer Address: 0x7ED53BfaA58B79Dd655B2f229258C093b6C09A8C Balance on source chain: 0.020999799151902245 Balance on destination chain: 0.026999459226731331
The initial state. Note that the address depends on your private key; it should be different from mine.
Report incorrect code
Copy
Ask AI
After transfer on source chain Address: 0x7ED53BfaA58B79Dd655B2f229258C093b6C09A8C Balance on source chain: 0.019999732176717961 Balance on destination chain: 0.026999459226731331
After the initiating message the balance on the source chain is immediately reduced.
Notice that even though we are sending 0.001 ETH, the balance on the source chain is reduced by a bit more (here, approximately 67 gwei).
This is the cost of the initiating transaction on the source chain.
Of course, as there has been no transaction on the destination chain, that balance is unchanged.
Report incorrect code
Copy
Ask AI
After relaying message to destination chain Address: 0x7ED53BfaA58B79Dd655B2f229258C093b6C09A8C Balance on source chain: 0.019999732176717961 Balance on destination chain: 0.027999278943880868
Now the balance on the destination chain increases, by slightly less than 0.001 ETH.
The executing message also has a transaction cost (in this case, about 180gwei).