Omniscia fetchai Audit
RateModelLL2 Manual Review Findings
RateModelLL2 Manual Review Findings
RLL-01M: Inexistent Usage of Safe Arithmetics
Type | Severity | Location |
---|---|---|
Mathematical Operations | Medium | RateModelLL2.sol:L50 |
Description:
The multiplication performed between hockeyStickUR
and rateMultiplier
is done unsafely.
Example:
contracts/ALP/RateModelLL2.sol
48finalValue = calcFinal(49 principleValue,50 getBorrowerLnSPRRate((hockeyStickUR * rateMultiplier) / ONE_UNIT),51 secsSinceLastUpdate52);
Recommendation:
We advise it to be safely performed by using a wrapper library such as SafeMath
to prevent overflows.
Alleviation:
Safe arithmetics are now correctly applied to the inner multiplication within calcNewValue
, alleviating this exhibit.