DeFiHardhat
21,000 USDC
View results
Submission Details
Severity: high
Invalid

Underflow/Overflow can be possible in LibFertilizer :: getTotalRecapDollarsNeeded(uint256 urLPsupply).

Vulnerability Details

The use of pragma version < ^0.8.0 and without any safeMath operations in calculations can increase the chances of overflow and underflow issue .

Impact

It can lead to the integer value out of range.

     function getTotalRecapDollarsNeeded(uint256 urLPsupply) internal pure returns(uint256) {
      uint256 totalDollars = C
        .dollarPerUnripeLP()
        .mul(urLPsupply)
        .div(DECIMALS);
          // @audit : without safeMath can lead to overflow/underflow
        totalDollars = totalDollars / 1e6 * 1e6; // round down to nearest USDC
        return totalDollars;
         }

Tools Used

Manual review

Recommendations

The recommendation is to used the safeMath operations while calcuation if you are using the older pragma version.

     totalDollars = totalDollars.div(1e6).mul(1e6); // round down to nearest USDC
Updates

Lead Judging Commences

giovannidisiena Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.