How to Create an ERC-20 Token, Step by Step
An ERC-20 token is a standard token on Ethereum that wallets and exchanges all support. Learn the decisions, the steps and the costs of creating one.
On this page
Short answer
An ERC-20 token is a digital asset on the Ethereum blockchain that follows a shared set of rules, so wallets, exchanges and apps all know how to hold it, send it and check its balance. You create one by writing a smart contract that follows the standard, testing it, auditing it, and deploying it to the chain you chose.
What is an ERC-20 token?
An ERC-20 token is a digital asset on the Ethereum blockchain that follows a shared set of rules, called the ERC-20 standard, so that wallets, exchanges and apps all know how to hold it, send it and check its balance.
The standard defines a small set of functions every ERC-20 token must have: a name, a symbol, a total supply, a way to check a balance, and a way to transfer tokens or approve someone else to spend them. Because every token follows the same rules, a wallet that works with one ERC-20 token works with all of them.
Three ideas sit at the centre of it:
- Fungibility. Every token is identical to every other token of the same kind, like coins of the same value.
- Compatibility. Wallets, exchanges and apps can support the token without custom work.
- Programmability. The token is a smart contract, so its rules can be extended with features such as minting limits or transfer fees.
ERC-20 tokens are used for loyalty points, in-game currency, governance votes, stablecoins and fundraising. The token itself is simple. The hard part is deciding what the token is for, who can mint it, and how it will be used. A team that builds tokens usually starts from smart contract development patterns, since the token is a contract first.
What do you need to decide before you start?
Before you write any code, you need to decide the token's name, symbol, total supply, decimal places and who controls minting, because these choices are hard to change after the token is deployed.
| Decision | What it means | Common choice |
|---|---|---|
| Name | The full name shown in wallets | Your product or project name |
| Symbol | The short code, usually 3-5 letters | A short version of the name |
| Total supply | How many tokens will ever exist | Fixed at launch, or capped |
| Decimals | How finely a token can be split | 18, the usual default |
| Minting control | Who can create new tokens | Nobody, or a named address |
| Network | Which chain the token lives on | Ethereum mainnet or a layer 2 |
Decimals deserve a careful look. With 18 decimals, one token can be split into a billion billion parts, which suits a token that will be traded in tiny amounts. A loyalty token used in whole units may be simpler with fewer decimals, but changing decimals later means a new contract.
Minting control is the decision that matters most for trust. A contract that lets one address mint new tokens at will can dilute every holder. Many teams set a fixed supply at launch, or put minting behind a multi-signature wallet, so no single person can change the supply alone.
How do you create an ERC-20 token?
You create an ERC-20 token by writing a smart contract that follows the standard, testing it on a test network, auditing it, and deploying it to the chain you chose.
The usual sequence is:
- Write the contract. Use a tested, open-source implementation of the ERC-20 standard as the base, and add only the features you need.
- Set the token details. Put in the name, symbol, total supply and decimals you decided earlier.
- Test on a test network. Deploy to a test network and try every function: transfers, approvals, minting and any extra features.
- Get an audit. Have the contract reviewed by a smart contract audit team before real value is involved.
- Deploy to the main network. Deploy the contract, pay the network fee, and record the contract address.
- Verify and publish. Publish the contract source so anyone can check it, and share the address with wallets and exchanges.
Do not write the standard from scratch. Tested implementations have been used by thousands of tokens and reviewed by many auditors, while a hand-written version can hide a bug that only appears after deployment. The code is the easy part. The decisions around supply, control and use are what decide whether the token works.
How much does it cost to create an ERC-20 token?
Creating an ERC-20 token costs a network fee to deploy the contract, plus the cost of testing and, for any token that will hold real value, an audit. The network fee varies with congestion and the price of the network's native currency, so check the current fee before you deploy.
The main costs are:
- Deployment fee. Paid in the network's native currency when the contract is deployed. It is usually a small, one-off cost.
- Testing time. Writing tests and running them on a test network costs time, not money, but it is the step that catches most bugs.
- Audit. A professional review of the contract. Prices vary widely, so ask for a quote from the audit team; see vendor site for current rates.
- Ongoing costs. Transfers and other actions cost network fees, paid by whoever sends the transaction.
Deploying on a layer 2 network is usually cheaper than on the Ethereum mainnet, which is why many new tokens start there. The trade-off is that fewer wallets and exchanges support the token at first, so the choice depends on who will use it. A blockchain development team can help weigh the network choice against the audience.
Example (hypothetical): a coffee chain creates a loyalty token
Example (hypothetical): a coffee chain with 40 shops wants a loyalty token that customers earn when they buy coffee and spend on free drinks.
The chain creates a token called Bean, symbol BEAN, with a fixed total supply of 10,000,000 tokens and 18 decimals. It sets aside 20% of the supply, which is 2,000,000 tokens, for rewards over the first two years, and keeps the rest in a company wallet for later use.
In the first month, 1,000 customers each earn 50 tokens, so 50,000 tokens are distributed in total. One customer who buys a coffee every weekday earns 50 tokens in the month, and a free drink costs 200 tokens, so that customer needs four months of regular visits to earn one free drink. The numbers add up: 1,000 customers times 50 tokens equals 50,000 tokens.
The chain also sets a rule: no new tokens can ever be minted, so the 10,000,000 supply is fixed. Customers can see the supply in any wallet, which makes the promise easy to check. The token has no cash value outside the chain, and the chain says so in its terms, so nobody mistakes it for an investment.
What are the risks and limits?
The main risks of creating an ERC-20 token are contract bugs, unclear legal status, loss of the controlling keys and the fact that a token with no use will not gain value just because it exists.
Contract bugs are the first risk. Once a contract is deployed, it cannot easily be changed. A bug in the transfer or minting logic can let tokens be created or stolen, and the loss is usually final. Testing and an audit reduce this risk, but they do not remove it.
The second risk is regulation. In many places a token that is sold to raise money, or that promises a return, can count as a security, which brings registration and disclosure rules. Teams that skip legal advice can be fined or shut down, and holders can be left with tokens they cannot trade.
Key loss is the third risk. If the address that controls minting or upgrades loses its keys, those functions are gone for good. Many teams use a multi-signature wallet so that no single lost key can lock the token.
Finally, a token is not a business. A loyalty token, a governance token or a game currency only works if the product behind it is useful. A token with no use will not gain value, however well the contract is written. A crypto wallet development team can help with the wallet side, but the use case comes first.
What are the common mistakes?
The most common mistakes when creating an ERC-20 token are writing the standard from scratch, skipping the audit, and leaving minting control in one person's hands.
- Writing the standard by hand. Use a tested implementation. Hand-written token code is where most bugs live.
- Skipping the audit. Any token that will hold real value should be reviewed before deployment, not after a problem appears.
- One key controls minting. Use a fixed supply or a multi-signature wallet, so no single person can dilute holders.
- No clear use. A token needs a job: loyalty, voting, payment or access. Without one, it has no reason to exist.
- Promising returns. Saying a token will rise in value can turn it into a security and bring legal trouble.
Start on a test network. Deploy the contract, try every function, break it on purpose, and fix what you find. Only when the tests pass and the audit is done should the token go live. That sequence costs time, but it costs far less than fixing a live contract.
Key takeaways
- ERC-20 is a shared standard, so any wallet or exchange can support the token
- Decide name, symbol, supply, decimals and minting control before you write code
- Use a tested implementation, test on a test network, and audit before deploying
- Costs are a deployment fee plus testing and an audit, with fees varying by network
- A token with no clear use will not gain value, however well the contract is written
Frequently asked questions
What does ERC-20 stand for?
ERC-20 stands for Ethereum Request for Comments 20, a proposal that set the standard rules for tokens on Ethereum. It defines the functions a token contract must have, such as checking balances, transferring tokens and approving spending by another address.
Do I need to know how to code to create a token?
Yes, unless you use a no-code token tool. Writing the contract needs basic Solidity skills, but the standard implementations are short and well documented. Most teams use a tested base contract and add only the features they need.
How long does it take to create an ERC-20 token?
The contract itself can be written and deployed in a day. Testing, audit and legal review take longer, often weeks. A token that will hold real value should not skip those steps, since a bug or a legal problem after launch is hard to fix.
Can I change the token after it is deployed?
Usually not. A standard ERC-20 contract is fixed once deployed, so the supply, name and rules cannot be changed. Some contracts add upgrade features, but those add risk and complexity, so most teams choose a fixed contract and get it right first.
What is the difference between ERC-20 and ERC-721?
ERC-20 tokens are fungible, meaning every token is identical to every other one, like coins. ERC-721 tokens are non-fungible, meaning each one is unique, which is why they are used for collectibles and art rather than currency or points.
Where can people see my token after deployment?
Once deployed, the token appears on block explorers under its contract address, and wallets can add it by that address. Exchanges list tokens on their own terms, and most want to see an audit, a clear use case and real trading interest first.