Skip to content

Commit 439570d

Browse files
committed
Fix add liquidity issue in soneium
1 parent 4df5c1c commit 439570d

File tree

2 files changed

+8
-2
lines changed
  • src/pages/PoolsPage/v3/SupplyLiquidityV3/containers

2 files changed

+8
-2
lines changed

src/pages/PoolsPage/v3/SupplyLiquidityV3/containers/AddLiquidityButton/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ export function AddLiquidityButton({
286286
amountToWrap,
287287
wrappingETH,
288288
]);
289+
console.log('------isReady:', isReady)
289290

290291
const onAddLiquidity = () => {
291292
if (expertMode) {

src/pages/PoolsPage/v3/SupplyLiquidityV3/containers/EnterAmounts/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { useActiveWeb3React } from 'hooks';
1313
import { useUSDCValue } from 'hooks/v3/useUSDCPrice';
1414
import {
1515
NONFUNGIBLE_POSITION_MANAGER_ADDRESSES,
16+
NONFUNGIBLE_POSITION_V4_MANAGER_ADDRESSES,
1617
UNI_NFT_POSITION_MANAGER_ADDRESS,
1718
} from 'constants/v3/addresses';
1819
import { halfAmountSpend, maxAmountSpend } from 'utils/v3/maxAmountSpend';
@@ -26,6 +27,7 @@ import { GlobalConst } from 'constants/index';
2627
import { useTranslation } from 'react-i18next';
2728
import { getGammaPairsForTokens } from 'utils';
2829
import { useSteerPeripheryContract } from 'hooks/useContract';
30+
import { useIsV4 } from 'state/application/hooks';
2931

3032
interface IEnterAmounts {
3133
currencyA: Currency | undefined;
@@ -42,6 +44,7 @@ export function EnterAmounts({
4244
}: IEnterAmounts) {
4345
const { t } = useTranslation();
4446
const { chainId } = useActiveWeb3React();
47+
const { isV4 } = useIsV4();
4548
const preset = useActivePreset();
4649

4750
const { independentField, typedValue } = useV3MintState();
@@ -133,8 +136,10 @@ export function EnterAmounts({
133136
if (mintInfo.feeTier && mintInfo.feeTier.id.includes('uni')) {
134137
return UNI_NFT_POSITION_MANAGER_ADDRESS[chainId];
135138
}
136-
return NONFUNGIBLE_POSITION_MANAGER_ADDRESSES[chainId];
137-
}, [chainId, mintInfo.feeTier]);
139+
return isV4
140+
? NONFUNGIBLE_POSITION_V4_MANAGER_ADDRESSES[chainId]
141+
: NONFUNGIBLE_POSITION_MANAGER_ADDRESSES[chainId];
142+
}, [chainId, mintInfo.feeTier, isV4]);
138143

139144
const steerPeripheryContract = useSteerPeripheryContract();
140145
const [approvalA, approveACallback] = useApproveCallback(

0 commit comments

Comments
 (0)