DeFiHardhatFoundry
250,000 USDC
View results
Submission Details
Severity: low
Invalid

Incorrect `UNRIPE_LP_PER_DOLLAR` calculation result as constant

Summary

The constant value UNRIPE_LP_PER_DOLLAR is incorrectly mentioned having 1 wei more than its original calculation result.
This mathematical error will cause unripeLPPerDollar method to return incorrect values

Vulnerability Details

The constant is defined as following in C.sol which is parent contract for a lot of in-scope contracts

uint256 private constant UNRIPE_LP_PER_DOLLAR = 1884592; // 145_113_507_403_282 / 77_000_000

The Comment states that it is the result of 145_113_507_403_282 / 77_000_000

However the actual result of it is 1884591.00524, which even rounded up according to rules , give 1884591

however specified value is 1884592 which is 1 more and incorrect

Submitting it as medium since funds can be lost because division by 1884592 instead of 1884591 will result in few tokens than intended.

Impact

Loss of funds although little but they are.

Tools Used

Manual review

Recommendations

Declare constant with correct value 1884591

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational/Gas

Invalid as per docs https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity

Support

FAQs

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