In the UpdateWeightRunner contract both setQuantAMMSwapFeeTake() and setQuantAMMUpliftFeeTake() functions update the same state variable quantAMMSwapFeeTake. This leads to overwriting of values set by each. The onAfterSwap function of the UpliftOnlyExample contract tries to fetch uplift fee from the UpdateWeightRunner contract but due to the state variable collision, the fetched uplift fee might incorrectly reflect the fee, resulting in inaccurate adjustments to the protocal fee. This directly impacts the protocol's revenue and stability.
The contract uses a single state variable; quantAMMSwapFeeTake for both swap and uplift fees.
The setQuantAMMSwapFeeTake Updates the swap fee and writes the value to the shared variable
Similarly, setQuantAMMUpliftFeeTake Updates the uplift fee overwriting the same variable.
In the onAfterSwap function of the UpliftOnlyExample contract, the uplift fee is fetched from the WeightRunner contract using the getQuantAMMUpliftFeeTake() function.
However, since the quantAMMSwapFeeTake variable is shared, the returned uplift fee may incorrectly reflect the last uplift fee update
An improperly set quantAMMFeeTake results in inaccurate fee allocation between the adminFee for protocol operations and the Owner fee during swaps . This mismanagement can lead to incorrect adjustments during swaps causing financial imbalances and directly impacting the protocol's sustainability.
Manual review
Introduce Separate Variables; quantAMMSwapFeeTake to store the swap fee and quantAMMUpliftFeeTake to store the uplift fee.
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.