Code Monkey home page Code Monkey logo

nft-marketplace-task's Introduction

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.

nft-marketplace-task's People

Contributors

miguelleonmarti avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.