-
Notifications
You must be signed in to change notification settings - Fork 265
Upgrade ERC20 tokens for interop #1577
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
Open
qbzzt
wants to merge
13
commits into
ethereum-optimism:main
Choose a base branch
from
qbzzt:250416-upgrade-erc20-move
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,042
−3
Open
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0c00162
Moved to correct location
qbzzt 52bc7fc
lint
qbzzt e419136
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
qbzzt 8a401a2
Merge branch 'main' into 250416-upgrade-erc20-move
qbzzt 80dbd8a
Apply suggestions from code review
qbzzt 7c6db48
lint
qbzzt 73aaa6b
Update upgrade-to-superchain-erc20.mdx
qbzzt ed9cb32
Coderabbit requests
qbzzt bbd7041
Merge branch 'main' into 250416-upgrade-erc20-move
qbzzt 8cf5903
maybe now it'll build
qbzzt 48d5183
Auto-fix: Update breadcrumbs, spelling dictionary and other automated…
qbzzt 756bfae
Update words.txt
qbzzt 94c605f
Update pages/interop/tutorials/upgrade-to-superchain-erc20/_meta.json
qbzzt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
title: Upgrading ERC20 to SuperchainERC20 | ||
lang: en-US | ||
description: Tutorial on how to take an existing ERC20 and upgrade it to SuperchainERC20. | ||
topic: Interoperability | ||
personas: [Developer] | ||
categories: [Tutorial, Interop] | ||
content_type: article | ||
--- | ||
|
||
import { Callout, Steps, Card, Cards } from 'nextra/components' | ||
|
||
<Callout> | ||
The SuperchainERC20 standard is ready for production deployments. | ||
Please note that the OP Stack interoperability upgrade, required for crosschain messaging, is currently still in active development. | ||
</Callout> | ||
|
||
# Upgrading ERC20 to SuperchainERC20 | ||
|
||
## Overview | ||
|
||
This guide explains how to upgrade an ERC20 to a [`SuperchainERC20`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainERC20.sol) that can teleport across the [Superchain interop cluster](/interop/explainer#superchain-interop-cluster) using the [`SuperchainTokenBridge`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainTokenBridge.sol) contract. For more information on how it works, [see the explainer](/interop/superchain-erc20). | ||
|
||
{/* | ||
|
||
I put this warning here when we don't have it on most pages because this tutorial | ||
has, IMHO, code that is a lot more likely to be used in production. It doesn't just | ||
show what is possible, it does the exact job needed. | ||
|
||
*/} | ||
|
||
There are several ways to upgrade an existing ERC20 for interop, depending on your circumstances: | ||
|
||
{/* | ||
|
||
* If you can upgrade the existing contract, but the address is not available on other chains? In that case, use a custom bridge | ||
|
||
upgrade-to-superchain-erc20/custom-bridge. | ||
|
||
*/} | ||
|
||
| When To Use | Action | | ||
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | | ||
| You can install a new ERC20 contract | [**Deploy New SuperchainERC20 contracts** directly](/interop/tutorials/deploy-superchain-erc20) | | ||
| Existing ERC20 contract cannot be upgraded | [**Implement Lockbox Solution** to bridge between tokens](/interop/tutorials/upgrade-to-superchain-erc20/lockbox) | | ||
| You can deploy to other chains using the same proxy address | [**Perform Contract Upgrade** while maintaining address](/interop/tutorials/upgrade-to-superchain-erc20/contract-upgrade) | | ||
|
||
<Cards> | ||
<Card title="Contract upgrade" href="/interop/tutorials/upgrade-to-superchain-erc20/contract-upgrade" icon={<img src="/img/icons/shapes.svg" />} /> | ||
|
||
<Card title="Lockboxes for permissionless interop" href="/interop/tutorials/upgrade-to-superchain-erc20/lockbox" icon={<img src="/img/icons/shapes.svg" />} /> | ||
</Cards> | ||
|
||
## Next steps | ||
|
||
* Deploy a [SuperchainERC20](/interop/tutorials/deploy-superchain-erc20) to the Superchain | ||
* [Learn more about SuperchainERC20](/interop/superchain-erc20) | ||
* Build a [revolutionary app](/app-developers/get-started) that uses multiple blockchains within the Superchain |
4 changes: 4 additions & 0 deletions
4
pages/interop/tutorials/upgrade-to-superchain-erc20/_meta.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"contract-upgrade": "Contract upgrade" | ||
"lockbox": "Lockboxes for permissionless interop", | ||
} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.