Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amanusk/hardhat-template
Template to build smart contract with hardhat + typescript + ethers
https://github.com/amanusk/hardhat-template
blockchain ethereum hardhat solidity typechain
Last synced: 30 days ago
JSON representation
Template to build smart contract with hardhat + typescript + ethers
- Host: GitHub
- URL: https://github.com/amanusk/hardhat-template
- Owner: amanusk
- License: mit
- Created: 2020-12-16T10:06:30.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-27T09:28:36.000Z (almost 2 years ago)
- Last Synced: 2023-11-07T18:15:23.853Z (about 1 year ago)
- Topics: blockchain, ethereum, hardhat, solidity, typechain
- Language: TypeScript
- Homepage:
- Size: 133 KB
- Stars: 109
- Watchers: 5
- Forks: 53
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Solidity Template
This is a basic hardhat template to get you started writing and compiling contract.
The template is configured with some sensible defaults but tries to stay minimal.
It comes with most sensible plugins already installed via the suggested `hardhat-toolbox`.- [Hardhat](https://github.com/nomiclabs/hardhat): compile and run the smart contracts on a local development network
- [TypeChain](https://github.com/ethereum-ts/TypeChain): generate TypeScript types for smart contracts
- [Ethers](https://github.com/ethers-io/ethers.js/): renowned Ethereum library and wallet implementationUse the template by clicking the "Use this template" button at the top of the page.
## Usage
### Pre Requisites
Before running any command, make sure to install dependencies:
```sh
yarn install
```### Compile
Compile the smart contracts with Hardhat:
```sh
yarn compile
```### Test
Run the tests:
```sh
yarn test
```#### Test gas costs
To get a report of gas costs, set env `REPORT_GAS` to true
To take a snapshot of the contract's gas costs
```sh
yarn test:gas
```### Deploy contract to network (requires Mnemonic and Infura API key)
```
npx hardhat run --network goerli ./scripts/deploy.ts
```### Validate a contract with etherscan (requires API key)
```
npx hardhat verify --network "Constructor argument 1"
```## Thanks
If you like it than you shoulda put a start ⭐ on it
Twitter: [@amanusk\_](https://twitter.com/amanusk_)
## License
MIT