1.0.0 • Published 2 years ago

create-hardhat-project v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Create Hardat Project

Create a hardhat project with the best plugins around without spend hours in configuration and checking compatibilities.

Quick start

You’ll need to have Node 14.0.0 or later version on your local development machine (but it’s not required on the server). We recommend using the latest LTS version. You can use nvm (macOS/Linux) or nvm-windows to switch Node versions between different projects.

For the moment the only way to create a project is with npx:

npx

npx create-hardhat-project

(npx is a package runner tool that comes with npm 5.2+ and higher, see instructions for older npm versions)

It will create a directory called my-project inside the current folder. Inside that directory, it will generate the initial project structure and install the dependencies:

my-project
├── contracts
│   └── Greeter.sol
├── deploy
│   └── 01-deploy-greeter.js
├── scripts
│   └── newGreeting.js
├── test
│   └── Greeter.test.js
├── utils
│   └── verify.js
├── example.env
├── hardhat.config.js
├── helper-hardat-config.js
├── package.json
└── README.md

Once the installation is done, you can open your project folder:

cd my-project

Quick configuration

  1. Rename the .env.example to .env and put your key here.
  2. If you need to deploy to a network not already built-in you can edit the hardhat.config.js to add it.

You' ll be able to write your own contract, compile and deploy to multiple network, estimate the gas fee and write test verifing the coverage automatically

Built-in command:

npm test

  • Runs all the test into test folder.

npm compile

  • Compile the contracts into contracts folder and make the artifacts and cache folder to save the results.

npm deploy

  • Runs all the deploy scripts in numerical/alphabetical order, it deploy to hardhat local network.

npm deploy:rinkeby

  • Runs all the deploy scripts in numerical/alphabetical order, it deploy to rinkeby test network.

npm deploy:goerli

  • Runs all the deploy scripts in numerical/alphabetical order, it deploy to goerli test network.

npx hardhat run scripts/*

  • Runs the specified script into the scripts folder

What is included?

Contributing to this project 👊

Thanks for showing interest to contribute to Create hardat project!

Follow the directions below to setup your project and contribute to this repository.

  1. Fork the repo (click the Fork button at the top right of this page)

  2. Clone your fork locally

git clone https://github.com/<YOUR_USERNAME>/create-hardhat-project.git
cd create-hardhat-project
  1. Setup all the dependencies and packages
npm install

Once you submit a PR, we'll respond as soon as possible so we can take a look at what you've made!

Making a Pull Request?

That's awesome! Start by following the instructions given earlier of how to run this project on your system locally.

Then, commit and push your changes:

git add .
git commit -m "My commit message"
git push

Once finished, you can create a pull request!

Is it your first time? Check out this link to learn how to submit a pull request.

Think you found a bug? 🐛

Please submit an issue and provide a clear path to reproduction with a code example.

The clearer you are, the easier it will be for us help!

License

Create hardhat project is open source software licensed as MIT.

Do you like my work?

Contact me on (Linkedin)https://linkedin.com/in/raoulpicconi or see my other work on (Github)https://github.com/raoulpicconi