Skip to content

Commit

Permalink
Merge pull request inkonchain#303 from inkonchain/docs/add-superchain…
Browse files Browse the repository at this point in the history
…erc20-tutorial

docs: add superchainerc20 tutorial
  • Loading branch information
eitjuh authored Dec 24, 2024
2 parents e98f6ba + 23457aa commit f7b6b18
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/pages/build/tutorials.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ Welcome to the tutorials section! Here you'll find step-by-step guides to help y
- [Deploying a Smart Contract with Remix](/build/tutorials/deploying-a-smart-contract/remix)
- [Verifying a Smart Contract](/build/tutorials/verify-smart-contract)
- [Shipping a Superchain App](/build/tutorials/shipping-on-the-superchain)
- [Deploying a SuperchainERC20](/build/tutorials/deploying-a-superchainerc20)
7 changes: 4 additions & 3 deletions src/pages/build/tutorials/_meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"deploying-a-smart-contract": "Deploying a Smart Contract",
"verify-smart-contract": "Verifying a Smart Contract",
"shipping-on-the-superchain": "Shipping on the Superchain"
"deploying-a-smart-contract": "Deploying a Smart Contract",
"verify-smart-contract": "Verifying a Smart Contract",
"shipping-on-the-superchain": "Shipping on the Superchain",
"deploying-a-superchainerc20": "Deploying a SuperchainERC20"
}
69 changes: 69 additions & 0 deletions src/pages/build/tutorials/deploying-a-superchainerc20.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Deploying a SuperchainERC20

This guide will walk you through deploying your own ERC20 token across the OP Superchain using the SuperchainERC20 starter kit.

## 🚀 Getting Started

### Prerequisites

First, you'll need to install Foundry, as the project requires `anvil`. Follow the [Foundry installation guide](https://book.getfoundry.sh/getting-started/installation).

### Setup Steps

1. **Clone the repository**
```sh
git clone git@github.com:ethereum-optimism/superchainerc20-starter.git
cd superchainerc20-starter
```

2. **Install dependencies**
```sh
pnpm i
```

3. **Set up environment files**
```sh
pnpm init:env
```

4. **Start the development environment**
```sh
pnpm dev
```

5. **Update RPC URLs**
```sh
pnpm contracts:update:rpcs
```

6. **Configure deployment settings**
Create or update your deployment configuration file:
```toml
[deploy_config]
salt = "ethers phoenix"
chains = ["sepolia/ink"]

[token]
owner_address = "<YOUR ADDRESS>" # Your wallet address
name = "<YOUR TOKEN NAME>" # The name of your token
symbol = "<YOUR TOKEN SYMBOL>" # Your token's symbol (e.g., "OPT")
decimals = 18 # Number of decimal places (18 is standard)
```
Save this to `packages/contracts/configs/deploy-config.toml`

7. **Set up your deployer private key**
```sh
echo 'DEPLOYER_PRIVATE_KEY=<YOUR PRIVATE KEY>' > packages/contracts/.env
```
⚠️ Never share or commit your private key. Make sure your wallet has enough funds for deployment.

8. **Deploy your token**
```sh
pnpm contracts:deploy:token
```

## What's Next?

After successful deployment, your token will be live on the specified chains in your deploy config. You can verify your token on block explorers and start interacting with it!

For troubleshooting or questions, join our [Discord community](http://discord.gg/inkonchain) or check the [SuperchainERC20 Starter Kit repository](https://github.com/ethereum-optimism/superchainerc20-starter).

0 comments on commit f7b6b18

Please sign in to comment.