ahsan7162 / NFT-Marketplce

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NFT Marketplace

Introduction

In this project we created a NFT marketplace based on ethereum tokens. The basic purpose of this project was to create a portal for buying and selling of NFTs and make use of smart contracts developed using solidity.

lx8avrmuwqswx9roub2g

Technologies Used

  • Solidity development environment : HardHat HardHat provides us with a local environment for developing, deploying and debugging the smart contract using local machine. HardHat is local Ethereum network designed for development.
  • Web3 API : Infura Network It is a suite of high availability APIs and Developer Tools provide quick, reliable access to the Ethereum and IPFS networks
  • Web application framework : Next.js Next.js is fullstack framework based on the react.js to create UI and backend logic for web applications.
  • Ethereum Web Client Library : Ethers.js

The ethers.js library aims to be a complete and compact library for interacting with the Ethereum Blockchain and its ecosystem

  • Wallet Software: Metamask Available as a browser extension and as a mobile app, MetaMask equips you with a key vault, secure login, token wallet, and token exchange—everything you need to manage your digital assets.

Architecture

Blockchain Project drawio

Working Of Project

  • When a user puts an NFT for sale, the ownership of the item will be transferred from the creator to the marketplace contract.

  • When a user purchases an NFT, the purchase price will be transferred from the buyer to the seller and the item will be transferred from the marketplace to the buyer.

  • The marketplace owner will be able to set a listing fee. This fee will be taken from the seller and transferred to the contract owner upon completion of any sale, enabling the owner of the marketplace to earn recurring revenue from any sale transacted in the marketplace.

Project Pre-requesite

  1. Metamask Chrome Extension

Clone the Project

git clone https://github.com/owaisimran2411/BlockChain_Project.git

Project Initial Setup

After cloning the project, go to the directory where the project was download and execute the following commands

cd nft-marketplace
npm install

Project Server Execution

Open three terminals into the same directory:

  1. Terminal 1: Execute a Hardhat Node
npx hardhat node
  1. Terminal 2: Deploy the nft and nft-marketplace contracts
npx hardhat run scripts/deploy.js --network localhost

After the contract is deployed on localhost, copy the nft market address and nft address and replace them in the file: ./config.js

export const nftaddress = "***"             //replace '***' with copied nft-address
export const nftmarketaddress = "***"       //replace '***' with copied nft-market-address
  1. Terminal 3: Execute the next.js server for web application
npm run next dev

After Terminal 3 is up and running goto the website

Project Execution

  1. From terminal 1, copy private key for any of the 20 accounts provided and import that wallet into the metamask wallet.
    NOTE: YOUR METAMASK WALLET SHOULD BE RUNNING ON LOCALHOST
  2. In the web application, go to sell NFT option and list your NFT, you will see that your NFT is currently available for sale.

Contributors

The Project is Contributed by:

About


Languages

Language:JavaScript 70.0%Language:Solidity 23.0%Language:CSS 7.0%