Develop your ERC-20 Token — explained!

Hargobind Gupta
2 min readNov 22, 2018

--

ERC 20 Tokens are creating a rage in the cryptocurrency sector, and you wouldn’t want to be left behind, would you? Anyone who is keen to know the functionality involved in an ERC-20 token creation and deployment is welcomed. Let’s get started.

What is an ERC-20 Token?

Ethereum Request For Comments 20(ERC 20) is a protocol standard that defines certain rules and standards for issuing tokens on Ethereum’s network.

A Token developed on Ethereum Blockchain is said to be an ERC-20 compliant only if it includes the basic functions defined by the protocol in its smart contract. The functions defined in the protocol are

The Ethereum community created this protocol so that a token can be shared, exchanged for other tokens, or transferred to a crypto-wallet as effortlessly as possible.

Things required to develop a Token.

Proficiency in Solidity, the official language to write smart-contracts on Ethereum Blockchain. The only hackable module in your Blockchain Project is your smart contract, So one should give utmost importance to its development as we do at Unbox Innovation.

Also this

  1. Ethereum Address (Ropsten Network)
  2. Some Ethereum (Ropsten Network)
  3. A text editor (I.e. ,Sublime / Atom)
  4. Solidity contract

Let’s jump into the code.

The Ethereum community created these standards with three optional rules, and six mandatory.

Optional

  • Token Name
  • Symbol
  • Decimal (up to 18)

Mandatory

  • totalSupply: identifies the total number of ERC-20 tokens created.
  • balanceOf: it returns the number of tokens a given address has in its account.
  • transfer: allows a certain number of tokens to be transferred from the total supply to a user account.
  • transferFrom: is the function that allows a user to transfer tokens to another user.
  • approve : checks a transaction against the total supply of tokens.
  • allowance: function checks the balance of the user’s account and will cancel the transaction if there are insufficient tokens.

A sample smart contract implementing all the protocol is defined here. The comments will guide you when you are inside.

If you find this useful, please share it with your crypto freaks in your network.

If you don’t want to take the burden of doing all this, reach out to us at contact@unboxinnovations.com

Originally published at medium.com on November 22, 2018.

--

--

Hargobind Gupta

An aspiring entrepreneur making way through the ever evolving and advanced world of technology. An early adopter of Blockchain Revolution.