Part 2

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

In FeeDistributionBranch.sol::_handleWethRewardDistribution rounding error could lead to fund loss

Summary

Rounding errors in _handleWethRewardDistribution could result in trapped funds.

Vulnerability Details

  • Rounding errors in fixed-point arithmetic could leave dust amounts in the contract.

  • Over time, these errors could accumulate to significant amounts.

UD60x18 receivedProtocolWethRewardX18 =
receivedWethX18.mul(feeRecipientsSharesX18);
UD60x18 receivedVaultsWethRewardX18 =
receivedWethX18.mul(ud60x18(Constants.MAX_SHARES).sub(feeRecipientsSharesX18)
);
// calculate leftover reward
UD60x18 leftover =
receivedWethX18.sub(receivedProtocolWethRewardX18).sub(receivedVaultsWethRewa
rdX18);

Impact

Accumulation of unclaimable funds due to rounding errors.

Tools Used

Manual code review.

Recommendations

  • Implement mechanisms to handle rounding errors.

  • Consider using a more precise arithmetic library.

Updates

Lead Judging Commences

inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!