Incorrect Fee Calculation in UpliftOnlyExample.sol
The onAfterRemoveLiquidity hook in UpliftOnlyExample.sol is responsible for calculating fees, including the uplift fee and admin charges. However, the getQuantAMMUpliftFeeTake() function in this updateWeightRunner.sol incorrectly returns the value of quantAMMSwapFeeTake instead of quantAMMUpliftFeeTake. This results in incorrect fee calculations.
In the onAfterRemoveLiquidity hook, fees such as upliftFee are calculated using getQuantAMMUpliftFeeTake().
In the updateWeightRunner, getQuantAMMUpliftFeeTake() wrongly fetches the value of quantAMMSwapFeeTake instead of quantAMMUpliftFeeTake.
This bug leads to incorrect fee deductions for liquidity removal operations, impacting both users and the protocol.
Incorrect Fee Calculation
Manual Review
Fix Function Logic:
Update the setQuantAMMUpliftFeeTake() and getQuantAMMUpliftFeeTake() functions to correctly set and retrieve the value of quantAMMUpliftFeeTake.
Likelyhood: High, calling setters or getters Impact: Low/Medium, both getters return `quantAMMSwapFeeTake` and `setQuantAMMUpliftFeeTake` modify `quantAMMUplfitFeeTake`. Real impact: those 2 values will be always the same.
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.