DeFiHardhat
35,000 USDC
View results
Submission Details
Severity: low
Invalid

Lack of Check for Zero Return from getWellTwaUsdLiquidityFromReserves() in calcLPToSupplyRatio() (Potential Incorrect Calculation)

Summary

The calcLPToSupplyRatio() function in the contract lacks a check for a zero return from the getWellTwaUsdLiquidityFromReserves() function. This can lead to potential incorrect calculations of liquidity-to-supply ratios if the token USD price is 0 or if the oracle fails to compute a valid price.

Impact

Without a check for a zero return from getWellTwaUsdLiquidityFromReserves(), the calcLPToSupplyRatio() function may proceed with calculations using an invalid or zero liquidity value, resulting in incorrect liquidity-to-supply ratios. This could impact decisions based on these ratios, such as fund allocations or rewards distributions, leading to unexpected behaviour in the protocol.

Tools Used

Manual review

Recommendations

Consider Adding a check in calcLPToSupplyRatio() to verify the return value of getWellTwaUsdLiquidityFromReserves() and handle the case where it returns 0 or an invalid value appropriately to prevent incorrect calculations.

Updates

Lead Judging Commences

giovannidisiena Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice
Assigned finding tags:

Informational/Invalid

Support

FAQs

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