Submitted by xuwinnie
When slot0 price is within the range of tokenized position, function deposit needs to be called with both parameters, n0 and n1, greater than zero. However, if price moves outside the range during the transaction, user will be charged an excessive fee.
Suppose range is [120, 122] and current price is 121. Alice calls deposit with {n0: 100, n1:100}, if Price moves to 119 during execution (due to market fluctuations or malicious frontrunning), getAmountsForLiquidity will return 0 for token1Amount. As a result, newFee1 will be equal to n1, which means all the 100 token1 will be charged as fee.
Then, increaseLiquidity will succeed since amount1Min is now zero.
Dont use this to calculate fee:
Always use this:
Keref (Good Entry) disputed and commented:
xuwinnie (Warden) commented:
Keref (Good Entry) confirmed and commented:
 Good Entry Mitigated:
Status: Mitigation confirmed. Full details in reports from  kutugu, xuwinnie and 3docSec.
