First Flight #18: T-Swap

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

`TSwapPool:: _addLiquidityMintAndTransfer` function emit the `LiquidityAdded` values in Incorrect order

Summary

Incorrect order of logged value in an event, can affect offchain functionality of protocol.

Vulnerability Details

TSwapPool has an event LiquidityAdded, But it's used incorrectly at the moment. Currently the value that should be in the second position (wethToDeposit) is being used at third position, While the value that should be used in third position (poolTokensToDeposit) is being used at second position.

Impact

Emitting events in wrong order, can heavily impact the off chain setup if used by dapps.

Tools Used

Manual Review

Recommendations

Reverse the position of 2nd and 3rd value to make it accurate.
Example is given below -

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

Appeal created

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