The LiquidityAdded event in the TSWAP contract emits incorrect values for the parameters poolTokensToDeposit and wethToDeposit. This discrepancy can lead to confusion and misinterpretation of the actual amounts involved in the liquidity addition process.
Events in smart contracts are essential for logging critical information that can be accessed by external users and services. Inaccurate emission of event values can lead to a range of issues including, but not limited to, incorrect data reporting, difficulty in auditing transactions, and misinformed decision-making by users.
The issue specifically lies in the LiquidityAdded event, where the values emitted for poolTokensToDeposit and wethToDeposit do not accurately reflect the actual amounts being deposited.
Deploy a contract with the LiquidityAdded event.
Call the deposit function with specified amounts of pool tokens and WETH.
Observe the emitted event and note the discrepancy between the actual values and the emitted values.
User Confusion: Users may be misled about the actual amounts of liquidity added, leading to confusion and potential mistrust in the platform.
Inaccurate Analytics: Third-party services that rely on event data for analytics and reporting will produce incorrect outputs, impacting decision-making processes.
Auditing Difficulties: Inaccurate event data complicates the auditing and verification of transactions, potentially masking other underlying issues.
Manual Review
Review and Correct Emission Logic: Thoroughly review the logic that prepares values for the LiquidityAdded event and ensure they accurately reflect the actual amounts involved.
Unit Testing: Implement comprehensive unit tests to validate that the emitted values match the expected values based on the inputs provided to the addLiquidity function.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.