Don't miss Build Games$1M Builder Competition

Introduction

Learn how to export your L1's native token to C-Chain as an ERC-20.

Native to ERC-20 Token Bridge

In this section, you'll learn how to export your L1's native token to the C-Chain, where it becomes an ERC-20 token that anyone can trade and use.

The Problem

You've created an L1 with a custom native token (let's call it TEST). Your users want to:

  • Trade TEST on C-Chain DEXs
  • Use TEST in C-Chain DeFi protocols
  • Bridge TEST to other Avalanche L1s

The Solution

Deploy a Native → ERC-20 bridge:

Your L1 (TEST is native)              C-Chain
┌──────────────────────────────┐     ┌──────────────────────────────┐
│                              │     │                              │
│  TEST (Native Gas Token)     │     │  TEST (ERC-20)               │
│       ↓                      │     │       ↑                      │
│  NativeTokenHome  ───────────│─────│  ERC20TokenRemote            │
│  (wraps & locks TEST)        │ ICM │  (mints ERC-20 TEST)         │
│                              │     │                              │
└──────────────────────────────┘     └──────────────────────────────┘

Contracts Involved

ContractChainPurpose
NativeTokenHomeYour L1Wraps native TEST to WTEST, locks when bridging out
ERC20TokenRemoteC-ChainMints ERC-20 TEST when receiving bridge messages
Wrapped Token (WTEST)Your L1ERC-20 wrapper for your native token

Key Difference from Other Chapters

Chapter 1 (ERC-20 → Native)Chapter 2 (Native → ERC-20)Chapter 3 (Native → Native)
DirectionImport to L1Export from L1Import to L1
SourceERC-20 on C-ChainNative on L1Native on C-Chain
ResultNative gas tokenERC-20 on C-ChainNative gas token
Native MinterRequired on L1Not requiredRequired on L1

Prerequisites

For this chapter, you need:

  1. An existing L1 with a custom native token (or create one in this chapter)
  2. A wrapped version of your native token (WTEST)
  3. A relayer running between your L1 and C-Chain

Unlike Chapters 1 and 3, this chapter does not require the Native Minter precompile since we're minting ERC-20 tokens, not native tokens.

Deployment Flow

StepActionChain
1Create L1 with custom native token (or use existing)Fuji (P-Chain)
2Deploy Wrapped Token (WTEST)Your L1
3Set up relayerLocal (Docker)
4Deploy NativeTokenHomeYour L1
5Deploy ERC20TokenRemoteC-Chain
6Register the remoteC-Chain → Your L1
7Bridge TEST → ERC-20Your L1 → C-Chain

What You'll Achieve

By the end of this section:

  • Your L1's native token is available as an ERC-20 on C-Chain
  • Users can bridge TEST from your L1 to C-Chain
  • TEST can be traded on C-Chain DEXs and used in DeFi

Let's get started!

Is this guide helpful?