DeFiHardhatOracleProxyUpdates
100,000 USDC
View results
Submission Details
Severity: low
Invalid

Division by zero not prevented

Summary

In the LibUnripe::unripeToUnderlying() function, division below take an input parameter, supply, which does not have any zero-value checks, which may lead to the functions reverting when zero is passed.

Vulnerability Details

underlying is calculated as follows:

underlying = s.u[unripeToken].balanceOfUnderlying.mul(unripe).div(supply);

The vulnerability stems from the .div(supply)

Impact

The unripeToUnderlying() function will revert if supply is zero.

Tools Used

Manual Review

Recommendations

Perform zero-value check on the function parameters.

Updates

Lead Judging Commences

giovannidisiena Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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