Skip to content

Add invoice creator reputation staking #89

@Kingsman-99

Description

@Kingsman-99

Label: complexity: high
Points: 200

Description

Creators with no skin in the game can abandon invoices without consequence. This issue adds optional stake_amount: i128 to create_invoice() — the creator deposits USDC as a reputation bond. If the invoice is cancelled by the creator, the stake is distributed equally among payers as compensation.

Technical Context

Involves types.rs (add stake_amount: i128) and lib.rs. In create_invoice(), if stake_amount > 0, transfer from creator to contract. In cancel_invoice() (Issue 4), if stake exists, distribute stake_amount / unique_payer_count to each unique payer. On successful release, return stake to creator.

Acceptance Criteria

  • create_invoice() transfers stake from creator when stake_amount > 0
  • On creator cancellation, stake distributed equally among unique payers
  • On successful release, stake returned to creator
  • stake_amount = 0 produces identical behaviour to current implementation
  • Test verifies payer receives stake share on creator cancellation
  • 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