Skip to content

Add time-locked fund release with creator-set unlock delay #327

Description

@Kingsman-99

Overview

Allow creators to configure a release delay so that funds cannot be withdrawn immediately after an invoice is fully funded. Useful for milestone-based payment flows where a grace period is needed.

Acceptance Criteria

  • InvoiceParams gains release_delay_ledgers: Option<u32> (max 100 000 ledgers ≈ 5 days)
  • When set, release_funds is blocked until funded_at_ledger + release_delay_ledgers is reached
  • release_funds returns FundsLockedUntil(ledger: u32) error if called too early
  • get_invoice exposes unlock_at_ledger: Option<u32>None if no delay set
  • Delay is immutable after invoice creation — cannot be shortened post-funding
  • Works with the dispute mechanism: dispute window begins after the delay expires
  • Emits FundsUnlocked { invoice_id, unlock_ledger } event when funds become releasable
  • Integration tests: early release rejection, release exactly at unlock ledger

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