Skip to content

Clarify that step 3 is just sending the message, it is not received until step 4 #1409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions pages/stack/interop/superchain-erc20.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ sequenceDiagram
participant src-bridge as SuperchainTokenBridge
end
actor user as User
participant relay as Autorelayer
box rgba(0,0,0,0.1) Destination Chain
participant dst-l2Xl2 as L2ToL2CrossDomainMessenger
participant dst-bridge as SuperchainTokenBridge
Expand All @@ -61,11 +62,11 @@ sequenceDiagram
note over src-erc20, dst-l2Xl2: Initiating Message
user->>src-bridge: 1. Move n tokens
src-bridge->>src-erc20: 2. Burn n tokens
src-bridge->>dst-l2Xl2: 3. Relay n tokens to user
src-bridge--)dst-l2Xl2: 3. Relay n tokens to user
end
rect rgba(0,0,0,0.1)
note over user,dst-erc20: Executing message
user->>dst-l2Xl2: 4. Relay the message
note over relay,dst-erc20: Executing message
relay->>dst-l2Xl2: 4. Relay the message
dst-l2Xl2->>dst-bridge: 4. Relay the message
dst-bridge->>dst-erc20: 5. Mint n tokens to user
end
Expand All @@ -79,10 +80,12 @@ sequenceDiagram

3. The source token bridge calls [`SuperchainTokenBridge.relayERC20`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainTokenBridge.sol#L80-L97) on the destination token bridge.
This call is relayed using [`L2ToL2CrossDomainMessenger`](./message-passing).
The call is *initiated* here, by emitting an initiating message.
It will be executed later, after the destination chain receives an executing message to [`L2ToL2CrossDomainMessenger`](./message-passing).

#### Executing message (destination chain)

4. The user, or a relayer, sends an executing message to [`L2ToL2CrossDomainMessenger`](./message-passing) to relay the message.
4. The autorelayer (or the user, or any offchain entity) sends an executing message to [`L2ToL2CrossDomainMessenger`](./message-passing) to relay the message.

5. The destination token bridge calls [`SuperchainERC20.crosschainMint`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainERC20.sol#L26-L35) to mint tokens for the user/contract that called `SuperchainTokenBridge.sendERC20` originally.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ The tutorial uses these primary tools:
pnpm contracts:update:rpcs
```

2. Edit `packages/contracts/configs/deploy-config.toml` for the deployment settings.
2. Edit `packages/contracts/configs/deploy-config.toml` for the deployment settings.

* Set these parameters in the `[deploy-config]` section:

Expand Down