Creating my own ERC-20 token
Using Ethereum to create my own Cryptocurrency
Time after time, decentralization has proven its superiority over centralization.
Blockchain technology allows for society to be completely revolutionized. Going from our current reliability on centralized systems onto the decentralized systems of Blockchain.
But why is that even important in the first place?
- In centralized systems, the data is concentrated on one central authority who can censor data and holds complete control. In decentralized systems, power is distributed therefore there is no censorship
- Intermediaries are not needed, and each individual has complete control over their information and is able to make decisions about their data for themselves
- Centralized systems have a single point of failure that can bring the entire network down, which is not possible using decentralized systems (making it nearly impossible to bring the entire network down)
Bitcoin. Ether. Ripple. Litecoin.
I’m sure you’ve all heard of at least one of these names over the past couple years. Each one of those are some of the most popular cryptocurrencies right now.
But, how do we go beyond simply attempting to decentralize currency?
Introducing ERC-20, the common standard for creating tokens on the Ethereum network.
Hold up, take it back for a minute:
What even is Ethereum?
Ethereum is a decentralized network of nodes with two main function: recording transactions on their blockchain, and allowing developers to create decentralized applications (DApps) using smart contracts executed on the Ethereum Virtual Machine.
These DApps are built on the existing Ethereum blockchain, riding off its underlying technology. In return, developers are charged for the computing power in their network, which is paid in Ether — the only inter-platform currency.
Depending on the aim, DApps may be used to create ERC-20 tokens to represent any sort of asset including a share in a company, currency, proof of ownership, the deed to a house, etc.
But, what exactly for the Smart Contracts do?
Smart contracts are used to create ERC-20 tokens, facilitate token transactions and record balances of tokens in an account.
A smart contract is where all the business logic of an application lives, and where one must actually code the decentralized portion of the application.
Smart contracts represent a covenant or an agreement.
After a token is created, this is where ERC-20 comes in.
ERC-20 is a universal language that allows tokens on the Ethereum network to be exchanged with one another.
It is a blockchain-based asset that has the ability to hold value and be sent and received. This can be done through the use of Ethereum addresses, transactions, and gas in order to cover the transaction fees.
The ERC-20 Standard
The Ethereum community created the ERC-20 standards with 3 optional rules, and six mandatory rules.
- Token Name
- Symbol: the exchange symbol
- Decimal — up to 18 (the lowest possible division of Ether is 18 decimal)
- totalSupply: the total number of ERC-20 tokens created
- transfer: allows for number of tokens to be transferred from supply to user account
- transferFrom: function that allows user to transfer tokens to another account
- balanceOf: function that returns the number of tokens a given address has in its account
- approve: checks a transaction against the total supply of token (making sure there are none missing or extra)
- allowance: checks the balance of user’s accounts and will cancel the transaction if there are insufficient funds
But, why is ERC-20 beneficial?
ERC-20 (Ethereum Request for Comment, proposal 20) helps streamline the process of creating tokens, whilst keeping it consistent throughout the community.
With a universal standard, new tokens can be put on an exchange or transferred to a wallet automatically, once it’s been created.
This standard has made the process of creating new tokens extremely easy and efficient, which is one of the reasons that Ethereum had become one of the most popular platforms for ICO’s in 2017.
Replicating my own Token
This DApp is a replicate of DApp University’s token.
It uses HTML, CSS, and JS for the front-end UI and for the back-end rather than connecting to a backend server, the application connects to the local Ethereum Blockchain.
Watch this video to learn more about how the contract was designed, a demonstration, and its functionality.
With the use of Blockchain, we have the ability to decentralize society.