50694 sc low spins occuring close to midnight lead to users streaks being unfairly broken due to vrf callback delay
Description
Brief/Intro
Vulnerability Details
// plume/src/spin/Spin.sol:146-164
modifier canSpin() {
// Early return if the user is whitelisted
if (whitelists[msg.sender]) {
_;
return;
}
UserData storage userDataStorage = userData[msg.sender];
uint256 _lastSpinTimestamp = userDataStorage.lastSpinTimestamp;
// Retrieve last spin date components
(uint16 lastSpinYear, uint8 lastSpinMonth, uint8 lastSpinDay) = (
dateTime.getYear(_lastSpinTimestamp),
dateTime.getMonth(_lastSpinTimestamp),
dateTime.getDay(_lastSpinTimestamp)
);
// Retrieve current date components
(uint16 currentYear, uint8 currentMonth, uint8 currentDay) =
(dateTime.getYear(block.timestamp), dateTime.getMonth(block.timestamp), dateTime.getDay(block.timestamp));
// Ensure the user hasn't already spun today
if (isSameDay(lastSpinYear, lastSpinMonth, lastSpinDay, currentYear, currentMonth, currentDay)) {
revert AlreadySpunToday();
}
_;
}Impact Details
Proof of Concept
References
Previous52129 sc low previewyielddistribution reverts instead of returning zero when no tokens are in circulationNext51929 sc low deactivating istransferallowed indirectly doses minting burning functionality
Was this helpful?