Problem
The escrow contract releases 100% of the held funds to the carrier on delivery confirmation. There is no mechanism to deduct a platform service fee before release. Without this, the platform has no on-chain revenue model and must rely entirely on off-chain accounting.
Proposed Solution
Create a fee-aware escrow contract inside contracts/package/escrow-with-fees/ that automatically deducts a configurable platform fee from the release amount and routes it to a treasury address.
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 escrow contract releases 100% of the held funds to the carrier on delivery confirmation. There is no mechanism to deduct a platform service fee before release. Without this, the platform has no on-chain revenue model and must rely entirely on off-chain accounting.
Proposed Solution
Create a fee-aware escrow contract inside
contracts/package/escrow-with-fees/that automatically deducts a configurable platform fee from the release amount and routes it to a treasury address.Acceptance Criteria
platform_fee_bps: u32(basis points) set at contract initialization (e.g., 250 = 2.5%)release_funds, not onfund_escrowplatform_treasury: Addressset at initializationfunded_amount - fee; treasury receivesfeeReleaseWithFeeevent emits{ carrier_amount, fee_amount, treasury_address }platform_fee_bpsis updatable by admin; an update event is emitted on change