Skip to content

ankurdaharwal/NFTMarketplace

Repository files navigation

NFT Marketplace

Version Prerequisite

A Non-Fungible Tokens based decentralised marketplace to bid and purchase collectibles on a P2P public network.

Documentation

Setup

  • yarn

Run local node, compile & migrate (Deploy) Contracts

  • yarn deploy (Default network: local Hardhat development network)

It runs up a Hardhat node, compile contracts, generates typescript interfaces, creates React context and instantiates your contract instances and factories with frontend provider.

Start the DApp User Interface

  • Open up a new terminal
  • Enter the frontend directory: cd frontend
  • Install dependencies: yarn
  • Import seed phrase in Metamask. The default mnemonic currently used by hardhat is test test test test test test test test test test test junk
  • Ensure Metamask RPC is set to http://localhost:8545 and chainID 31337.
  • Start the React app yarn start localhost:3000

Image from Gyazo

Because of the default hardhat.config.ts it will first try to connect with an injected provider like Metamask (web3modal package does this).

If nothing found it will try to connect with your hardhat node. On localhost and hardhat nodes it will inject your mnemonic into the frontend so you have a "browser wallet" that can both call and send transactions. NB! Dont ever put a mnemonic with actual value here.

In hardhat.config.ts there is example on how to instruct your hardhat-network to use mnemonic or privatekey.

const config: HardhatUserConfig = {
  react: {
    providerPriority: ["web3modal", "hardhat"],
  },
};

Ensure you are using RPC to http://localhost:8545.

You may also need to set the chainID to 31337 if you are using Hardhat blockchain development node.

Invalid nonce.

eth_sendRawTransaction
  Invalid nonce. Expected X but got X.

Reset your account in Metamask.

We ❤️ these Ethereum projects:

About

ERC-721 based Collectible Non-Fungible Tokens Marketplace

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published