Unichain Docs

Deploy a SuperchainERC20 Token (Using thirdweb)

Learn how to deploy a SuperchainERC20 token with thirdweb Modular Contracts.

Modular contracts is a framework that enables the creation of highly customizable and upgradeable smart contracts. Designed to encompass a broad number of use cases without compromising on the ease and security of creating smart contracts with thirdweb.

Modular Contracts Overview

Modular contracts are composed of two components:

  • Core Contract: smart contracts that serve as the foundation of the modular contract
  • Module Contract: smart contracts that are installed on top of the core contract

You can think of Modular Contracts like building bricks. Pick a core, install modules, and swap them out to enable different functionality.

We will be using Modular Contracts to deploy our SuperchainERC20-enabled token contract.

Prerequisites

  • thirdweb account: You can create an account here
  • thirdweb Project: You can create a Project by following the guide here

Steps to Deploy

1. Go to the thirdweb Explore page

Explore Page
  • Log into your thirdweb account: Use the same login used when creating your account to log into the thirdweb dashboard
  • Visit the thirdweb Explore page: You can access the contract deployment page in the following ways
    • Clicking into your project -> Selecting Contracts Tab -> Selecting Deploy Contract at the top right
    • Direct through the link here

2. Selecting the Modular Superchain Token Contract

  • Locating the contract in Explore: You can deploy either the Modular Token Drop or Modular Token contract from this section. Click on view all if your preferred contract is not listed
Explore Modular Contracts
  • Understanding the difference between Token and Token Drop: Deploying a token on Unichain with thirdweb is as simple as deploying a smart contract. You can choose between two approaches, dependent on how the token intends to be distributed

  • Use the Token contract when:

    1. You need full control over token minting and distribution
    2. You want to reward users with tokens for specific actions

The Token contract is great for when you don't need pre-defined claim conditions or public distribution mechanisms.

  • Use the Token Drop contract when:
    1. You have a known distribution plan
    2. You want users to claim their distribution

The Token Drop contract offers more structured and controlled token distribution, allowing you to set up complex release strategies.

3. Configuring Contract Metadata

  • Setting contract metadata as well as owner information:
    1. You can set the contract metadata to anything you would like
    2. The owner information should be a wallet you have access to as this will be set as the admin for this contract. By default it is prefilled to the currently logged in wallet address
    3. Primary sales are where funds from sales minus any fees are sent
Contract Metadata
  • Select a Project to add this contract to:
Project Add

4. Choosing the Deployment Network

  • Selecting the Unichain Network you wish to deploy to:
    • Click on the chain to bring up the Chain Search Modal
    • Search for "Unichain"
Unichain Search
  • Select your desired network to deploy on
Deploy Unichain

5. Deploying the Contract

  • Initiating deployment: Click on "Deploy Now" to deploy the contract
  • Signing the transaction (for EOA wallets): If using an EOA wallet for thirdweb login you will be prompted to sign a deploy transaction in your wallet. Once this is approved your contract will deploy
  • Once complete you will have the ability to view your contract which should look similar to below
Contract Overview

6. Minting Tokens

  • Accessing the Modules view: Click on the "Modules" section on the left hand side
Modules View
  • Minting your tokens:
  1. Click on the "Mint NFT" dropdown

  2. Enter the amount of tokens you wish to mint along with the recipient address

Mint Tokens
  1. Click on the "Mint" button to mint your tokens

You have now successfully setup your contract to work with the SuperchainERC20 functionality!

Final Setup

Last updated on

On this page