Research · Web3 Security · High
New players retroactively dilute unclaimed rewards
The reward formula applies today’s total grow power to the whole unclaimed period, reducing rewards earned before a new player joined.
9 November 2026
What went wrong
handle_join_game increased global_stats.total_grow_power when a player joined. The claim calculation then used that live total as the denominator for the entire period since an existing player's last harvest.
// join.rs:199-203 — GlobalStats updated with no prior harvest for existing players
let global_stats = &mut ctx.accounts.global_stats;
global_stats.total_grow_power = global_stats
.total_grow_power
.checked_add(total_gp)
.ok_or(GameError::GrowPowerArithmetic)?;
The new total was valid for future rewards, but it was also applied to rewards accrued before the newcomer participated. Increasing the denominator therefore changed the value of an existing player's unclaimed history.
Why it mattered
In the report's example, one player with 1,000 grow power farms alone for 10 days. Another player joins with 1,000 grow power before the first player harvests. The first player's rewards for that earlier period are then calculated using a total of 2,000, halving their allocation even though the newcomer was absent during those days.
Players who harvested infrequently were exposed over a longer period. The report bounds the calculation by the 51-day MAX_HARVEST_DAYS cap.
The fix
The recommended approach is a global reward-per-grow-power accumulator. Before changing total grow power, checkpoint the rewards accrued under the old total. Subsequent rewards use the new total, and each player's accounting records their entitlement across those checkpoints.
This avoids harvesting every player when someone joins or leaves. It also preserves the total grow power field for calculating future allocations.
Takeaway
Changes to participation should affect future emissions. Checkpoint accrued rewards before changing the denominator used to allocate them.
Finding status: Fixed.
Shipping something similar? We review the code before it holds money.
Request an audit