-
Notifications
You must be signed in to change notification settings - Fork 262
Tutorial: Upgrade ERC20 to support interop #1525
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
Changes from 34 commits
7fbd348
3697d7d
c1ed880
a4f98e2
ac5de2c
6c6fd85
eb9ba15
7327294
0f4388b
c75befd
7644214
a93acb3
0c49dfe
fdc7a7f
33b49ed
cdebe0f
11e0b32
e059449
4b8033b
921101d
ca937f7
3685944
63f4021
523dbbc
5b92cb7
73f1f9f
3968ad1
cad3ad9
b0b71a2
9330958
25ce3e2
4640c8a
1eb5657
384c99d
9bcaaeb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
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](/stack/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](/stack/interop/superchain-erc20). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is |
||
|
||
<Callout type="warning"> | ||
qbzzt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
The code on the documentation site is sample code, *not* production code. | ||
This means that we ran it, and it works as advertised. | ||
However, it did not pass through the rigorous audit process that most Optimism code undergoes. | ||
You're welcome to use it, but if you need it for production purposes you should get it audited first. | ||
</Callout> | ||
|
||
{/* | ||
qbzzt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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 the exact circumstances. Click any of the green rectangles for directions. | ||
qbzzt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```mermaid | ||
graph TB | ||
classDef link fill:#f96 | ||
Deployed{Is there<br/>already an<br/>ERC20 contract<br/>in use?} | ||
Deployed -- No --> New[<a href="./deploy-superchain-erc20">New SuperchainERC20 contract</a>]:::link | ||
Deployed -- Yes --> Proxy{Is the<br/>existing contract</br>behind a<br/>proxy?} | ||
Proxy -- No --> Lockbox[<a href="upgrade-to-superchain-erc20/lockbox">Lockbox contract</a>]:::link | ||
Proxy -- Yes --> Proxy2{Can you<br/>deploy proxies on<br/>the same address<br/>on the other chains?} | ||
Proxy2 -- No --> Bridge[Specialized Bridge<br/>Coming soon] | ||
Proxy2 -- Yes --> Upgrade[<a href="upgrade-to-superchain-erc20/proxy-upgrade">Contract upgrade</a>]:::link | ||
``` | ||
|
||
|
||
<Cards> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also i'm not sure what the relationship between the diagram above and these cards. Do we need both?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need the cards. But I can't get past the automatic checks without them. |
||
|
||
<Card title="Contract upgrade" href="/stack/interop/tutorials/upgrade-to-superchain-erc20/proxy-upgrade" icon={<img src="/img/icons/shapes.svg" />} /> | ||
<Card title="Lockboxes for permissionless interop" href="/stack/interop/tutorials/upgrade-to-superchain-erc20/lockbox" icon={<img src="/img/icons/shapes.svg" />} /> | ||
|
||
</Cards> | ||
|
||
## Next steps | ||
|
||
qbzzt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* Deploy a [SuperchainERC20](./deploy-superchain-erc20) to the Superchain | ||
* [Learn more about SuperchainERC20](/stack/interop/superchain-erc20) | ||
* Build a [revolutionary app](/app-developers/get-started) that uses multiple blockchains within the Superchain |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"lockbox": "Lockboxes for permissionless interop", | ||
"proxy-upgrade": "Contract upgrade" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using
./
in links- this can cause issues when we move files around if the directory structure changes.