Starter Next/Hardhat Project
This project serves as a starting point for utilizing Next.js with Hardhat for Ethereum development. It integrates frontend and smart contract functionalities.
-A view function allowing anyone to check the contract's current balance.
-Allows the owner to deposit additional funds into the contract. It increases the contract's balance by the provided _amount.
-Permits the owner to withdraw funds from the contract. It checks if the requested withdrawal amount is available and reverts if the balance is insufficient.
-Allows the owner to burn the entire balance. However, the current implementation includes an issue - the while loop checking for balance greater than zero could potentially result in an infinite loop, as the balance is set to zero before the loop. The loop condition should likely check for balance > n instead.
- Clone the GitHub repository to your local machine.
- Ensure you have Node.js installed. If not, download and install it.
- Inside the project directory, in the terminal, run:
npm i
- Open two additional terminals in your VS code (or use two terminals of cmd), and run both as administrator to avoid technical issues.
- In the second terminal, type:
npx hardhat node
- In the third terminal, type:
npx hardhat run --network localhost scripts/deploy.js
- Back in the first terminal, launch the front-end:
npm run dev
For common problems or issues, refer to the documentation or run:
Contributor/s: Sally Segundo @Hoshiyom1