First Flight #18: T-Swap

First Flight #18
Beginner FriendlyDeFiFoundry
100 EXP
View results
Submission Details
Severity: low
Valid

TSwapPool::LiquidityAdded event has parameters out of order

Summary

When the LiquidityAdded event is emitted in the TSwapPool::_addLiquidityMintAndTransfer function, it logs values in an incorrect order. Specifically, the poolTokensToDeposit value should go in the third parameter position, whereas the wethToDeposit value should go in the second position.

Vulnerability Details

The code currently emits the LiquidityAdded event with the poolTokensToDeposit and wethToDeposit parameters in the wrong order, which can be seen in the following line:

emit LiquidityAdded(msg.sender, poolTokensToDeposit, wethToDeposit);

Impact

Event emission is incorrect, leading to off-chain functions potentially malfunctioning. This could cause issues for any external systems or scripts relying on the correct order of these event parameters to function properly.

Tools Used

Manual code review

Recommendations

Correct the order of parameters in the event emission to ensure they are logged correctly:

emit LiquidityAdded(msg.sender, wethToDeposit, poolTokensToDeposit);
Updates

Appeal created

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

`LiquidityAdded` event has parameters out of order

Support

FAQs

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