Skip to content

Latest commit

 

History

History
100 lines (77 loc) · 4.8 KB

README.md

File metadata and controls

100 lines (77 loc) · 4.8 KB

NFT-Marketplace

Description

home

This is a simple NFT marketplace built with Next.js, Hardhat, and IPFS. It allows users to mint their own NFTs and list them for sale. Users can also purchase NFTs listed for sale and resell them at a later date.

Technologies

  • Next.js
  • Hardhat
  • IPFS
  • Solidity
  • Infura
  • Metamask

Dependencies

  • ethers
  • hardhat
  • @nomiclabs/hardhat-waffle
  • @nomiclabs/hardhat-ethers
  • ethereum-waffle
  • chai
  • web3modal
  • @openzeppelin/contracts
  • ipfs-http-client@50.1.2
  • axios

Setup

  • Clone the repo
git clone
  • Move into the main project directory
cd nft-marketplace
  • Install dependencies
npm install
  • Create a .env.local file in the root directory and add the following
NEXT_PUBLIC_project_Id = YOUR_INFURA_IPFS_PROJECT_ID
NEXT_PUBLIC_project_Secret = YOUR_INFURA_IPFS_PROJECT_SECRET
  • Open three terminal windows and run the following commands in each
npx hardhat node
npx hardhat run scripts/deploy.js --network localhost
npm run dev

Deployment

  • To deploy to the Polygon Mumbai Testnet, you will need to create two .env file in the root directory and add the following

.secretAccount

PRIVATE_KEY_OF_ACCOUNT_WITH_MATIC

.secretProject

INFURA_PROJECT_ID
  • To deploy to the Polygon Mumbai Testnet, run the following command
npx hardhat run scripts/deploy.js --network mumbai
  • Replace the provider in the index.js file inside the loadNFTS() function with the following
/* pages/index.js */

/* old provider */
const provider = new ethers.providers.JsonRpcProvider()

/* new provider */
const provider = new ethers.providers.JsonRpcProvider("https://rpc-mumbai.maticvigil.com")

Demo

You can use the above address instead of deploying your own contract to test the app, but you will have to replace the contract address in the config.js file with the above address, compile the NFTMarket.sol contract for it's abi and still replace the provider as shown above.