The _beforeSwap function calculates the fee amount to emit in the ReFiSold event, providing users and off-chain systems with information about the fee charged during a sell transaction.
The calculation uses an incorrect denominator of 100000, while Uniswap V4's LP fee system uses 1_000_000 as the denominator (where 1_000_000 = 100%). This causes the emitted feeAmount to be 10 times larger than the actual fee taken by the protocol.
Likelihood:
Every sell transaction emits the ReFiSold event with inflated fee data
The default sellFee = 3000 will display as 3% fee instead of the actual 0.3%
Impact:
Users checking transaction events will see 10x higher fees than actually charged, causing confusion and loss of trust
Analytics dashboards, trading bots, and portfolio trackers parsing these events will show incorrect fee metrics
Financial reporting and tax calculations based on event data will be materially inaccurate
Discrepancy between advertised/documented fees and event data may raise compliance concerns
Add the following test to RebateFiHookTest.t.sol. The test demonstrates that the fee amount calculation in the event uses an incorrect denominator, resulting in a 10x inflation compared to the actual Uniswap V4 fee mechanics:
Update the fee calculation denominator to match Uniswap V4's LP fee system, where fees are expressed in hundredths of a bip (1_000_000 = 100%):
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.