黎海 b90909b8bd demo | 1 anno fa | |
---|---|---|
artifacts | 1 anno fa | |
cache | 1 anno fa | |
contracts | 1 anno fa | |
frontend | 1 anno fa | |
scripts | 1 anno fa | |
tasks | 1 anno fa | |
test | 1 anno fa | |
.gitignore | 1 anno fa | |
LICENSE | 1 anno fa | |
README.md | 1 anno fa | |
hardhat.config.js | 1 anno fa | |
package-lock.json | 1 anno fa | |
package.json | 1 anno fa |
This repository contains a sample project that you can use as the starting point for your Ethereum project. It's also a great fit for learning the basics of smart contract development.
This project is intended to be used with the
Hardhat Beginners Tutorial, but you should be
able to follow it by yourself by reading the README and exploring its
contracts
, tests
, scripts
and frontend
directories.
The first things you need to do are cloning this repository and installing its dependencies:
git clone https://github.com/NomicFoundation/hardhat-boilerplate.git
cd hardhat-boilerplate
npm install
Once installed, let's run Hardhat's testing network:
npx hardhat node
Then, on a new terminal, go to the repository's root folder and run this to deploy your contract:
npx hardhat run scripts/deploy.js --network localhost
Finally, we can run the frontend with:
cd frontend
npm install
npm start
Open http://localhost:3000/ to see your Dapp. You will
need to have Metamask installed and listening to
localhost 8545
.
You can find detailed instructions on using this repository and many tips in its documentation.
For a complete introduction to Hardhat, refer to this guide.
This repository uses our recommended hardhat setup, by using our @nomicfoundation/hardhat-toolbox
. When you use this plugin, you'll be able to:
hardhat-ethers
plugin.This project also includes a sample frontend/Dapp, which uses Create React App.
Invalid nonce
errors: if you are seeing this error on the npx hardhat node
console, try resetting your Metamask account. This will reset the account's
transaction history and also the nonce. Open Metamask, click on your account
followed by Settings > Advanced > Reset Account
.Hardhat for Visual Studio Code is the official Hardhat extension that adds advanced support for Solidity to VSCode. If you use Visual Studio Code, give it a try!
If you need help with this project, or with Hardhat in general, please read this guide to learn where and how to get it.
For the latest news about Hardhat, follow us on Twitter, and don't forget to star our GitHub repository!
Happy building!