Chronify is a composable, upgradeable supply chain platform leveraging the Diamond Standard (EIP‑2535) and Hedera Token Service for end‑to‑end traceability. It provides a transparent and immutable way to track products from origin to destination, ensuring accountability and reducing fraud.
Chronify is a modular smart contract system for supply chain management, built on the Hedera network. It employs the Diamond Standard (EIP‑2535) for upgradeable, facet‑based architecture, allowing seamless extension and maintenance. Core supply chain entities—parties, products, and supply chain events—are managed as distinct facets. The system integrates Hedera Token Service (HTS) to mint and transfer NFTs representing unique products, enabling secure, verifiable, and transparent asset tracking across the supply chain.
By combining modularity, upgradeability, and HTS NFT integration, Chronify delivers a robust foundation for traceable, compliant, and future‑proof supply chain solutions.
- Modular Facet Architecture: Parties, Products, and Supply Chain logic separated into upgradable facets.
- Diamond Standard (EIP‑2535): Dynamic addition, replacement, and removal of contract functionality.
- HTS NFT Integration: Mint, transfer, and manage NFTs for unique product tracking on Hedera.
- Access Control: Role‑based permissions for parties (e.g., Supplier, Transporter, Retailer).
- Traceability: End‑to‑end product journey tracking and event logging.
- Upgradeable & Extensible: Use DiamondCut to safely upgrade or extend contract logic.
- Event Logging: On‑chain logs for party/product registration, transfer, and status changes.
- Foundry (optional, for advanced EVM tooling)
- Clone the repository:
git clone https://github.com/dadadave80/chronicle.git cd chronicle
- Install dependencies:
forge install
- Configure network:
- Update
foundry.toml
or.env
with your Hedera RPC and credentials.
- Update
src/
├── Chronicle.sol # Diamond proxy root contract
├── facets/
│ ├── PartiesFacet.sol # Party registration, roles, access control
│ ├── ProductsFacet.sol # Product/NFT management, minting, transfer
│ └── SupplyChainFacet.sol # Supply chain event logging
├── initializers/
│ └── InitHTCKeyTypes.sol # Key type initialization for HTS
├── libraries/
│ ├── LibParty.sol # Party logic, storage, helpers
│ ├── LibProduct.sol # Product logic, HTS/NFT integration
│ ├── LibSupplyChain.sol # Supply chain logic, HTS/NFT integration
│ ├── hts/
│ │ ├── LibHederaTokenService.sol # HTS interface, NFT mint/transfer
│ │ └── LibKeyHelper.sol # Key generation for HTS tokens
│ ├── logs/
│ │ ├── PartyLogs.sol # Events for party actions
│ │ ├── ProductLogs.sol # Events for product actions
│ │ └── SupplyChainLogs.sol # Events for supply chain actions
│ └── types/ # Storage structs/enums for parties/products/keys
// Register a new party (Supplier, Transporter, Retailer)
PartiesFacet.registerParty("Acme Logistics", Role.Transporter);
// Mint a new product as an NFT
ProductsFacet.addProduct("Widget A", "Batch 001", 100, 10);
// Transfer NFT from supplier to transporter
ProductsFacet.transferProduct(tokenAddress, transporterAddress, serialNumber);
// Update or query product status
ProductsFacet.getProductByTokenAddress(tokenAddress);
ProductsFacet.updateProduct(tokenAddress, "Widget A+", "Batch 001A", 120);
- Compile contracts:
forge build
- Run tests:
forge test
- Upgrade contracts (DiamondCut):
- Deploy new facet contract.
- Call
diamondCut
on the Diamond proxy with facet address and function selectors. - See EIP-2535 DiamondCut documentation for details.
- Owner lookup and management
- Compliance and audit workflows
- UI front-end for supply chain visualization
- Testnet deployment scripts
- Advanced analytics and reporting
We welcome contributions!
- Please use GitHub Issues for bug reports and feature requests.
- Follow the Pull Request template for submitting changes.
- Adhere to Solidity Style Guide and project coding standards.
- Write clear commit messages and document public functions.
This project is licensed under the MIT License.