From a3a7570aabfe830b793f75f646fac48aa7e659e5 Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Sat, 15 Feb 2025 11:28:52 -0600 Subject: [PATCH 01/10] WIP --- pages/stack/interop/tutorials/_meta.json | 2 +- .../tutorials/deploy-superchain-erc20.mdx | 27 ++++++++++++------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/pages/stack/interop/tutorials/_meta.json b/pages/stack/interop/tutorials/_meta.json index f69605cf5..183081d61 100644 --- a/pages/stack/interop/tutorials/_meta.json +++ b/pages/stack/interop/tutorials/_meta.json @@ -1,7 +1,7 @@ { "message-passing": "Interop message passing", + "deploy-superchain-erc20": "Issuing new assets with SuperchainERC20", "transfer-superchainERC20": "Transferring a SuperchainERC20", - "deploy-superchain-erc20": "Issuing new assets with SuperchainERC20", "bridge-crosschain-eth": "Bridging native cross-chain ETH transfers", "relay-messages-cast": "Relaying interop messages using `cast`", "relay-messages-viem": "Relaying interop messages using `viem`", diff --git a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx index ac553951a..7ff9c5b8f 100644 --- a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx +++ b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx @@ -9,28 +9,37 @@ import { Steps } from 'nextra/components' The SuperchainERC20 standard is ready for production use with active Mainnet deployments. -Please note that the OP Stack interoperability upgrade, required for crosschain messaging, is currently still in active development. +However, the OP Stack interoperability upgrade, required for crosschain messaging, is currently still in active development. # Issuing new assets with SuperchainERC20 -This guide explains how to issue new assets with the `SuperchainERC20` and bridge them effectively using the `SuperchainERC20Bridge`. If you want more information about the `SuperchainERC20 standard`, see our [`SuperchainERC20` standard explainer](/stack/interop/superchain-erc20) +This guide explains how to issue new assets with the [`SuperchainERC20`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainERC20.sol) contract. +Those assets can then be bridged quickly and safely using the [`SuperchainTokenBridge` ](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainTokenBridge.sol) contract (once interop is operational, anyway). +For more information on how it works, [see the explainer](/stack/interop/superchain-erc20). -Note that bridging assets through the Superchain using `SuperchainERC20` never affects the total supply of your asset. The supply remains fixed, and bridging only changes the chain on which your asset is located. This keeps the token's total amount the same across all networks, ensuring its value stays stable during the move and that the `SuperchainERC20` retains a unified, global supply count. +Note that bridging assets through the Superchain using `SuperchainTokenBridge` *never* affects the total supply of your asset. +The supply remains fixed, bridging only changes the chain on which the asset is located. +The token's total amount across all network always remains the same, ensuring value stability. -## Steps to issue and bridge assets +To ensure fungibility across chains, `SuperchainERC20` assets *must* have the same contract address on all chains. +This requirement abstracts away the complexity of cross-chain validation. +Achieving this requires deterministic deployment methods. There are [many ways to do this](https://github.com/Arachnid/deterministic-deployment-proxy). +Here we will use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit). + +## Step by step explanation + ### Install the prerequisites and the SuperchainERC20 Starter Kit + + 1. + + ### Deploy the `SuperchainERC20` Token Contract - To ensure fungibility across chains, the SuperchainERC20 assets need to have the same contract address on all chains. Achieving this requires deterministic deployment methods, such as: - * `Create2Deployer`: A smart contract that enables deploying contracts with predictable addresses. - * `OptimismSuperchainERC20Factory`: A factory contract designed for L1-native tokens to ensure uniform deployments across chains. - There are [many ways to do this](https://github.com/Arachnid/deterministic-deployment-proxy), but [here's an example smart contract to start](https://github.com/ethereum-optimism/superchainerc20-starter/blob/main/packages/contracts/src/L2NativeSuperchainERC20.sol). For an in-depth guide on how to deploy a `SuperchainERC20` use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit). - By deploying assets at identical addresses across multiple chains, we abstract away the complexity of cross-chain validation. ### Implement the IERC7802 interface From 0b17a5568b8696d5608afa49a8f09d3be0602e50 Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Sat, 15 Feb 2025 11:29:59 -0600 Subject: [PATCH 02/10] WIP --- pages/stack/interop/tutorials/deploy-superchain-erc20.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx index 7ff9c5b8f..8cb1b999f 100644 --- a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx +++ b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx @@ -29,6 +29,8 @@ Here we will use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit). ## Step by step explanation +1. Install the starter kit, as explained [here](/app-developers/starter-kit#setup). + ### Install the prerequisites and the SuperchainERC20 Starter Kit From 635742c204af8757c0a76132e61fe664fc1cd703 Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Sat, 15 Feb 2025 17:24:11 -0600 Subject: [PATCH 03/10] WIP --- .../tutorials/deploy-superchain-erc20.mdx | 121 ++++++++++++++++-- 1 file changed, 110 insertions(+), 11 deletions(-) diff --git a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx index 8cb1b999f..d5bb681f2 100644 --- a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx +++ b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx @@ -15,7 +15,7 @@ However, the OP Stack interoperability upgrade, required for crosschain messagin # Issuing new assets with SuperchainERC20 This guide explains how to issue new assets with the [`SuperchainERC20`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainERC20.sol) contract. -Those assets can then be bridged quickly and safely using the [`SuperchainTokenBridge` ](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainTokenBridge.sol) contract (once interop is operational, anyway). +Those assets can then be bridged quickly and safely using the [`SuperchainTokenBridge` ](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainTokenBridge.sol) contract (once interop is operational). For more information on how it works, [see the explainer](/stack/interop/superchain-erc20). Note that bridging assets through the Superchain using `SuperchainTokenBridge` *never* affects the total supply of your asset. @@ -27,32 +27,131 @@ This requirement abstracts away the complexity of cross-chain validation. Achieving this requires deterministic deployment methods. There are [many ways to do this](https://github.com/Arachnid/deterministic-deployment-proxy). Here we will use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit). -## Step by step explanation -1. Install the starter kit, as explained [here](/app-developers/starter-kit#setup). +{/* + +### Implement the IERC7802 interface + + Implementations of `SuperchainERC20` will be required to implement the [IERC7802](https://specs.optimism.io/interop/token-bridging.html#ierc7802) interface, that includes two external functions and two events. + + The interface defines two functions for bridging: + + * `sendERC20`: Initializes a cross-chain transfer of a `SuperchainERC20` by burning the tokens locally and sending a message to the `SuperchainERC20Bridge` on the target chain using the `L2toL2CrossDomainMessenger`. This ensures that asset supply remains constant, as sending an asset moves it from one chain to another without creating additional supply. + * `relayERC20`: Processes incoming messages from the L2toL2CrossDomainMessenger and mints the corresponding amount of the SuperchainERC20. + + [Here's an example implementation of the `SuperchainERC20Bridge`](https://specs.optimism.io/interop/token-bridging.html#implementation) + +*/} + +## Step by step explanation ### Install the prerequisites and the SuperchainERC20 Starter Kit - 1. + Follow the setup steps in the [SuperchainERC20 Starter Kit](/app-developers/starter-kit#setup). + ### Prepare for deployment - ### Deploy the `SuperchainERC20` Token Contract + The Starter Kit already deploys a `SuperchainECR20` token to [Supersim](../tools/supersim). + Here we will deploy it to the [Interop devnet](../tools/devnet). + 1. Edit `packages/contracts/foundry.toml` to add the RPC endpoints for the devnet (add the bottom two rows). + + ```toml + [rpc_endpoints] + op_chain_a = "http://127.0.0.1:9545" + op_chain_b = "http://127.0.0.1:9546" + devnet0 = "https://interop-alpha-0.optimism.io" + devnet1 = "https://interop-alpha-1.optimism.io" + ``` + You can import most RPC endpoints with this command, but it does not include the Interop devnet. + ```sh + pnpm contracts:update:rpcs + ``` + 1. Edit `packages/contracts/configs/deploy-config.toml` for the deployment settions. - ### Implement the IERC7802 interface + - Set these parameters in the `[deploy-config]` section: - Implementations of `SuperchainERC20` will be required to implement the [IERC7802](https://specs.optimism.io/interop/token-bridging.html#ierc7802) interface, that includes two external functions and two events. + | Parameter | Meaning | Example | + | --------- | --- | - | + | salt | A unique identifier | Carthage + | chains | The chains to deploy the contract1 | ["devnet0","devnet1"] - The interface defines two functions for bridging: + (1) These names must correspond to the chain names in the `[rpc-endpoints]` section of `foundry.toml` you updated in the previous step. - * `sendERC20`: Initializes a cross-chain transfer of a `SuperchainERC20` by burning the tokens locally and sending a message to the `SuperchainERC20Bridge` on the target chain using the `L2toL2CrossDomainMessenger`. This ensures that asset supply remains constant, as sending an asset moves it from one chain to another without creating additional supply. - * `relayERC20`: Processes incoming messages from the L2toL2CrossDomainMessenger and mints the corresponding amount of the SuperchainERC20. + - Set these parameters in the `[token]` section: - [Here's an example implementation of the `SuperchainERC20Bridge`](https://specs.optimism.io/interop/token-bridging.html#implementation) + | Parameter | Meaning | Example | + | --------- | --- | - | + | owner_address | Owner of the token | Your address1 | 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 + | name | Token name | Quick Transfer Token + | symbol | Token symbol | QTT + | decimals | Number of decimal places | 18 + + (1) This should be an address you control (for which you know the private key), which has some ETH on the devnets. + [See here](/stack/interop/tools/devnet#sending-eth-to-the-interop-devnets) to add ETH to the devnets. + + Here is a sample `packages/contracts/configs/deploy-config.toml` file you can use, as long as you update `owner_address`. + + ```toml + [deploy_config] + salt = "is the source of our word salary" + chains = ["devnet0","devnet1"] + + [token] + owner_address = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" + name = "Quick Transfer Token" + symbol = "QTT" + decimals = 18 + ``` + + 1. Set the private key. + Edit `packages/contracts/.env` to set `DEPLOYER_PRIVATE_KEY` to the private key of an account that has ETH on both devnet blockchains. + + ```sh + DEPLOYER_PRIVATE_KEY=0x0123456701234567012345670123456701234567012345670123456701234567 + ``` + + ### Deploy the contracts + + Run the deployment script. + + ```sh + pnpm contracts:deploy:token + ``` + +
+ + Sanity check + + 1. Set `TOKEN_ADDRESS` to the address where the token is deployed. + + ```sh + TOKEN_ADDRESS=0x322f4aF25D370BE2A2C74eEFf0DD0d2AF2e7eD75 + ``` + + 1. Set `PRIVATE_KEY` to the private key for the owner address. + + ```sh + PRIVATE_KEY=0x0123456701234567012345670123456701234567012345670123456701234567 + ``` + + 1. Mint tokens for an address you control on both chains. + The owner address is the easiest to use. + + ```sh + OWNER_ADDRESS=`cast wallet address --private-key $PRIVATE_KEY` + RPC_DEV0=https://interop-alpha-0.optimism.io + RPC_DEV1=https://interop-alpha-1.optimism.io + cast send --private-key $PRIVATE_KEY $TOKEN_ADDRESS "mint(address,uint256)" $OWNER_ADDRESS 1000 --rpc-url $RPC_DEV0 + cast send --private-key $PRIVATE_KEY $TOKEN_ADDRESS "mint(address,uint256)" $OWNER_ADDRESS 1000 --rpc-url $RPC_DEV1 + ``` + +
+
## Next steps From a7a9b59573edb437b3b1fc44a029f96724997af7 Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Sat, 15 Feb 2025 21:02:50 -0600 Subject: [PATCH 04/10] First draft --- .../tutorials/deploy-superchain-erc20.mdx | 47 ++++++++++++++----- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx index d5bb681f2..162502471 100644 --- a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx +++ b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx @@ -8,12 +8,14 @@ import { Callout } from 'nextra/components' import { Steps } from 'nextra/components' -The SuperchainERC20 standard is ready for production use with active Mainnet deployments. -However, the OP Stack interoperability upgrade, required for crosschain messaging, is currently still in active development. + The SuperchainERC20 standard is ready for production use with active Mainnet deployments. + However, the OP Stack interoperability upgrade, required for crosschain messaging, is currently still in active development. # Issuing new assets with SuperchainERC20 +## Overview + This guide explains how to issue new assets with the [`SuperchainERC20`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainERC20.sol) contract. Those assets can then be bridged quickly and safely using the [`SuperchainTokenBridge` ](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainTokenBridge.sol) contract (once interop is operational). For more information on how it works, [see the explainer](/stack/interop/superchain-erc20). @@ -27,21 +29,33 @@ This requirement abstracts away the complexity of cross-chain validation. Achieving this requires deterministic deployment methods. There are [many ways to do this](https://github.com/Arachnid/deterministic-deployment-proxy). Here we will use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit). +### What you'll do + +* Use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit) to deploy an `SuperchainERC20` token on the devnet. + +### What you'll learn + +* How to deploy `SuperchainERC20` tokens on different chains at the same address. + +## Prerequisites + +Before starting this tutorial, ensure your development environment meets the following requirements: -{/* +### Technical knowledge -### Implement the IERC7802 interface +* Understanding of smart contract development +* Familiarity with blockchain concepts - Implementations of `SuperchainERC20` will be required to implement the [IERC7802](https://specs.optimism.io/interop/token-bridging.html#ierc7802) interface, that includes two external functions and two events. +### Development environment - The interface defines two functions for bridging: +* Unix-like operating system (Linux, macOS, or WSL for Windows) +* Git for version control - * `sendERC20`: Initializes a cross-chain transfer of a `SuperchainERC20` by burning the tokens locally and sending a message to the `SuperchainERC20Bridge` on the target chain using the `L2toL2CrossDomainMessenger`. This ensures that asset supply remains constant, as sending an asset moves it from one chain to another without creating additional supply. - * `relayERC20`: Processes incoming messages from the L2toL2CrossDomainMessenger and mints the corresponding amount of the SuperchainERC20. +### Required tools - [Here's an example implementation of the `SuperchainERC20Bridge`](https://specs.optimism.io/interop/token-bridging.html#implementation) +The tutorial uses these primary tools: -*/} +* Foundry: For sending transactions to blockchains. ## Step by step explanation @@ -146,15 +160,24 @@ Here we will use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit). OWNER_ADDRESS=`cast wallet address --private-key $PRIVATE_KEY` RPC_DEV0=https://interop-alpha-0.optimism.io RPC_DEV1=https://interop-alpha-1.optimism.io - cast send --private-key $PRIVATE_KEY $TOKEN_ADDRESS "mint(address,uint256)" $OWNER_ADDRESS 1000 --rpc-url $RPC_DEV0 - cast send --private-key $PRIVATE_KEY $TOKEN_ADDRESS "mint(address,uint256)" $OWNER_ADDRESS 1000 --rpc-url $RPC_DEV1 + cast send --private-key $PRIVATE_KEY $TOKEN_ADDRESS "mintTo(address,uint256)" $OWNER_ADDRESS 1000 --rpc-url $RPC_DEV0 + cast send --private-key $PRIVATE_KEY $TOKEN_ADDRESS "mintTo(address,uint256)" $OWNER_ADDRESS 2000 --rpc-url $RPC_DEV1 ``` + 1. Check the balance of the owner address on both blockchains. + + ```sh + cast call $TOKEN_ADDRESS "balanceOf(address)" $OWNER_ADDRESS --rpc-url $RPC_DEV0 | cast to-dec + cast call $TOKEN_ADDRESS "balanceOf(address)" $OWNER_ADDRESS --rpc-url $RPC_DEV1 | cast to-dec + ``` + +
## Next steps +* Learn how to [transfer tokens between chains inside the Superchain](transfer-superchainERC20). * Use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit) to deploy your token across the Superchain. * Explore the [SuperchainERC20 specifications](https://specs.optimism.io/interop/token-bridging.html) for in-depth implementation details. * Review the [Superchain Interop Explainer](../explainer) for answers to common questions about interoperability. From d8ee37d637e0ba669702109d207a8f08407b23a1 Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Mon, 17 Feb 2025 10:05:50 -0600 Subject: [PATCH 05/10] Coderabbit discovered typo --- pages/stack/interop/tutorials/deploy-superchain-erc20.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx index 162502471..7acd2af9d 100644 --- a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx +++ b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx @@ -66,7 +66,7 @@ The tutorial uses these primary tools: ### Prepare for deployment - The Starter Kit already deploys a `SuperchainECR20` token to [Supersim](../tools/supersim). + The Starter Kit already deploys a `SuperchainERC20` token to [Supersim](../tools/supersim). Here we will deploy it to the [Interop devnet](../tools/devnet). 1. Edit `packages/contracts/foundry.toml` to add the RPC endpoints for the devnet (add the bottom two rows). From d2cef23a66ab08be32021cd5f25e0d130b7bc925 Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Tue, 18 Feb 2025 10:57:39 -0600 Subject: [PATCH 06/10] lint --- .../tutorials/deploy-superchain-erc20.mdx | 101 +++++++++--------- words.txt | 1 + 2 files changed, 50 insertions(+), 52 deletions(-) diff --git a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx index 7acd2af9d..9ae75cf92 100644 --- a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx +++ b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx @@ -8,7 +8,7 @@ import { Callout } from 'nextra/components' import { Steps } from 'nextra/components' - The SuperchainERC20 standard is ready for production use with active Mainnet deployments. + The SuperchainERC20 standard is ready for production use with active Mainnet deployments. However, the OP Stack interoperability upgrade, required for crosschain messaging, is currently still in active development. @@ -31,11 +31,11 @@ Here we will use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit). ### What you'll do -* Use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit) to deploy an `SuperchainERC20` token on the devnet. +* Use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit) to deploy an `SuperchainERC20` token on the devnet. ### What you'll learn -* How to deploy `SuperchainERC20` tokens on different chains at the same address. +* How to deploy `SuperchainERC20` tokens on different chains at the same address. ## Prerequisites @@ -69,44 +69,44 @@ The tutorial uses these primary tools: The Starter Kit already deploys a `SuperchainERC20` token to [Supersim](../tools/supersim). Here we will deploy it to the [Interop devnet](../tools/devnet). - 1. Edit `packages/contracts/foundry.toml` to add the RPC endpoints for the devnet (add the bottom two rows). - - ```toml - [rpc_endpoints] - op_chain_a = "http://127.0.0.1:9545" - op_chain_b = "http://127.0.0.1:9546" - devnet0 = "https://interop-alpha-0.optimism.io" - devnet1 = "https://interop-alpha-1.optimism.io" - ``` + 1. Edit `packages/contracts/foundry.toml` to add the RPC endpoints for the devnet (add the bottom two rows). - You can import most RPC endpoints with this command, but it does not include the Interop devnet. + ```toml + [rpc_endpoints] + op_chain_a = "http://127.0.0.1:9545" + op_chain_b = "http://127.0.0.1:9546" + devnet0 = "https://interop-alpha-0.optimism.io" + devnet1 = "https://interop-alpha-1.optimism.io" + ``` - ```sh - pnpm contracts:update:rpcs - ``` + You can import most RPC endpoints with this command, but it does not include the Interop devnet. - 1. Edit `packages/contracts/configs/deploy-config.toml` for the deployment settions. + ```sh + pnpm contracts:update:rpcs + ``` - - Set these parameters in the `[deploy-config]` section: + 2. Edit `packages/contracts/configs/deploy-config.toml` for the deployment settions. - | Parameter | Meaning | Example | - | --------- | --- | - | - | salt | A unique identifier | Carthage - | chains | The chains to deploy the contract1 | ["devnet0","devnet1"] + * Set these parameters in the `[deploy-config]` section: - (1) These names must correspond to the chain names in the `[rpc-endpoints]` section of `foundry.toml` you updated in the previous step. + | Parameter | Meaning | Example | + | --------- | --------------------------------------------- | ---------------------- | + | salt | A unique identifier | Carthage | + | chains | The chains to deploy the contract1 | \["devnet0","devnet1"] | - - Set these parameters in the `[token]` section: + (1) These names must correspond to the chain names in the `[rpc-endpoints]` section of `foundry.toml` you updated in the previous step. - | Parameter | Meaning | Example | - | --------- | --- | - | - | owner_address | Owner of the token | Your address1 | 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 - | name | Token name | Quick Transfer Token - | symbol | Token symbol | QTT - | decimals | Number of decimal places | 18 + * Set these parameters in the `[token]` section: - (1) This should be an address you control (for which you know the private key), which has some ETH on the devnets. - [See here](/stack/interop/tools/devnet#sending-eth-to-the-interop-devnets) to add ETH to the devnets. + | Parameter | Meaning | Example | | + | -------------- | ------------------------ | ------------------------ | ------------------------------------------ | + | owner\_address | Owner of the token | Your address1 | 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 | + | name | Token name | Quick Transfer Token | | + | symbol | Token symbol | QTT | | + | decimals | Number of decimal places | 18 | | + + (1) This should be an address you control (for which you know the private key), which has some ETH on the devnets. + [See here](/stack/interop/tools/devnet#sending-eth-to-the-interop-devnets) to add ETH to the devnets. Here is a sample `packages/contracts/configs/deploy-config.toml` file you can use, as long as you update `owner_address`. @@ -122,7 +122,7 @@ The tutorial uses these primary tools: decimals = 18 ``` - 1. Set the private key. + 3. Set the private key. Edit `packages/contracts/.env` to set `DEPLOYER_PRIVATE_KEY` to the private key of an account that has ETH on both devnet blockchains. ```sh @@ -133,50 +133,47 @@ The tutorial uses these primary tools: Run the deployment script. - ```sh - pnpm contracts:deploy:token - ``` + ```sh + pnpm contracts:deploy:token + ```
- Sanity check - 1. Set `TOKEN_ADDRESS` to the address where the token is deployed. + 1. Set `TOKEN_ADDRESS` to the address where the token is deployed. ```sh TOKEN_ADDRESS=0x322f4aF25D370BE2A2C74eEFf0DD0d2AF2e7eD75 ``` - 1. Set `PRIVATE_KEY` to the private key for the owner address. + 2. Set `PRIVATE_KEY` to the private key for the owner address. ```sh PRIVATE_KEY=0x0123456701234567012345670123456701234567012345670123456701234567 ``` - 1. Mint tokens for an address you control on both chains. - The owner address is the easiest to use. + 3. Mint tokens for an address you control on both chains. + The owner address is the easiest to use. - ```sh - OWNER_ADDRESS=`cast wallet address --private-key $PRIVATE_KEY` - RPC_DEV0=https://interop-alpha-0.optimism.io - RPC_DEV1=https://interop-alpha-1.optimism.io - cast send --private-key $PRIVATE_KEY $TOKEN_ADDRESS "mintTo(address,uint256)" $OWNER_ADDRESS 1000 --rpc-url $RPC_DEV0 - cast send --private-key $PRIVATE_KEY $TOKEN_ADDRESS "mintTo(address,uint256)" $OWNER_ADDRESS 2000 --rpc-url $RPC_DEV1 - ``` + ```sh + OWNER_ADDRESS=`cast wallet address --private-key $PRIVATE_KEY` + RPC_DEV0=https://interop-alpha-0.optimism.io + RPC_DEV1=https://interop-alpha-1.optimism.io + cast send --private-key $PRIVATE_KEY $TOKEN_ADDRESS "mintTo(address,uint256)" $OWNER_ADDRESS 1000 --rpc-url $RPC_DEV0 + cast send --private-key $PRIVATE_KEY $TOKEN_ADDRESS "mintTo(address,uint256)" $OWNER_ADDRESS 2000 --rpc-url $RPC_DEV1 + ``` - 1. Check the balance of the owner address on both blockchains. + 4. Check the balance of the owner address on both blockchains. ```sh cast call $TOKEN_ADDRESS "balanceOf(address)" $OWNER_ADDRESS --rpc-url $RPC_DEV0 | cast to-dec cast call $TOKEN_ADDRESS "balanceOf(address)" $OWNER_ADDRESS --rpc-url $RPC_DEV1 | cast to-dec ``` - -
-
## Next steps + * Learn how to [transfer tokens between chains inside the Superchain](transfer-superchainERC20). * Use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit) to deploy your token across the Superchain. * Explore the [SuperchainERC20 specifications](https://specs.optimism.io/interop/token-bridging.html) for in-depth implementation details. diff --git a/words.txt b/words.txt index f4402123e..ee8aac2c4 100644 --- a/words.txt +++ b/words.txt @@ -362,6 +362,7 @@ seqnr SEQUENCERHTTP sequencerhttp serv +settions signup SLLV SLTI From 9866fa2ef415383274916aca1e34f103ad3356d4 Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Thu, 20 Feb 2025 11:16:30 -0600 Subject: [PATCH 07/10] @sbvegan, coderabbit, and lint --- .../interop/tutorials/deploy-superchain-erc20.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx index 9ae75cf92..71a61dcc2 100644 --- a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx +++ b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx @@ -8,7 +8,7 @@ import { Callout } from 'nextra/components' import { Steps } from 'nextra/components' - The SuperchainERC20 standard is ready for production use with active Mainnet deployments. + The SuperchainERC20 standard is ready for production deployments. However, the OP Stack interoperability upgrade, required for crosschain messaging, is currently still in active development. @@ -17,7 +17,7 @@ import { Steps } from 'nextra/components' ## Overview This guide explains how to issue new assets with the [`SuperchainERC20`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainERC20.sol) contract. -Those assets can then be bridged quickly and safely using the [`SuperchainTokenBridge` ](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainTokenBridge.sol) contract (once interop is operational). +Those assets can then be bridged quickly and safely using the [`SuperchainTokenBridge`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainTokenBridge.sol) contract (once interop is operational). For more information on how it works, [see the explainer](/stack/interop/superchain-erc20). Note that bridging assets through the Superchain using `SuperchainTokenBridge` *never* affects the total supply of your asset. @@ -100,7 +100,7 @@ The tutorial uses these primary tools: | Parameter | Meaning | Example | | | -------------- | ------------------------ | ------------------------ | ------------------------------------------ | - | owner\_address | Owner of the token | Your address1 | 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 | + | owner\_address | Owner of the token | Your address1 | | | name | Token name | Quick Transfer Token | | | symbol | Token symbol | QTT | | | decimals | Number of decimal places | 18 | | @@ -126,7 +126,7 @@ The tutorial uses these primary tools: Edit `packages/contracts/.env` to set `DEPLOYER_PRIVATE_KEY` to the private key of an account that has ETH on both devnet blockchains. ```sh - DEPLOYER_PRIVATE_KEY=0x0123456701234567012345670123456701234567012345670123456701234567 + DEPLOYER_PRIVATE_KEY= <<>> ``` ### Deploy the contracts @@ -149,7 +149,7 @@ The tutorial uses these primary tools: 2. Set `PRIVATE_KEY` to the private key for the owner address. ```sh - PRIVATE_KEY=0x0123456701234567012345670123456701234567012345670123456701234567 + PRIVATE_KEY= <<>> ``` 3. Mint tokens for an address you control on both chains. From 58a8f1fa67fdd6817ba389cad7eada9ba61dbaa1 Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Thu, 20 Feb 2025 11:17:25 -0600 Subject: [PATCH 08/10] A comment I didn't notice --- pages/stack/interop/tutorials/deploy-superchain-erc20.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx index 71a61dcc2..4380345ca 100644 --- a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx +++ b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx @@ -26,7 +26,7 @@ The token's total amount across all network always remains the same, ensuring va To ensure fungibility across chains, `SuperchainERC20` assets *must* have the same contract address on all chains. This requirement abstracts away the complexity of cross-chain validation. -Achieving this requires deterministic deployment methods. There are [many ways to do this](https://github.com/Arachnid/deterministic-deployment-proxy). +Achieving this requires deterministic deployment methods. There are multiple ways to do this. Here we will use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit). ### What you'll do From afb418b08229bb2ccf78870924e351f0cfb9f555 Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Thu, 20 Feb 2025 11:30:30 -0600 Subject: [PATCH 09/10] Update deploy-superchain-erc20.mdx --- pages/stack/interop/tutorials/deploy-superchain-erc20.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx index 4380345ca..a60f09afd 100644 --- a/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx +++ b/pages/stack/interop/tutorials/deploy-superchain-erc20.mdx @@ -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 settions. + 2. Edit `packages/contracts/configs/deploy-config.toml` for the deployment settings. * Set these parameters in the `[deploy-config]` section: From ad2a171f7925ff7f8f5571049715874c4618844e Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Thu, 20 Feb 2025 11:30:52 -0600 Subject: [PATCH 10/10] Update words.txt