Commit 93d33947 authored by Moody Salem's avatar Moody Salem

fix bug in remove

parent 91f3e21b
...@@ -17,12 +17,11 @@ import FormattedCurrencyAmount from 'components/FormattedCurrencyAmount' ...@@ -17,12 +17,11 @@ import FormattedCurrencyAmount from 'components/FormattedCurrencyAmount'
import { useV3NFTPositionManagerContract } from 'hooks/useContract' import { useV3NFTPositionManagerContract } from 'hooks/useContract'
import { useUserSlippageTolerance } from 'state/user/hooks' import { useUserSlippageTolerance } from 'state/user/hooks'
import useTransactionDeadline from 'hooks/useTransactionDeadline' import useTransactionDeadline from 'hooks/useTransactionDeadline'
import JSBI from 'jsbi'
import ReactGA from 'react-ga' import ReactGA from 'react-ga'
import { useActiveWeb3React } from 'hooks' import { useActiveWeb3React } from 'hooks'
import { TransactionResponse } from '@ethersproject/providers' import { TransactionResponse } from '@ethersproject/providers'
import { useTransactionAdder } from 'state/transactions/hooks' import { useTransactionAdder } from 'state/transactions/hooks'
import { WETH9, Percent, CurrencyAmount } from '@uniswap/sdk-core' import { WETH9, CurrencyAmount } from '@uniswap/sdk-core'
import { TYPE } from 'theme' import { TYPE } from 'theme'
import styled from 'styled-components' import styled from 'styled-components'
import { Wrapper, SmallMaxButton } from './styled' import { Wrapper, SmallMaxButton } from './styled'
...@@ -33,7 +32,6 @@ import DoubleCurrencyLogo from 'components/DoubleLogo' ...@@ -33,7 +32,6 @@ import DoubleCurrencyLogo from 'components/DoubleLogo'
import { RangeBadge } from 'pages/AddLiquidity/styled' import { RangeBadge } from 'pages/AddLiquidity/styled'
import { Break } from 'components/earn/styled' import { Break } from 'components/earn/styled'
import { NonfungiblePositionManager } from '@uniswap/v3-sdk' import { NonfungiblePositionManager } from '@uniswap/v3-sdk'
import { BIPS_BASE } from '../../constants'
import { calculateGasMargin } from 'utils' import { calculateGasMargin } from 'utils'
export const UINT128MAX = BigNumber.from(2).pow(128).sub(1) export const UINT128MAX = BigNumber.from(2).pow(128).sub(1)
...@@ -122,7 +120,7 @@ function Remove({ tokenId }: { tokenId: BigNumber }) { ...@@ -122,7 +120,7 @@ function Remove({ tokenId }: { tokenId: BigNumber }) {
const { calldata, value } = NonfungiblePositionManager.removeCallParameters(positionSDK, { const { calldata, value } = NonfungiblePositionManager.removeCallParameters(positionSDK, {
tokenId: tokenId.toString(), tokenId: tokenId.toString(),
liquidityPercentage, liquidityPercentage,
slippageTolerance: new Percent(JSBI.BigInt(allowedSlippage), BIPS_BASE), slippageTolerance: allowedSlippage,
deadline: deadline.toString(), deadline: deadline.toString(),
collectOptions: { collectOptions: {
expectedCurrencyOwed0: liquidityValue0.token.equals(WETH9[chainId]) expectedCurrencyOwed0: liquidityValue0.token.equals(WETH9[chainId])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment