Skip to content

Add invoice dispute mechanism with arbitration window #325

Description

@Kingsman-99

Overview

Add a dispute function that allows a payer to flag an invoice as disputed within 48 hours of funding. Disputed invoices cannot release funds until the dispute is resolved by the admin or the window expires.

Acceptance Criteria

  • raise_dispute(invoice_id: u64, reason_hash: BytesN<32>) callable by any payer within 48 ledgers of full funding
  • Disputed invoices enter Disputed status; release_funds is blocked with InvoiceDisputed error
  • resolve_dispute(invoice_id, outcome: DisputeOutcome) callable only by admin
  • DisputeOutcome: Approved (release funds to recipients) or Refunded (return funds to payers)
  • If dispute is not resolved within 72 ledgers, it auto-expires and funds are released to recipients
  • Emits DisputeRaised, DisputeResolved, DisputeExpired events
  • get_invoice adds dispute: Option<DisputeStatus> to the invoice struct
  • Integration tests: dispute → resolve approve, dispute → resolve refund, dispute → auto-expire

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: highComplex feature requiring deep knowledge - 200 ptsfeatureNew contract feature or operation

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions