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/samuveth/hardhat-hackathon-boilerplate-vue.git
cd hardhat-hackathon-boilerplate-vue
yarn install
Once installed, let's run Hardhat's testing network:
yarn hardhat node
Then, on a new terminal, go to the repository's root folder and run this to deploy your contract:
yarn hardhat run scripts/deploy.js --network localhost
Finally, we can run the frontend with:
cd frontend
yarn install
yarn serve
Open http://localhost:8080/ 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.
- Project description (Token.sol)
- Setting up the environment
- Testing with Hardhat, Mocha and Waffle
- Setting up Metamask
- Hardhat's full documentation
For a complete introduction to Hardhat, refer to this guide.
Your environment will have everything you need to build a Dapp powered by Hardhat and Vue.
- Hardhat: An Ethereum development task runner and testing network.
- Mocha: A JavaScript test runner.
- Chai: A JavaScript assertion library.
- ethers.js: A JavaScript library for interacting with Ethereum.
- Waffle: To have Ethereum-specific Chai assertions/mathers.
- A sample frontend/Dapp: A Dapp which uses Vue CLI (vue create).
Invalid nonce
errors: if you are seeing this error on theyarn 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 bySettings > Advanced > Reset Account
. Or you can also enable "Customize transaction nonce" in advanced settings, then you can enter the expected nounce from the error message.
We'd love to have your feedback on this tutorial. Feel free to reach us through this repository or our Discord server.
Also you can follow us on Twitter.
Happy buidling!