In onAfterSwap function the calculation of adminFee is as follow
Which is incorrect due to the multiple-division
The right equation should be:
Add this test on any test file ex: UpliftExample.t.sol
you'll notice that the wrong Fee was 5e17 while the correct one was 250000000000000004
which is a huge loss and an inaccurate calculation of the Fee
precision loss leads to a loss of funds to the owner.
Manual review
Use the correct equation as follows
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.