You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The shipment contract changes state without emitting any Soroban events. External indexers, analytics systems, and the FreightFlow backend have no way to react to on-chain state changes without polling every contract state, which is impractical and expensive.
Proposed Solution
Create a new shipment contract inside contracts/package/shipment-events/ that emits a structured Soroban event on every state transition.
Note: All work must be done inside the contracts/package/ directory. Do not modify any existing contract files outside this folder.
Acceptance Criteria
Events emitted for all transitions: ShipmentCreated, ShipmentAccepted, InTransit, Delivered, Completed, Disputed, Cancelled
Each event payload includes: shipment_id, new_status, actor_address, ledger_timestamp
Events use env.events().publish() as per the Soroban SDK specification
Event topic is a (Symbol, BytesN<32>) tuple of (event_name, shipment_id) for efficient indexer filtering
Unit tests use the Soroban test harness to assert that the correct event is emitted with the correct payload for each transition
Problem
The shipment contract changes state without emitting any Soroban events. External indexers, analytics systems, and the FreightFlow backend have no way to react to on-chain state changes without polling every contract state, which is impractical and expensive.
Proposed Solution
Create a new shipment contract inside
contracts/package/shipment-events/that emits a structured Soroban event on every state transition.Acceptance Criteria
ShipmentCreated,ShipmentAccepted,InTransit,Delivered,Completed,Disputed,Cancelledshipment_id,new_status,actor_address,ledger_timestampenv.events().publish()as per the Soroban SDK specification(Symbol, BytesN<32>)tuple of(event_name, shipment_id)for efficient indexer filtering