Skip to content

khalidfsh/drug-supply-chain

Repository files navigation

drug-supply-chain

An Ethereum DApp that demonstrates a Supply Chain flow from a Designer of a drug along to the end user Buyer(consumer). Regulator whos responsable for approve the drug. Manufacturer can act as a owner of a drug design or bulid partner contract with a designer. A Distributor should act as middleman between manufacturer to retailer to last actor in the system consumer.

Live demo on rinkeby network.

UML Architecture

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Please make sure you've already installed ganache-cli, Truffle and enabled MetaMask extension in your browser.

npm install -g ganache-cli truffle

or use npx befor every npm package comand.

clone this repository using Git.

install project packages for blockchain and frontend project

npm i 
cd frontend && npm i

Start Development

Launch Ganache with unlimited gas (important), more balances.

npx ganache-cli --gasLimit=0x1fffffffffffff --allowUnlimitedContractSize -e 1000000000

start new terminal tab and start compiling contract codes

truffle compile

test contract using truffle

truffle test

if you want to test it using front end migrate contract to ganache local network and make sure you copy some addresses to MetaTask. hence, first account (deployer) will has all the roles and he is the only one can approve or give regulator role to another address.

truffle migrate --reset

locate to frontend project and start development

cd frontend && npm start

Libraries

  • Partnerships: library keep track partner in a partnership contract with known share. I write it to make project less smaller and to try the power of spilted payment contract.
  • Roles: library from Open Zeppelin contract thats keep track of a mapping list of address in any role based contract.

IPFS

Deployed Contract Address (Rinkeby)

0x9c9b36c9b8049eb954fc2a8d73fc900132521f21

TransctionsHash for Live Testing


Built With ❤️ Using:

  • Udacity
  • Ethereum - Ethereum is a decentralized platform that runs smart contracts.
  • Truffle - development environment, testing framework and asset pipeline for blockchains using the Ethereum Virtual Machine (EVM).
  • OpenZeppelin - A library for secure smart contract development. It provides implementations of standards like ERC20 and Ownable.
  • React - A library for secure smart contract development. It provides implementations of standards like ERC20 and Ownable.
  • OpenZeppelin - A library for secure smart contract development. It provides implementations of standards like ERC20 and Ownable.