Uniswap v2 remove liquidity ds-math-sub-underflow

I am testing an ERC20 token on hardhat and running into this error when trying to removeLiquidity. ‘ds-math-sub-underflow’.

Currently testing this process:

  1. Adding liquidity
  2. swapping a few times
  3. Adding liquidity
  4. Removing a small amount of liquidity

If you see the attached image, the only place running safemath sub to show this error is highlighted.

Trying to understand how this error can happen From what I understand, kLast should be calculated during step 3.

Currently using removeLiquidityETHSupportingFeeOnTransferTokens()

Though fees on or off, the error persists enter image description here

Uniswap v2 remove liquidity ds-math-sub-underflow

Shopping cart
There are no products in the cart!
Continue shopping