Skip to content

levblanc/web3-nft-marketplace-hardhat

Repository files navigation


Logo

Web3, Full Stack Solidity, Smart Contract & Blockchain development with JavaScript

My Web3 full stack Solicity smart contract & blockchain development journey along with
» this course from Patrick Collins



view marketplace app in action


Getting Started

  1. Clone the repo
git clone https://github.com/levblanc/web3-nft-marketplace-hardhat.git
  1. Install dependencies with yarn install or npm install

  2. Create a .env file under project's root directory

PRIVATE_KEY=private_key_of_your_wallet
ETHERSCAN_API_KEY=your_etherscan_api_key
GOERLI_ALCHEMY_URL=rpc_url_from_provider
GOERLI_INFURA_URL=rpc_url_from_provider
PINATA_API_KEY=pinata_api_key
PINATA_API_SECRET=pinata_api_secret
UPLOAD_TO_PINATA=boolean_of_your_choice
UPDATE_FRONT_END=boolean_of_your_choice

Usage

For local development:

# spin up hardhat local node
yarn localhost

# deploy contract
yarn deploy:local

# Run `mint` function
yarn mint:local

For Goerli testnet:

# deploy contract to Goerli
yarn deploy:goerli

# Run `mint` function
yarn mint:goerli

Run tests

# Run unit tests
yarn test

Check tests coverage

yarn coverage

[Optional] Generate converage report

// hardhat.config.js
module.exports = {
  // ... other configs
  gasReporter: {
    enabled: true, // set to true when needs a report
  },
};

Lint Solidity files

# Lint only
yarn lint

# Lint & fix
yarn lint:fix

Code formatting

yarn format

Skills

  • Solidity
  • JavaScript
  • Hardhat
  • Chai
  • Mocha
  • Pinata

Roadmap

  • Creating a marketplace for ERC721 NFTs
  • Concept of 'Pull Over Push' when sending ETH
  • Ins & outs of Reentrancy attack
  • Solidity Events with indexed params
  • Solidity modifiers - review and application on marketplace
  • Unit tests for all NFTs
  • Scripts to interact with contract functions