Developers / Token standards

ERC-20 on Ethereum

Last reviewed 1 December 2026.

Information, not advice. This page describes the ERC-20 standard and official documentation for implementing it. It is not financial, legal, investment, or tax advice, and it is not a recommendation to issue or purchase a token.

Safety: This site will never ask you to enter a seed phrase, private key, or wallet backup. Do not paste signing keys into a browser page you do not control.

EIP-20 is the Ethereum standard for fungible tokens: each unit is interchangeable with every other unit of the same contract. Wallets, exchanges, and other contracts integrate a single interface instead of a custom API per token. ethereum.org's ERC-20 page and OpenZeppelin's ERC-20 guide are the usual official starting points for implementation.

The standard is an interface. It does not, by itself, tell you how supply is created, whether anyone can mint later, or whether transfers can be paused or taxed. Those choices live in the contract you deploy.

The interface

EIP-20 requires these methods and events (Solidity names as in the standard):

  • totalSupply(), balanceOf(address)
  • transfer(address _to, uint256 _value) and transferFrom(address _from, address _to, uint256 _value), each returning a boolean and emitting Transfer
  • approve(address _spender, uint256 _value) and allowance(address _owner, address _spender), with Approval on a successful approve

name, symbol, and decimals are optional in EIP-20. They exist so user interfaces can display amounts. As OpenZeppelin documents, decimals is a display hint: all arithmetic inside the contract is still in integer base units. The default in OpenZeppelin's ERC20 is 18, matching how wei relates to ether. To transfer a display amount of 5 tokens at 18 decimals you send 5 * (10 ** 18) base units.

EIP-20 also notes the well-known approve race: a spender might use the old allowance if you change it in a single approve call. Clients are advised to set an allowance to zero before setting a new non-zero value. The contract itself is not required to enforce that, for compatibility.

OpenZeppelin's implementation

OpenZeppelin Contracts provides ERC20 as an inheritable implementation of the interface plus the optional metadata extensions. Official documentation is clear that you do not deploy a bare ERC20 and expect a usable token: there is no supply until a derived contract mints.

Supply is created with the internal _mint function, which also emits the required Transfer from the zero address. Creating ERC-20 Supply shows the fixed-supply pattern: mint once in the constructor to the deployer. The following snippet is the official illustration from that ERC-20 guide, which OpenZeppelin uses for a hypothetical in-game currency called Gold (GLD):

// contracts/GLDToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract GLDToken is ERC20 {
    constructor(uint256 initialSupply) ERC20("Gold", "GLD") {
        _mint(msg.sender, initialSupply);
    }
}

initialSupply is in base units. If decimals is 18, a display supply of 1,000 tokens is 1000 * (10 ** 18), not 1000.

OpenZeppelin's token documentation also lists official extensions you can compose when you actually need them, including ERC20Burnable, ERC20Capped, ERC20Pausable, ERC20Permit (EIP-2612 allowances by signature), and ERC20Votes. Each extension adds power to whoever is authorized to call it. A pausable or uncapped mintable token is a different trust model from a fixed-supply constructor mint. Our suggestion: if you do not need an extension, leave it out.

Typical tooling and deploy flow

Official Ethereum developer documentation and the OpenZeppelin guides assume a Solidity toolchain you run locally:

  • Foundry (forge to compile and test, cast and forge create or scripts to deploy)
  • Hardhat
  • OpenZeppelin Contracts as a dependency, at a pinned version, imported as in the snippet above

A conservative flow, still staying on official rails:

  1. Write a contract that inherits a pinned OpenZeppelin ERC20 and a supply policy you can explain in one paragraph (for example, constructor mint only).
  2. Add tests that cover mint, transfer, allowance, and any cap or pause logic. Foundry and Hardhat both document unit tests against a local chain.
  3. Deploy first to a public Ethereum test network or a local node, from a key that exists only for that test.
  4. Verify the source on the explorer so that name, symbol, decimals, and the bytecode can be checked against the repository.
  5. Only then consider a mainnet deployment, with the constructor arguments recorded, the compiler version and optimizer settings recorded, and a plan for who holds the deployer key.

This page does not include a mainnet deploy command. Those commands sign with a private key and spend real ether. Use the official Foundry or Hardhat deploy documentation on a machine you control.

After deploy, other contracts move your tokens with transferFrom, which first requires approve. Approving an unknown spender is one of the tricks ethereum.org warns about. Prefer checking the spender address against official project documentation, and use the allowance UI in a wallet you already trust rather than a fresh “claim” site.

The same Solidity source may compile for other EVM chains. The standard name and required methods can still differ — BEP-20 requires symbol and decimals, and TRC-20 has its own deploy toolchain. See those pages rather than copying an Ethereum script unchanged.

Scam red flags

  • A website that asks for a seed phrase to “create your ERC-20” or “verify ownership.”
  • A token that uses a familiar name or symbol at a different contract address than the one published by the issuing project. ethereum.org: symbols are not unique; addresses are.
  • Verified source that includes hidden mint, blacklist, pause, or fee logic not described in the project's own documentation.
  • An unlimited approve requested by a site you arrived at from a chat message or advertisement.
  • “Honey pot” behaviour described by Uniswap Labs: you can buy, but sells revert or face a 100% fee. That is a property of the token contract, not of ERC-20 itself.

See also Liquidity pools for how residual mint authority and removable liquidity are used in rug pulls.

Read next

Token issuance overview · BEP-20 · TRC-20 · Tools

Sources