Giter VIP home page Giter VIP logo

hello-erc-20-token's Introduction

A very basic ERC-20 Token

Table of contents

About

In this elementary stage project, we will be using OpenZeppelin, an open-source blockchain security product, to implement a very basic ERC-20 Token. OpenZeppelin provides developers a set of smart contracts that enables them to create and deploy secure and efficient code on a wide range of blockchains using Solidity.

My goal for this project is to deploy a functional ERC-20 token on Ethereum's test network "Ropsten" and use Metamask to send and receive tokens. You can have a complete code walkthrough on the related post on my website.

Technologies




Deployment

To deploy this project locally, we need to have installed on our local environment NodeJS and Truffle. Subsequently, we can proceed with applying the following commands.

$ git clone https://github.com/Erodotos/HELLO-ERC-20-TOKEN
$ cd HELLO-ERC-20-TOKEN
$ npm install

Additionally, we need to generate a new file with the name .env. In this file, we will be introducing some local variables that are required. For the moment, name a variable for the total supply of our token as shown below.

TOTAL_SUPPLY = 100000

After that, we need to get into the Truffle development console and deploy our smart contracts. The following commands shall do the work.

$ truffle develop
$ truffle(develop)> migrate
$ truffle(develop)> test

After running the last command, all code tests shall be passed, and we should receive the following result.

Contract: Token Test
    ✓ All tokens should be in the deployer's account (84ms)
    ✓ I can send tokens between accounts (203ms)
    ✓ It's not possible to send more tokens than account 1 has (537ms)
3 passing (1s)

Now we are ready to send and receive our token via Metamask wallet in the browser.

BONUS

To deploy the token on Ethereum's test network "Ropsten" you need to import your Metamask wallet in Truffle to deploy our smart contracts on "Ropsten."

Find your wallet's Secret Recovery Phrase as shown below and then copy it.

Afterward, go to our .env file, create a new variable with the name MNEMONIC, and paste your secret phrase. Furthermore, we need to access the network via an Ethereum Node. To do so you have to create an account into INFURA, create a project and get its ID into our .env file.

MNEMONIC = <secret phrase>
INFURA_PROJECT_ID = <infura project id>

Finally, execute the following command to deploy our smart contract on Ethereum's test network "Ropsten".

$ truffle(develop)> migrate --network ropsten

Demonstration\

Click on the Image/Link below to view the demonstration video.

Demo Video

hello-erc-20-token's People

Contributors

erodotos avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.