Skip to content

πŸ‘·πŸ½ Template for new Solidity projects built with Hardhat and tested with Chai πŸ«–

Notifications You must be signed in to change notification settings

solidstate-network/hardhat-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

716db45 Β· Aug 28, 2024

History

90 Commits
Aug 5, 2024
Oct 23, 2020
Oct 23, 2020
Oct 23, 2020
Jan 26, 2022
Feb 8, 2022
Aug 21, 2023
Mar 30, 2022
Feb 28, 2024
Aug 28, 2024
Feb 28, 2024
Aug 28, 2024

Repository files navigation

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

About

πŸ‘·πŸ½ Template for new Solidity projects built with Hardhat and tested with Chai πŸ«–

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published