diff --git a/src/constants/networks/zksync.ts b/src/constants/networks/zksync.ts index a0294e035a..188b1e9330 100644 --- a/src/constants/networks/zksync.ts +++ b/src/constants/networks/zksync.ts @@ -47,14 +47,15 @@ const zkSyncInfo: EVMNetworkInfo = { fairlaunchV2: [], }, elastic: { - defaultSubgraph: '', + // zkSync not supports elastic + defaultSubgraph: 'https://api.thegraph.com/subgraphs/name/kybernetwork/kyberswap-elastic-zksync', startBlock: 0, - coreFactory: '', - nonfungiblePositionManager: '', - tickReader: '', - initCodeHash: '', - quoter: '', - routers: '', + coreFactory: '0x5F1dddbf348aC2fbe22a163e30F99F9ECE3DD50a', + nonfungiblePositionManager: '0x2B1c7b41f6A8F2b2bc45C3233a5d5FB3cD6dC9A8', + tickReader: '0x165c68077ac06c83800d19200e6E2B08D02dE75D', + initCodeHash: '0xc597aba1bb02db42ba24a8878837965718c032f8b46be94a6e46452a9f89ca01', + quoter: '0x0D125c15D54cA1F8a813C74A81aEe34ebB508C1f', + routers: '0xC1e7dFE73E1598E3910EF4C7845B68A9Ab6F4c83', farms: [], }, limitOrder: NOT_SUPPORT, diff --git a/src/pages/AddLiquidityV2/index.tsx b/src/pages/AddLiquidityV2/index.tsx index 3113cf9881..e1547b3d59 100644 --- a/src/pages/AddLiquidityV2/index.tsx +++ b/src/pages/AddLiquidityV2/index.tsx @@ -47,6 +47,7 @@ import TransactionConfirmationModal, { ConfirmationModalContent } from 'componen import { TutorialType } from 'components/Tutorial' import { Dots } from 'components/swapv2/styleds' import { APP_PATHS } from 'constants/index' +import { ELASTIC_NOT_SUPPORTED } from 'constants/networks' import { EVMNetworkInfo } from 'constants/networks/type' import { NativeCurrencies } from 'constants/tokens' import { useActiveWeb3React, useWeb3React } from 'hooks' @@ -61,7 +62,7 @@ import useTheme from 'hooks/useTheme' import useTransactionDeadline from 'hooks/useTransactionDeadline' import { convertTickToPrice } from 'pages/Farm/ElasticFarmv2/utils' import { ApplicationModal } from 'state/application/actions' -import { useNotify, useOpenModal, useWalletModalToggle } from 'state/application/hooks' +import { useNotify, useOpenModal, useOpenNetworkModal, useWalletModalToggle } from 'state/application/hooks' import { FarmUpdater } from 'state/farms/elastic/hooks' import { useElasticFarmsV2 } from 'state/farms/elasticv2/hooks' import ElasticFarmV2Updater from 'state/farms/elasticv2/updater' @@ -131,6 +132,7 @@ export default function AddLiquidity() { const { account, chainId, isEVM, networkInfo } = useActiveWeb3React() const { library } = useWeb3React() const theme = useTheme() + const openNetworkModal = useOpenNetworkModal() const toggleWalletModal = useWalletModalToggle() // toggle wallet when disconnected const [isDegenMode] = useDegenModeManager() const addTransactionWithType = useTransactionAdder() @@ -1400,222 +1402,243 @@ export default function AddLiquidity() { tutorialType={TutorialType.ELASTIC_ADD_LIQUIDITY} /> - - - - - Choose pool - -
- { - if (tokenA?.symbol && tokenB?.symbol) - mixpanelHandler(MIXPANEL_TYPE.ELASTIC_ADD_LIQUIDITY_CLICK_SWAP, { - token_1: tokenA?.symbol, - token_2: tokenB?.symbol, - }) - }} - > - - - Swap - - -
-
- + {ELASTIC_NOT_SUPPORTED[chainId]} + - - - { - if (!!rightPrice) { - onLeftRangeInput(rightPrice?.invert().toString()) - } - if (!!leftPrice) { - onRightRangeInput(leftPrice?.invert().toString()) - } - setRotate(prev => !prev) - }} - > - {!currencyIdA && !currencyIdB ? ( - - ) : ( - - - - )} - - - - - - - Select fee tier - - - - - {noLiquidity ? ( - - - - - Set Starting Price - - - - - - To initialize this pool, select a starting price for the pool then enter your liquidity price - range. - - - - - - - - - - - - Starting Price - - - {price ? ( - - - - - - ) : ( - '-' - )} - - - fetchPrices(tokens.map(t => t?.wrapped.address || ''))} - marketPrice={marketPrice} - baseCurrency={baseCurrency} - quoteCurrency={quoteCurrency} - /> - - - ) : ( - poolStatRef.current && ( - <> - - - Pool Stats - - { + Change network + + + ) : ( + <> + + + + + Choose pool + +
+ { if (tokenA?.symbol && tokenB?.symbol) - mixpanelHandler(MIXPANEL_TYPE.ELASTIC_ADD_LIQUIDITY_CLICK_POOL_ANALYTIC, { + mixpanelHandler(MIXPANEL_TYPE.ELASTIC_ADD_LIQUIDITY_CLICK_SWAP, { token_1: tokenA?.symbol, token_2: tokenB?.symbol, }) }} - /> - - + + + Swap + + +
+
+ + - - ) - )} - {upToMedium && chart} -
- {!upToMedium && {chart}} -
- - {warnings && ( - - {warnings} - - )} - - - - - - - + { + if (!!rightPrice) { + onLeftRangeInput(rightPrice?.invert().toString()) + } + if (!!leftPrice) { + onRightRangeInput(leftPrice?.invert().toString()) + } + setRotate(prev => !prev) + }} + > + {!currencyIdA && !currencyIdB ? ( + + ) : ( + + + + )} + + + + + + + Select fee tier + + + + + {noLiquidity ? ( + + + + + Set Starting Price + + + + + + To initialize this pool, select a starting price for the pool then enter your liquidity + price range. + + + + + + + + + + + + Starting Price + + + {price ? ( + + + + + + ) : ( + '-' + )} + + + fetchPrices(tokens.map(t => t?.wrapped.address || ''))} + marketPrice={marketPrice} + baseCurrency={baseCurrency} + quoteCurrency={quoteCurrency} + /> + + + ) : ( + poolStatRef.current && ( + <> + + + Pool Stats + + { + if (tokenA?.symbol && tokenB?.symbol) + mixpanelHandler(MIXPANEL_TYPE.ELASTIC_ADD_LIQUIDITY_CLICK_POOL_ANALYTIC, { + token_1: tokenA?.symbol, + token_2: tokenB?.symbol, + }) + }} + /> + + + + ) + )} + {upToMedium && chart} +
+ {!upToMedium && {chart}} +
+ + {warnings && ( + + {warnings} + + )} + + + + + + + + + + )}