Code Monkey home page Code Monkey logo

hardhat-template's Introduction

SolidState Smart Contract Project

Note: This repository was generated from a template or is the template itself. To set up a new project, set the missing data marked "TODO" in package.json and remove this notice.

This project is built with SolidState. See the solidstate-solidity documentation for information about contract integration and testing.

Development

Install dependencies via Yarn:

yarn install

Setup Husky to format code on commit:

yarn prepare

Compile contracts via Hardhat:

yarn run hardhat compile

The Hardhat environment relies on the following environment variables. The dotenv package will attempt to read them from the .env and .env.secret files, if they are present.

Key Description
API_KEY_ETHERSCAN Etherscan API key for source code verification
NODE_URL_MAINNET JSON-RPC node URL for mainnet network
NODE_URL_TESTNET JSON-RPC node URL for testnet network
PKEY_TESTNET private key for test/development use on testnet network
PKEY_MAINNET private key for production use on mainnet network
REPORT_GAS if true, a gas report will be generated after running tests

Networks

By default, Hardhat uses the Hardhat Network in-process. Two additional networks, mainnet and testnet are available, and their behavior is determined by the configuration of environment variables.

Testing

Test contracts via Hardhat:

yarn run hardhat test

Activate gas usage reporting by setting the REPORT_GAS environment variable to "true":

REPORT_GAS=true yarn run hardhat test

Generate a code coverage report using solidity-coverage:

yarn run hardhat coverage

Documentation

A static documentation site can be generated using hardhat-docgen:

yarn run hardhat docgen

hardhat-template's People

Contributors

itsnickbarry avatar noudaimon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hardhat-template's Issues

Convert to Typescript

Install relevant Typescript packages as devDependencies and convert js files to ts.

Replace eslint with prettier

prettier is more useful because it can be used to format Solidity as well as js/ts. Include functionality to automatically run prettier on commit, and add instructions to the readme.

Changes can be copied directly from here (excluding the "format with prettier" commit, which includes changes to most files in the repository): solidstate-network/solidstate-solidity#36

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.