What is an ERC20 Token?

in erc20 •  7 years ago 

If you aren’t already a fan of Ethereum before reading this article, chances are you will be when you’re done. You see, Ethereum isn’t just a cryptocurrency like Bitcoin or Litecoin. It is an entire platform with upon which other applications can be built. And many of these applications use the ERC20 standard to bring their projects to market. The standard is relatively easy to implement which is why so many ICOs use it to when raising capital. Who knows? This article may inspire you to create your own ERC20 token.

But before we get ahead of ourselves, let’s take a close look at Ethereum and ERC20 tokens to learn how this all actually works.

What Does ERC20 Stand For?
ERC stands for Ethereum Request for Comments. This is the name for the proposed system within Ethereum and 20 was the number of that proposal or request.

What Does ERC20 Do?
ERC20 refers to a technical standard that allows developers to create tokens that are interoperable on the Ethereum platform.

Before the ERC20 standard was created, anyone who wanted to build on the Ethereum platform had to “reinvent the wheel,” so to speak, which meant each contract was slightly different. Practically speaking, this meant that exchanges and wallets had to write custom code to support each token.

Today, with ERC20, exchanges and wallets only have to implement this code once in order to support the various coins. This is why, MyEtherWallet, for example, can support any ERC20 compliant token without having to be updated. In Exodus wallet, your ERC20 tokens share the same receiving address as your Ethereum address. That is because these tokens live on the Ethereum blockchain. They are not independent of Ethereum and rely on the platform.

That said, many of projects that initially start as ERC20 tokens eventually migrate to their own platform. At that time, the ERC20 token needs to be swapped for the new token or coin on the project’s mainnet. Of course, some tokens are specifically used for DApps (decentralized applications) to be used on the Ethereum network in the future so those remain as ERC20 tokens.

Already there are tons of ERC20 tokens — in fact, the vast majority of tokens on the market are ERC20 tokens. Here is a list of ERC20 tokens via Etherscan.io. Or you can go to CoinMarketCap.com and sort the token list by platform.

How Does the Standard Work?
ERC20 defines guidelines for Ethereum tokens to follow within the larger Ethereum ecosystem, allowing developers to accurately predict the interaction between tokens. These guidelines are largely a set of functions the public can use in order to interact with that coins. The functions in include how the tokens are transferred between addresses and how data within each token is accessed. Because these functions can be identified by other smart contracts, the interaction between tokens is seamless.

Let’s take a look at these functions. First, there are three optional features one can include:

  1. Name
  2. Symbol
  3. The number of decimals which indicates how divisible the token will be. Most will have 18 decimals like Ether (the native token of the Ethereum network.)

The six mandatory functions of an ERC20 token are:

  1. TotalSupply — when this limit is reached, the smart contract will refuse to create new tokens.
  2. BalanceOf — indicates the number of tokens a given address has.
  3. Transfer — takes a certain amount of tokens FROM the total supply and give them to a user.
  4. Transferfrom — which can be used to transfer tokens from any 2 users who have them.
  5. Approve — verifies that your contract can give a certain amount of tokens to a user taking the total supply into account.
  6. Allowance — checks whether one user has a sufficient amount of tokens to send to someone else.

Two events that are triggered when a contract takes a relevant action are:

  1. Transfer — broadcasts the details coins moving from one contract to another onto the network
  2. Approval — broadcasts the details of approvals of tokens from one address to another onto the network

An ERC20 token is generated by a set of smart contracts. Every transaction, therefore, goes through the smart contract. Outside of the ERC20 standards, developers can build more functions for the token in the smart contract. For example, token smart contracts can be programmed to have a lock-up period for the token before they become transferable. Or the smart contract can even be programmed to “mine” new tokens under certain conditions. The creation of new ERC20 tokens — adding to the token supply — can be done by virtue of issuing the smart contract code. This is referred to as “minting” (a term applied to the same process on other platforms as well.)

A Word of Caution For Investors
Of course, there are 2 sides to every token. With all of these functions and events defined for tokens in advance, it becomes very easy for a developer to create new tokens upon the Ethereum blockchain. That is why the vast amount of ICOs are built on Ethereum. Since it’s so easy to create a token and market it, little technical skill is required. Please keep this in mind when reviewing an ICO or existing token projects before investing. Be sure and determine what the project is doing above and beyond just creating a token. What is the token’s functionality in and out of the ecosystem? Will it provide a DApp? How realistic is it that this team will be able to fully develop the project? There are more skills required than just implementing the base token.

Conclusion
With all of these functions and events defined for tokens in advance, it becomes very easy for a developer to create new tokens upon the Ethereum blockchain. Speaking the same language via the use of ERC20 technical specifications saves a lot of time and resources. And it makes it easier for wallets to accept these tokens. Are you ready to create your own token now?

Disclaimer:
This article was written to the best of our knowledge with the information available to us. We do not guarantee that every bit of information is completely accurate or up-to-date. Please use this information as a complement to your own research. Nothing we write in any of our articles is intended as investment advice nor as an endorsement to buy/sell/hold anything. Cryptocurrency investments are inherently risky so you should never invest more than you can afford to lose.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:
https://blockgeeks.com/guides/ethereum-token/