Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/windingtree/smartcontracts-template-hardhat
📐 Template repository for smart contracts 📃
https://github.com/windingtree/smartcontracts-template-hardhat
ethereum windingtree
Last synced: 29 days ago
JSON representation
📐 Template repository for smart contracts 📃
- Host: GitHub
- URL: https://github.com/windingtree/smartcontracts-template-hardhat
- Owner: windingtree
- License: gpl-3.0
- Created: 2022-04-04T11:31:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-05-09T07:04:46.000Z (over 2 years ago)
- Last Synced: 2024-05-01T10:23:46.641Z (8 months ago)
- Topics: ethereum, windingtree
- Language: TypeScript
- Homepage:
- Size: 590 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
---
author: mfw78
---# WT Smart Contract Template
## Overview
This is a template repository for smart contract development in **Hardhat**. This repository
contains the base tools required for testing, coverage analysis, and deployment. Tools
used include:- ethers
- hardhat / hardhat-deploy
- openzeppelin
- typescript / typechain
- solhint / gas-reporter / soliditiy-coverage## Commits
To commit to the repository after staging the commit:
```bash
yarn commit
```Select the appropriate type of commit message, any issues to close, and note any breaking
changes.## Tests
Test are handled with `chai` and includes `solidity-coverage`, enabling coverage
reports to be done for the code-base. By default, contracts located in `contracts/test`
are ignored by `solidity-coverage`.## Deployment
### Requirements
1. Ensure **100% solidity coverage** in tests prior to production deployment.
2. All `Ownable` contracts **MUST** have their owner set to the community multi-sig and/or
`TimelockController`. **NO** contracts must be allowed to retain **ANY** deployer addresses
in their configurtion.
3. **MINIMUM** two reviewers prior to commiting to the main branch.### Scripts
This repository uses `hardhat-deploy` for reproducible deployment tests, as well as:
1. Get contracts via name from `ethers`.
2. Named accounts for more readable tests.
3. Conditional logic execution based on tagged network deploying to (allowing for more
complex logic when deploying across multiple chains, and/or testnets).Deployment scripts are contained within `deploy`, and these deployment scripts are executed
prior to any tests, and are executed in **alphabetical order**.### How to use
Unit testing:
```
yarn test
```Coverage analysis:
```
yarn hardhat coverage
```Run deploy scripts and deploy to `mainnet`:
```
yarn hardhat deploy --network mainnet
```Now verify the contracts on Etherscan:
```
yarn hardhat --network mainnet etherscan-verify
```**NOTE: Substitute `mainnet` above for the applicable target network.**