51878 sc high timing misalignment between campaign days and calendar days allows double spinning on high probability jackpot days
Description
Brief/Intro
Vulnerability Details
1
Calendar Days (for spin restrictions)
// Lines 149-162 in Spin.sol
(uint16 lastSpinYear, uint8 lastSpinMonth, uint8 lastSpinDay) = (
dateTime.getYear(_lastSpinTimestamp),
dateTime.getMonth(_lastSpinTimestamp),
dateTime.getDay(_lastSpinTimestamp)
);
(uint16 currentYear, uint8 currentMonth, uint8 currentDay) =
(dateTime.getYear(block.timestamp), dateTime.getMonth(block.timestamp), dateTime.getDay(block.timestamp));
if (isSameDay(lastSpinYear, lastSpinMonth, lastSpinDay, currentYear, currentMonth, currentDay)) {
revert AlreadySpunToday();
}The Critical Misalignment
Economic Impact
Proof of Concept
References
Previous52667 sc high commission is not added at point of adding validator hence stakers that stake before the first checkpoint would always use the current commission Next52027 sc low whitelistrestrictions sol mint burn operations blocked when transfers disabled
Was this helpful?