First Flight #18: T-Swap

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

The `TSwapPool::LiquidityAdded` event has parameters out of order

Summary

When the LiquidityAdded event is emitted in the TSwapPool::_addLiquidityMintAndTransfer function, it returns values in an incorrect order. The poolTokensToDeposit value and the wethToDeposit value should be swapped.

Vulnerability Details

The event information is incorrect, this leads to wrong off-chain information being output and any off-chain services relying on this information to potentially break.

event LiquidityAdded(
address indexed liquidityProvider,
uint256 wethDeposited,
uint256 poolTokensDeposited
);

Tools Used

--Foundry

Recommendations

It is recommended to swap the order of the poolTokensToDeposit and wethToDeposit parameters.

- emit LiquidityAdded(msg.sender, poolTokensToDeposit, wethToDeposit);
+ 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.