Skip to content

Early Payment Discount on Platform Fee #489

Description

@Kingsman-99

Description

To incentivise prompt payment, the contract should offer a reduced platform fee for contributions made within a configurable early-bird window after invoice creation. Contributions outside this window pay the standard fee.

Technical Context

Add early_bird_window_ledgers: u32 and early_bird_fee_bps: u32 to the Invoice struct in types.rs. In the contribute method in contracts/split/src/lib.rs, compare env.ledger().sequence() against created_ledger + early_bird_window_ledgers to select the applicable fee. Emit EarlyBirdPayment(invoice_id, payer, discount_amount) from events.rs when the discount applies.

Acceptance Criteria

  • Contributions within the early-bird window use early_bird_fee_bps
  • Contributions outside the window use the standard platform fee
  • early_bird_fee_bps must be less than or equal to the standard fee at creation time
  • EarlyBirdPayment event is emitted with the calculated discount amount
  • Window of zero ledgers disables the early-bird discount
  • All CI checks (cargo build --target wasm32-unknown-unknown, cargo test, cargo clippy) pass and the branch has no merge conflicts

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions