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:
- Adding liquidity
- swapping a few times
- Adding liquidity
- 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()