Mint NFTs on the Mumbai testnet and list them for sale. You can even sell them to your friends. Make sure to connect your wallet on the Mumbai testnet
This Marketplace allows you to do the following:
- Create NFTs on the Mumbai testnet - Which you can check out on Opensea Testnet
- Set a sale price of your NFT
- provide a list of NFTs that you've minted, and ones that you own
- Allows you to "buy" and transfer ownership of those NFTs
This is my project to go along with Nader Dabit's blog post Building a Full Stack NFT Marketplace on Ethereum with Polygon
To run this project locally, follow these steps.
- Clone the project locally, change into the directory, and install the dependencies:
yarn
- Open another terminal tab in the project directory and start the local Hardhat node
npx hardhat node
- With the local node running, deploy the contracts
npx hardhat run scripts/deploy.js --network localhost
This will produce an output similar to this
nftMarket deployed to: 0x5FbDB2315678afecb367f032d93F642f64180aa3 // Your contract address will be different!
nft deployed to: 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 // Your contract address will be different!
- Double check that the following 4 files are all in the
.gitignore
- Create these 4 files:
.env
- PasteNEXT_PUBLIC_WORKSPACE_URL="https://rpc-mumbai.maticvigil.com"
.secret
- Paste a wallet account private key.infuraId
- Paste your infura API key.polygonScanApiKey
- Paste yor PolygonScan API key
- Google how to do these things if you're not sure how
- Using the
config.example.js
and the contract addresses above, create aconfig.js
file and input values with your contact addresses:
export const nftmarketaddress = "0x02f696d4Cf0B61376FF1c9fe6b669b4F7bD8055C" // Your contract address will be different!
export const nftaddress = "0xC4B9D5414D3931027C7529A7E598072ab1F20F48" // Your contract address will be different!
- Start the UI and view it at
localhost:3000
with the following command
yarn dev
- Deploy to Mumbai with the following command:
npx hardhat run scripts/deploy.js --network mumbai
- Verify your contracts - using your deployed contract addresses:
npx hardhat verify --network mumbai 0x02f696d4Cf0B61376FF1c9fe6b669b4F7bD8055C
npx hardhat verify --network mumbai 0xC4B9D5414D3931027C7529A7E598072ab1F20F48 "0x02f696d4Cf0B61376FF1c9fe6b669b4F7bD8055C"