53047 sc high the jackpot eligibility check uses stale storage data instead of the freshly calculated streak
Description
Brief / Intro
Vulnerability Details
// Line 216: Calculate fresh streak for current spin
uint256 currentSpinStreak = _computeStreak(user, block.timestamp, true);
// Line 218: Use fresh streak for reward determination
(string memory rewardCategory, uint256 rewardAmount) = determineReward(randomness, currentSpinStreak);
// Lines 225-232: Jackpot eligibility check uses STALE data
if (keccak256(bytes(rewardCategory)) == keccak256("Jackpot")) {
uint256 currentWeek = getCurrentWeek();
if (currentWeek == lastJackpotClaimWeek) {
// ... weekly limit check ...
} else if (userDataStorage.streakCount < (currentWeek + 2)) { // ❌ USES OLD STREAK
userDataStorage.nothingCounts += 1;
rewardCategory = "Nothing";
rewardAmount = 0;
emit NotEnoughStreak("Not enough streak count to claim Jackpot");
}
}Impact Details
References
Proof of Concept
Previous53048 sc medium approval logic can break on non standard erc 20s usdt style and leave allowances looseNext53043 sc high handlerandomness doesn t properly account for current streak which could result in the user spinning losing a jackpot
Was this helpful?