https://github.com/devpavan04/hardhat-starter-kit
A starter kit for building decentralized applications powered by hardhat, solidity, ethers.js, ethereum-waffle, and react.
https://github.com/devpavan04/hardhat-starter-kit
Last synced: about 1 year ago
JSON representation
A starter kit for building decentralized applications powered by hardhat, solidity, ethers.js, ethereum-waffle, and react.
- Host: GitHub
- URL: https://github.com/devpavan04/hardhat-starter-kit
- Owner: devpavan04
- Created: 2021-04-24T17:30:34.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-28T08:22:35.000Z (about 5 years ago)
- Last Synced: 2025-02-05T21:54:14.914Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 480 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hardhat Starter Kit
### Uses hardhat, ethers.js and ethereum-waffle
```
git clone https://github.com/devpavan04/hardhat-starter-kit.git your-dapp
```
Install hardhat dependencies
```
cd your-dapp
npm install
```
Install react dependencies
```
cd client
npm install
```
Hardhat flow :
* cd back into root folder
```
cd ..
```
* Write contracts inside contracts folder
* Write tests inside test folder
* Compile
```
npm run compile
```
* specify the contract/s being deployed in the main() function of scripts/deploy.js file
* Deployments and tests :
* Hardhat Network
* Deploy - no need to deploy
* Test
* change defaultNetwork to "hardhat" in hardhat.config.js file
```
npm run test
```
* Localhost
* Deploy
* change defaultNetwork to "localhost" in hardhat.config.js file
* run a local JsonRpcProvider (chain) at localhost:8545
```
npm run chain
```
* open new terminal
* deploy contract
```
npm run deploy
```
* Test
```
npm run test
```
* Testnet
* Deploy
* change defaultNetwork to required testnet in hardhat.config.js file, ex: "kovan", "ropsten"
* change INFURA_API_KEY to your infura api key
* change TESTNET_ACCOUNT_PRIVATE_KEY to your testnet's account's private key
* deploy contract
```
npm run deploy
```
* Publish artifacts to the frontend
```
npm run publish
```
* access artifacts from ./subgraph folder and ./client/src/contracts folder
* Start react app
```
cd client
npm start
```