Skip to content

Implement invoice automatic dispute resolution #118

@Kingsman-99

Description

@Kingsman-99

Label: complexity: high
Points: 200

Description

Manual dispute resolution requires human arbiters and delays. This issue adds auto_resolve_rules: Vec<ResolveRule> — pre-agreed conditions (e.g. "if funded > 50% release to recipients, else refund payers") evaluated automatically when a dispute is filed, resolving without human intervention.

Technical Context

Involves types.rs — define ResolveRule { min_funded_bps: u32, action: ResolveAction } where ResolveAction is Release or Refund. In lib.rs, add auto_resolve(env, invoice_id) that evaluates rules in order against invoice.funded / total, executing the first matching action.

Acceptance Criteria

  • create_invoice() accepts auto_resolve_rules Vec
  • auto_resolve() evaluates rules in order and executes first match
  • Release action calls _release(), Refund action calls refund logic
  • No matching rule panics with "no matching resolution rule"
  • Test with 50% threshold verifies release above and refund below
  • All existing cargo tests pass
  • cargo clippy passes with zero warnings

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: highComplex feature requiring deep knowledge - 200 pts

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