DeFiLayer 1Layer 2
14,723 OP
View results
Submission Details
Severity: low
Invalid

Precision Loss in Arithmetic Operations

Summary

Certain arithmetic operations within the contract introduce precision loss due to integer division, potentially leading to small discrepancies in calculated values. While this does not directly compromise funds, it may cause unexpected behavior in financial calculations.

Vulnerability Details

The contract performs integer division in various calculations without considering precision loss. Solidity rounds down the result of integer division, which can lead to small inaccuracies in computed values. Over multiple transactions, these inaccuracies can accumulate and impact user expectations.

Example:

uint256 result = valueA / valueB; // Solidity rounds down

If valueA is 5 and valueB is 2, the result will be 2 instead of 2.5.

Impact

  • Minor inaccuracies in calculations.

  • Potentially unfair distribution of funds over time.

Tools Used

  • Manual code review

  • Remix IDE for simulation

Recommendations

  • Use a multiplier (e.g., 10**18) to maintain precision.

  • Consider using fixed-point libraries like ABDKMath64x64 for calculations.

Updates

Lead Judging Commences

0xnevi Lead Judge
6 months ago
0xnevi Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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