Skip to content

A template of a Hardhat project with extra plugins

Notifications You must be signed in to change notification settings

CREESTL/HardhatTemplate

Repository files navigation

Hardhat Template

This repository contains a template of a Hardhat project with additional plugins integrated. Use it as a base for your own project.
Feel free to customize it further in any way you like, as well as remove parts you find redundant.

List of plugins:

Solhint

repo

  • Run linter
solhint 'contracts/**/*.sol'

Slither

repo

  • Install
pip3 install slither-analyzer
  • Run the security check
slither .

Solidity Coverage

repo

  • Run the coverage check
npx hardhat coverage
  • Open the results in the browser
    • See results in coverage/index.html file

Prettier (+ Solidity Plugin)

original repo
plugin repo

  • Run code formatter
npx prettier --write .

Hardhat Dodoc

repo

  • Run
npx hardhat dodoc
  • It's configured to run on each contracts compilation
  • See results in docs/ directory

Hardhat Gas Reporter

repo

  • Run (automatically runs with tests)
npx hardhat test

Hardhat ABI Exporter

repo

  • Run
npx hardhat export-abi

It automatically runs on contracts compilation

Hardhat Contract Sizer

repo

  • Run
npx hardhat size-contracts

It automatically runs on contracts compilation

Hardhat Tracer

repo

  • Run
npx hardhat test --trace

or

npx hardhat test --fulltrace