50796 sc high jackpot eligibility uses stale streak

Submitted on Jul 28th 2025 at 16:24:35 UTC by @BeastBoy for Attackathon | Plume Network

  • Report ID: #50796

  • Report Type: Smart Contract

  • Report severity: High

  • Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/plume/src/spin/Spin.sol

  • Impacts:

    • Contract fails to deliver promised returns, but doesn't lose value

Description

In handleRandomness the code begins by computing:

currentSpinStreak = _computeStreak(user, block.timestamp, true)

but then, inside the “Jackpot” branch, evaluates:

else if (userDataStorage.streakCount < (currentWeek + 2)) {
    userDataStorage.nothingCounts += 1;
    rewardCategory = "Nothing";
}

Here userDataStorage.streakCount still holds yesterday’s value, so even if currentSpinStreak meets the required threshold (currentWeek + 2), the check fails. Only after this logic does the code execute:

userDataStorage.streakCount = currentSpinStreak;

meaning the first day a user actually reaches the needed streak they are incorrectly treated as ineligible.

Impact

Recommendation

Assign userDataStorage.streakCount = currentSpinStreak before the jackpot check or change the condition to compare currentSpinStreak directly against the required threshold so that today’s spin counts immediately.

Proof of Concept

Was this helpful?