31078 - [SC - High] withdraw doesnt claim all rewards before burnin...
Description
Brief/Intro
Vulnerability Details
for (uint256 i = 0; i < 50; i++) {
if (weekCursor >= _lastTokenTime) break;
if (weekCursor >= userPoint.ts && userEpoch <= maxUserEpoch) {
userEpoch += 1;
oldUserPoint = userPoint;
if (userEpoch > maxUserEpoch) {
userPoint = IVotingEscrow.Point(0, 0, 0, 0);
} else {
userPoint = IVotingEscrow(_ve).getUserPointHistory(_tokenId, userEpoch);
}
} else {
int256 dt = int256(weekCursor - oldUserPoint.ts);
int256 calc = oldUserPoint.bias - dt * oldUserPoint.slope > int256(0)
? oldUserPoint.bias - dt * oldUserPoint.slope
: int256(0);
uint256 balanceOf = uint256(calc);
if (balanceOf == 0 && userEpoch > maxUserEpoch) break;
if (balanceOf != 0) {
toDistribute += (balanceOf * tokensPerWeek[weekCursor]) / veSupply[weekCursor];
}
weekCursor += WEEK;
}
}Impact Details
References
Proof of Concept
Previous31077 - [SC - Critical] RevenueHandler counts unclaimed tokens as new r...Next31079 - [SC - Critical] Claiming bribes for epochs you didnt vote for l...
Last updated
Was this helpful?