Skip to content

feat: sync inventory contract with registry to prevent double-allocation#1107

Merged
Emeka000 merged 1 commit into
Emeka000:mainfrom
KingFRANKHOOD:fix/inventory-registry-sync
Jun 29, 2026
Merged

feat: sync inventory contract with registry to prevent double-allocation#1107
Emeka000 merged 1 commit into
Emeka000:mainfrom
KingFRANKHOOD:fix/inventory-registry-sync

Conversation

@KingFRANKHOOD

Copy link
Copy Markdown
Contributor

Pr Summary

InventoryContract could allocate/reserve the same blood unit independently of the HealthChain registry, creating a race condition where two hospitals get the same unit.

What Changed

  • Added a cross-contract sync layer. The InventoryContract now checks registry availability before reserving and notifies the registry on reserve/release. The registry's write endpoints are guarded by env.current_contract_address().

@Emeka000 Emeka000 merged commit 0a430b3 into Emeka000:main Jun 29, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment