Skip to content

Commit 0fc2e4e

Browse files
committed
Lint
1 parent 91febcf commit 0fc2e4e

File tree

2 files changed

+34
-42
lines changed

2 files changed

+34
-42
lines changed

pages/stack/interop/tutorials/custom-superchain-erc20.mdx

+34-39
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import { Callout } from 'nextra/components'
88
import { Steps } from 'nextra/components'
99

1010
<Callout>
11-
The SuperchainERC20 standard is ready for production use with active Mainnet deployments.
12-
Please note that the OP Stack interoperability upgrade, required for crosschain messaging, is currently still in active development.
11+
The SuperchainERC20 standard is ready for production use with active Mainnet deployments.
12+
Please note that the OP Stack interoperability upgrade, required for crosschain messaging, is currently still in active development.
1313
</Callout>
1414

1515
# Creating custom SuperchainERC20 tokens
1616

1717
## Overview
1818

19-
This guide explains how to modify the behavior of [`SuperchainERC20`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainERC20.sol) contracts to create custom tokens that 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).
19+
This guide explains how to modify the behavior of [`SuperchainERC20`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainERC20.sol) contracts to create custom tokens that 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).
2020
For more information on how it works, [see the explainer](/stack/interop/superchain-erc20).
2121

2222
To ensure fungibility across chains, `SuperchainERC20` assets *must* have the same contract address on all chains.
@@ -30,7 +30,7 @@ Here we will use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit).
3030

3131
### What you'll learn
3232

33-
* How to deploy custom ERC-20 tokens on different chains at the same address so that they can be bridged with the [`SuperchainTokenBridge` ](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainTokenBridge.sol) contract.
33+
* How to deploy custom ERC-20 tokens on different chains at the same address so that they can be bridged with the [`SuperchainTokenBridge`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/SuperchainTokenBridge.sol) contract.
3434

3535
## Prerequisites
3636

@@ -56,17 +56,16 @@ The tutorial uses these primary tools:
5656
## Step by step explanation
5757

5858
<Steps>
59-
6059
### Prepare for deployment
6160

62-
1. Follow the setup steps in the [SuperchainERC20 Starter Kit](/app-developers/starter-kit#setup).
63-
Don't start the development environment (step 5).
61+
1. Follow the setup steps in the [SuperchainERC20 Starter Kit](/app-developers/starter-kit#setup).
62+
Don't start the development environment (step 5).
6463

65-
1. Follow [the deployment preparations steps](./deploy-superchain-erc20#prepare-for-deployment) in the issuing new assets page.
66-
Don't deploy the contracts yet.
64+
2. Follow [the deployment preparations steps](./deploy-superchain-erc20#prepare-for-deployment) in the issuing new assets page.
65+
Don't deploy the contracts yet.
6766

68-
**Note:** Make sure to specify a previously unused value for the salt, for example your address and a timestamp.
69-
This is necessary because if the same constructor code is used with the same salt when using the deployment script, it gets the same address, which is a problem if you want a fresh deployment.
67+
**Note:** Make sure to specify a previously unused value for the salt, for example your address and a timestamp.
68+
This is necessary because if the same constructor code is used with the same salt when using the deployment script, it gets the same address, which is a problem if you want a fresh deployment.
7069

7170
### Create the custom contract
7271

@@ -77,49 +76,46 @@ The tutorial uses these primary tools:
7776
```
7877

7978
<details>
80-
8179
<summary>Explanation</summary>
8280

8381
```typescript file=<rootDir>/public/tutorials/CustomSuperchainToken.sol#L36-L38 hash=4e402ea88c9cd796500425172a6de16d
8482
```
8583

8684
This function lets users get tokens for themselves.
8785
This token is for testing purposes, so it is useful for users to get their own tokens to run tests.
88-
8986
</details>
9087

9188
### Deploy the new token
9289

93-
1. Edit `packages/contracts/scripts/SuperchainERC20Deployer.s.sol`:
90+
1. Edit `packages/contracts/scripts/SuperchainERC20Deployer.s.sol`:
9491

95-
- Change line 6 to import the new token.
92+
* Change line 6 to import the new token.
9693

97-
```solidity
98-
import {CustomSuperchainToken} from "../src/CustomSuperchainToken.sol";
99-
```
94+
```solidity
95+
import {CustomSuperchainToken} from "../src/CustomSuperchainToken.sol";
96+
```
10097

101-
- Change lines 52-54 to get the `CustomSuperchainToken` initialization code.
98+
* Change lines 52-54 to get the `CustomSuperchainToken` initialization code.
10299

103-
```solidity
104-
bytes memory initCode = abi.encodePacked(
105-
type(CustomSuperchainToken).creationCode, abi.encode(ownerAddr_, name, symbol, uint8(decimals))
106-
);
107-
```
100+
```solidity
101+
bytes memory initCode = abi.encodePacked(
102+
type(CustomSuperchainToken).creationCode, abi.encode(ownerAddr_, name, symbol, uint8(decimals))
103+
);
104+
```
108105

109-
- Change line 62 to deploy a `CustomSuperchainToken` contract.
106+
* Change line 62 to deploy a `CustomSuperchainToken` contract.
110107

111-
```solidity
112-
addr_ = address(new CustomSuperchainToken{salt: _implSalt()}(ownerAddr_, name, symbol, uint8(decimals)));
113-
```
108+
```solidity
109+
addr_ = address(new CustomSuperchainToken{salt: _implSalt()}(ownerAddr_, name, symbol, uint8(decimals)));
110+
```
114111

115-
1. Deploy the token contract.
112+
2. Deploy the token contract.
116113

117-
```sh
118-
pnpm contracts:deploy:token
119-
```
114+
```sh
115+
pnpm contracts:deploy:token
116+
```
120117

121118
<details>
122-
123119
<summary>Sanity check</summary>
124120

125121
1. Set `TOKEN_ADDRESS` to the address where the token is deployed.
@@ -129,35 +125,33 @@ The tutorial uses these primary tools:
129125
TOKEN_ADDRESS=0xF3Ce0794cB4Ef75A902e07e5D2b75E4D71495ee8
130126
```
131127

132-
1. Source the `.env` file to get the private key and the address to which it corresponds.
128+
2. Source the `.env` file to get the private key and the address to which it corresponds.
133129

134130
```sh
135131
. packages/contracts/.env
136132
MY_ADDRESS=`cast wallet address $DEPLOYER_PRIVATE_KEY`
137133
```
138134

139-
1. Set variables for the RPC URLs.
135+
3. Set variables for the RPC URLs.
140136

141137
```sh
142138
RPC_DEV0=https://interop-alpha-0.optimism.io
143139
RPC_DEV1=https://interop-alpha-1.optimism.io
144140
```
145141

146-
1. Get your current balance (it should be zero).
142+
4. Get your current balance (it should be zero).
147143

148144
```sh
149145
cast call --rpc-url $RPC_DEV0 $TOKEN_ADDRESS "balanceOf(address)" $MY_ADDRESS | cast to-dec | cast --from-wei
150146
```
151147

152-
1. Call the faucet to get a token and check the balance again.
148+
5. Call the faucet to get a token and check the balance again.
153149

154150
```sh
155151
cast send --private-key $DEPLOYER_PRIVATE_KEY --rpc-url $RPC_DEV0 $TOKEN_ADDRESS "faucet()"
156152
cast call --rpc-url $RPC_DEV0 $TOKEN_ADDRESS "balanceOf(address)" $MY_ADDRESS | cast to-dec | cast --from-wei
157153
```
158-
159154
</details>
160-
161155
</Steps>
162156

163157
## How does this work?
@@ -168,6 +162,7 @@ You can either use [the `SuperchainERC20` implementation](https://github.com/eth
168162
For more details [see the explainer](../superchain-erc20).
169163

170164
## Next steps
165+
171166
* Use the [SuperchainERC20 Starter Kit](/app-developers/starter-kit) to deploy your token across the Superchain.
172167
* Explore the [SuperchainERC20 specifications](https://specs.optimism.io/interop/token-bridging.html) for in-depth implementation details.
173168
* Review the [Superchain Interop Explainer](../explainer) for answers to common questions about interoperability.

words.txt

-3
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ dripcheck
107107
Drippie
108108
Eigen
109109
EIPs
110-
emmited
111110
ENABLEDEPRECATEDPERSONAL
112111
enabledeprecatedpersonal
113112
enginekind
@@ -237,7 +236,6 @@ multichain
237236
multiclient
238237
multisigs
239238
MULTU
240-
neccessary
241239
nethermind
242240
NETRESTRICT
243241
netrestrict
@@ -420,7 +418,6 @@ undercollateralize
420418
Unichain
421419
unmetered
422420
Unprotect
423-
unqiue
424421
unsubmitted
425422
UPNP
426423
VERKLE

0 commit comments

Comments
 (0)