Uniswap/v3-sdk

`encodeCollect` doesn't use `expectedCurrencyOwed` for `amount0Max`/`amount1Max`

pdunc opened this issue · 0 comments

pdunc commented

Inside nonfungiblePositionManager.ts, the encodeCollect function includes the following:

// collect
calldatas.push(
  NonfungiblePositionManager.INTERFACE.encodeFunctionData('collect', [
    {
      tokenId,
      recipient: involvesETH ? ADDRESS_ZERO : recipient,
      amount0Max: MaxUint128,
      amount1Max: MaxUint128
    }
  ])
)

MaxUint128 is used for both amount0Max and amount1Max. I think this should use options.expectedCurrencyOwedX.quotient

With the current behavior, when the transaction involvesETH (or any Native Token), any excess native currency/token will not be respectively unwrapped or swept.