diff --git a/package.json b/package.json index d5f6307d92..54ddcd7e4b 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "@kybernetwork/oauth2": "1.0.1", "@kyberswap/krystal-walletconnect-v2": "0.0.1", "@kyberswap/ks-sdk-classic": "^1.0.3", - "@kyberswap/ks-sdk-core": "1.1.2", + "@kyberswap/ks-sdk-core": "1.1.3", "@kyberswap/ks-sdk-elastic": "^1.1.2", "@lingui/macro": "^4.6.0", "@lingui/react": "^4.6.0", @@ -205,7 +205,7 @@ "vite-tsconfig-paths": "^4.0.8" }, "resolutions": { - "@kyberswap/ks-sdk-core": "1.1.2", + "@kyberswap/ks-sdk-core": "1.1.3", "babel-plugin-lodash/@babel/types": "~7.20.0", "react-error-overlay": "6.0.9" } diff --git a/src/components/ClassicElasticTab.tsx b/src/components/ClassicElasticTab.tsx index 8544e4b0c2..d3ba51f46f 100644 --- a/src/components/ClassicElasticTab.tsx +++ b/src/components/ClassicElasticTab.tsx @@ -47,7 +47,14 @@ function ClassicElasticTab() { const upToMedium = useMedia(`(max-width: ${MEDIA_WIDTHS.upToMedium}px)`) - const dontShowLegacy = [ChainId.ZKEVM, ChainId.BASE, ChainId.LINEA, ChainId.SCROLL, ChainId.BLAST].includes(chainId) + const dontShowLegacy = [ + ChainId.ZKEVM, + ChainId.BASE, + ChainId.LINEA, + ChainId.SCROLL, + ChainId.BLAST, + ChainId.MANTLE, + ].includes(chainId) const showLegacyExplicit = upToMedium || dontShowLegacy ? false : isFarmPage ? shouldShowFarmTab : shouldShowPositionTab diff --git a/src/components/Header/web3/NetworkModal/index.tsx b/src/components/Header/web3/NetworkModal/index.tsx index 7138c99b32..4e35807d14 100644 --- a/src/components/Header/web3/NetworkModal/index.tsx +++ b/src/components/Header/web3/NetworkModal/index.tsx @@ -10,7 +10,7 @@ import { ButtonAction } from 'components/Button' import Column from 'components/Column' import Modal from 'components/Modal' import Row, { RowBetween } from 'components/Row' -import { mantle, x1 } from 'constants/networks/index' +import { x1 } from 'constants/networks/index' import { NetworkInfo } from 'constants/networks/type' import { Z_INDEXS } from 'constants/styles' import { useActiveWeb3React } from 'hooks' @@ -204,7 +204,6 @@ export default function NetworkModal({ .map((networkInfo: NetworkInfo) => { return renderNetworkButton(networkInfo) })} - diff --git a/src/components/SwapForm/index.tsx b/src/components/SwapForm/index.tsx index e86cbfef53..e90a225ac7 100644 --- a/src/components/SwapForm/index.tsx +++ b/src/components/SwapForm/index.tsx @@ -219,7 +219,7 @@ const SwapForm: React.FC = props => { - {!isPartnerSwap && chainId !== ChainId.BLAST && ( + {!isPartnerSwap && ![ChainId.BLAST, ChainId.MANTLE].includes(chainId) && ( navigate( diff --git a/src/constants/bases.ts b/src/constants/bases.ts index 52a214af87..ef2e3cbdb5 100644 --- a/src/constants/bases.ts +++ b/src/constants/bases.ts @@ -26,6 +26,7 @@ const WETH_ONLY: ChainTokenList = { [ChainId.BASE]: [WETH[ChainId.BASE]], [ChainId.SCROLL]: [WETH[ChainId.SCROLL]], [ChainId.BLAST]: [WETH[ChainId.BLAST]], + [ChainId.MANTLE]: [WETH[ChainId.MANTLE]], } // used to construct intermediary pairs for trading diff --git a/src/constants/networks.ts b/src/constants/networks.ts index e625aa4d9a..f6f988f7e0 100644 --- a/src/constants/networks.ts +++ b/src/constants/networks.ts @@ -15,6 +15,7 @@ import { fantom, görli, linea, + mantle, matic, mumbai, optimism, @@ -46,6 +47,7 @@ const NETWORKS_INFO_CONFIG: NETWORKS_INFO_CONFIG_TYPE = { [ChainId.BASE]: base, [ChainId.SCROLL]: scroll, [ChainId.BLAST]: blast, + [ChainId.MANTLE]: mantle, } as const //this Proxy helps fallback undefined ChainId by Ethereum info diff --git a/src/constants/networks/mantle.ts b/src/constants/networks/mantle.ts index b44413d64f..ed8401732c 100644 --- a/src/constants/networks/mantle.ts +++ b/src/constants/networks/mantle.ts @@ -27,7 +27,7 @@ const mantle: NetworkInfo = { decimal: 18, minForGas: 10 ** 16, }, - defaultRpcUrl: '', + defaultRpcUrl: 'https://rpc.mantle.xyz', multicall: '0xcA11bde05977b3631167028862bE2a173976CA11', classic: { defaultSubgraph: '', @@ -65,8 +65,8 @@ const mantle: NetworkInfo = { }, limitOrder: NOT_SUPPORT, averageBlockTimeInSeconds: 2.0, // dont use for base - coingeckoNetworkId: 'blast', - coingeckoNativeTokenId: 'ethereum', + coingeckoNetworkId: 'mantle', + coingeckoNativeTokenId: 'mnt', deBankSlug: EMPTY, dexToCompare: NOT_SUPPORT, geckoTermialId: NOT_SUPPORT, diff --git a/src/constants/tokens.ts b/src/constants/tokens.ts index d641d8ae93..ef197b8112 100644 --- a/src/constants/tokens.ts +++ b/src/constants/tokens.ts @@ -53,6 +53,7 @@ export const STABLE_COIN_ADDRESSES_TO_TAKE_FEE: Record = { [ChainId.BASE]: [], [ChainId.SCROLL]: [], [ChainId.BLAST]: [], + [ChainId.MANTLE]: [], } // This is basically the same as STABLE_COIN_ADDRESSES_TO_TAKE_FEE, @@ -139,6 +140,7 @@ export const SUPER_STABLE_COINS_ADDRESS: { [chainId in ChainId]: string[] } = { [ChainId.SCROLL]: [], [ChainId.SCROLL]: [], [ChainId.BLAST]: [], + [ChainId.MANTLE]: [], } export const CORRELATED_COINS_ADDRESS: { [chainId in ChainId]: string[][] } = { @@ -187,6 +189,7 @@ export const CORRELATED_COINS_ADDRESS: { [chainId in ChainId]: string[][] } = { [ChainId.BASE]: [], [ChainId.SCROLL]: [], [ChainId.BLAST]: [], + [ChainId.MANTLE]: [], } export const KNC_ADDRESS = '0xdeFA4e8a7bcBA345F687a2f1456F5Edd9CE97202' @@ -213,6 +216,7 @@ export const KNC: { [chainId in ChainId]: Token } = { [ChainId.SCROLL]: new Token(ChainId.SCROLL, KNC_ADDRESS, 18, 'KNC', 'KNC'), [ChainId.ZKSYNC]: new Token(ChainId.ZKSYNC, KNC_ADDRESS, 18, 'KNC', 'KNC'), [ChainId.BLAST]: new Token(ChainId.BLAST, KNC_ADDRESS, 18, 'KNC', 'KNC'), + [ChainId.MANTLE]: new Token(ChainId.MANTLE, KNC_ADDRESS, 18, 'KNC', 'KNC'), [ChainId.AVAXTESTNET]: new Token(ChainId.AVAXTESTNET, KNC_ADDRESS, 18, 'KNC', 'KNC'), [ChainId.MUMBAI]: new Token(ChainId.MUMBAI, '0xFD1f9381Cb641Dc76Fe8087dbcf8ea84a2c77cbE', 18, 'KNC', 'KNC'), @@ -241,6 +245,7 @@ export const DEFAULT_OUTPUT_TOKEN_BY_CHAIN: Partial> = { [ChainId.BASE]: new Token(ChainId.BASE, '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA', 6, 'USDC', 'USD Coin'), [ChainId.SCROLL]: new Token(ChainId.SCROLL, '0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df', 6, 'USDT', 'Tether USD'), [ChainId.BLAST]: new Token(ChainId.BLAST, '0x4300000000000000000000000000000000000003', 18, 'USDB', 'USDB'), + [ChainId.MANTLE]: new Token(ChainId.MANTLE, '0x201EBa5CC46D216Ce6DC03F6a759e8E766e956aE', 18, 'USDT', 'USDT'), } export const DEFAULT_SWAP_FEE_STABLE_PAIRS = 4 diff --git a/src/pages/About/AboutKyberSwap/index.tsx b/src/pages/About/AboutKyberSwap/index.tsx index 9fd482d100..78f2afe96b 100644 --- a/src/pages/About/AboutKyberSwap/index.tsx +++ b/src/pages/About/AboutKyberSwap/index.tsx @@ -763,6 +763,8 @@ function AboutKyberSwap() { /> Blast + + mantle diff --git a/yarn.lock b/yarn.lock index faff9f29d1..3057753a33 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3725,10 +3725,10 @@ tiny-warning "^1.0.3" toformat "^2.0.0" -"@kyberswap/ks-sdk-core@1.1.2", "@kyberswap/ks-sdk-core@^1.0.5": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@kyberswap/ks-sdk-core/-/ks-sdk-core-1.1.2.tgz#9a6c5bc5c087c1a6acce3d9c9fb831cf0e22b0f5" - integrity sha512-P7bWLn9DsGWtVS4VMs47lmq3UM8qwD+RwUjZCtlD/zp1/nGM2rXLT2eYQbmf16e6tCw5mA5+AozPmoyf2eIBIA== +"@kyberswap/ks-sdk-core@1.1.3", "@kyberswap/ks-sdk-core@^1.0.5": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@kyberswap/ks-sdk-core/-/ks-sdk-core-1.1.3.tgz#952dabacff1a831463b0dd95f8cdbe13bfc41c4f" + integrity sha512-TzTkhBVqlIXUi3s20MiTakdEcpyvMd/3JG0B3Xo/AWMFqc8WSaMRn3/mr4cMX5UXeo1LNy0nLIRD06bjQGyHjw== dependencies: "@ethersproject/address" "^5.0.2" big.js "^5.2.2"