QuantAMM

QuantAMM
49,600 OP
View results
Submission Details
Severity: high
Invalid

Miscalculation of `adminFee` leading to overcharging

Summary

`quantAMMSwapFeeTake` is a % of the total swap fee, and `adminFee` should be calculated by multiplying `hookFee` by `quantAMMSwapFeeTake`.

However, in `UpliftOnlyExample.sol`, `quantAMMFeeTake` was used for division, which resulted in over-calculation of fees.

https://github.com/Cyfrin/2024-12-quantamm/blob/a775db4273eb36e7b4536c5b60207c9f17541b92/pkg/pool-hooks/contracts/hooks-quantamm/UpliftOnlyExample.sol#L335

Vulnerability Details

```solidity

uint256 adminFee = hookFee / (1e18 / quantAMMFeeTake);

```

Impact

`adminFee` is overcalculated and `ownerFee` is reduced accordingly.

Tools Used

Recommendations

```solidity

uint256 adminFee = hookFee * quantAMMFeeTake / 1e18;

```

Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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

Give us feedback!