Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: low
Invalid

In FeeDistributionBranch.sol::_handleWethRewardDistribution there is precision Loss in Fee Distribution Calculations

Summary

The contract's fee distribution calculations involve multiple decimal conversions and mathematical operations, which can lead to precision loss, particularly in reward distribution.

Vulnerability Details

  • The calculations for distributing WETH rewards involve converting and multiplying decimal values.

  • Precision loss can occur due to rounding errors in fixed-point arithmetic operations.

  • The contract attempts to handle leftover dust by adding it to vault rewards, but accumulated rounding errors over time could lead to discrepancies.

UD60x18 receivedProtocolWethRewardX18 =receivedWethX18.mul(feeRecipientsSharesX18);
UD60x18 receivedVaultsWethRewardX18 =receivedWethX18.mul(ud60x18(Constants.MAX_SHARES).sub(feeRecipientsSharesX18));

Impact

Minor discrepancies in fee distribution could accumulate over time, potentially leading to small amounts of unallocated or misallocated funds.

Tools Used

Manual code review and analysis of arithmetic operations.

Recommendations

  • Use a more precise arithmetic library to minimize rounding errors.

  • Implement a mechanism to periodically reconcile and correct any discrepancies in fee distribution.

  • Consider logging or monitoring the accumulation of dust amounts to ensure they remain within acceptable limits.

Updates

Lead Judging Commences

inallhonesty Lead Judge 10 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.

Give us feedback!