#41664 [SC-Low] Users may receive fewer rewards due to the change in reward limits
Description
Brief/Intro
Vulnerability Details
function getClaimableAmount(address user) public view returns (uint256) {
uint256 totalClaimable;
// Fixed-point arithmetic for more precision
uint256 scalingFactor = 1e18;
for (uint256 epoch = lastClaimedForEpoch[user] + 1; epoch < currentEpoch; epoch++) {
if (totalYeetVolume[epoch] == 0) continue; // Avoid division by zero
uint256 userVolume = userYeetVolume[epoch][user];
uint256 totalVolume = totalYeetVolume[epoch];
uint256 userShare = (userVolume * scalingFactor) / totalVolume;
@> uint256 maxClaimable = (epochRewards[epoch] / rewardsSettings.MAX_CAP_PER_WALLET_PER_EPOCH_FACTOR());
uint256 claimable = (userShare * epochRewards[epoch]) / scalingFactor;
if (claimable > maxClaimable) {
@> claimable = maxClaimable;
}
totalClaimable += claimable;
}
return totalClaimable;
}Impact Details
References
Proof of Concept
Proof of Concept
Previous#41659 [SC-Insight] Previous owner still hold manager role after ownership transferNext41672 sc insight permanent loss risk of user funds due to inflexible function design in claim
Was this helpful?