This repository contains a Solidity smart contract for a supply chain management system. The contract allows tracking the lifecycle of products from creation to delivery using the MODE blockchain.
contract deployed on mode: https://sepolia.explorer.mode.network/address/0xb1e52226fB72585BFA3e63bA8Cb12b4D6EeFd255 Token Contract : https://sepolia.explorer.mode.network/address/0x16624074F5cFff83F51E9bA40F1e34FbA6fa90A5
- Product creation with creator's details, name, price, and creation timestamp.
- State management with various states (Created, InTransit, Delivered, Completed).
- Ownership transfer between participants.
- Payment handling using an ERC20 token.
- Shipment history tracking.
- Admin role for managing contract-related actions.
- Solidity development environment (Truffle, Remix, etc.)
- An ERC20 token contract (for payment handling)
- Deploy the ERC20 token contract on the Ethereum network.
- Deploy the Supply Chain Management smart contract, providing the address of the deployed ERC20 token contract.
-
Create a Product: Call the
createProductfunction to create a new product. Provide the product name and price in ETH. -
Update State: Call the
updateProductStatefunction to update the state of a product. This function should be used to move the product through its lifecycle. -
Transfer Ownership: Call the
transferProductOwnershipfunction to transfer ownership of a product to another address. -
Update Price: Call the
updateProductPricefunction (admin-only) to update the price of a product. -
Make Payment: Call the
makePaymentfunction to make a payment for a product using the ERC20 token. -
Complete Delivery: Call the
completeDeliveryfunction to mark the delivery of a product as completed. -
Complete Product: Call the
completeProductfunction to mark a product as completed. -
Get Shipment History: Call the
getShipmentHistoryfunction to retrieve the shipment history of a product.
Contributions to this project are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature:
git checkout -b feature-name - Commit your changes:
git commit -m "Add feature" - Push to the branch:
git push origin feature-name - Create a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.