/Bhawana-Token-BHT

ERC-20 Token named Bhawana-Token (BHT) using Ethereum Blockchain

Primary LanguageJavaScript

Bhawana-Token

ERC-20 Token using Ethereum Blockchain

Introduction

Tokens are digital assets built on top of the Ethereum blockchain. Using tokens, developers can use it to pay for services performed by Smart Contracts, as well as use it as a mean for fund raising. Tokens also drive demands for Ether, the native cryptocurrency on the Ethereum blockchain.

Example

To understand the concept of tokens, let’s start off with a real-life analogy. Most people are familiar with carnival (or fun fair). To play the games at the carnival, the stalls usually do not accept cash payment. Instead, they need you to exchange your cash (or use credit card) to purchase coins (or commonly called tokens) so that you can use them at the game stalls.

Coins vs Tokens

Strictly speaking, coins are not the same as tokens. In fact, tokens are based on coins. The definition of a coin is that it is an asset that is native to its own blockchain. Examples of coins are Bitcoin, Litecoin, and Ether. Each of these coins exists on their own blockchain. Tokens, on the other hand, are created on existing blockchains. The most common token platform is Ethereum, which allows developers to create their own tokens using the ERC20 standard (more on this in the later section of this chapter). Using Ether (which is the coin native to the Ethereum blockchain), users can exchange them for specific tokens on the Ethereum blockchain.

ERC20 Token Standard

In order for tokens created on the Ethereum blockchain to be accepted by Smart Contracts, tokens must adhere to some particular standards. In the case of Ethereum tokens, that standard is ERC20. ERC stands for Ethereum Request for Comments. In ERC20, the number 20 refers to the proposal ID number. The proposal ERC20 defines a set of rules which need to be met for a token to be able to interact with each other.

Truffle

Installation : $ sudo npm install -g truffle

  • Create a new folder and run command truffle init which basically initializes a truffle project into our directory
  • Run $ ls. You will find 3 folders and a config file.
  • Contracts folder will store any smart contract we create for our dapp.
  • The migrations folder is for deploying our smart contract onto the blockchain.
  • The test folder is where we write test suites for testing of smart contract.
  • The config file will have basic configuration details, eg. network of blockchain etc.

Resources

Book - Beginning Ethereum Smart Contracts Programming With Examples in Python, Solidity and JavaScript by Wei-Meng Lee (z-lib.org)