From 5493b773a9dc212a39eb488732e1f519f8467d6d Mon Sep 17 00:00:00 2001
From: Bradley Camacho <42678939+bradleycamacho@users.noreply.github.com>
Date: Wed, 30 Oct 2024 14:18:58 -0700
Subject: [PATCH 1/9] Draft Deploy assets using SuperchainERC20
---
.../interop/deploy-superchain-erc20.mdx.mdx | 89 +++++++++++++++++++
1 file changed, 89 insertions(+)
create mode 100644 pages/stack/interop/deploy-superchain-erc20.mdx.mdx
diff --git a/pages/stack/interop/deploy-superchain-erc20.mdx.mdx b/pages/stack/interop/deploy-superchain-erc20.mdx.mdx
new file mode 100644
index 000000000..e7aedcab9
--- /dev/null
+++ b/pages/stack/interop/deploy-superchain-erc20.mdx.mdx
@@ -0,0 +1,89 @@
+---
+title: Deploy assets using SuperchainERC20
+lang: en-US
+description: Learn about the basic details of deploying assets on SuperchainERC20
+---
+
+import { Callout } from 'nextra/components'
+
+# Issuing new assets with SuperchainERC20
+
+## Overview
+
+This guide explains how to issue new assets with the `SuperchainERC20` standard 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)
+
+An important thing to note, is that bridging assets through the Superchain using SuperchainERC20 never affects the supply of your asset. Supply is always fixed; bridging and moving your asset across the superchain only affects which chain its located on.
+
+
+## Steps to issue and bridge assets
+
+
+### 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:
+
+```solidity
+// Example token deployment using Create2Deployer
+bytes32 salt = keccak256(abi.encodePacked("SuperchainToken"));
+address tokenAddress = Create2Deployer.deploy(salt, bytecode, constructorArgs);
+```
+
+By deploying assets at identical addresses across multiple chains, we abstract away the complexity of cross-chain validation.
+
+### Implement the ICrosschainERC20 interface
+
+Ensure that your token contract conforms to the ICrosschainERC20 interface to support cross-chain minting and burning.
+
+```solidity
+interface ICrosschainERC20 {
+ function crosschainMint(address _account, uint256 _amount) external; /// Mints _amount of token to address _account.
+ function crosschainBurn(address _account, uint256 _amount) external; /// Burns _amount of token from address _account.
+
+ event CrosschainMint(address indexed _to, uint256 _amount); /// MUST trigger when crosschainMint is called
+ event CrosschainBurn(address indexed _from, uint256 _amount); /// MUST trigger when crosschainBurn is called
+}
+```
+
+### Use the `SuperchainERC20Bridge` for cross-chain transfers
+
+The `SuperchainERC20Bridge` relies on the `L2ToL2CrossDomainMessenger` to securely relay messages between chains and provide replay protection, domain binding and access to additional message information.
+
+We'll use two function 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 never changes; sending an asset moves it from one chain to another, it does not "create" an additional asset in regards to supply.
+* `relayERC20`: process incoming messages from the L2toL2CrossDomainMessenger and mints the corresponding amount of the SuperchainERC20.
+
+Here's an example implementation of the `SuperchainERC20Bridge`
+
+```solidity
+function sendERC20(SuperchainERC20 _token, address _to, uint256 _amount, uint256 _chainId) external returns (bytes32 msgHash_) {
+ _token.crosschainBurn(msg.sender, _amount);
+
+ bytes memory _message = abi.encodeCall(this.relayERC20, (_token, msg.sender, _to, _amount));
+
+ msgHash_ = L2ToL2CrossDomainMessenger.sendMessage(_chainId, address(this), _message);
+
+ emit SentERC20(address(_token), msg.sender, _to, _amount, _chainId);
+}
+
+function relayERC20(SuperchainERC20 _token, address _from, address _to, uint256 _amount) external {
+ require(msg.sender == address(L2ToL2CrossChainMessenger));
+ require(L2ToL2CrossChainMessenger.crossDomainMessageSender() == address(this));
+
+ uint256 _source = L2ToL2CrossChainMessenger.crossDomainMessageSource();
+
+ _token.crosschainMint(_to, _amount);
+
+ emit RelayedERC20(address(_token), _from, _to, _amount, _source);
+}
+```
+
+## Next steps
+* Explore the [SuperchainERC20 specifications](https://specs.optimism.io/interop/token-bridging.html) for in-depth implementation details.
+* Watch the [Superchain interop design video walkthrough](https://www.youtube.com/watch?v=FKc5RgjtGes) for a visual explanation of the concepts.
+* Review the [Superchain Interop Explainer](explainer) for answers to common questions about interoperability.
From d7e9154334d947af76f3056acb6d3497379a32ce Mon Sep 17 00:00:00 2001
From: Bradley Camacho <42678939+bradleycamacho@users.noreply.github.com>
Date: Wed, 30 Oct 2024 14:24:06 -0700
Subject: [PATCH 2/9] Nav and various fixes
---
pages/stack/interop/_meta.json | 3 ++-
...ain-erc20.mdx.mdx => deploy-superchain-erc20.mdx} | 12 ++++++++----
pages/stack/interop/superchain-erc20.mdx | 2 ++
3 files changed, 12 insertions(+), 5 deletions(-)
rename pages/stack/interop/{deploy-superchain-erc20.mdx.mdx => deploy-superchain-erc20.mdx} (87%)
diff --git a/pages/stack/interop/_meta.json b/pages/stack/interop/_meta.json
index 304ddf4a7..8af79e2c9 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",
+ "deploy-superchain-erc20": "Deploy assets using SuperchainERC20"
}
\ No newline at end of file
diff --git a/pages/stack/interop/deploy-superchain-erc20.mdx.mdx b/pages/stack/interop/deploy-superchain-erc20.mdx
similarity index 87%
rename from pages/stack/interop/deploy-superchain-erc20.mdx.mdx
rename to pages/stack/interop/deploy-superchain-erc20.mdx
index e7aedcab9..9f373d471 100644
--- a/pages/stack/interop/deploy-superchain-erc20.mdx.mdx
+++ b/pages/stack/interop/deploy-superchain-erc20.mdx
@@ -5,10 +5,13 @@ description: Learn about the basic details of deploying assets on SuperchainERC2
---
import { Callout } from 'nextra/components'
+import { Steps } from 'nextra/components'
# Issuing new assets with SuperchainERC20
-## Overview
+
+ 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 explains how to issue new assets with the `SuperchainERC20` standard 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)
@@ -22,8 +25,8 @@ An important thing to note, is that bridging assets through the Superchain using
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.
+* `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:
@@ -37,7 +40,7 @@ By deploying assets at identical addresses across multiple chains, we abstract a
### Implement the ICrosschainERC20 interface
-Ensure that your token contract conforms to the ICrosschainERC20 interface to support cross-chain minting and burning.
+Ensure that your token contract conforms to the `ICrosschainERC20` interface to support cross-chain minting and burning.
```solidity
interface ICrosschainERC20 {
@@ -82,6 +85,7 @@ function relayERC20(SuperchainERC20 _token, address _from, address _to, uint256
emit RelayedERC20(address(_token), _from, _to, _amount, _source);
}
```
+
## Next steps
* Explore the [SuperchainERC20 specifications](https://specs.optimism.io/interop/token-bridging.html) for in-depth implementation details.
diff --git a/pages/stack/interop/superchain-erc20.mdx b/pages/stack/interop/superchain-erc20.mdx
index 6542f6ae5..4959e9525 100644
--- a/pages/stack/interop/superchain-erc20.mdx
+++ b/pages/stack/interop/superchain-erc20.mdx
@@ -79,6 +79,8 @@ Application developers must do two things to make their tokens `SuperchainERC20`
For now, application developers should view `SuperchainERC20`as ERC20 tokens with additional built-in functions that allow cross-chain asset movement that will be enabled once Interop goes live.
+For step-by-step information on implementing SuperchainERC20, see [Deploy assets using SuperchainERC20](/stack/interop/deploy-superchain-erc20)
+
To enable asset interoperability, `SuperchainERC20` must give access to the address where the future `SuperchainERC20Bridge` will live.
From 79a3924b29f2d9ffc0bd68b1349aa638b5879064 Mon Sep 17 00:00:00 2001
From: Bradley Camacho <42678939+bradleycamacho@users.noreply.github.com>
Date: Wed, 30 Oct 2024 14:42:38 -0700
Subject: [PATCH 3/9] Clarift supply considerations
---
pages/stack/interop/deploy-superchain-erc20.mdx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pages/stack/interop/deploy-superchain-erc20.mdx b/pages/stack/interop/deploy-superchain-erc20.mdx
index 9f373d471..9c79577a0 100644
--- a/pages/stack/interop/deploy-superchain-erc20.mdx
+++ b/pages/stack/interop/deploy-superchain-erc20.mdx
@@ -15,7 +15,7 @@ import { Steps } from 'nextra/components'
This guide explains how to issue new assets with the `SuperchainERC20` standard 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)
-An important thing to note, is that bridging assets through the Superchain using SuperchainERC20 never affects the supply of your asset. Supply is always fixed; bridging and moving your asset across the superchain only affects which chain its located on.
+An important thing to note is using `crosschainBurn` and `crosschainMint` on the `SuperchainERC20` to move your asset across the Superchain only affects which chain your asset is located on and does not change the overall supply of the token. 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.
## Steps to issue and bridge assets
From df0e197fe9993753c852d50b0cd17da1b765a530 Mon Sep 17 00:00:00 2001
From: Bradley Camacho <42678939+bradleycamacho@users.noreply.github.com>
Date: Thu, 7 Nov 2024 12:19:22 -0800
Subject: [PATCH 4/9] Implement feedback
---
.../stack/interop/deploy-superchain-erc20.mdx | 52 ++-----------------
1 file changed, 5 insertions(+), 47 deletions(-)
diff --git a/pages/stack/interop/deploy-superchain-erc20.mdx b/pages/stack/interop/deploy-superchain-erc20.mdx
index 9c79577a0..98cb08a62 100644
--- a/pages/stack/interop/deploy-superchain-erc20.mdx
+++ b/pages/stack/interop/deploy-superchain-erc20.mdx
@@ -13,7 +13,7 @@ import { 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 explains how to issue new assets with the `SuperchainERC20` standard 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` 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)
An important thing to note is using `crosschainBurn` and `crosschainMint` on the `SuperchainERC20` to move your asset across the Superchain only affects which chain your asset is located on and does not change the overall supply of the token. 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.
@@ -28,63 +28,21 @@ To ensure fungibility across chains, the SuperchainERC20 assets need to have the
* `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:
-
-```solidity
-// Example token deployment using Create2Deployer
-bytes32 salt = keccak256(abi.encodePacked("SuperchainToken"));
-address tokenAddress = Create2Deployer.deploy(salt, bytecode, constructorArgs);
-```
+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)
By deploying assets at identical addresses across multiple chains, we abstract away the complexity of cross-chain validation.
-### Implement the ICrosschainERC20 interface
-
-Ensure that your token contract conforms to the `ICrosschainERC20` interface to support cross-chain minting and burning.
-
-```solidity
-interface ICrosschainERC20 {
- function crosschainMint(address _account, uint256 _amount) external; /// Mints _amount of token to address _account.
- function crosschainBurn(address _account, uint256 _amount) external; /// Burns _amount of token from address _account.
-
- event CrosschainMint(address indexed _to, uint256 _amount); /// MUST trigger when crosschainMint is called
- event CrosschainBurn(address indexed _from, uint256 _amount); /// MUST trigger when crosschainBurn is called
-}
-```
-
-### Use the `SuperchainERC20Bridge` for cross-chain transfers
+### Implement the IERC7802 interface
-The `SuperchainERC20Bridge` relies on the `L2ToL2CrossDomainMessenger` to securely relay messages between chains and provide replay protection, domain binding and access to additional message information.
+Implementations of `SuperchainERC2` 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.
We'll use two function 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 never changes; sending an asset moves it from one chain to another, it does not "create" an additional asset in regards to supply.
* `relayERC20`: process incoming messages from the L2toL2CrossDomainMessenger and mints the corresponding amount of the SuperchainERC20.
-Here's an example implementation of the `SuperchainERC20Bridge`
-
-```solidity
-function sendERC20(SuperchainERC20 _token, address _to, uint256 _amount, uint256 _chainId) external returns (bytes32 msgHash_) {
- _token.crosschainBurn(msg.sender, _amount);
-
- bytes memory _message = abi.encodeCall(this.relayERC20, (_token, msg.sender, _to, _amount));
-
- msgHash_ = L2ToL2CrossDomainMessenger.sendMessage(_chainId, address(this), _message);
-
- emit SentERC20(address(_token), msg.sender, _to, _amount, _chainId);
-}
-
-function relayERC20(SuperchainERC20 _token, address _from, address _to, uint256 _amount) external {
- require(msg.sender == address(L2ToL2CrossChainMessenger));
- require(L2ToL2CrossChainMessenger.crossDomainMessageSender() == address(this));
-
- uint256 _source = L2ToL2CrossChainMessenger.crossDomainMessageSource();
-
- _token.crosschainMint(_to, _amount);
+[Here's an example implementation of the `SuperchainERC20Bridge`](https://specs.optimism.io/interop/token-bridging.html#implementation)
- emit RelayedERC20(address(_token), _from, _to, _amount, _source);
-}
-```
## Next steps
From 2fcb3c879d08d6678b9bcfddd94c0c8d75871ded Mon Sep 17 00:00:00 2001
From: Bradley Camacho <42678939+bradleycamacho@users.noreply.github.com>
Date: Thu, 7 Nov 2024 16:23:13 -0800
Subject: [PATCH 5/9] Feedback additions
---
pages/stack/interop/deploy-superchain-erc20.mdx | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/pages/stack/interop/deploy-superchain-erc20.mdx b/pages/stack/interop/deploy-superchain-erc20.mdx
index 98cb08a62..3b6a03245 100644
--- a/pages/stack/interop/deploy-superchain-erc20.mdx
+++ b/pages/stack/interop/deploy-superchain-erc20.mdx
@@ -15,7 +15,8 @@ import { Steps } from 'nextra/components'
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)
-An important thing to note is using `crosschainBurn` and `crosschainMint` on the `SuperchainERC20` to move your asset across the Superchain only affects which chain your asset is located on and does not change the overall supply of the token. 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 `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.
## Steps to issue and bridge assets
@@ -25,8 +26,8 @@ An important thing to note is using `crosschainBurn` and `crosschainMint` on the
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.
+ * `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)
@@ -34,12 +35,12 @@ By deploying assets at identical addresses across multiple chains, we abstract a
### Implement the IERC7802 interface
-Implementations of `SuperchainERC2` 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.
+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.
-We'll use two function for bridging:
+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 never changes; sending an asset moves it from one chain to another, it does not "create" an additional asset in regards to supply.
-* `relayERC20`: process incoming messages from the L2toL2CrossDomainMessenger and mints the corresponding amount of the SuperchainERC20.
+* `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)
From da9d202943a909a36cb274a54a9dd80867ea03b1 Mon Sep 17 00:00:00 2001
From: Bradley Camacho <42678939+bradleycamacho@users.noreply.github.com>
Date: Thu, 7 Nov 2024 16:25:13 -0800
Subject: [PATCH 6/9] Fix nav files
---
pages/stack/interop/_meta.json | 3 +--
pages/stack/interop/assets/_meta.json | 3 ++-
pages/stack/interop/{ => assets}/deploy-superchain-erc20.mdx | 0
3 files changed, 3 insertions(+), 3 deletions(-)
rename pages/stack/interop/{ => assets}/deploy-superchain-erc20.mdx (100%)
diff --git a/pages/stack/interop/_meta.json b/pages/stack/interop/_meta.json
index 204b397c5..d42e969ce 100644
--- a/pages/stack/interop/_meta.json
+++ b/pages/stack/interop/_meta.json
@@ -4,6 +4,5 @@
"supersim": "Supersim Multichain Development Environment",
"message-passing": "Interop message passing",
"op-supervisor": "OP Supervisor",
- "assets": "Assets",
- "deploy-superchain-erc20": "Deploy assets using SuperchainERC20"
+ "assets": "Assets"
}
\ No newline at end of file
diff --git a/pages/stack/interop/assets/_meta.json b/pages/stack/interop/assets/_meta.json
index 15677456d..9398906a4 100644
--- a/pages/stack/interop/assets/_meta.json
+++ b/pages/stack/interop/assets/_meta.json
@@ -1,5 +1,6 @@
{
"superchain-erc20": "SuperchainERC20",
"superchain-weth": "SuperchainWETH (Interoperable ETH)",
- "transfer-superchainERC20": "How to transfer a SuperchainERC20"
+ "transfer-superchainERC20": "How to transfer a SuperchainERC20",
+ "deploy-superchain-erc20": "Deploy assets using SuperchainERC20"
}
\ No newline at end of file
diff --git a/pages/stack/interop/deploy-superchain-erc20.mdx b/pages/stack/interop/assets/deploy-superchain-erc20.mdx
similarity index 100%
rename from pages/stack/interop/deploy-superchain-erc20.mdx
rename to pages/stack/interop/assets/deploy-superchain-erc20.mdx
From 1fe6af018f6c8866916179d232deb032a28db5cf Mon Sep 17 00:00:00 2001
From: Bradley Camacho <42678939+bradleycamacho@users.noreply.github.com>
Date: Thu, 7 Nov 2024 16:33:52 -0800
Subject: [PATCH 7/9] Linting
---
.../assets/deploy-superchain-erc20.mdx | 30 +++++++++----------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/pages/stack/interop/assets/deploy-superchain-erc20.mdx b/pages/stack/interop/assets/deploy-superchain-erc20.mdx
index 3b6a03245..0379308cb 100644
--- a/pages/stack/interop/assets/deploy-superchain-erc20.mdx
+++ b/pages/stack/interop/assets/deploy-superchain-erc20.mdx
@@ -15,38 +15,36 @@ import { Steps } from 'nextra/components'
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)
-
-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 `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.
## Steps to issue and bridge assets
-### Deploy the `SuperchainERC20` Token Contract
+ ### 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:
+ 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.
+ * `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)
+ 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)
-By deploying assets at identical addresses across multiple chains, we abstract away the complexity of cross-chain validation.
+ By deploying assets at identical addresses across multiple chains, we abstract away the complexity of cross-chain validation.
-### Implement the IERC7802 interface
+ ### 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.
+ 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:
+ 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)
+ * `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)
## Next steps
+
* Explore the [SuperchainERC20 specifications](https://specs.optimism.io/interop/token-bridging.html) for in-depth implementation details.
* Watch the [Superchain interop design video walkthrough](https://www.youtube.com/watch?v=FKc5RgjtGes) for a visual explanation of the concepts.
* Review the [Superchain Interop Explainer](explainer) for answers to common questions about interoperability.
From dc3c05e47af543d5f5eb64a4fabc43f09ea794a1 Mon Sep 17 00:00:00 2001
From: Bradley Camacho <42678939+bradleycamacho@users.noreply.github.com>
Date: Thu, 7 Nov 2024 16:40:16 -0800
Subject: [PATCH 8/9] Lint again
---
pages/stack/interop/assets.mdx | 2 ++
words.txt | 8 +-------
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/pages/stack/interop/assets.mdx b/pages/stack/interop/assets.mdx
index f86a72a22..7aa352c94 100644
--- a/pages/stack/interop/assets.mdx
+++ b/pages/stack/interop/assets.mdx
@@ -16,4 +16,6 @@ Documentation covering SuperchainERC20, Superchain WETH, Supersim, and how to tr
+
+
diff --git a/words.txt b/words.txt
index 5d17e5318..a46c5ae63 100644
--- a/words.txt
+++ b/words.txt
@@ -10,7 +10,6 @@ Allnodes
Allocs
allocs
ANDI
-Ankr
Apeworx
Arweave
authrpc
@@ -146,10 +145,10 @@ historicalrpctimeout
HOLESKY
Holesky
holesky
+IERC
IGNOREPRICE
ignoreprice
implicity
-Immunefi
Inator
inator
INFLUXDBV
@@ -197,7 +196,6 @@ minsuggestedpriorityfee
Mintable
Mintplex
MIPSEVM
-Mitigations
Monitorism
Moralis
Mordor
@@ -292,8 +290,6 @@ Proxied
Proxyd
proxyd
pseudorandomly
-Pyth
-Pyth's
QRNG
Quicknode
quicknode
@@ -328,7 +324,6 @@ safedb
Schnorr
secp
SELFDESTRUCT
-Sepolia
seqnr
SEQUENCERHTTP
sequencerhttp
@@ -394,7 +389,6 @@ vhosts
Viem
viem
Viem's
-voxel
VMDEBUG
vmdebug
VMODULE
From 18cd436d09fe95f68dc36373906e71810d2f78ef Mon Sep 17 00:00:00 2001
From: Bradley Camacho <42678939+bradleycamacho@users.noreply.github.com>
Date: Thu, 7 Nov 2024 16:45:25 -0800
Subject: [PATCH 9/9] Fix linter again :(
---
words.txt | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/words.txt b/words.txt
index a46c5ae63..ee47a71c4 100644
--- a/words.txt
+++ b/words.txt
@@ -1,3 +1,10 @@
+Ankr
+Immunefi
+Mitigations
+Pyth
+Pyth's
+Sepolia
+voxel
ACCOUNTQUEUE
accountqueue
ACCOUNTSLOTS