In calculation of totalDollars in LibFertilizer :: getTotalRecapDollarsNeeded(uint256 urLPsupply) the division is done before multiplication.
This can lead to the precision loss while calculating the totalDollars.
function getTotalRecapDollarsNeeded(uint256 urLPsupply) internal pure returns(uint256) {
uint256 totalDollars = C
.dollarPerUnripeLP()
.mul(urLPsupply)
.div(DECIMALS);
// @audit
totalDollars = totalDollars / 1e6 * 1e6; // round down to nearest USDC
return totalDollars;
}
Manual Review.
Consider multiplication before division while calculation. Write the calculation like this .
totalDollars = totalDollars * 1e6/1e6
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.