Mouzayan / blockchain-developer-bootcamp-final-project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

supply chain management on the blockchain

(Final Project: Consensys Blockchain Developer Bootcamp)

Empty Shelves at Target

Nitashia Johnson for The New York Times.

Overview

It comes as no shock that it’s common practice in some businesses and industries to overstate the scarcity of a certain item in order to spike demand and perceived value. This project provides a safe and secure way for buyers of commodities (fuel, medical and household goods, etc.) to make purchases with transparency about the seller’s available inventory at a previously locked in price and locked in quantities (DECLARED INVENTORY). This is especially useful for buyers during periods of crisis. The application takes advantage of the blockchain's secure, verified and distributed ledger to manage inventory, verifying the supply chain of goods and limiting anyone’s ability to intentionally manipulate pricing by faking scarcity.

Seller

The supplier must record both the price and quantity of their inventory six months before it is available for sale. At that point, both price and inventory are locked in regardless of future market conditions.

Buyer

Consumers elect to purchase from suppliers who participate in this system of transparency and accountability. As consumers purchase a good, the ledger is updated via Smart Contract and the updated stock values are revealed to all buyers. Inventory pricing and quantities are constantly verified over time making it very difficult to artificially manipulate their values. This secure marketplace for goods, especially in countries with uncertain market conditions, will attract a critical mass of buyers who prefer to make verified purchases thus putting pressure on suppliers to participate in the marketplace.

Safeguards

If a vendor makes fake claims, they will get punished by being expelled from participation in the marketplace. Their profits will be slashed.

Project url

DApp

Screencast

Vimeo link

TO RUN THE PROJECT LOCALLY

Requirements:

  • Node.js
  • Truffle
  • Ganache
  • npm
  • git checkout main

Solidity backend:

  • run npm install in the client folder to install Truffle and smart contract dependencies
  • run ganache-cli to start a local testnet on port 8545
  • truffle migrate --network development
  • truffle console --network development
  • run tests in Truffle console with test
  • development network chain id is 5777

Launching the React frontend:

  • cd client
  • run npm run start
  • access the app locally at http://localhost:3000
  • your Metamask localhost network should be set to port 8545 and chain id 5777

Public Ethereum account for certification

0x6c6F915B21d43107d83c47541e5D29e872d82Da6


MVP

  • Smart contract MVP has the buy and transfer occurring at the same time. It does not implement a Withdrawal Pattern for pull vs. push.
  • UI MVP only reflects the seller portion of the app, allowing a user to add market items and have them display in the Items for Sale list.

MVP Workflow

  • a seller will fill a form to add a market item, its price and quantity
  • the market item will populate the inventory list

Directory Structure

  • client: project's React frontend
  • contracts: solidity contracts deployed on the Rinkeby testnet
  • migrations: migration files for deploying the contracts in the contracts directory
  • test: tests for smart contracts

 

About

License:MIT License


Languages

Language:JavaScript 71.9%Language:Solidity 12.8%Language:SCSS 8.4%Language:HTML 4.8%Language:CSS 2.1%