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
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: u32andearly_bird_fee_bps: u32to theInvoicestruct intypes.rs. In thecontributemethod incontracts/split/src/lib.rs, compareenv.ledger().sequence()againstcreated_ledger + early_bird_window_ledgersto select the applicable fee. EmitEarlyBirdPayment(invoice_id, payer, discount_amount)fromevents.rswhen the discount applies.Acceptance Criteria
early_bird_fee_bpsearly_bird_fee_bpsmust be less than or equal to the standard fee at creation timeEarlyBirdPaymentevent is emitted with the calculated discount amount