Coffee Track is an Ethereum-based decentralized application (DApp) that showcases a supply chain flow for coffee from farmers to consumers. This project demonstrates how blockchain technology can enhance transparency and traceability in supply chains.
Coffee Track offers various features through its smart contracts:
- Role-Based Access Control: Different roles for participants like Farmers, Distributors, Retailers, and Consumers.
- Tracking Coffee Journey: From harvesting, processing, packing, for sale, sold, shipped, received to purchased stages.
- Ownership Management: Smart contract functionalities to manage ownership.
To set up Coffee Track locally:
-
Clone the repository:
git clone https://github.com/blockchaincyberpunk1/coffee-track.git
-
Navigate to the project directory:
cd coffee-track
-
Install dependencies:
npm install
-
Compile the smart contracts:
npx hardhat compile
- Owned.sol: Manages contract ownership.
- Roles.sol: Library for managing addresses assigned to a Role.
- ConsumerRole.sol: Contract to manage a 'consumer' role.
- DistributorRole.sol: Contract for distributor role management.
- FarmerRole.sol: Contract for farmer role management.
- RetailerRole.sol: Contract for retailer role management.
- SupplyChain.sol: The main contract that tracks the coffee product journey.
- Ownable.sol: Extends SupplyChain with ownership control functionalities.
To deploy the smart contracts to a local Ethereum network:
-
Start a local Ethereum node:
npx hardhat node
-
Deploy the contracts:
npx hardhat run scripts/deploy.js --network localhost
Contributions to Coffee Track are welcome! Please read our Contribution Guidelines for more information on how to report bugs, suggest features, or submit pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
Ownable contract deployed to: 0xd9D29e8a4E257A8813FF1E8CA1814C742ABb75BD