Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/defi-wonderland/solidity-hardhat-boilerplate
Start your next Solidity project with Hardhat in seconds
https://github.com/defi-wonderland/solidity-hardhat-boilerplate
Last synced: 3 months ago
JSON representation
Start your next Solidity project with Hardhat in seconds
- Host: GitHub
- URL: https://github.com/defi-wonderland/solidity-hardhat-boilerplate
- Owner: defi-wonderland
- License: agpl-3.0
- Created: 2021-06-15T14:57:36.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-27T15:11:01.000Z (over 1 year ago)
- Last Synced: 2024-05-14T00:54:01.593Z (6 months ago)
- Language: TypeScript
- Homepage:
- Size: 1.75 MB
- Stars: 131
- Watchers: 5
- Forks: 22
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Blockchain-Development-Resources - Solidity hardhat boilerplate
README
# Hardhat Boilerplate
## Why ?
Thought to have a fast way of bootstraping projects with best practice's in mind. Having linters, prettiers, standards on how to commit, and changelog creation & maintenance.
---
## How ?
This is achieved using several hardhat plugins, and external known packages.
---
## Setup
```bash
# Install dependencies
yarn install
# Copy Env example file
cp .env.example .env
```After installing dependencies and copying the example environment, you will have to update your `.env` file with
at least you alchemy API KEY (`NODE_URI_ETHEREUM`).
You can generate your API KEY in the [Alchemy site](https://www.alchemy.com).---
## Tools
This boilerplate includes:
- [Hardhat](https://hardhat.org/)
- [Solhint](https://github.com/protofire/solhint)
- [Prettier](https://github.com/prettier-solidity/prettier-plugin-solidity)
- [Coverage](https://github.com/sc-forks/solidity-coverage)
- [Gas reporter](https://github.com/cgewecke/hardhat-gas-reporter/tree/master)
- [Commitlint](https://github.com/conventional-changelog/commitlint)
- [Standard version](https://github.com/conventional-changelog/standard-version)
- [Uniswap](https://github.com/Uniswap/uniswap-v2-periphery) + [Internal tooling](./test/utils/uniswap.ts)---
## Commands
### **Coverage**
```bash
yarn coverage
```Runs solidity code coverage
### **Fork**
```bash
yarn fork
```Runs a mainnet fork via hardhat's node forking util.
```bash
yarn fork:script {path}
```Runs the script in mainnet's fork.
```
yarn fork:test
```Runs tests that should be run in mainnet's fork.
### **Lint**
```bash
yarn lint:check
```Runs solhint.
### **Prettier (lint fix)**
```bash
yarn lint:fix
```Runs prettier
### **Release**
```bash
yarn release
```Runs standard changelog, changes package.json version and modifies CHANGELOG.md accordingly.
### **Test**
```bash
yarn test:all
```Runs all solidity tests.
```bash
yarn test:unit
```Runs all solidity tests in folder [unit](./test/unit)
```bash
yarn test:e2e
```Runs all solidity tests in folder [e2e](./test/e2e)
### **Gas report**
```bash
yarn test:gas
```Runs all tests and report gas usage.