Hardhat is a development environment for Ethereum software. It consists of different components for editing, compiling, debugging and deploying your smart contracts and dApps, all of which work together to create a complete development environment.
One of the standout features of Hardhat is its built-in Ethereum network, known as Hardhat Network, which enables fast local testing without the need for external blockchain connections.
Additionally, Hardhat's task runner automates repetitive tasks such as compiling, testing, and deploying smart contracts, making the workflow more efficient.
yarn or bun]mkdir example
cd example
mkdir web3
cd web3
npm install --save-dev hardhat
npx hardhat init
888 888 888 888 888
888 888 888 888 888
888 888 888 888 888
8888888888 8888b. 888d888 .d88888 88888b. 8888b. 888888
888 888 "88b 888P" d88" 888 888 "88b "88b 888
888 888 .d888888 888 888 888 888 888 .d888888 888
888 888 888 888 888 Y88b 888 888 888 888 888 Y88b.
888 888 "Y888888 888 "Y88888 888 888 "Y888888 "Y888
π· Welcome to Hardhat v2.22.18 π·β
? What do you want to do? β¦
β― Create a JavaScript project
Create a TypeScript project
Create a TypeScript project (with Viem)
Create an empty hardhat.config.js
Quit
? Hardhat project root: Β» **C:\\Users\\username\\example\\web3** **β΅**
? Do you want to add a .gitignore? (Y/n) Β· **y**
? Do you want to install this sample project's dependencies with npm (hardhat @nomicfoundation/hardhat-toolbox)? (Y/n) Β» **y**
For beginning , choose the first option with your keyboard up-down arrow keys hit enter [β΅] after that just hit [β΅] or press y for every dropdown you see
After successful completion of initiation , you can find a folder structure like this -
βββ πdummy-web3
βββ πcontracts
βββ Lock.sol
βββ πignition
βββ πmodules
βββ Lock.js
βββ πtest
βββ Lock.js
βββ .gitignore
βββ hardhat.config.js
βββ package-lock.json
βββ package.json
βββ README.md
Now we have to install some more dependencies which are required to write, run and deploy our contract -
npm install dotenv @openzeppelin/contracts
contracts folder in solidityignition/modules folder in Megh2005/dummy-web3 in **j**avascript