The setQuantAMMUpliftFeeTake function of the UpdateWeightRunner.sol contract incorrectly updates the quantAMMSwapFeeTake state variable instead of maintaining an independent quantAMMUpliftFeeTake variable. And the getQuantAMMUpliftFeeTake function returns the quantAMMSwapFeeTake state variable instead of quantAMMUpliftFeeTake variable. These result in state inconsistencies, mismanagement of fees, and inaccurate event logging, financial losses and protocol misbehavior.
In the UpdateWeightRunner.sol contract, the setQuantAMMUpliftFeeTake function updates the quantAMMSwapFeeTake variable instead of maintaining a dedicated quantAMMUpliftFeeTake variable. And the getQuantAMMUpliftFeeTake function returns the quantAMMSwapFeeTake state variable instead of quantAMMUpliftFeeTake variable. Changing the swap fee variable while attempting to modify the uplift fee creates confusion and misalignment in fee configurations. The UpliftFeeTakeSet event logs the old value of quantAMMSwapFeeTake instead of the correct quantAMMUpliftFeeTake.
Additionally, the setQuantAMMSwapFeeTake and getQuantAMMSwapFeeTake functions already handle setting and retrieving the SwapFee, so there is no need for setQuantAMMUpliftFeeTake and getQuantAMMUpliftFeeTake to manage the same SwapFee.
pkg/pool-quantamm/contracts/UpdateWeightRunner.sol:setQuantAMMUpliftFeeTake:#L141-148
pkg/pool-quantamm/contracts/UpdateWeightRunner.sol:getQuantAMMUpliftFeeTake#L151-L153
Fee Mismanagement: Misconfigured fees can result in incorrect fee charges, reducing protocol income and causing potential financial losses for users.
Operational Confusion: Mixing swap fees with uplift fees introduces significant operational complexity, making it difficult to track and audit fee structures.
Event Misrepresentation: Incorrect event data undermines transparency and trust, as external systems relying on event logs (e.g., analytics tools) receive inaccurate information.
Manual Review
It is recommended to add a separate state variable for quantAMMUpliftFeeTake to ensure clear differentiation between swap fees and uplift fees and update the function to modify the correct variable and log the correct event.
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.