AlphaDataOmega / OpenSea_NFT_Market

This is a NFT Marketplace project I've been working on just for fun so I can understand more about OpenSea and creating NFT smart contracts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Open Punks

Technology Stack & Tools

  • Solidity (Writing Smart Contract)
  • Javascript (React & Testing)
  • Web3 (Blockchain Interaction)
  • Truffle (Development Framework)
  • Ganache (For Local Blockchain)
  • Infura.io (For copying the Ethereum mainnet)
  • MetaMask (Ethereum Wallet)
  • Git/GitHub (Commit our code)
  • Fleek (Website Deployment)

Requirements For Initial Setup

  • Install NodeJS, I recommend using node version 10.16.3 to avoid any potential dependency issues
  • Install Truffle, In your terminal, you can check to see if you have truffle by running truffle --version. To install truffle run npm i -g truffle.
  • Install Ganache.
  • Install MetaMask in your browser.

Setting Up

1. Clone/Download the Repository

2. Install Dependencies:

$ npm install

3. Setup .env File

Create a .env file or rename the .env.example file, and update the values. The API & IPFS keys are technically optional for local testing, if you plan to deploy to the testnet or mainnet, you'll need to update those values.

4. Start Ganache

5. Migrate Smart Contracts

$ truffle migrate --reset

6. Run Frontend Application

In a separate CMD prompt/terminal run: $ npm start

7. (Optional) Test Smart Contracts

$ truffle test

Preparing for Contract Deployment

  • Create or log in to your Infura.io account and create a new project, and save your project ID located in your project settings, you'll need this if deploying to Ethereum Mainnet, or Rinkeby Testnet.

  • If deploying to Polygon, you may need to setup the network in MetaMask. To do this, open MetaMask, in the top right click on your profile icon -> Settings -> Networks -> Add Network.

Funding your MetaMask Wallet

  • If deploying to Polygon Mainnet, you will need to fund your MetaMask account with MATIC on the polygon chain, How you decide to transfer/fund is entirely upto you. Keep in mind if you have MATIC currently on the Ethereum Mainnet, you will need to bridge your MATIC over to the polygon chain. You can do this by visiting https://wallet.polygon.technology/, also keep in mind you will have to have ETH in your account to cover gas fees!

  • If deploying to Rinkeby testnet, you may use this ETH faucet supplied by chainlink to fund your account: https://faucets.chain.link/rinkeby.

  • If deploying to Polygon Mumbai testnet, you may use this MATIC faucet: https://faucet.polygon.technology/

1. Setup your .env file

Create a .env file in the root directory of your project, and fill in the following:

  • DEPLOYER_PRIVATE_KEY="YOUR_PRIVATE_KEY"

  • INFURA_API_KEY="PROJECT_ID"

  • ETHERSCAN_API_KEY="API_TOKEN"

  • PROJECT_NAME="YOUR_PROJECT_NAME"

  • PROJECT_SYMBOL="YOUR_PROJECT_SYMBOL"

  • MINT_COST=0

  • MAX_SUPPLY=1000

  • IPFS_IMAGE_METADATA_CID="IPFS_CID"

  • IPFS_HIDDEN_IMAGE_METADATA_CID="IPFS_CID"

  • NFT_MINT_DATE="MON DD, YYYY 20:00:00"

2. Run your migrations

  • For Rinkeby testnet: truffle migrate --reset --network rinkeby
  • For Polygon Mainnet: truffle migrate --reset --network matic

3. Verify your contracts

  • For Rinkeby testnet: truffle run verify OpenPunks --network rinkeby
  • For Polygon Mainnet: truffle run verify OpenPunks --network matic

Preparing for Frontend Deployment

1. Create or Login to your GitHub account

2. Create a new repository

Input the name of your project, and a description if you wish. You may also choose to make the repository public or private

4. Create or sign in to your Fleek account

Easiest option is to sign in with your GitHub account.

Click on Add new site & Connect with GitHub

Configure and select your repo to deploy

For deploy location, select IPFS hosting

On the build options and deploy tab, under the section Basic Build Settings, for framework select Create React App, then click on Deploy site.

About

This is a NFT Marketplace project I've been working on just for fun so I can understand more about OpenSea and creating NFT smart contracts.


Languages

Language:Solidity 63.9%Language:JavaScript 28.8%Language:CSS 4.7%Language:HTML 2.2%Language:Shell 0.4%