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

Incorrect USD Price Calculation Due to 1e24 Division (Precision Issue)

Summary

The getUsdPrice() function divides 1e24 by the ETH or WSTETH price, likely in an attempt to convert the price to USD. However, this division by 1e24 might result in incorrect USD prices due to precision issues.

Impact

The division by 1e24 introduces a large scale factor that may cause the resulting USD price to be inaccurate. This can lead to incorrect calculations and potentially affect various functionalities dependent on accurate price information.

Tools Used

Manual Review

Recommendations

Review the intended behavior of the getUsdPrice() function and ensure that the division by 1e24 is appropriate for converting the ETH or WSTETH price to USD. Consider using a different scale factor or approach to avoid precision issues and ensure accurate USD price calculations.

Updates

Lead Judging Commences

giovannidisiena Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

Precision loss

Support

FAQs

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