Skip to content

Deploy assets using Superchain ERC20 #1050

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pages/stack/interop/assets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ Documentation covering SuperchainERC20, Superchain WETH, Supersim, and how to tr
<Card title="SuperchainWETH (Interoperable ETH)" href="/stack/interop/assets/superchain-weth" />

<Card title="How to transfer a SuperchainERC20" href="/stack/interop/assets/transfer-superchainERC20" />

<Card title="How to deploy assets using SuperchainERC20" href="/stack/interop/assets/deploy-superchain-erc20" />
</Cards>
3 changes: 2 additions & 1 deletion pages/stack/interop/assets/_meta.json
Original file line number Diff line number Diff line change
@@ -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"
}
50 changes: 50 additions & 0 deletions pages/stack/interop/assets/deploy-superchain-erc20.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: Deploy assets using SuperchainERC20
lang: en-US
description: Learn about the basic details of deploying assets on SuperchainERC20
---

import { Callout } from 'nextra/components'
import { Steps } from 'nextra/components'

# Issuing new assets with SuperchainERC20

<Callout>
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.
</Callout>

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.

## Steps to issue and bridge assets

<Steps>
### 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)

By deploying assets at identical addresses across multiple chains, we abstract away the complexity of cross-chain validation.

### 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)
</Steps>

## 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.
2 changes: 2 additions & 0 deletions pages/stack/interop/assets/superchain-erc20.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,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)

<Callout type="warning">
To enable asset interoperability, `SuperchainERC20` must give access to the address where the future `SuperchainERC20Bridge` will live.
</Callout>
Expand Down
15 changes: 8 additions & 7 deletions words.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Ankr
Immunefi
Mitigations
Pyth
Pyth's
Sepolia
voxel
ACCOUNTQUEUE
accountqueue
ACCOUNTSLOTS
Expand All @@ -10,7 +17,6 @@ Allnodes
Allocs
allocs
ANDI
Ankr
Apeworx
Arweave
authrpc
Expand Down Expand Up @@ -146,10 +152,10 @@ historicalrpctimeout
HOLESKY
Holesky
holesky
IERC
IGNOREPRICE
ignoreprice
implicity
Immunefi
Inator
inator
INFLUXDBV
Expand Down Expand Up @@ -197,7 +203,6 @@ minsuggestedpriorityfee
Mintable
Mintplex
MIPSEVM
Mitigations
Monitorism
Moralis
Mordor
Expand Down Expand Up @@ -292,8 +297,6 @@ Proxied
Proxyd
proxyd
pseudorandomly
Pyth
Pyth's
QRNG
Quicknode
quicknode
Expand Down Expand Up @@ -328,7 +331,6 @@ safedb
Schnorr
secp
SELFDESTRUCT
Sepolia
seqnr
SEQUENCERHTTP
sequencerhttp
Expand Down Expand Up @@ -394,7 +396,6 @@ vhosts
Viem
viem
Viem's
voxel
VMDEBUG
vmdebug
VMODULE
Expand Down
Loading