Git Product home page Git Product logo

CineCapsule Project 🍿

Principle

  • A user puts an item for sale, the ownership of the item will be transferred from the creator to the marketplace.
  • A user purchases an item, 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.

The marketplace logic will consist of two smart contracts

  • NFT Contract - This contract allows users to mint unique digital assets.
  • Marketplace Contract - This contract allows users to put their digital assets for sale on an open market.

Docs.

Main technologies used 🧰

  • Web application framework - Next.js
  • Solidity development environment - Hardhat
  • File Storage - IPFS
  • Ethereum Web Client Library - Ethers.js

Prerequisites

  • Node.js installed on your machine
  • Metamask wallet extension installed as a browser extension

About Polygon

"Polygon is a protocol and a framework for building and connecting Ethereum-compatible blockchain networks. Aggregating scalable solutions on Ethereum supporting a multi-chain Ethereum ecosystem."

Local setup

To run this project locally, follow these steps.

  1. Clone the project locally, change into the directory, and install the dependencies:
git clone https://github.com/Margotte83/Kryptopixel-marketplace.git

cd Kryptopixel-marketplace

# install using NPM or Yarn
npm install

# or

yarn
  1. Start the local Hardhat node
npx hardhat node
  1. With the network running, deploy the contracts to the local network in a separate terminal window
npx hardhat run scripts/deploy.js --network localhost
  1. Start the app
npm run dev

Configuration

To deploy to Polygon test or main networks, update the configurations located in hardhat.config.js to use a private key and, optionally, deploy to a private RPC like Infura.

require("@nomiclabs/hardhat-waffle");
const fs = require('fs');
const privateKey = fs.readFileSync(".secret").toString().trim() || "";

// infuraId is optional if you are using Infura RPC
const infuraId = fs.readFileSync(".infuraid").toString().trim() || "";

module.exports = {
  defaultNetwork: "hardhat",
  networks: {
    hardhat: {
      chainId: 1337
    },
    mumbai: {
      // Infura
      // url: `https://polygon-mumbai.infura.io/v3/${infuraId}`
      url: "https://matic-mumbai.chainstacklabs.com",
      accounts: [privateKey]
    },
    matic: {
      // Infura
      // url: `https://polygon-mainnet.infura.io/v3/${infuraId}`,
      url: "https://rpc-mainnet.maticvigil.com",
      accounts: [privateKey]
    }
  },
  solidity: {
    version: "0.8.4",
    settings: {
      optimizer: {
        enabled: true,
        runs: 200
      }
    }
  }
};

If using Infura, update .infuraid with your Infura project ID.

🚨 Be sure to never commit any private keys to Git. To be extra safe, consider storing these values in temporary environment variables when working with wallets that contain real tokens. To omit from Git, add .secret to your .gitignore file.

Basic Sample Hardhat Project

This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, a sample script that deploys that contract, and an example of a task implementation, which simply lists the available accounts.

Try running some of the following tasks:

npx hardhat accounts
npx hardhat compile
npx hardhat clean
npx hardhat test
npx hardhat node
node scripts/sample-script.js
npx hardhat help

cinecapsule's Projects

backer icon backer

Support artists by sending them token stream

hashlips_art_engine icon hashlips_art_engine

HashLips Art Engine is a tool used to create multiple different instances of artworks based on provided layers.

metamask_etherjs icon metamask_etherjs

Connect my react app to MetaMask 🦊 browser wallet. Tools πŸ›  utilized: React, MetaMask , and Ethers.js

subway icon subway

Subway is a set of 306 pixel perfect crafted icons optimized for mobile

tribute-ui icon tribute-ui

Tribute - A modular DAO framework developed and coordinated by its members

valentine-day icon valentine-day

DApp that allows you to mint a collection of NFTsπŸΏπŸ’•

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.