Problem
The shipment and escrow contracts are entirely independent. A carrier could call release_funds on the escrow contract while the corresponding on-chain shipment record still shows InTransit, bypassing the delivery confirmation requirement and receiving payment before the goods are received.
Proposed Solution
Create a validator contract inside contracts/package/cross-contract-validator/ that performs atomic cross-contract checks before allowing escrow release.
Note: All work must be done inside the contracts/package/ directory. Do not modify any existing contract files outside this folder.
Acceptance Criteria
Problem
The shipment and escrow contracts are entirely independent. A carrier could call
release_fundson the escrow contract while the corresponding on-chain shipment record still showsInTransit, bypassing the delivery confirmation requirement and receiving payment before the goods are received.Proposed Solution
Create a validator contract inside
contracts/package/cross-contract-validator/that performs atomic cross-contract checks before allowing escrow release.Acceptance Criteria
validate_and_release(shipment_id: BytesN<32>, escrow_id: BytesN<32>)functionDELIVERED; returnsShipmentNotDeliveredotherwiseFUNDEDstate; returnsEscrowNotFundedotherwisesoroban_sdk invoke_contract)