Skip to content
This repository was archived by the owner on Jun 12, 2026. It is now read-only.
This repository was archived by the owner on Jun 12, 2026. It is now read-only.

Implement dispute resolution mechanism for milestones #2

Description

@0xdevcollins

Problem

dispute_milestone() sets milestone status to Disputed but there is no resolution mechanism. Disputed milestones become a dead-end with no way to resolve them in favor of either party.

Current Behavior

  • Backer calls dispute_milestone() → milestone status becomes Disputed
  • No function exists to resolve the dispute
  • No emergency refund if dispute is resolved in backer's favor
  • No reputation penalty for failed disputes

Expected Behavior

Add dispute resolution functions:

Contract Changes

  1. resolve_dispute(campaign_id, milestone_index, resolution: DisputeResolution) (Admin-only)
    • DisputeResolution::ApproveCreator → milestone status back to Submitted or Released (release funds)
    • DisputeResolution::ApproveBacker → milestone status to Rejected, trigger partial refund or hold
  2. get_dispute_status(campaign_id, milestone_index) — query current dispute state
  3. Emit DisputeResolved event with resolution details

Acceptance Criteria

  • Admin can resolve disputes in favor of creator or backer
  • Funds are handled correctly based on resolution outcome
  • Events emitted for indexer to pick up
  • Tests cover both resolution paths

Priority

High — This is a critical gap in the end-to-end flow. Backers can file disputes but nothing happens.

Labels

crowdfunding, smart-contract, critical

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions