Git Product home page Git Product logo

smart-contract-boilerplate's Introduction

Smart Contract Deployer Boilerplate

This is Boilerplate for Developing Smart Contract in any ethereum-based network. This project is using yarn as package manager.

What this project uses

Instalation

  1. Initialize package using

    yarn install
    
  2. Create .env file in the root directory to set environment variable. See .env.example file for example value of the file.

    • DEVELOPMENT_MNEMONIC, can be mnemonic phrase or private key of account who will deploy the smart contract in development network.
    • DEVELOPMENT_ENDPOINT, the json-rpc endpoint of development network in format <protocol>://<host>:<port>.
    • TEST_ENDPOINT, the json-rpc endpoint of test network in format <protocol>://<host>:<port>.
    • TESTNET_MNEMONIC, can be mnemonic phrase or private key of account who will deploy the smart contract in testnet network.
    • INFURA_ID, id from your infura account to access testnet network.

Building

To build the smart contract, use this:

yarn build

Deployment

To deploy the smart contract to development network, use this:

yarn deploy

If you want to deploy to another network, use this:

yarn deploy:<network_name>

For example, to deploy in Mumbai Testnet Network, use

yarn deploy:mumbai

Testing

To do testing based on Mocha, use this:

yarn test

# use this if you want to show reported gas used
yarn test:gas-reporter

Console

To access console connected to development network, use this:

yarn console

If you want to access console connected to another network, use this:

yarn console:<network_name>

For example, to access console connected to in Mumbai Testnet Network, use

yarn console:mumbai

To create local network and access the console, use this:

yarn develop

Lint

To check for problem from smart contract, use this:

yarn lint:contracts

# use this to overwrite smart contract with fixes
yarn lint:contracts-write

To lint javascript script, use this:

yarn lint:js

# use this to overwrite js script with fixes
yarn lint:js-write

To check for problem from smart contract and overwrite js script with fixes, use this:

yarn lint

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.