Feature: Integrate Escrow UI for Bounty Fund Management
Overview
The Core Escrow contract manages all fund pools, deposits, releases, and refunds. The main web (boundless/lib/api/escrow.ts) has escrow API helpers, but the bounty frontend has none. Contributors and creators need visibility into escrow state for trust and transparency.
Depends on: #139 (TypeScript contract bindings)
Goals
- Display escrow status on bounty detail pages
- Show locked funds, release slots, and fee breakdowns
- Enable creators to see pool state and fund release history
- Show contributors their pending payouts
Contract Methods Used
CoreEscrow.get_pool(pool_id) → Pool details
CoreEscrow.get_slot(pool_id, index) → Slot recipient and amount
CoreEscrow.is_pool_locked(pool_id) → bool
CoreEscrow.calculate_fee(amount, sub_type) → (net, fee)
Implementation Details
1. Escrow Status Badge
Create: components/bounty/escrow-status.tsx
- Show on bounty cards and detail pages
- States: "Funds Escrowed", "Partially Released", "Fully Released", "Refunded"
- Amount locked vs released
2. Escrow Detail Panel
Create: components/bounty/escrow-detail-panel.tsx
- Pool info: total amount, asset, locked status, expiry
- Release slots: recipient, amount, status (pending/released)
- Fee breakdown: gross amount, platform fee, insurance, net payout
- Transaction history links (Stellar explorer)
3. Fee Calculator Widget
Create: components/bounty/fee-calculator.tsx
- For creators: show fee breakdown before funding
- Input: bounty amount + type
- Output: net amount to contributor, platform fee, insurance fee
- Uses
calculate_fee() contract method
4. Create Hook
Create: hooks/use-escrow.ts
useEscrowPool(poolId) — read pool state
useEscrowSlots(poolId) — list release slots
useFeeCalculation(amount, subType) — calculate fees
Files Affected
Created
hooks/use-escrow.ts
components/bounty/escrow-status.tsx
components/bounty/escrow-detail-panel.tsx
components/bounty/fee-calculator.tsx
Modified
app/bounty/[bountyId]/page.tsx (add escrow panel)
components/bounty/bounty-card.tsx (add escrow badge)
Acceptance Criteria
Feature: Integrate Escrow UI for Bounty Fund Management
Overview
The Core Escrow contract manages all fund pools, deposits, releases, and refunds. The main web (
boundless/lib/api/escrow.ts) has escrow API helpers, but the bounty frontend has none. Contributors and creators need visibility into escrow state for trust and transparency.Depends on: #139 (TypeScript contract bindings)
Goals
Contract Methods Used
Implementation Details
1. Escrow Status Badge
Create:
components/bounty/escrow-status.tsx2. Escrow Detail Panel
Create:
components/bounty/escrow-detail-panel.tsx3. Fee Calculator Widget
Create:
components/bounty/fee-calculator.tsxcalculate_fee()contract method4. Create Hook
Create:
hooks/use-escrow.tsuseEscrowPool(poolId)— read pool stateuseEscrowSlots(poolId)— list release slotsuseFeeCalculation(amount, subType)— calculate feesFiles Affected
Created
hooks/use-escrow.tscomponents/bounty/escrow-status.tsxcomponents/bounty/escrow-detail-panel.tsxcomponents/bounty/fee-calculator.tsxModified
app/bounty/[bountyId]/page.tsx(add escrow panel)components/bounty/bounty-card.tsx(add escrow badge)Acceptance Criteria