From 5555c6cf12123556e906792fe64549b3ba32513d Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 30 Oct 2024 16:57:09 +0100 Subject: [PATCH 01/11] Added a guide on how to transfer a SuperchainERC20 --- pages/stack/interop/_meta.json | 3 +- .../interop/transfer-superchainERC20.mdx | 128 ++++++++++++++++++ words.txt | 8 +- 3 files changed, 135 insertions(+), 4 deletions(-) create mode 100644 pages/stack/interop/transfer-superchainERC20.mdx diff --git a/pages/stack/interop/_meta.json b/pages/stack/interop/_meta.json index 0fad31024..1b77774f6 100644 --- a/pages/stack/interop/_meta.json +++ b/pages/stack/interop/_meta.json @@ -2,5 +2,6 @@ "explainer": "Interop explainer", "cross-chain-message": "Anatomy of cross-chain message", "supersim": "Supersim Multichain Development Environment", - "superchain-erc20": "SuperchainERC20 token standard" + "superchain-erc20": "SuperchainERC20 token standard", + "transfer-superchainERC20": "How to transfer a SuperchainERC20" } \ No newline at end of file diff --git a/pages/stack/interop/transfer-superchainERC20.mdx b/pages/stack/interop/transfer-superchainERC20.mdx new file mode 100644 index 000000000..085537284 --- /dev/null +++ b/pages/stack/interop/transfer-superchainERC20.mdx @@ -0,0 +1,128 @@ +--- +title: How to transfer a SuperchainERC20 +lang: en-US +description: Learn how to transfer a SuperchainERC20 between chains using L2ToL2CrossDomainMessenger. +--- + +import { Callout, Steps } from 'nextra/components' + +# How to transfer a SuperchainERC20 + +This guide walks you through transferring SuperchainERC20 tokens between chains using the `L2ToL2CrossDomainMessenger` contract. + +## Prerequisites + +Before you begin, ensure you have: + +* Access to source and destination chain RPC endpoints +* A private key with funds on both chains +* The `cast` command-line tool installed + + + All commands in this guide use the `cast` CLI tool. Make sure you have it properly configured with your RPC endpoints. + + +## Contract addresses + +The following contracts are used in this guide: + +* L2NativeSuperchainERC20: `0x420beeF000000000000000000000000000000001` +* L2ToL2CrossDomainMessenger: `0x4200000000000000000000000000000000000023` + +## How it works + +Transferring tokens involves two main phases: + +1. **Source chain operations**: Mint tokens and initiate the transfer +2. **Destination chain operations**: Relay the message to complete the transfer + + + Always verify your addresses and amounts before sending transactions. Cross-chain transfers cannot be reversed. + + + + +### Step 1: Mint tokens + +First, mint tokens on the source chain: + +```bash +cast send 0x420beeF000000000000000000000000000000001 \ +"mint(address _to, uint256 _amount)" \ +YOUR_ADDRESS 1000 \ +--rpc-url SOURCE_CHAIN_RPC \ +--private-key YOUR_PRIVATE_KEY +``` + + + Replace `YOUR_ADDRESS`, `SOURCE_CHAIN_RPC`, and `YOUR_PRIVATE_KEY` with your actual values. + + +### Step 2: Initiate transfer + +After minting, initiate the bridge transfer: + +```bash +cast send 0x4200000000000000000000000000000000000028 \ +"sendERC20(address _token, address _to, uint256 _amount, uint256 _chainId)" \ +0x420beeF000000000000000000000000000000001 \ +RECIPIENT_ADDRESS 1000 DESTINATION_CHAIN_ID \ +--rpc-url SOURCE_CHAIN_RPC \ +--private-key YOUR_PRIVATE_KEY +``` + + + The transfer isn't complete until you relay the message on the destination chain. + + +### Step 3: Get message details + +Retrieve the message details from the L2ToL2CrossDomainMessenger: + +```bash +cast logs \ +--address 0x4200000000000000000000000000000000000023 \ +--rpc-url SOURCE_CHAIN_RPC +``` + + + Note down the `blockNumber`, `logIndex`, and timestamp - you'll need these for relaying. + + +### Step 4: Relay the message + +Complete the transfer by relaying the message on the destination chain: + +```bash +cast send 0x4200000000000000000000000000000000000023 \ +--gas-limit 200000 \ +"relayMessage((address, uint256, uint256, uint256, uint256), bytes)" \ +"(0x4200000000000000000000000000000000000023, BLOCK_NUMBER, LOG_INDEX, TIMESTAMP, SOURCE_CHAIN_ID)" \ +MESSAGE_PAYLOAD \ +--rpc-url DESTINATION_CHAIN_RPC \ +--private-key YOUR_PRIVATE_KEY +``` + +### Step 5: Verify transfer + +Check the balance on the destination chain: + +```bash +cast balance \ +--erc20 0x420beeF000000000000000000000000000000001 \ +RECIPIENT_ADDRESS \ +--rpc-url DESTINATION_CHAIN_RPC +``` + + +## Alternative methods + +You can also use: + +* `supersim --interop.autorelay` for development environments +* [viem bindings/actions](https://supersim.pages.dev/guides/interop/relay-using-viem) for TypeScript integration + +## Next steps + +* Read the [Superchain Interop Explainer](/stack/interop/explainer#faqs) or check out this [Superchain interop design video walk-thru](https://www.youtube.com/watch?v=FKc5RgjtGes). +* Use [Supersim](supersim), a local dev environment that simulates Superchain interop for testing applications against a local version of the Superchain. diff --git a/words.txt b/words.txt index 5ce846b7a..5be79af1c 100644 --- a/words.txt +++ b/words.txt @@ -1,5 +1,5 @@ -accountqueue ACCOUNTQUEUE +accountqueue ACCOUNTSLOTS accountslots ADDI @@ -29,8 +29,8 @@ BLOBPOOL blobpool blobspace blockhash -BLOCKLOGS blocklists +BLOCKLOGS blocklogs BLOCKPROFILERATE blockprofilerate @@ -326,7 +326,9 @@ safedb Schnorr secp SELFDESTRUCT +SEPOLIA Sepolia +sepolia seqnr SEQUENCERHTTP sequencerhttp @@ -404,4 +406,4 @@ xtensibility ZKPs ZKVM Zora -zora \ No newline at end of file +zora From 6048f9cfbba1a0a75d9da0c02b54f817ce5303dd Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Wed, 30 Oct 2024 17:04:15 +0100 Subject: [PATCH 02/11] updated text --- pages/stack/interop/transfer-superchainERC20.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pages/stack/interop/transfer-superchainERC20.mdx b/pages/stack/interop/transfer-superchainERC20.mdx index 085537284..a5ac331d2 100644 --- a/pages/stack/interop/transfer-superchainERC20.mdx +++ b/pages/stack/interop/transfer-superchainERC20.mdx @@ -14,9 +14,9 @@ This guide walks you through transferring SuperchainERC20 tokens between chains Before you begin, ensure you have: -* Access to source and destination chain RPC endpoints -* A private key with funds on both chains -* The `cast` command-line tool installed +* Access to source and destination chain RPC endpoints. +* A private key with funds on both chains. +* The `cast` command-line tool installed. All commands in this guide use the `cast` CLI tool. Make sure you have it properly configured with your RPC endpoints. @@ -33,8 +33,8 @@ The following contracts are used in this guide: Transferring tokens involves two main phases: -1. **Source chain operations**: Mint tokens and initiate the transfer -2. **Destination chain operations**: Relay the message to complete the transfer +1. **Source chain operations**: Mint tokens and initiate the transfer. +2. **Destination chain operations**: Relay the message to complete the transfer. Always verify your addresses and amounts before sending transactions. Cross-chain transfers cannot be reversed. From 393bda8113f4269e270dd1ffeb35a012fa259d1e Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Thu, 31 Oct 2024 13:28:18 +0100 Subject: [PATCH 03/11] Updated the SuperchainERC20 description --- pages/stack/interop/superchain-erc20.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/stack/interop/superchain-erc20.mdx b/pages/stack/interop/superchain-erc20.mdx index 092af2cb4..e30d9cdb0 100644 --- a/pages/stack/interop/superchain-erc20.mdx +++ b/pages/stack/interop/superchain-erc20.mdx @@ -12,14 +12,14 @@ import { Callout } from 'nextra/components' Interop is currently in active development and not yet ready for production use. The information provided here may change. Check back regularly for the most up-to-date information. -`SuperchainERC20` is a token standard designed to enable asset interoperability in the Superchain. +`SuperchainERC20` is an implementation of [ERC-7802](https://ethereum-magicians.org/t/erc-xxxx-crosschain-token-interface/21508) designed to enable asset interoperability in the Superchain. Asset interoperability allows for tokens to securely move across chains without asset wrapping or liquidity pools for maximal capital efficiency, thus unifying liquidity and simplifying the user experience. Additional features: * **Simplified deployments**: Provides a consistent, unified standard for tokens across all Superchain-compatible networks and a common crosschain interface for the EVM ecosystem at large. * **Permissionless propagation**: Easily clone an existing token contract to a new OP Stack chain using `create2` without requiring the original owner, which enables movement of assets to the new chain once Interop goes live. Importantly, permissionless propagation retains the integrity of the original owner on the contract and preserves security but proliferates the contract's availability to new chains. -* **Ethereum-aligned**: Intentionally designed to be generic and supported as an Ethereum-wide standard (RIP coming soon). +* **Ethereum-aligned**: Implements ERC-7802, a unified interface that can be used across all of Ethereum to enable cross-chain mint/burn functionality. ## How it works @@ -63,7 +63,7 @@ This diagram illustrates the process where tokens are burned on the source chain `SuperchainERC20` differs from other token standards in its focus and implementation: -* `SuperchainERC20` has minimal differentiation from a standard ERC20 deployment, only requiring a minimal crosschain mint/burn interface, which aims to be a common pattern for the EVM ecosystem (RIP coming soon). +* `SuperchainERC20` implements ERC-7802, which provides a minimal crosschain mint/burn interface designed to be a common pattern for the EVM ecosystem. * `SuperchainERC20` shares trust assumptions across all chains in the Superchain, such that custom assumptions around security and latency are not required to account for when executing transfers. From 431328782b12aaa65a24521ebe72c627cac93ee2 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Thu, 31 Oct 2024 14:23:22 +0100 Subject: [PATCH 04/11] updated link --- pages/stack/interop/superchain-erc20.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/superchain-erc20.mdx b/pages/stack/interop/superchain-erc20.mdx index eed809dd0..ac6e45482 100644 --- a/pages/stack/interop/superchain-erc20.mdx +++ b/pages/stack/interop/superchain-erc20.mdx @@ -12,7 +12,7 @@ import { Callout } from 'nextra/components' Interop is currently in active development and not yet ready for production use. The information provided here may change. Check back regularly for the most up-to-date information. -`SuperchainERC20` is an implementation of [ERC-7802](https://ethereum-magicians.org/t/erc-xxxx-crosschain-token-interface/21508) designed to enable asset interoperability in the Superchain. +`SuperchainERC20` is an implementation of [ERC-7802](https://ethereum-magicians.org/t/erc-7802-crosschain-token-interface/21508) designed to enable asset interoperability in the Superchain. Asset interoperability allows for tokens to securely move across chains without asset wrapping or liquidity pools for maximal capital efficiency, thus unifying liquidity and simplifying the user experience. Additional features: From 9ec7d869ebcf2b2a81ef853855734b590c8958a5 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Thu, 31 Oct 2024 14:55:40 +0100 Subject: [PATCH 05/11] updated the content --- pages/stack/interop/superchain-erc20.mdx | 2 +- .../interop/transfer-superchainERC20.mdx | 113 ++++-------------- 2 files changed, 27 insertions(+), 88 deletions(-) diff --git a/pages/stack/interop/superchain-erc20.mdx b/pages/stack/interop/superchain-erc20.mdx index ac6e45482..3a9fc57a4 100644 --- a/pages/stack/interop/superchain-erc20.mdx +++ b/pages/stack/interop/superchain-erc20.mdx @@ -17,7 +17,7 @@ Asset interoperability allows for tokens to securely move across chains without Additional features: -* **Simplified deployments**: Provides a consistent, unified implementation for tokens across all Superchain-compatible networks and a common crosschain interface for the EVM ecosystem at large. +* **Simplified deployments**: 0-infrastructure cost to make your token cross-chain. Provides a consistent, unified implementation for tokens across all Superchain-compatible networks and a common cross-chain interface for the EVM ecosystem at large. * **Permissionless propagation**: Easily clone an existing token contract to a new OP Stack chain using `create2` without requiring the original owner, which enables movement of assets to the new chain once Interop goes live. Importantly, permissionless propagation retains the integrity of the original owner on the contract and preserves security but proliferates the contract's availability to new chains. * **Ethereum-aligned**: Implements ERC-7802, a unified interface that can be used across all of Ethereum to enable cross-chain mint/burn functionality. diff --git a/pages/stack/interop/transfer-superchainERC20.mdx b/pages/stack/interop/transfer-superchainERC20.mdx index a5ac331d2..1849040f9 100644 --- a/pages/stack/interop/transfer-superchainERC20.mdx +++ b/pages/stack/interop/transfer-superchainERC20.mdx @@ -8,113 +8,52 @@ import { Callout, Steps } from 'nextra/components' # How to transfer a SuperchainERC20 -This guide walks you through transferring SuperchainERC20 tokens between chains using the `L2ToL2CrossDomainMessenger` contract. - -## Prerequisites - -Before you begin, ensure you have: - -* Access to source and destination chain RPC endpoints. -* A private key with funds on both chains. -* The `cast` command-line tool installed. - - - All commands in this guide use the `cast` CLI tool. Make sure you have it properly configured with your RPC endpoints. + + Interop is currently in active development and not yet ready for production use. The information provided here may change. Check back regularly for the most up-to-date information. -## Contract addresses - -The following contracts are used in this guide: +This guide provides an overview of transferring SuperchainERC20 tokens between chains. For detailed technical steps and commands, see the [technical reference guide](https://supersim.pages.dev/guides/interop/manually-relaying-interop-messages-cast). -* L2NativeSuperchainERC20: `0x420beeF000000000000000000000000000000001` -* L2ToL2CrossDomainMessenger: `0x4200000000000000000000000000000000000023` +## Overview -## How it works +Transferring SuperchainERC20 tokens between chains involves two main phases: -Transferring tokens involves two main phases: - -1. **Source chain operations**: Mint tokens and initiate the transfer. -2. **Destination chain operations**: Relay the message to complete the transfer. +1. **Source Chain Operations** + - Mint tokens if needed + - Initiate the transfer using the bridge + +2. **Destination Chain Operations** + - Relay the transfer message + - Verify the transfer completion Always verify your addresses and amounts before sending transactions. Cross-chain transfers cannot be reversed. - - -### Step 1: Mint tokens - -First, mint tokens on the source chain: - -```bash -cast send 0x420beeF000000000000000000000000000000001 \ -"mint(address _to, uint256 _amount)" \ -YOUR_ADDRESS 1000 \ ---rpc-url SOURCE_CHAIN_RPC \ ---private-key YOUR_PRIVATE_KEY -``` - - - Replace `YOUR_ADDRESS`, `SOURCE_CHAIN_RPC`, and `YOUR_PRIVATE_KEY` with your actual values. - - -### Step 2: Initiate transfer - -After minting, initiate the bridge transfer: - -```bash -cast send 0x4200000000000000000000000000000000000028 \ -"sendERC20(address _token, address _to, uint256 _amount, uint256 _chainId)" \ -0x420beeF000000000000000000000000000000001 \ -RECIPIENT_ADDRESS 1000 DESTINATION_CHAIN_ID \ ---rpc-url SOURCE_CHAIN_RPC \ ---private-key YOUR_PRIVATE_KEY -``` - - - The transfer isn't complete until you relay the message on the destination chain. - +## How it works -### Step 3: Get message details + -Retrieve the message details from the L2ToL2CrossDomainMessenger: +### Step 1: Prepare your tokens -```bash -cast logs \ ---address 0x4200000000000000000000000000000000000023 \ ---rpc-url SOURCE_CHAIN_RPC -``` +First, ensure you have tokens on the source chain. You can mint new tokens if needed using the [L2NativeSuperchainERC20](https://github.com/ethereum-optimism/supersim/blob/main/contracts/src/L2NativeSuperchainERC20.sol) contract. - - Note down the `blockNumber`, `logIndex`, and timestamp - you'll need these for relaying. - +### Step 2: Initiate the transfer -### Step 4: Relay the message +Use the bridge contract to start the transfer process. This will lock or burn your tokens on the source chain. -Complete the transfer by relaying the message on the destination chain: +### Step 3: Complete the transfer -```bash -cast send 0x4200000000000000000000000000000000000023 \ ---gas-limit 200000 \ -"relayMessage((address, uint256, uint256, uint256, uint256), bytes)" \ -"(0x4200000000000000000000000000000000000023, BLOCK_NUMBER, LOG_INDEX, TIMESTAMP, SOURCE_CHAIN_ID)" \ -MESSAGE_PAYLOAD \ ---rpc-url DESTINATION_CHAIN_RPC \ ---private-key YOUR_PRIVATE_KEY -``` +Relay the transfer message on the destination chain to complete the process. This will mint or unlock your tokens. -### Step 5: Verify transfer +### Step 4: Verify completion -Check the balance on the destination chain: +Check your balance on the destination chain to confirm the transfer was successful. -```bash -cast balance \ ---erc20 0x420beeF000000000000000000000000000000001 \ -RECIPIENT_ADDRESS \ ---rpc-url DESTINATION_CHAIN_RPC -``` +For detailed technical instructions including contract addresses, specific commands, and message relaying details, refer to our [technical reference guide](https://supersim.pages.dev/guides/interop/manually-relaying-interop-messages-cast). + ## Alternative methods You can also use: @@ -124,5 +63,5 @@ You can also use: ## Next steps -* Read the [Superchain Interop Explainer](/stack/interop/explainer#faqs) or check out this [Superchain interop design video walk-thru](https://www.youtube.com/watch?v=FKc5RgjtGes). -* Use [Supersim](supersim), a local dev environment that simulates Superchain interop for testing applications against a local version of the Superchain. +* Read the [Superchain Interop Explainer](/stack/interop/explainer#faqs) or check out this [Superchain interop design video walk-thru](https://www.youtube.com/watch?v=FKc5RgjtGes) +* Use [Supersim](supersim), a local dev environment that simulates Superchain interop for testing applications against a local version of the Superchain \ No newline at end of file From 37cc2bc83820c03b37fff20ad2fa36157aa12545 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Thu, 31 Oct 2024 15:02:24 +0100 Subject: [PATCH 06/11] Added a mermaid diagram --- .../interop/transfer-superchainERC20.mdx | 79 +++++++++++++++---- 1 file changed, 63 insertions(+), 16 deletions(-) diff --git a/pages/stack/interop/transfer-superchainERC20.mdx b/pages/stack/interop/transfer-superchainERC20.mdx index 1849040f9..57e471ca6 100644 --- a/pages/stack/interop/transfer-superchainERC20.mdx +++ b/pages/stack/interop/transfer-superchainERC20.mdx @@ -18,13 +18,12 @@ This guide provides an overview of transferring SuperchainERC20 tokens between c Transferring SuperchainERC20 tokens between chains involves two main phases: -1. **Source Chain Operations** - - Mint tokens if needed - - Initiate the transfer using the bridge - -2. **Destination Chain Operations** - - Relay the transfer message - - Verify the transfer completion +1. **Source Chain Operations** + * Mint tokens if needed + * Initiate the transfer using the bridge +2. **Destination Chain Operations** + * Relay the transfer message + * Verify the transfer completion Always verify your addresses and amounts before sending transactions. Cross-chain transfers cannot be reversed. @@ -32,24 +31,72 @@ Transferring SuperchainERC20 tokens between chains involves two main phases: ## How it works +```mermaid +sequenceDiagram + actor User + participant SourceChain + participant Bridge as L2ToL2CrossDomainMessenger + participant DestChain + + Note over User,DestChain: Step 1: Prepare Tokens + User->>SourceChain: Check token balance + alt Needs tokens + User->>SourceChain: Mint or acquire tokens + end + + Note over User,DestChain: Step 2: Initiate Transfer + User->>SourceChain: Approve bridge contract + User->>Bridge: Call sendERC20 + Bridge->>SourceChain: Burn tokens + Bridge-->>Bridge: Emit transfer message + + Note over User,DestChain: Step 3: Complete Transfer + User->>Bridge: Get message details + User->>Bridge: Relay message on destination + Bridge->>DestChain: Mint tokens to recipient + + Note over User,DestChain: Step 4: Verify + User->>DestChain: Check token balance +``` + + ### Step 1: Prepare your tokens + + Ensure you have tokens on the source chain using one of these methods: + + * Use existing tokens you already own + * Mint new tokens using the [L2NativeSuperchainERC20](https://github.com/ethereum-optimism/supersim/blob/main/contracts/src/L2NativeSuperchainERC20.sol) contract if you have minting permissions + * Acquire tokens through a supported exchange or transfer + + ### Step 2: Initiate the transfer -### Step 1: Prepare your tokens + To start the transfer: -First, ensure you have tokens on the source chain. You can mint new tokens if needed using the [L2NativeSuperchainERC20](https://github.com/ethereum-optimism/supersim/blob/main/contracts/src/L2NativeSuperchainERC20.sol) contract. + 1. Choose the destination chain where you want to receive the tokens + 2. Specify the recipient address and the amount to transfer + 3. Call the bridge contract, which will: + * Lock or burn your tokens on the source chain + * Emit a message that will be used to mint tokens on the destination chain -### Step 2: Initiate the transfer + ### Step 3: Complete the transfer -Use the bridge contract to start the transfer process. This will lock or burn your tokens on the source chain. + To finalize the transfer on the destination chain: -### Step 3: Complete the transfer + 1. Get the message details from the source chain event + 2. Use the L2ToL2CrossDomainMessenger contract to relay the message + 3. The message relay will trigger the minting of tokens on the destination chain -Relay the transfer message on the destination chain to complete the process. This will mint or unlock your tokens. + + The transfer isn't complete until the message is successfully relayed on the destination chain. See the [technical reference guide](https://supersim.pages.dev/guides/interop/manually-relaying-interop-messages-cast) for specific relay instructions. + -### Step 4: Verify completion + ### Step 4: Verify completion -Check your balance on the destination chain to confirm the transfer was successful. + After relaying the message: + 1. Check your token balance on the destination chain + 2. Confirm the transferred amount matches what you sent + 3. The tokens should now be available for use on the destination chain For detailed technical instructions including contract addresses, specific commands, and message relaying details, refer to our [technical reference guide](https://supersim.pages.dev/guides/interop/manually-relaying-interop-messages-cast). @@ -64,4 +111,4 @@ You can also use: ## Next steps * Read the [Superchain Interop Explainer](/stack/interop/explainer#faqs) or check out this [Superchain interop design video walk-thru](https://www.youtube.com/watch?v=FKc5RgjtGes) -* Use [Supersim](supersim), a local dev environment that simulates Superchain interop for testing applications against a local version of the Superchain \ No newline at end of file +* Use [Supersim](supersim), a local dev environment that simulates Superchain interop for testing applications against a local version of the Superchain From f6f41bb6b4cc4c0d1a747220c6b4fdd0b91a3021 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Thu, 31 Oct 2024 15:11:52 +0100 Subject: [PATCH 07/11] updated the description --- pages/stack/interop/transfer-superchainERC20.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pages/stack/interop/transfer-superchainERC20.mdx b/pages/stack/interop/transfer-superchainERC20.mdx index 57e471ca6..fed6f9d81 100644 --- a/pages/stack/interop/transfer-superchainERC20.mdx +++ b/pages/stack/interop/transfer-superchainERC20.mdx @@ -31,6 +31,10 @@ Transferring SuperchainERC20 tokens between chains involves two main phases: ## How it works +This diagram illustrates the process of a SuperchainERC20 token transfer between chains. +Through the `L2ToL2CrossDomainMessenger` contract, tokens are burned on the source chain and a transfer message is emitted. +This message must then be relayed to the destination chain, where an equivalent amount of tokens will be minted to the specified recipient address - ensuring secure cross-chain transfers while maintaining the total token supply across all chains. + ```mermaid sequenceDiagram actor User @@ -40,7 +44,7 @@ sequenceDiagram Note over User,DestChain: Step 1: Prepare Tokens User->>SourceChain: Check token balance - alt Needs tokens + alt User->>SourceChain: Mint or acquire tokens end From 7a306cb89d505db7e25076f921c47fbacc74d070 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Thu, 31 Oct 2024 15:14:51 +0100 Subject: [PATCH 08/11] updated link --- pages/stack/interop/transfer-superchainERC20.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/transfer-superchainERC20.mdx b/pages/stack/interop/transfer-superchainERC20.mdx index fed6f9d81..11544796c 100644 --- a/pages/stack/interop/transfer-superchainERC20.mdx +++ b/pages/stack/interop/transfer-superchainERC20.mdx @@ -12,7 +12,7 @@ import { Callout, Steps } from 'nextra/components' Interop is currently in active development and not yet ready for production use. The information provided here may change. Check back regularly for the most up-to-date information. -This guide provides an overview of transferring SuperchainERC20 tokens between chains. For detailed technical steps and commands, see the [technical reference guide](https://supersim.pages.dev/guides/interop/manually-relaying-interop-messages-cast). +This guide provides an overview of transferring `SuperchainERC20` tokens between chains. ## Overview From 7679dbfe26814b535baef2041d16a93610e9f9ad Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Thu, 31 Oct 2024 15:42:48 +0100 Subject: [PATCH 09/11] fix lint issues --- pages/stack/interop/transfer-superchainERC20.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/transfer-superchainERC20.mdx b/pages/stack/interop/transfer-superchainERC20.mdx index 11544796c..4301dfba7 100644 --- a/pages/stack/interop/transfer-superchainERC20.mdx +++ b/pages/stack/interop/transfer-superchainERC20.mdx @@ -87,7 +87,7 @@ sequenceDiagram To finalize the transfer on the destination chain: 1. Get the message details from the source chain event - 2. Use the L2ToL2CrossDomainMessenger contract to relay the message + 2. Use the `L2ToL2CrossDomainMessenger` contract to relay the message 3. The message relay will trigger the minting of tokens on the destination chain From 41b44b36a9731be0521a8f0cea7ead5894d34591 Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Thu, 31 Oct 2024 16:38:42 +0100 Subject: [PATCH 10/11] updated content from coments --- pages/stack/interop/superchain-erc20.mdx | 2 +- pages/stack/interop/transfer-superchainERC20.mdx | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pages/stack/interop/superchain-erc20.mdx b/pages/stack/interop/superchain-erc20.mdx index 3a9fc57a4..eaa150508 100644 --- a/pages/stack/interop/superchain-erc20.mdx +++ b/pages/stack/interop/superchain-erc20.mdx @@ -19,7 +19,7 @@ Additional features: * **Simplified deployments**: 0-infrastructure cost to make your token cross-chain. Provides a consistent, unified implementation for tokens across all Superchain-compatible networks and a common cross-chain interface for the EVM ecosystem at large. * **Permissionless propagation**: Easily clone an existing token contract to a new OP Stack chain using `create2` without requiring the original owner, which enables movement of assets to the new chain once Interop goes live. Importantly, permissionless propagation retains the integrity of the original owner on the contract and preserves security but proliferates the contract's availability to new chains. -* **Ethereum-aligned**: Implements ERC-7802, a unified interface that can be used across all of Ethereum to enable cross-chain mint/burn functionality. +* **Common standard**: Implements ERC-7802, a unified interface that can be used across all of Ethereum to enable cross-chain mint/burn functionality. ## How it works diff --git a/pages/stack/interop/transfer-superchainERC20.mdx b/pages/stack/interop/transfer-superchainERC20.mdx index 4301dfba7..e2c856b4f 100644 --- a/pages/stack/interop/transfer-superchainERC20.mdx +++ b/pages/stack/interop/transfer-superchainERC20.mdx @@ -109,7 +109,6 @@ For detailed technical instructions including contract addresses, specific comma You can also use: -* `supersim --interop.autorelay` for development environments * [viem bindings/actions](https://supersim.pages.dev/guides/interop/relay-using-viem) for TypeScript integration ## Next steps From 9a52fac977c659d9b283ba26e21330b1043c2b6a Mon Sep 17 00:00:00 2001 From: Blessing Krofegha Date: Thu, 31 Oct 2024 16:42:18 +0100 Subject: [PATCH 11/11] updated term --- pages/stack/interop/transfer-superchainERC20.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/transfer-superchainERC20.mdx b/pages/stack/interop/transfer-superchainERC20.mdx index e2c856b4f..18e9fa29a 100644 --- a/pages/stack/interop/transfer-superchainERC20.mdx +++ b/pages/stack/interop/transfer-superchainERC20.mdx @@ -69,7 +69,7 @@ sequenceDiagram Ensure you have tokens on the source chain using one of these methods: * Use existing tokens you already own - * Mint new tokens using the [L2NativeSuperchainERC20](https://github.com/ethereum-optimism/supersim/blob/main/contracts/src/L2NativeSuperchainERC20.sol) contract if you have minting permissions + * Mint new tokens using the [SuperchainERC20](https://github.com/ethereum-optimism/supersim/blob/main/contracts/src/L2NativeSuperchainERC20.sol) contract if you have minting permissions * Acquire tokens through a supported exchange or transfer ### Step 2: Initiate the transfer