diff --git a/pages/stack/interop/_meta.json b/pages/stack/interop/_meta.json index 304ddf4a7..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" + "superchain-erc20": "SuperchainERC20 token standard", + "transfer-superchainERC20": "How to transfer a SuperchainERC20" } \ No newline at end of file diff --git a/pages/stack/interop/superchain-erc20.mdx b/pages/stack/interop/superchain-erc20.mdx index 6542f6ae5..eaa150508 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 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: -* **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**: Intentionally designed to be generic and supported as an Ethereum-wide implementation (RIP coming soon). +* **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 @@ -63,7 +63,7 @@ This diagram illustrates the process where tokens are burned on the source chain `SuperchainERC20` differs from other token implementations in its focus and implementation: -* `SuperchainERC20` has minimal differentiation from an 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. diff --git a/pages/stack/interop/transfer-superchainERC20.mdx b/pages/stack/interop/transfer-superchainERC20.mdx new file mode 100644 index 000000000..18e9fa29a --- /dev/null +++ b/pages/stack/interop/transfer-superchainERC20.mdx @@ -0,0 +1,117 @@ +--- +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 + + + 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. + +## Overview + +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 + + + Always verify your addresses and amounts before sending transactions. Cross-chain transfers cannot be reversed. + + +## 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 + participant SourceChain + participant Bridge as L2ToL2CrossDomainMessenger + participant DestChain + + Note over User,DestChain: Step 1: Prepare Tokens + User->>SourceChain: Check token balance + alt + 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 [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 + + To start the transfer: + + 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 3: Complete the transfer + + 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 + 3. The message relay will trigger the minting of tokens on the destination chain + + + 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 + + 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). + +## Alternative methods + +You can also use: + +* [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