Omniscia fetchai Audit

RateModelLL2 Manual Review Findings

RateModelLL2 Manual Review Findings

RLL-01M: Inexistent Usage of Safe Arithmetics

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 secsSinceLastUpdate
52);

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.