From db5dd5e79344f546c3b0c4c0a3be497974f08095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CMainnet-ops=E2=80=9D?= <“footballwatch68@gmail.com”> Date: Sun, 27 Sep 2026 18:08:40 +0100 Subject: [PATCH] fix: emit previous boost value in set_boost event The 'boost applied' event previously only included the new allocation_pct, preventing indexers from tracking boost history, calculating deltas, or performing historical analysis. Now the event payload includes old_allocation_pct alongside the new value, giving consumers a complete audit trail of boost changes. --- docs/events.md | 3 ++- soroban/contracts/farming-pool/src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/events.md b/docs/events.md index b2d5df7..b2ec0a1 100644 --- a/docs/events.md +++ b/docs/events.md @@ -175,7 +175,8 @@ Emitted by `set_boost` when a user sets their allocation percentage. | Field | Rust Type | Description | | :--- | :--- | :--- | | `user` | `Address` | The user who set their boost allocation. | -| `allocation_pct` | `u32` | The allocation percentage (1-100) applied. | +| `old_allocation_pct` | `u32` | The previous allocation percentage (0 if user had no boost). | +| `allocation_pct` | `u32` | The new allocation percentage (1-100) applied. | | `multiplier` | `u32` | The global multiplier in effect at the time of the call. | ### `mult_set` (boost) diff --git a/soroban/contracts/farming-pool/src/lib.rs b/soroban/contracts/farming-pool/src/lib.rs index 4e6b71e..dc82372 100644 --- a/soroban/contracts/farming-pool/src/lib.rs +++ b/soroban/contracts/farming-pool/src/lib.rs @@ -2019,7 +2019,7 @@ impl FarmingPool { let multiplier = read_global_multiplier(&env); env.events().publish( (symbol_short!("boost"), symbol_short!("applied")), - (user.clone(), allocation_pct, multiplier), + (user.clone(), old_alloc, allocation_pct, multiplier), ); record_boost_event(&env, &user, old_alloc, allocation_pct);