Skip to content

Latest commit

 

History

History

03-hardhat-fund-me


Logo

Full Blockchain, Solidity & Full-Stack Web3 development with JavaScript

Everything related to my progress through this course from Patrick Collins
Go to the video »


Trying out / testing

To get a local copy up and running follow these simple example steps.

You will need to install either npm or yarn to run the commands, and git to clone the repository.

Installation

  1. Clone the whole repo:
    git clone https://github.com/0xpolarzero/full-blockchain-solidity-course-js.git
  2. Navigate into the subdirectory:
    cd 03-hardhat-fund-me
  3. Install NPM packages using yarn or npm install.
  4. Create a .env file at the root of the project, and populate it with the following variables:
     GOERLI_RPC_URL = goerli_rpc_from_provider
     PRIVATE_KEY = your_wallet_private_key
     ETHERSCAN_API_KEY = your_etherscan_api_key
     COINMARKETCAP_API_KEY = your_coinmarketcap_api_key

Usage

Deploy:

yarn hardhat deploy

You can specify the network to deploy to with the --network flag, e.g. yarn hardhat deploy --network goerli. You can use polygon, goerli, hardhat, localhost. The latter will require you to run a local node first with the following command.

Run a local node:

yarn hardhat node

Run tests:

yarn hardhat test

Report coverage:

yarn hardhat coverage

To get the gas usage report included or not, change enabled to true or false in the hardhat.config.js file.

gasReporter: {
    enabled: true,
}

Achievements

  • Deploying multiple/selected contracts with Hardhat
  • Mocking a Chainlink price feed for testing
  • Unit & Staging tests
  • Interacting with storage in Solidity
  • Gas optimization, using storage, immutable & constant variables

Skills

Solidity JavaScript Hardhat Chai Mocha Chainlink