π·ββοΈ Create Hardhat DApp
The fastest way to initialize a new Hardhat development environment.
β‘οΈ
Features - Zero Configuration β No need to install and configure hardhat plugins manually
- Typescript by Default β Provides static typing for both JavaScript and Smart Contract ABI
- Extensible β Still a Hardhat environment that can be extended with many awesome plugins
π
Getting Started Start by running the command below and replace defi-app
with the name of your project.
npx create-hardhat-dapp defi-app
Or using yarn
yarn create hardhat-dapp defi-app
πͺ
Options create-hardhat-dapp
comes with the following option:
-
-p, --provider [{ alchemy | infura }] β Prepare network configurations for connecting to networks using your favorite JSON-RPC provider. Leave it blank for
alchemy
-
--no-install β Prevent installing dependencies at beginning
π¦
What Comes Out of the Box Anything marked with
π·
is optional
Web3
- ethers.js β JavaScript library to interact with Ethereum
- hardhat-ethers β Extended version of ethers.js for Hardhat
Test
- waffle β Simple smart contract testing library
- mocha β Feature-rich JavaScript test framework
- chai β Assertion library paired with Mocha
Hardhat Plugins
hardhat-gas-reporter optionally requires an API Key for coinmarketcap to fetch price data
hardhat-etherscan requires an API Key for etherscan to submit smart contract
- hardhat-gas-reporter β Mocha reporter that generates gas usage
- hardhat-etherscan β Smart Contract verification on Etherscan
Tools / Utilities
Feel free to customize the
.prettierrc
config file to follow your code style
- Typescript β Static Type version of JavaScript
- Typechain β
π TypeScript bindings for Ethereum smart contracts - Prettier β Automatic code formatter and comes with the Solidity plugin
- Yarn Berry β Fast, reliable, and secure dependency management for JavaScript.
π·
Network Configurations Ethereum networks require an API Key for JSON-RPC Provider either Alchemy or Infura
You can generate these configurations using the
-p
or--provider
command, see options
- Ethereum β Mainnet, GΓΆrli and Rinkeby
- Polygon (previously matic) β Mainnet and Mumbai
- Smart Chain β Mainnet and Testnet
π
Future - scaffold-eth-like interface for quickly testing your smart contract
- Intuitive command-line menu prompts
- Ability to opt-out and use
npm
orJavaScript
- Initialize with an example template like ERC20 Token, ERC721 NFT, AMM, and Lending Protocol
Feel free to suggest anything ππ»
License
Farrel Darian (farreldarian) MIT
Mentions
Some ways and code adopted from create-next-app