A high risk vulnerability exists in the UpdateWeightRunner contract where both swap fee and uplift fee management functions use the same storage variable quantAMMSwapFeeTake, causing one fee to override the other.
The UpdateWeightRunner stores config for 2 types of fees - swap fee and uplift fee.
Admin can set the swap fee:
But there is a bug in uplift fee setter. It writes to the same storage variable quantAMMSwapFeeTake which holds info about swap fee:
When either fee is updated by admin it overwrites the other fee value. Thus one of fees will always have the wrong value.
For example, admin calls setQuantAMMUpliftFeeTake(0.5e18) followed by setQuantAMMSwapFeeTake(0.1e18). Uplift fee gets overwritten and its value is 5x lower than what it is supposed to be. In we look at UplifOnlyExample.sol integration, admin will be at significant financial loss due to collecting less fees than what it is supopsed to be.
Protocol will either overcharge or undercharge fees, causing financial loss either for users or admin/protocol.
Manual code review
Introduce new storage variable for storing uplift fee and update uplift fee getter and setter to use it:
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.