diff --git a/contracts/split/src/lib.rs b/contracts/split/src/lib.rs index 1c757aa..b9b686c 100644 --- a/contracts/split/src/lib.rs +++ b/contracts/split/src/lib.rs @@ -3934,6 +3934,15 @@ impl SplitContract { .persistent() .set(&recipient_whitelist_key(invoice_id), &whitelist); events::recipient_whitelisted(&env, invoice_id, &address); + let mut added: Vec
= Vec::new(&env); + added.push_back(address.clone()); + events::recipient_whitelist_updated( + &env, + invoice_id, + invoice.recipient_whitelist_enabled, + &added, + &Vec::new(&env), + ); } } @@ -3974,6 +3983,15 @@ impl SplitContract { .persistent() .set(&recipient_whitelist_key(invoice_id), &new_wl); events::recipient_removed_from_whitelist(&env, invoice_id, &address); + let mut removed: Vec = Vec::new(&env); + removed.push_back(address.clone()); + events::recipient_whitelist_updated( + &env, + invoice_id, + invoice.recipient_whitelist_enabled, + &Vec::new(&env), + &removed, + ); } } @@ -7346,6 +7364,36 @@ impl SplitContract { } } + // Issue #686: announce when the overfunding policy actually changes the + // outcome of this payment, i.e. it would push `funded` past `total`. + // `Cap` has its own `overflow_behavior` events, so it is excluded here. + match invoice.overfunding_policy { + OverfundingPolicy::AcceptAll => { + let surplus = (invoice.funded + credited_amount - total).max(0); + if surplus > 0 { + events::overfunding_triggered( + env, + invoice_id, + payer, + &invoice.overfunding_policy, + surplus, + ); + } + } + OverfundingPolicy::ReturnSurplus => { + if excess > 0 { + events::overfunding_triggered( + env, + invoice_id, + payer, + &invoice.overfunding_policy, + excess, + ); + } + } + OverfundingPolicy::Cap => {} + } + invoice.insurance_fund += premium; // Penalty for late payment (issues #42, #211). @@ -7381,6 +7429,14 @@ impl SplitContract { token_client.transfer(payer, &recipient, &share); } } + // Issue #687: surface the late-payment penalty deduction. + events::penalty_applied( + env, + invoice_id, + payer, + penalty_amount, + penalty_bps, + ); } } } @@ -11875,9 +11931,11 @@ impl SplitContract { assert!(is_creator_or_co || is_delegate, "not authorized"); } + let old_deadline = invoice.deadline; invoice.deadline = new_deadline; save_invoice(&env, invoice_id, &invoice); append_audit_entry(&env, invoice_id, symbol_short!("extend"), &caller); + events::deadline_extended(&env, invoice_id, old_deadline, new_deadline); } /// Roll over a partially funded invoice to a new invoice with the same recipients,