Brought to you by the Liquid team to help you make sense of crypto.
ERC-20 tokens are unique tokens issued on the Ethereum network. They follow a set of standardized conventions that allow for streamlined wallet and exchange support, and they’ve become the de facto standard for projects looking to do ICO crowdfunding. In this article, we'll get to the heart of what ERC-20 tokens are all about.What is Ethereum?
Ethereum is an open-source blockchain platform designed for distributed computing through execution of smart contracts. It allows developers to run DApps (decentralized applications) powered by the network’s computational resources. Interacting with the Ethereum blockchain requires users to pay transaction fees in the form of Ether (ETH), the second largest cryptocurrency in existence today.
While the Ethereum Foundation has lofty goals for the project, Ethereum’s most popular use case over the last few years has undoubtedly been ICO crowdfunding. An ICO, short for “initial coin offering,” is a process where a developer can use a smart contract to generate a unique token on the Ethereum blockchain. These tokens are then typically sold to the public in exchange for ETH. At this point, the developer can sell the collected ETH for fiat to fund development of his or her project, while ICO participants hold onto the tokens with the hope of selling them for a higher price in the future. For example, OmiseGo, Augur, and Populous, three Ethereum-based ICOs, all saw exponential price appreciation exceeding 3,000% during 2017’s speculative bull market.
The ERC-20 Token Standard
ERC, short for “Ethereum Request for Comments”, is a process to propose new standards in the Ethereum ecosystem. A developer can create an ERC to discuss with the larger community. If the ERC is widely accepted, it may eventually be standardized into the Ethereum protocol through a process called Ethereum Improvement Proposal (EIP). When an ERC is opened, it is assigned a reference number. Thus, ERC-20 is simply the 20th ERC, and it specifies the technical standards to follow when writing a token contract to issue tokens on the Ethereum network. Even though ERC-20 was officially formalized as EIP-20 in September 2017, the Ethereum community still refers to issued tokens as “ERC-20 tokens” and not “EIP-20 tokens”.
To understand the ERC-20 token standard better, let’s take a look at the required functions and events inside an ERC-20 compliant token contract.
function name() view returns (string name)
This function returns the name of a token - eg Lendingblock, Zebi, etc.
function symbol() view returns (string symbol)
This function returns the ticker symbol of a token - eg LND, ZCO, etc.
function decimals() view returns (uint8 decimals)
This function returns the number of decimals used by a token.
function totalSupply() view returns (uint256 totalSupply)
This function returns a token’s total supply.
function balanceOf(address _owner) view returns (uint256 balance)
This function returns the token balance of an address.
function transfer(address _to, uint256 _value) returns (bool success)
This function transfers a number of tokens to an address, and is designed to terminate if the originating address does not have enough tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) returns (bool success)
This function allows a smart contract to transfer tokens on your behalf, and is designed to terminate if the _from account has not been authorized by the sender to perform such an action.
function approve(address _spender, uint256 _value) returns (bool success)
This function allows a _spender address to withdraw up to a certain _value of tokens from your address. The _approve function can be used to authorize a smart contract address to use the transferFrom function.
function allowance(address _owner, address _spender) view returns (uint256 remaining)
This function returns the number of tokens an address is able to transfer to another address.
event Transfer(address indexed _from, address indexed _to, uint256 _value)
This event MUST be triggered when tokens are transferred from one address to another. This includes zero value transfer as well.
event Approval(address indexed _owner, address indexed _spender, uint256 _value)
This event MUST be triggered when approval is granted to move tokens from one address to another.
With the above functions and events, an ERC-20 compliant token contract can easily be created for ICO crowdfunding purposes. If you’re not a developer, there are even websites like Hexel that can help you issue ERC-20 tokens. With that said, it's not recommend to use a website like this for a serious project. If you’re looking to crowdfund via an ICO, having a developer onboard with the skills to write a secure ERC-20 token contract from scratch can be a wise move.
The Relationship Between ETH and ERC-20 Tokens
ETH is Ethereum’s network utility token. It’s used as a form of payment for smart contract execution on the platform, and is currently the second largest cryptocurrency in market cap behind Bitcoin.
Due to it popularity, ETH has gained support from many cryptocurrency exchanges, wallets, and services. Since ERC-20 tokens are issued on the Ethereum blockchain, they can be sent to any Ethereum address and stored in most ETH wallets. Furthermore, exchanges that have implemented the Ethereum blockchain can easily add support for ERC-20 token trading on their platform with minimal effort. ERC-20’s ease of use has resulted in it becoming the standard for holding ICO crowdsales.
Notable Examples of ERC-20 Tokens
According to Etherscan, there are a total of 106,174 ERC-20 tokens on the market today. While most of these tokens can likely be attributed to hobbyist or failed projects, there are many notable ERC-20 tokens on the list as well. A few examples of successful ERC-20 tokens are OMG, ZRX, GNT and ZIL.
ERC-223, ERC-721, and ERC-777
While ERC-20 is currently the default token standard for most cryptocurrency projects using the ICO funding model, a number of updated ERCs have been proposed as improvements or alternatives to the tried and tested ERC-20 standard.
ERC-223 Token Standard
ERC-223 is an Ethereum token standard that focuses on making token transfers safer, while maintaining backwards-compatibility with ERC-20 contracts. The design of the current ERC-20 standard has resulted in a significant amount of lost funds due to ERC-20 contracts not being able to recognize incoming token transfers.
- 154, 834 lost EOS in the EOS ERC-20 contract address.
- 22, 293 lost QTUM in the QTUM ERC-20 contract address.
- 342, 446 lost GNT in the Golem ERC-20 contract address.
Since the ERC-20 standard doesn’t have any withdrawal function, these tokens will forever be stuck in the contract unable to be returned to their original owners. ERC-223 aims to solve this problem by allowing token transfers to occur over the normal _transfer function instead of the two-step _transferFrom and _approve process.
ERC-721 Token Standard
ERC-721 is an Ethereum token standard proposed by Dieter Shirley that is designed to issue non-fungible tokens. A fungible asset is one where every unit is interchangeable. For example, 1 kg of gold can always be swapped with another 1 kg of gold without affecting value. On the other hand, a Toyota Camry and Honda Civic are not fungible even though they are both cars. ERC-721 tokens exhibit non-fungibility and can be used to digitize collectibles. Thus, the value of an ERC-721 token is derived from its rarity.
ERC-777 Token Standard
ERC-777 is an Ethereum token standard created by Jordi Baylina, Jacques Dafflon, and Thomas Shababi. Developers can incorporate the new standard if they wish to do so. ERC-777 is designed to be backwards-compatible with ERC-20, and streamlines the current two-step transfer process into one direct transfer, ultimately resulting in reduced transaction fees. ERC-777 also supports “hooks”, which can be used to specify a transaction’s parameters. In practice, hooks can be used for tasks like activating push notifications to be transmitted to the recipient and sender, and automatically allocating and sending a percentage of the transaction to a separate address.
Token swaps and the future of Ethereum
Over the last few months, many projects that originally sold ERC-20 tokens during their ICOs have completed their respective token swaps. Once a project’s own blockchain is ready for launch, a token swap is initiated whereby ERC-20 tokens are swapped 1:1 with “mainnet tokens” that can be utilized on the newly launched blockchain.
EOS, TRON, and QTUM are three notable projects that have recently completed their mainnet token swaps. On a macro scale, this can be seen as value and liquidity moving out of the Ethereum ecosystem as projects move from ERC-20 tokens to their own mainnet blockchains. Since Ethereum’s main real world and use case at the moment is ICO crowdfunding, it’ll be interesting to see how the Ethereum Foundation will innovate over the next few years.
This content is not financial advice and should not form the basis of any financial investment decisions nor be seen as a recommendation to buy or sell any good or product. Trading cryptocurrency is complex and comes with a high risk of losing money, particularly if you trade on leverage. You should carefully consider whether trading cryptocurrencies is right for you and take the time to learn how trading works and decide how much money you are prepared to lose.
Providing liquidity for the crypto economy.