QuantAMM

QuantAMM
49,600 OP
View results
Submission Details
Severity: medium
Valid

A specific variable for uplift fee has not been defined in `UpdateWeightRunner` contract

Summary

The QuantAMMWeightedPool contract, utilize a functions called setQuantAMMUpliftFeeTake and getQuantAMMUpliftFeeTake (+). These two function supposed to be used for setting and getting uplift fee, However a specific variable for uplift fee has not been defined.

Vulnerability Details

The code of setQuantAMMUpliftFeeTake and getQuantAMMUpliftFeeTake functions are exactly the same as setQuantAMMSwapFeeTake and getQuantAMMSwapFeeTake function. however these two function should set and get another variable which has not been defined yet.

Impact

Users may end up paying more than they anticipated as a fee when the protocol does not differentiate between the swap fee and the uplift fee.

Tools Used

Manual review

Recommendations

Consider defining a variable for uplift fee (Lets call it quantAMMUpliftFeeTake) and then change two mentioned functions like this:

+ uint256 public quantAMMUpliftFeeTake = 5e16; // initilize to 5%
function setQuantAMMUpliftFeeTake(uint256 _quantAMMUpliftFeeTake) external{
require(msg.sender == quantammAdmin, "ONLYADMIN");
require(_quantAMMUpliftFeeTake <= 1e18, "Uplift fee must be less than 100%");
- uint256 oldSwapFee = quantAMMSwapFeeTake;
+ uint256 oldUpliftFee = quantAMMUpliftFeeTake;
- quantAMMSwapFeeTake = _quantAMMUpliftFeeTake;
+ quantAMMUpliftFeeTake = _quantAMMUpliftFeeTake;
- emit UpliftFeeTakeSet(oldSwapFee, _quantAMMUpliftFeeTake);
+ emit UpliftFeeTakeSet(oldUpliftFee, _quantAMMUpliftFeeTake);
}
/// @notice Get the quantAMM uplift fee % amount allocated to the protocol for running costs
function getQuantAMMUpliftFeeTake() external view returns (uint256){
- return quantAMMSwapFeeTake;
+ return quantAMMUpliftFeeTake;
}
Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding_quantAMMSwapFeeTake==quantAMMUplfitFeeTake

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.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.