Skip to content

Simplestorage Contract with Hardhat support. Hardhat provides fully automated contract handling and makes our life Easy.

Notifications You must be signed in to change notification settings

theirrationalone/hardhat-simple-storage

Repository files navigation

SimpleStorage Hardhat Project

This project demonstrates SimpleStorage Hardhat use case. It comes with SimpleStorage contract, a test for that contract, and a script that deploys that contract.

If You want to run this project on "GOERLI" testnet and don't know how to get Ready Your Project to work with "GOERLI TESTNET" and Having ETH fund/balance Issue. click here




SETTING ENVIRONMENT VARIABLES

Create a file .env and add keys given below with your credentials

  • GOERLI_RPC_URL=your-rpc-from-alchemy-app

  • METAMASK_PRIVATE_KEY=your-metamask-private-key

  • COINMARKETCAP_API_KEY=your-coinmarketcap-api-key

  • ETHERSCAN_API_KEY=your-etherscan-api-key


if you don't have etherscan api key then Go [here](https://etherscan.io/register) and signup/login here. After signing up or logging in click on 'API KEYS' then click on 'Add' you would've your etherscan api key.

if you don't have coinmarketcap api key then Go here and signup/login here. After signing up or logging in you would've your coinmarketcap api key.




RUNNING SCRIPTS

Note:

Follow Steps below if You are running your project on vs code otherwise open your terminal / shell / bash / cmd, with admin privileges then go to your project's directory i.e. as on windows "C:/users/username/documents/your_project/" and then paste and run commands given below in sequence.




Copy code below, Go to Your Project, Open Terminal then paste it into terminal.

npm install --force

Try running some of the following tasks: 🚀🚀🚀

npx hardhat help
npx hardhat test
REPORT_GAS=true npx hardhat test
npx hardhat coverage
npx hardhat node
npx hardhat run scripts/deploy.js
npx hardhat run scripts/deploy.js --network goerli

Try running Command Given Below...

Shows all available command:

npx hardhat


Prints Number of accounts to work with local Project development on local/hardhat node:

npx hardhat accounts


Prints Number of accounts to work with local Project development on Goerli testnet:

npx hardhat accounts --network goerli


Prints Current Block Number that can be used for Transaction(s) to be Mined on local/hardhat node:

npx hardhat block-number


Prints Current Block Number that can be used for Transaction(s) to be Mined on Goerli testnet:

npx hardhat block-number --network goerli


Whilst interacting with Project you'll probably get the idea how a smart contract works, how current scripts are working and how easy working with smart contract with hardhat support is and why i write these scripts in such a way.

THANK YOU! :) 🏴‍☠️

About

Simplestorage Contract with Hardhat support. Hardhat provides fully automated contract handling and makes our life Easy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published