In the onAfterSwap function, when quantAMMFeeTake exceeds 0.5e18 (50%), the ownerFee will be incorrectly calculated as zero due to precision loss in arithmetic operations, resulting in the owner not receiving their share of fees
In the onAfterSwap function, the quantAMMFeeTake value is used to calculate the adminFee as a percentage of the total hookFee.
The ownerFee is then derived by subtracting the adminFee from the total hookFee.
However, when quantAMMFeeTake > 0.5e18 (50%), the integer division logic can cause the ownerFee to round down to 0:
For example:
If hookFee = 100 and quantAMMFeeTake = 0.6e18, the calculation becomes:
Likelyhood: High, quantAMMFeeTake is a percentage on calculated fees. Being between 30-70% is very likely. Impact: High, fees for LP providers will be lower than expected and 0 if the admin fees is above 50%.
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.