A Next.js marketplace app that uses the Web3 and IPFS APIs of Infura to mint, buy and sell NFTs.
You will need an Infura account with the following product keys:
- Web3 API
- IPFS
Make a copy of the example environment variables file and name it .env.local
cp .env.example .env.local
Populate the environment variables with the values shown in your Infura account.
Install dependencies with:
yarn install
Start a local Hardhat node with:
yarn start:hardhat
Deploy the 2 smart contracts to the local node with:
yarn deploy:hardhat
This command will also write the contract addresses to a file at
./config.js
where they can be consumed by the app.
Start the development server:
yarn dev
Open http://localhost:3000 with your browser to see the marketplace app.
This app uses 2 smart contracts:
MBMarket.sol
- fetching NFTs, keeping track of sold/unsold NFTs, creating sales (buying transactions)NFT.sol
- for storing URIs and minting tokens