(Final Project: Consensys Blockchain Developer Bootcamp)
Nitashia Johnson for The New York Times.
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.
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
- Node.js
- Truffle
- Ganache
- npm
git checkout main
- run
npm install
in theclient
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
- 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
0x6c6F915B21d43107d83c47541e5D29e872d82Da6
- 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.
- a seller will fill a form to add a market item, its price and quantity
- the market item will populate the inventory list
client
: project's React frontendcontracts
: solidity contracts deployed on the Rinkeby testnetmigrations
: migration files for deploying the contracts in the contracts directorytest
: tests for smart contracts