Skip to content

Integrate Escrow UI for Bounty Fund Management #143

Description

@0xdevcollins

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

  • Escrow status visible on bounty cards and detail pages
  • Pool details (locked amount, asset, expiry) displayed
  • Release slots show recipient and amount
  • Fee breakdown shown before funding
  • Links to Stellar explorer for on-chain verification

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions