The UpdateWeightRunner contract incorrectly reuses the same storage variable (quantAMMSwapFeeTake) for both the “swap fee” and the “uplift fee.” Whenever setQuantAMMSwapFeeTake or setQuantAMMUpliftFeeTake is called, it overwrites the same variable, causing one fee configuration to replace the other.
Notice in the interface that those variables represent different fees:
Take the following case as an example:
If the admin sets the swap fee to 0.3 (30%) and then sets the uplift fee to 0.4 (40%), the swap fee becomes 0.4 as well. Subsequent calculations for swap-based revenue or uplift-based revenue will be incorrect.
Admin cannot set two different fees: setting the uplift fee destroys the swap fee, and vice versa, causing critical fee miscalculations.
Protocol can become insolvent as stated in the interface above "% amount allocated to the protocol for running costs".
Manual Review
Declare two separate state variables, e.g.:
Update the setters/getters so each fee is stored and retrieved from its own variable.
Ensure all logic that references either fee is updated accordingly.
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.