Skip to content

Commit 83e9c15

Browse files
qbzztkrofax
andauthored
Apply suggestions from code review
Co-authored-by: Blessing Krofegha <bkrofegha@gmail.com>
1 parent a267c49 commit 83e9c15

File tree

1 file changed

+28
-22
lines changed

1 file changed

+28
-22
lines changed

pages/stack/interop/superchain-weth.mdx

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ import { InteropCallout } from '@/components/WipCallout'
1212

1313
# Interoperable ETH
1414

15-
InteroperableETH is implemented using three contracts:
15+
InteroperableETH enables seamless ETH transfers across Superchain blockchains. It is implemented using three key contracts:
1616

17-
* [`SuperchainWETH`](https://github.com/ethereum-optimism/optimism/blob/develop/contracts-bedrock/src/L2/SuperchainWETH.sol) is the bridge that lets you move ETH from one Superchain blockchain to another.
18-
* [`ETHLiquidity`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/ETHLiquidity.sol), which serves as a liquidity provider for ETH transfers.
19-
It is used by `SuperchainWETH` as a liquidity repository to be able to provide ETH on the destination chain when transferring.
20-
* [`L2ToL2CrossDomainMessenger`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol) is used to [pass messages between different chains](./message-passing).
17+
* [`SuperchainWETH`](https://github.com/ethereum-optimism/optimism/blob/develop/contracts-bedrock/src/L2/SuperchainWETH.sol): A bridge contract that facilitates ETH transfers between Superchain blockchains.
18+
* [`ETHLiquidity`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/ETHLiquidity.sol): A liquidity provider for ETH transfers.
19+
`SuperchainWETH` uses this contract as a liquidity repository to ensure ETH availability on the destination chain.
20+
* [`L2ToL2CrossDomainMessenger`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/L2ToL2CrossDomainMessenger.sol): A messaging contract that [facilitates cross-chain communication](/message-passing).
2121

22-
InteroperableETH works by depositing ETH on the source chain's `ETHLiquidity` and withdrawing an equivalent amount on the destination chain.
23-
This approach addresses issues such as liquidity fragmentation and poor user experiences caused by asset wrapping or reliance on liquidity pools.
22+
InteroperableETH deposits ETH into the `ETHLiquidity` contract on the source chain and withdraws an equivalent amount on the destination chain.
23+
This mechanism improves capital efficiency and eliminates liquidity fragmentation and poor user experiences caused by asset wrapping or reliance on liquidity pools.
2424

2525
## Features and benefits
2626

@@ -74,33 +74,39 @@ sequenceDiagram
7474
1. The user (or a contract operating on a user's behalf) calls `SuperchainWETH.sendETH` with a destination address and a chainId.
7575
This call should have an attached amount of ETH.
7676

77-
2. `SuperchainWETH` sends the amount of ETH to `ETHLiquidity`, removing it from circulation on the source chain.
77+
2. `SuperchainWETH` transfers the specified ETH amount to `ETHLiquidity`, removing it from circulation on the source chain.
7878

79-
3. `SuperchainWETH` on the source chain sends a [`relayETH`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainWETH.sol#L125-L145) call to the `SuperchainWETH` on the destination chain using [`L2ToL2CrossDomainMessenger`](./message-passing).
79+
3. `SuperchainWETH` on the source chain sends a [`relayETH`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainWETH.sol#L125-L145) message to `SuperchainWETH` on the destination chain using the [`L2ToL2CrossDomainMessenger`](/message-passing).
8080

8181
#### Executing message
8282

83-
4. Some offchain entity submits a transaction with the executing message.
84-
Any address can submit such a transaction, but it has to have ETH on the destination chain to do so.
85-
We expect that usually this will be a relayer rather than the user because the user won't have ETH on the destination chain yet.
83+
4. An off-chain entity submits a transaction to execute the message.
84+
Any address can submit this transaction, but it must have ETH on the destination chain.
85+
Typically, a relayer submits the transaction, since the user does not yet have ETH on the destination chain.
8686

87-
5. `L2ToL2CrossDomainMessenger` on the destination chain calls `SuperchainWETH` with the source of the ETH, the destination address, and the amount.
87+
5. `L2ToL2CrossDomainMessenger` on the destination chain calls `SuperchainWETH` with the following details:
8888

89-
`SuperchainWETH` runs several sanity checks:
89+
* Source of the ETH
90+
* Destination address
91+
* Amount of ETH
9092

91-
* The `relayETH` call has to come directly from `L2ToL2CrossDomainMessenger`.
92-
* The interop message has to have been sent by `SuperchainWETH`
93+
`SuperchainWETH` performs several sanity checks:
9394

94-
6. `SuperchainWETH` withdraws the requested amount of ETH from `ETHLiquidity`.
95-
It is the only contract allowed to withdraw from `ETHLiquidity`, which adds to the ETH in circulation on the destination chain.
95+
* The `relayETH` call must originate from `L2ToL2CrossDomainMessenger`.
96+
* The interop message must have been sent by `SuperchainWETH`
9697

97-
7. `SuperchainWETH` uses [`SafeSend`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/universal/SafeSend.sol) to send the ETH.
98-
This means that even if the destination is a smart contract, its custom logic does not get called, [in contrast to normal ETH transfers](https://docs.base.org/base-learn/docs/address-and-payable/#receiving-ether-with-payable-addresses).
98+
6. `SuperchainWETH` withdraws the specified amount of ETH from `ETHLiquidity`.
99+
Only `SuperchainWETH` can withdraw from `ETHLiquidity`, ensuring that the ETH is correctly reintroduced into circulation on the destination chain.
100+
101+
7. `SuperchainWETH` uses [`SafeSend`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/universal/SafeSend.sol) to send ETH.
102+
This ensures that even if the destination is a smart contract, its custom logic is not executed.
103+
This behavior differs from [standard ETH transfers](https://docs.base.org/base-learn/docs/address-and-payable/#receiving-ether-with-payable-addresses), where smart contracts can trigger custom logic upon receiving ETH.
99104

100105
## L1 Treasury
101106

102-
Every ETH in circulation on the Superchain (all the ETH except for those held by `ETHLiquidity`) needs to be backed by ETH held on L1.
103-
This is done using a lockbox contract on L1 that holds all the ETH ever bridged to [chains in the Superchain interop cluster](explainer#superchain-interop-cluster) and not yet withdrawn.
107+
Every ETH in circulation on the Superchain—excluding ETH held by `ETHLiquidity`—must be backed by ETH on L1.
108+
109+
This is enforced by a lockbox contract on L1, which holds all ETH bridged to [Superchain interop cluster chains](https://github.com/ethereum-optimism/docs/pull/1297/explainer#superchain-interop-cluster) that has not yet been withdrawn.
104110
New ETH can only be minted on L2 when it is locked on L1, and it is burned on L2 before it can be released from the lockbox.
105111

106112
Here is an example of how this works.

0 commit comments

Comments
 (0)