Shardeum Documentation

Using Remix

What is an ERC-20 Token?

ERC-20 is a widely adopted token standard originally defined for Ethereum-compatible blockchains. 'ERC' stands for 'Ethereum Request for Comment. It specifies a common set of functions and events that enable tokens to be transferred, approved, and integrated seamlessly across wallets, exchanges, and applications.

Because Shardeum is EVM-compatible, smart contracts that follow the ERC-20 standard can be deployed and used on Shardeum without modification.

At a minimum, an ERC-20 token exposes the following core functionality:

  1. totalSupply
  2. balanceOf
  3. allowance
  4. transfer
  5. approve
  6. transferFrom

Deployment Guide

This guide walks through deploying a simple ERC-20 token on Shardeum using Remix IDE and MetaMask. It is intended as a reference for developers who want a quick, browser-based way to deploy contracts on Shardeum testnet or mainnet.

For production workflows, automated deployments, or advanced testing, refer to the Hardhat and Foundry guides. These functions ensure consistent behavior across tooling such as wallets, explorers, and dApps.

Prerequisites

Before continuing, ensure you have:

  • MetaMask or other EVM-compatible wallets installed and set up
  • A Shardeum network added to MetaMask
  • SHM tokens available to pay for transaction fees

Add Shardeum Network to Metamask

Connect MetaMask to Shardeum testnet by following the instructions here:

Connect Metamask to Shardeum

Once connected, claim test SHM from a faucet to cover deployment gas fees:

Claim SHM from faucet

Writing the ERC-20 Contract

Open Remix IDE and create a new file named 'ShardeumERC20Token.sol' (you can name it anything you want). And, in the contract, paste the following code:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
 
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
 
contract ShardeumERC20Token is ERC20 {
    constructor(string memory name_, string memory symbol_) ERC20(name_, symbol_) {
        _mint(msg.sender, 10_000 * 10 ** decimals());
    }
}

Code explanation in brief for reference:

  1. pragma solidity ^0.8.0 – Specifies that the contract uses Solidity version 0.8.x or higher.
  2. import..ERC20.sol – Imports the standard ERC-20 implementation from OpenZeppelin.
  3. contract ShardeumERC20Token is ERC20 – Declares a new ERC-20 token contract that inherits OpenZeppelin’s implementation.
  4. constructor – Runs once at deployment and sets the token name and symbol.
  5. _mint – Mints a fixed supply of tokens to the deployer’s address.
  6. **10_000 * 10 ** decimals() – Mints 10,000 full tokens using the standard ERC-20 decimal precision.

Compiling the Contract

  1. Open the Solidity Compiler tab in Remix
  2. Select the appropriate compiler version (≥ 0.8.0)
  3. Click Compile ShardeumERC20Token.sol

mint_your_own_crypto_1

Deploying the Contract

Let's deploy a fixed supply of 10000 Tokens (You can change it to another supply at the code level).

Note: Some screenshots may reference legacy test networks such as Sphinx or Liberty. Always ensure MetaMask is connected to the Shardeum network you intend to deploy to.

  1. Open the Deploy & Run Transactions tab
  2. Set Environment to Injected Provider - MetaMask
  3. Confirm MetaMask is connected to the correct Shardeum network
  4. Select ShardeumERC20Token from the contract dropdown
  5. Enter values for:
    • name_ (e.g., Vaiju's ERC20 Token)
    • symbol_ (e.g., VSHM)

mint_your_own_crypto_2

Proceed to click 'Transact' or 'Deploy' and approve the transaction in 'Metamask' to deploy your contract!

mint_your_own_crypto_3

You have now successfully deployed ERC-20 Token on Shardeum testnet!

mint_your_own_crypto_4

Copy the contract address and search for it on a Shardeum explorer:

On this page