First Flight #18: T-Swap

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

Incorrect parameter logs in `TSwapPool::LiquidityAdded` event

Summary

values of wethDeposited and poolTokensDeposited are interchanged and doesn't match what is expected as shown below.
second and third place in parameters must be interchanged while emitting.

//expected
event LiquidityAdded(address indexed liquidityProvider, uint256 wethDeposited, uint256 poolTokensDeposited);
// emitted
emit LiquidityAdded(msg.sender, poolTokensToDeposit, wethToDeposit);

Impact

Systems reading Protocol logs like frontend or event indexers like The Graph protocol or any other off chain systems relying on protocol data will misinterpret the information logged due to the error

Recommendations

Make below code changes in TSwapPool.sol

function _addLiquidityMintAndTransfer(...){
.
.
.
- emit LiquidityAdded(msg.sender, poolTokensToDeposit, wethToDeposit);
+ emit LiquidityAdded(msg.sender, wethToDeposit, poolTokensToDeposit);
}
Updates

Appeal created

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