miguelleonmarti / nft-marketplace-task

Marketplace to sell & buy NFTs (ERC721) with ERC20 tokens through the 0x v4 protocol

Home Page:nft-marketplace-0x-brown.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NFT Marketplace πŸ›’

Hardhat Tests Vercel

Marketplace to sell and buy NFTs (ERC721) with ERC20 tokens through the 0x v4 protocol.

Website Image

Hardhat β›“

Setup

  • Install dependencies
cd hardhat && npm install
  • Create .env file (like .env.example) with your keys
INFURA_API_KEY=
PRIVATE_KEY= # your account's private key in order to deploy contracts
ETHERSCAN_API_KEY= # to verify the deployed contracts
  • To compile the contracts and generate typechain typings for compiled contracts:
npx hardhat clean && npx hardhat compile && npx hardhat typechain
  • (Optional) You need to copy and paste the Typechain typings generated to the frontend directory so the Dapp works. There is already a script for that:
npm run typechain
  • Run tests:
npx hardhat test

Frontend πŸ’»

Tools

Installation

In order to run the project locally follow the next steps:

  • Install dependencies
cd frontend && npm install
  • Create .env file (like .env.example) with your keys. You can omit setting database variables one by one and copy the database URL directly in DATABASE_URL. The NEXT_PUBLIC_API_TOKEN helps making the API routes private, only within the client.
ALCHEMY_API_KEY=
DATABASE_HOST=
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_DB=
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB}
DATABASE_URL_WITH_SCHEMA=${DATABASE_URL}?schema=public
NEXT_PUBLIC_API_TOKEN=
  • Create and start the docker container with the PostgreSQL database:
docker compose up -d
  • Create migrations from the Prisma schema, apply them to the database and generate artifacts:
npx prisma migrate dev --preview-feature
  • Run the app:
npm run dev

Open http://localhost:3000 with your browser to see the website

Features

  • Users can request new NFT tokens to be minted, no restrictions here, anyone can request new NFT minting free-of-charge
  • Users can list their NFT token for sale for any price they want using the ERC-20 token.
  • Users can list and review all existing and yet not executed sell offers.
  • Users can accept the existing sell order from some other user and purchase the NFT using ERC-20

Details

  • ERC-20 token standard using the OpenZeppelin implementation.
  • ERC-721 token standard using the Azuki project implementation.

About

Marketplace to sell & buy NFTs (ERC721) with ERC20 tokens through the 0x v4 protocol

nft-marketplace-0x-brown.vercel.app


Languages

Language:TypeScript 98.9%Language:SCSS 0.6%Language:Solidity 0.3%Language:Shell 0.2%Language:JavaScript 0.1%