GithubHelp home page GithubHelp logo

solangegueiros / sol-token-box Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 177 KB

Truffle box configured to create an ERC20 token using Open Zeppelin smart contracts library and deploy on Goerli network.

License: MIT License

Solidity 20.42% JavaScript 78.15% Shell 1.43%
solidity truffle truffle-box truffle-framework solidity-contracts open-zeppelin ethereum token

sol-token-box's Introduction

Ethereum Truffle Token Box

Truffle box configured to create an ERC20 token using Open Zeppelin smart contracts library and deploy on Görli or Kovan Ethereum testnet network.

Tutorials

Requirements

There are a few technical requirements before we start. To use Truffle boxes, you need to have installed in your computer:

  • Git
  • a POSIX compliant shell
  • cURL
  • Node.js and NPM
  • a code editor

Truffle framework

Once you have those requirements installed, you only need one command to install Truffle. It is better to do it globally:

npm install -g truffle

Installation

  1. Create a new folder. For example, create the folder mytoken. Navigate to the folder in the terminal.
mkdir mytoken
cd mytoken
  1. Run the unbox command. This also takes care of installing the necessary dependencies and it can take some time.
truffle unbox solangegueiros/eth-token-box

Compile

Compile the smart contract.

truffle compile

Test

This Truffle box also comes with the file TestToken.js which include some examples for testing the smart contract. You can check it out in the test folder.

There are many other tests which can be done to check an ERC20 token.

Run this command on terminal:

truffle test

Requirements to deploy on a network

Before you deploy on a network, you need:

  • A wallet with enought ETH to deploy
  • An account at infura

Setup an account

  1. Create a wallet

The easy way to setup an account is using a web3 wallet injected in the browser

Copy your mnemonic (seed phrase or backup words)

  1. Create an account at infura
    • Create a project, selecting Ethereum network.
    • Copy the project ID

Create .env

Make a copy of .env.example and named .env, located in the folder project.

Update your MNEMONIC and RPC_URL in .env

Save .env file.

Deploy on Görli - Ethereum testnet network

Görli Testnet

Get ETH on Görli

Select the Goerli Network in the web wallet.

  1. Get some ETHs - Faucets

Connect to Görli

Run the Truffle development console

truffle console --network goerli

Test the connection to Görli network

Run this commands in the Truffle console:

Block number

Shows the last block number.

(await web3.eth.getBlockNumber()).toString()

Network ID

To get the network ID, run this command:

(await web3.eth.net.getId()).toString()

The Görli network ID is 5.

Exit the Truffle console:

.exit

Deploy / migrate the smart contract.

truffle migrate --network goerli

The migrate process in a real blockchain takes more time, because Truffle creates some transactions which need to be mined on the blockchain.

sol-token-box's People

Contributors

solangegueiros avatar

Watchers

 avatar  avatar  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.