Skip to content

Implement Bounty Cancellation and Refund Flow #149

Description

@0xdevcollins

Feature: Bounty Cancellation and Refund Flow

Overview

The Bounty Registry contract supports cancel_bounty() which returns funds to the escrow pool for refunding. The Core Escrow contract has refund_all() and refund_remaining() methods. The frontend has no cancellation UI.

Depends on: #139 (TypeScript contract bindings)


Goals

  • Allow bounty creators to cancel bounties before completion
  • Trigger on-chain escrow refund
  • Show cancellation status and refund confirmation
  • Handle edge cases (in-progress work, partial payments)

Contract Methods

BountyRegistry.cancel_bounty(creator, bounty_id)
CoreEscrow.refund_all(pool_id)
CoreEscrow.refund_remaining(pool_id)

Implementation Details

1. Cancel Button

Modify: app/bounty/[bountyId]/page.tsx

  • "Cancel Bounty" button for creator (only when status allows)
  • Confirmation dialog with warning about implications
  • Reason input (logged on-chain)

2. Refund Status Tracker

Create: components/bounty/refund-status.tsx

  • Shows refund progress after cancellation
  • Transaction hash and Stellar explorer link
  • Amount refunded

Acceptance Criteria

  • Creator can cancel open/in-progress bounties
  • Cancellation triggers escrow refund
  • Refund confirmation displayed with tx hash
  • Cancelled bounties show clear status
  • Cannot cancel already-completed bounties

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