Skip to content

Add recipient vesting cliff on release #27

@Kingsman-99

Description

@Kingsman-99

Label: complexity: high
Points: 200

Description

Recipients currently receive their full share the moment an invoice is released. This issue adds an optional vesting_cliff: Option<u64> (ledger timestamp) per invoice — funds are held in the contract until the cliff passes, after which any address can call claim(invoice_id, recipient) to transfer the recipient's share.

Technical Context

Involves types.rs (add vesting_cliff: Option<u64>, claimed: Vec<bool>), lib.rs. In _release(), if cliff is set, mark status Released but do not transfer. Add claim(env, invoice_id, recipient) that checks cliff passed and claimed[i] is false, then transfers.

Acceptance Criteria

  • _release() holds funds when cliff is set
  • claim() before cliff panics with "cliff not reached"
  • claim() after cliff transfers correct amount to recipient
  • Each recipient can only claim once
  • No cliff behaves identically to current implementation
  • 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