Bridging native cross-chain ETH transfers
Crosschain ETH transfers in the Superchain are facilitated through the SuperchainWETH (opens in a new tab) contract.
This tutorial walks through how to send native ETH from chain 901 to 902. To simplify these steps, supersim will be run with the --interop.autorelay
flag. The --interop.autorelay
flag automatically triggers the relay message transaction once the initial send transaction is completed on the source chain, improving the developer experience by removing the need to manually send the relay message.
If the source chain uses native ETH as their gas token, but the destination chain uses a custom gas token, then the recipient will receive SuperchainWETH
on the destination chain.
Start supersim
with the autorelayer enabled
supersim --interop.autorelay
Initiate the send transaction on chain 901
- In this step, you'll send ETH from Chain 901 to Chain 902 through
SuperchainWETH
contract deployed at0x4200000000000000000000000000000000000024
. - Use the following command:
cast send 0x4200000000000000000000000000000000000024 "sendETH(address _to, uint256 _chainId)" 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 902 --value 10ether --rpc-url http://127.0.0.1:9545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
Wait for the relayed message to appear on chain 902
In a few seconds, you should see the relayed message on chain 902:
# example
INFO [12-02|14:53:02.434] SuperchainWETH#RelayETH chain.id=902 from=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 to=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 amount=10,000,000,000,000,000,000 source=901
Check the balance on chain 902
Verify that the balance of the ETH on chain 902 has increased:
cast balance 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --rpc-url http://127.0.0.1:9546
Next steps
- Checkout the SuperchainWETH guide for more information.
- Use the SuperchainERC20 Starter Kit to deploy your token across the Superchain.
- Review the Superchain Interop Explainer for answers to common questions about interoperability.