The Chain logo

Ethereum ERC-20 Tokens — Everything You Need to Know

ERC-20 is one of the most used standards for smart contracts on the Ethereum platform. All ERC-20 tokens are issued to the same standard, allowing them to operate on the Ethereum blockchain.

By RagunathPublished 7 months ago 5 min read
Like

Ethereum and ERC-20 tokens

When Ethereum launched in 2015, it ushered in a new era for blockchain. While previously the technology’s usefulness was primarily limited to cryptocurrencies such as Bitcoin , Ethereum was the first smart contract platform in history and soon became the second largest and most popular cryptocurrency, with a large number of followers and investors seeking buy Ether . The years following its launch saw an explosion of new projects entering the space, fueled by the ERC-20 token development .

All ERC-20 tokens are issued to the same standard, allowing them to operate on the Ethereum blockchain. In this guide, we will cover all the basics related to the ERC-20 token standard and the rules of how a new ERC-20 is issued. We’ll also look at a few of the many current use cases for ERC-20 tokens.

What are ERC-20 tokens and smart contracts?

Like Bitcoin, Ethereum is a blockchain made up of transactions that cover its entire history since the genesis block. The Ethereum Virtual Machine, or EVM, is a different layer of Ethereum. Anyone can programme a smart contract on the Ethereum platform thanks to the EVM.

A smart contract is simply a piece of code written in Solidity, Ethereum’s programming language, that works with “if-this-then-that” logic. It works similar to a vending machine. If you put a coin in a vending machine, you will automatically get a can of soda or a candy bar in return. A smart contract is programmed in a similar way.

ERC-20 is one of the most used standards for smart contracts on the Ethereum platform. The fact that almost all Ethereum tokens are issued to the same standard brings great benefits to users of the Ethereum ecosystem. It means that ERC-20 tokens are interoperable with each other and with any ERC-20 compatible contract, exchange, marketplace or wallet.

This integration capability has acted as a positive reinforcement cycle for Ethereum as the existing ecosystem attracts more developers and users who want to join.

Which guidelines apply to the ERC-20 token standard?

The ERC-20 token generator standard is relatively simple and comprises nine rules for token issuance. Six of them are mandatory and must be applied in all cases. Three are optional, although at least two of them are generally used.

Optional Rules

The three optional rules are:

1. Token name — for example, Maker. Despite being optional, it is almost always used, as token owners want users to be able to identify their tokens.

2. Token Ticker — for example, MKR. Again, it is almost always used as exchanges list token pairs using tickers.

3. Decimal — each ERC-20 token can be denominated in fractional units up to one-eighteenth.

Mandatory rules

Mandatory rules are classified as functions or events. The first two functions do not modify the state of the contract. They define some basic characteristics of the token and, if queried, will return already defined information.

1. TotalSupply — the total number of tokens issued

2. BalanceOf — responds to a query about how many tokens a given address has

Two others are commonly used events and known to all cryptocurrency users.

1. Approving the transfer of tokens in a transaction.

2. Transfer — once approved, this function instructs the contract to move a defined value of tokens from a sender address to a receiver address

Finally, there are two more that may not be implemented, but must be included for the token to comply with the ERC-20 standard.

1. Allocation — ERC-20 allows an address to be programmed with an allocation of tokens to spend that can be sent by the smart contract without any approval. It is effectively a pre-approval to spend an allocation. This function is set to zero by default, but if queried it will return the number of tokens left in the allocation

2. TransferFrom — allows you to schedule a token for automatic payments, starting the Transfer event to move tokens from a subsidy.

Therefore, as long as any Ethereum token implementation adheres to these rules, it will be using the ERC-20 token standard. Token issuers can establish other programming rules that govern the behavior of the tokens. For example, if the founder of a project is crowdfunding with tokens, he can program a smart contract to dispense ERC-20 tokens automatically. When an investor sends a certain amount of ETH from his wallet and deposits it into the smart contract, the smart contract will return the acquired tokens to the investor’s wallet.

Notable Projects Using the ERC-20 Token Standard

However, some of the most well-known and well-used projects in cryptocurrency still operate as ERC-20 tokens and are likely to continue for a long time into the future.

DeFi Tokens

Some of the largest ERC-20 tokens by market capitalization and popularity right now are DeFi tokens. Since Compound debuted its COMP token in the summer of 2020, they have grown in popularity and now offer a variety of services, such as yield generation and governance powers. Since then, others, such as Uniswap ‘s UNI , Sushiswap’s SUSHI, and Yearn’s YFI, have seen similar success.

Utility tokens

Some ERC-20 instances offer utility within a particular project. Numerous use cases for utility tokens have been proposed by blockchain entrepreneurs. For instance, members in the Brave browser advertising ecosystem use the Basic Attention Token (BAT) token.

Finally, it is worth noting that ERC-20 tokens are also compatible with some other platforms. For example, Matic Network is a layer two platform developed to surpass the scalability of Ethereum. It makes use of the Ethereum virtual machine, so it can interoperate with ERC-20 tokens. The ERC-20 ecosystem is therefore even bigger than Ethereum itself, according to this.

Conclusion

ERC-20 tokens are not necessarily perfect, and all smart contracts are only as good as the code they are based on. However, ERC20 development service are typically easy to create, adaptable, and supported by the cryptocurrency community. For that reason, it is safe to assume that ERC-20 will remain the most popular token standard for quite some time.

ethereum
Like

About the Creator

Ragunath

Safe and Secure Blockchain Technology Service Provider

Reader insights

Be the first to share your insights about this piece.

How does it work?

Add your insights

Comments

There are no comments for this story

Be the first to respond and start the conversation.

Sign in to comment

    Find us on social media

    Miscellaneous links

    • Explore
    • Contact
    • Privacy Policy
    • Terms of Use
    • Support

    © 2024 Creatd, Inc. All Rights Reserved.