๐Ÿ”ฐ What is ERC20 ? - in layman terms as per my capability๐Ÿ‘ˆ๐Ÿ˜

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
ยท@pankajborahยท
0.000 HBD
๐Ÿ”ฐ What is ERC20 ? - in layman terms as per my capability๐Ÿ‘ˆ๐Ÿ˜
Hi, Pankaj here ๐Ÿ‘‹

<center>![erc20_anime.gif](https://cdn.steemitimages.com/DQmPnDW2SX2nH2X376ep6Krkg1MmP5TYmvk9VgoVJeyCbGA/erc20_anime.gif)</center>

<div class="text-justify">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>I am pretty much sure most of you who are into crypto have come across the term <code><b>ERC20</b></code> many times uptill now. May be you have just bought some <code><b>ERC20 tokens</b></code> in an ICO or you may have heard from your friend. So what the f**k is this <code><b>ERC20</b></code> ? ๐Ÿ˜ฌ So let me explain to you in the simplest terms as within my capabilitiy.

<center>![ERC20.png](https://cdn.steemitimages.com/DQmVfBmphYmsdbdsk7UuurpkY3k4MfZfD3JSsZkbQRd3wX7/ERC20.png)</center>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code><b>ERC20</b></code> is an acronym for <code><b>E</b></code>thereum <code><b>R</b></code>equest for <code><b>C</b></code>omments and <code><b>20</b></code> is associated with the Prosopal ID. <code><b>It is a protocol</b></code> or <code><b>standard</b></code> or you can say a <code><b>guide line</b></code> which tokens created on the Ethereum platform must follow to be acceptable as <b>ERC20</b>. It just <code><b>like a recipe book</b></code> but for Tokens.
</i>

<center>![erc20_purpose.jpg](https://cdn.steemitimages.com/DQmZ3ybZHSjCd4iLzqRU81gPruFMeCeaYouQnJHqPzTbc4G/erc20_purpose.jpg)</center>

![a_peek_at_history.png](https://cdn.steemitimages.com/DQmT2P4ayj2BumL65SmivriJMpX5LoddXgstutnFJfBz3X2/a_peek_at_history.png)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To properly understand the purpose of the <code><b>ERC20 protocol</b></code> let me take you to the early days of the internet. Back in the early days of the internet, <code><b>communication between any two applications was very difficult</b></code> as each programmer was creating their own custom code that only he/she understands, so in order for <code><b>one application created by</b></code>say, <code><b>programmer A to communicate with another application created by</b></code> some another <code> <b>programmer say B</b></code>, Programmer A must have a thorough and proper understanding of the code written by Programmer B. And this caused a lot of problems as it was <code><b>time-consuming and inefficient</b></code> and <code><b>ultimately hindered the scalability of the internet</b></code>.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;So in order to make the internet quickly scalable, <code><b>there was a need for some guidelines or common grounds which each application on the internet must adhere to in order to communicate with each other through the internet</b></code>. Following these guidelines, programmers can create applications without bothering about the in-depth understanding of other applications working. These guidelines are today's <code><b>protocols like HTTP, FTP</b></code> etc we use in our day to day life. <code><b>Creation of these protocols gave the early internet the scalability boost it required</b></code> to become what it is today.

![problems_with_early_eth.png](https://cdn.steemitimages.com/DQmdfP45APEjNtAx18JeTP3VxUKgegks11VCwd4zg6YNqkv/problems_with_early_eth.png)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Same way as the internet, in the early days of Ethereum, developers creating tokens on Ethereum were completely free to implement whatever functions they require and however they require, for example say a developer create a Token A on Ethereum with having a token transfer function named <code><b>transfer_A</b></code> and another developer create another Token B having a transfer token function named <code><b>transfer_B</b></code>. These cause problems similar to what the internet faced long ago. As you can see both the tokens are having different transfer functions, named different or may function wise different too. The problem arises when these token are listed on exchanges. As the structure of both the tokens <code><b>A and B</b></code> are different,<code><b> the exchanges, in order to interact with each of the tokens, need to write custom code for each of the tokens, which was cumbersome and inefficient as a lot of new tokens began to emerge</b></code>. This was <code><b>hindering the scalability</b></code> and so the Ethereum platform required some sort of standards or guidelines for tokens. 

<center>![erc20.gif](https://cdn.steemitimages.com/DQmVFPaJam9AwWT4YVBiHyvfLXsTcfkBiKJJPdZyTv4CWSK/erc20.gif)
<sup>[Gif prepared by Pankaj Borah](https://steemit.com/@pankajborah)</sup>
</center>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The <code><b>standard they came up with is ERC20</b></code>. Tokens create following these standards are known as <code><b>ERC20 tokens</b></code> and these solved a lot of the issues like <code><b>now exchanges can write code only once and interact with all the ERC20 token without any modifications</b></code>to their current code, and these you may have noticed on My Ether Wallet on which every ERC20 token is available as soon it's created without having to write any further code. All <code><b>this gave a boost in token interoperability among ERC20 tokens</b></code> on the Ethereum platform and for exchanges <code><b>ERC20 is acting like some sort of Swiss Army Knife</b></code>.
</div>

<center>![exchange_erc20.gif](https://cdn.steemitimages.com/DQmRsu8cKKoXyt1BoYSb6jZL9G1JvNL6v2FfdxgXvZNRdY3/exchange_erc20.gif)
<sup>[Gif prepared by Pankaj Borah](https://steemit.com/@pankajborah)</sup>
</center>
<center>![erc20_stanadard.jpg](https://cdn.steemitimages.com/DQmasGNb5FK1Txj1x5Ch1CAu78vxrPM5ydLzaTLFzZKX9jj/erc20_stanadard.jpg)</center>
<center>![optional_function.png](https://cdn.steemitimages.com/DQmdzSVtiERsF5DXz3UvGmP5TX7XYwu2aGCHJKfrx8obLTG/optional_function.png)</center>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;In ERC20 standard token <code><b>name</b></code>, <code><b>symbol</b></code> and <code><b>decimals are optional</b></code>. This means the creator can skip this parameters and then also the token will be considered ERC20 token. But there are 6 other mandatory functions which are implemented as an <code><b>Interface contract</b></code> which enforces the creator to define these for his/her token to meet the ERC20 standard ๐Ÿ‘‡. If you don't know what an interface is, then long story short, it's an OOPs(Object Oriented Programming) programming structure that enforces certain properties on an object. 

<center>![mandatory_function.png](https://cdn.steemitimages.com/DQmT9U1nYtDf8B9JtVNH9EoDevspYhTUPZa7Qbdpj4dyGmY/mandatory_function.png)</center>

* <code><b>totalSupply</b></code>- this method defines the total supply of a token. When this limit is reached the smart contract will not create any further new tokens.

* <code><b>balanceOf</b></code> - this method returns the no of tokens a given address has. You can compare this to checking any eth wallet balance on etherscan.

* <code><b>transfer</b></code> - this method is used to transfer a given amount of token <code><b>from the total supply to a user</b></code>.

* <code><b>transferFrom</b></code> - this method is used to transfer tokens <code><b>between any two users.</b></code>

* <code><b>approve</b></code> - this verifies if the contract can give a certain amount of token to a user taking into account the total supply.

* <code><b>allowance</b></code> - this verifies if a user has sufficient balance to send to a certain amount of token to another user.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;So as you can see if the token creator implements the above guidelines for creating the contract then the token is considered and ERC20 token.Apart from these the creator can implement additional functionality as per his/her wish. With this I am wrapping up this article my friend. See you another time and as always, thanks your reading.๐Ÿ˜‰

<center><i>
โœŒ๏ธ <b>FOLLOW</b>, <b>UPVOTE</b> or <b>RESTEEM</b> may be if you like this article.
โœ๏ธ <b>+VE</b> comments, suggestions and pointing out my mistakes before this post expires is welcome โค๏ธ, after that nothing I can do about ๐Ÿ˜„ and for <b>-VE</b> and hate comments I don't give a shit.</i>
</center>
![v6mt1ywn00tgjwirh4uv.gif](https://cdn.steemitimages.com/DQmRwsgA2fANyiaUQMLGvAuy7LsJ7oyhRC55Xkyb9pj3axV/v6mt1ywn00tgjwirh4uv.gif)
๐Ÿ‘ , , , , , , , , , , , , , , , , , , , , , , , , , , , ,