Part 2

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

The `FeeDistributionBranch::convertAccumulatedFeesToWeth` function incorrectly distributes the reward with `tokenIn`.

Summary

The FeeDistributionBranch::convertAccumulatedFeesToWeth function incorrectly distributes the reward with tokenIn.

Vulnerability Details

The convertAccumulatedFeesToWeth function converts the any asset into the weth and then distributes the rewards for protocol and markets . However, this function mistakenly sends the weth amount with tokenIn instead of tokenOut.

https://github.com/Cyfrin/2025-01-zaros-part-2/blob/main/src/market-making/branches/FeeDistributionBranch.sol#L230

Impact

The protocol and market will receive the reward in wrong token.

Tools Used

Manual review.

Recommendations

- _handleWethRewardDistribution(market, asset, ctx.receivedWethX18);
+ _handleWethRewardDistribution(market, ctx.weth, ctx.receivedWethX18);
Updates

Lead Judging Commences

inallhonesty Lead Judge 6 months ago
Submission Judgement Published
Validated
Assigned finding tags:

FeeDistributionBranch::convertAccumulatedFeesToWeth passes input token instead of WETH to _handleWethRewardDistribution, causing incorrect reward tracking

Appeal created

bigsam Auditor
6 months ago
inallhonesty Lead Judge
6 months ago
inallhonesty Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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