31597 - [SC - High] Loss of precision while calculating claimable f...
Description
Bug Description
/// @notice Multiplier for the slope of the decay
uint256 public constant MULTIPLIER = 2;int256 internal constant iMULTIPLIER = 2;function _calculatePoint(LockedBalance memory _locked, uint256 _time) internal pure returns (Point memory point) {
if (_locked.end > _time && _locked.amount > 0) {
point.slope = _locked.maxLockEnabled ? int256(0) : (int256(_locked.amount) * iMULTIPLIER) / iMAXTIME;
point.bias = _locked.maxLockEnabled
? ((int256(_locked.amount) * iMULTIPLIER) / iMAXTIME) * (int256(_locked.end - _time))
: (point.slope * (int256(_locked.end - _time)));
}
}Impact
Recommendation
References
Proof Of Concept
Previous31594 - [SC - Insight] RewardPoolManager can only add RewardPoolToken ...NextBadgerDAO (eBTC)
Last updated
Was this helpful?