Create an ERC-20 Token on Avalanche C-Chain

·

Creating your own ERC-20 token is a foundational step for launching decentralized applications, reward systems, or community-driven projects on blockchain networks. With Avalanche’s Ethereum-compatible C-Chain, developers can seamlessly deploy Solidity-based smart contracts—just like on Ethereum—making it easier than ever to build and launch tokens. In this guide, we’ll walk you through the complete process of creating a mintable ERC-20 token on the Avalanche Fuji Testnet, using Remix IDE and Core Wallet.

Whether you're a beginner exploring blockchain development or an experienced developer testing cross-chain functionality, this tutorial provides a clear, step-by-step approach to deploying your first token.


Why Build ERC-20 Tokens on Avalanche?

Avalanche stands out with its high-speed consensus, low transaction fees, and full EVM (Ethereum Virtual Machine) compatibility. This means any contract written in Solidity for Ethereum can be deployed directly on Avalanche’s C-Chain without modification.

Key advantages:

By leveraging these features, developers can rapidly prototype and deploy tokens for testing before going live on mainnet.

Core keywords: ERC-20 token, Avalanche C-Chain, Solidity, Remix IDE, Fuji Testnet, smart contract deployment, token minting


Step 1: Set Up Core Wallet for Testnet

Before deploying any contract, configure your wallet to interact with the Avalanche test environment.

  1. Open Core Wallet.
  2. Navigate to Settings > Advanced.
  3. Enable Testnet Mode.

Once activated, Core automatically switches from Mainnet to the Fuji Testnet, allowing you to test functionalities without spending real funds.

💡 You’ll initially have 0 AVAX balance. Don’t worry—you’ll receive test AVAX shortly.

👉 Learn how to securely manage testnet assets while preparing for real-world deployments.


Step 2: Get Test AVAX from Faucet

To cover gas fees for contract deployment, you need test AVAX on the C-Chain.

Option 1: Use Official Faucet

Visit the Core Testnet Faucet and paste your C-Chain address to request tokens.

Option 2: Request via Guild

If you don’t qualify for the faucet, join the Avalanche Guild community and request a faucet coupon.

Option 3: Discord Support

Reach out in the official Avalanche Discord. Admins and moderators can manually send test AVAX to developers who are unable to access other options.

After receiving funds, verify your balance in Core Wallet under the Avalanche C-Chain section.


Step 3: Write and Compile Your ERC-20 Contract in Remix

We'll use Remix IDE, a browser-based Solidity development environment, to write, compile, and deploy our token.

  1. Open Remix IDE.
  2. Click "Create New File" in the file explorer.
  3. Name the file MyToken.sol.

Now, instead of writing the entire ERC-20 logic from scratch, we’ll use a pre-audited template from OpenZeppelin, a trusted library for secure smart contracts.

Paste this import statement into your file:

import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol";

This imports ERC20PresetMinterPauser.sol, which includes built-in functions for:

No additional coding is required—this preset contract is ready to deploy.

Compile the Contract

  1. Go to the Solidity Compiler tab.
  2. Select a compiler version matching the pragma statement (^0.8.0 or higher). Version 0.8.29 is recommended.
  3. Click Compile MyToken.sol.

If successful, you’ll see no errors and a green checkmark indicating readiness for deployment.


Step 4: Deploy the Token to Avalanche C-Chain

Now that the contract is compiled, it's time to deploy it using Injected Web3 through Core Wallet.

  1. Switch to the Deploy & Run Transactions tab in Remix.
  2. Change environment to Injected Web3.
  3. Confirm connection when prompted by Core Wallet.
  4. From the contract dropdown menu, select ERC20PresetMinterPauser.
  5. Enter your token’s:

    • Name: e.g., TestToken
    • Symbol: e.g., TST

Click Transact.

A confirmation window will appear in Core Wallet. Review details and confirm the transaction.

Once confirmed, your contract is deployed on the Avalanche C-Chain!


Step 5: Verify Deployment on Snowtrace Explorer

To verify success:

  1. Copy the transaction hash from the Remix console.
  2. Paste it into the Snowtrace Testnet Explorer.

Here, you can view:

Save this contract address—you’ll need it to interact with or distribute your token.

👉 Discover advanced tools for monitoring and analyzing deployed contracts across EVM chains.


Step 6: Mint Tokens to Your Wallet

Back in Remix, under Deployed Contracts, locate your token instance.

Find the mint(address to, uint256 amount) function:

  1. Expand it.
  2. Enter your wallet address.
  3. Input amount in wei (e.g., 1000000000000000000000 for 1,000 tokens).

Click Transact and confirm in Core Wallet.

After confirmation, tokens are minted—but they won’t appear in your wallet yet.


Step 7: Add Custom Token to Core Wallet

To see your tokens:

  1. In Core Wallet, go to Avalanche C-Chain.
  2. Click Manage > Add Custom Token.
  3. Paste the token contract address from Snowtrace.
  4. Symbol and decimals will auto-fill.
  5. Click Add Token.

Your balance should now display the newly minted tokens!

You can:


Frequently Asked Questions (FAQ)

Q: Can I deploy this token on Avalanche Mainnet?

Yes. Follow the same steps but disable Testnet Mode in Core and use real AVAX for gas fees.

Q: Is the ERC20PresetMinterPauser contract secure?

It’s developed and audited by OpenZeppelin, one of the most trusted names in smart contract security. However, always audit custom modifications before mainnet deployment.

Q: How do I allow others to mint tokens?

Only the contract owner (deployer) can mint by default. To grant minting rights to others, use the grantRole() function with the MINTER_ROLE hash.

Q: What happens if I lose my private key?

Like all blockchain assets, losing access to your wallet means losing control of your token and contract. Always back up recovery phrases securely.

Q: Can I change the token supply after deployment?

With this preset, you can mint more tokens as needed—but only if you retain ownership. There’s no hard cap unless manually enforced.

Q: Why use Fuji Testnet instead of local testing?

Fuji offers real network conditions with minimal risk, making it ideal for integration testing with wallets, explorers, and bridges.


Final Thoughts

Building an ERC-20 token on Avalanche is fast, affordable, and developer-friendly thanks to EVM compatibility and robust tooling support. From setting up your wallet to minting custom tokens, this workflow empowers anyone to enter the world of decentralized finance and tokenized ecosystems.

As you advance, consider exploring:

The possibilities are limitless when you combine innovation with powerful infrastructure.

👉 Start building the next generation of blockchain applications with confidence and speed.