Trending
Crypto
  • BTC
    16987.94 0.17%
  • ETH
    1254.75 -0.3%
  • SOL
    14.13 2.1%
  • ADA
    0.32 -1.03%
  • AVAX
    13.55 -0.22%
  • DOT
    5.47 -0.44%
  • LTC
    78.69 -1.91%
  • BCH
    111.18 0.52%
  • CRO
    0.07 -3.5%
  • MATIC
    0.91 -0.63%
  • LINK
    7.04 -2.86%
  • XLM
    0.09 -1.25%
  • UNI
    6.09 -1.59%
  • SHIB
    0 -1.59%

Fundament of the week – ERC-20 Tokens

When it comes to tokens, there are simply no limits to the imagination. One could say that tokens are essentially smart contracts that use the Ethereum blockchain network. Today, let's talk about one of the most important token standards for the ETH network - the ERC-20.

ERC-20 empowers developers

One of the most prominent types of tokens is known as the ERC-20 and when it comes to token implementation, it has proven to be the technical standard used for all intelligent contracts on the Ethereum blockchain. As of April 16, 2019, there are more than 181,000 ERC-20 compatible tokens in the Ethereum core network.

The ERC-20 is crucial due to the fact that it defines a common list of rules that all Ethereum tokens must follow. That is why this particular token allows developers to predict exactly how the new tokens will work under the larger Ethereum system. The impact that the ERC-20 standard has on developers is therefore tremendous. In this case, there is no need to redesign or add support for each newly created token. They are designed to be compatible with the new tokens, provided that they also follow the rules set by the standard. Developers of new tokens generally follow the rules of ERC_20, which means that most of the tokens released through the initial coin offerings built on the Ethereum blockchain comply with the requirements of ERC-20.

Different functions of Ethereum blockchain Figure 1: The majority of the tokens running on the Ethereum blockchain are compatible with the ERC-20 standard

6 functions that specify the ERC-20

The ERC-20 is defined by six different functions in favor of other tokens in the Ethereum system. In general, these are basic functionality issues, including how tokens are transferred and how users can access specific token data.

Overall, this set of functions and signals ensures that Ethereum tokens of different types will work anywhere in the Ethereum system in an evenly distributed manner. Almost all digital wallets that support Ethereum currency also support ERC-20 compatible tokens. But because the ERC-20 standard is still relatively young, there are likely to be bugs that need to be tweaked as Ethereum is still maturing.

Allowance

The allowance function allows two addresses to create a repetitive one-way transaction channel. The owner's address and the recipient’s address are defined as two wallets that participate in recurring transactions. More specifically, the recipient will receive a certain amount from the owner's wallet at a certain interval. Both of these variables must be defined.

Approve

This feature is closely related to the previous one. It allows two addresses to repeatedly terminate a one-way transaction. Approve is a simple standard feature that allows the wallet owner to authorize the transaction he is making. This function requires two inputs, the recipient’s address and the number of tokens to receive. The output sends a Boolean value (0 or 1) that determines whether the transaction was allowed.

BalanceOf

Simply put, this function receives output from the address on the blockchain and returns a numeric output that indicates the number of tokens on the account. The Ethereum blockchain is public, so anyone can find out how many tokens are in any account.

Total Supply

This feature has been run only once, at the very beginning when the Ethereum network was being launched. The function is anonymous and, as the name suggests, it indicates the final number of tokens that can exist on the network.

Transfer

The transfer function is the most important function that ERC-20 tokens have. Defines and implements direct token transfers between accounts. The extent to which the function is initiated by wallet owners requires only two parameters. The recipient's address and the number of tokens the sender wants to send. The output of this function is a Boolean value that determines whether the transaction will take place.

TransferFrom

The last feature, TransferFrom, allows smart contracts to make a transaction based on the wallet owner's requirements. Not to be confused with the previous function, which is used only for direct transactions. However, this function is used to determine the conditions under which the transaction can take place. For example, stock exchange transactions or buying and selling tokens at a certain price are all performed using this function. The TransferFrom function has three basic input parameters, the sender's address, the recipient's address, and the number of tokens to be transferred.

Solidity

The most popular Ethereum client is written in the Google Go programming language. Developers usually choose those languages that are “smart contracts-friendly”. That is why they usually choose languages like Vyper, Bamboo, Serpent, and Solidity.

Solidity is a programming language focused on the work and implementation of smart contracts. Syntax Solidity is a combination of concepts from Javascript, Python, and C programming languages.

Sources: investopedia.com, kryptoportal.sk, cryptosvet.sk, support.blockchain.com, ledger.com

Jakub is a crypto trader and founder of Trader 2.0 project, which helps hundreds of traders from central Europe to understand cryptocurrency trading and its challenges. Jakub not o...

Comments

Comments are closed.