diff --git a/package.json b/package.json index d56fb8543d..5d94606c76 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,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", @@ -206,7 +206,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 c2482c4aee..fba8e67b44 100644 --- a/src/components/SwapForm/index.tsx +++ b/src/components/SwapForm/index.tsx @@ -220,7 +220,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..c35716b672 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 @@ -75,6 +77,7 @@ export const MAINNET_NETWORKS = [ ChainId.BTTC, ChainId.CRONOS, ChainId.BLAST, + ChainId.MANTLE, ] as const // These option of walletconnect is not support by wallets properly diff --git a/src/constants/networks/mantle.ts b/src/constants/networks/mantle.ts index b44413d64f..d3ffa63f5a 100644 --- a/src/constants/networks/mantle.ts +++ b/src/constants/networks/mantle.ts @@ -17,7 +17,7 @@ const mantle: NetworkInfo = { iconSelected: NOT_SUPPORT, defaultBlockSubgraph: '', - etherscanUrl: '', + etherscanUrl: 'https://explorer.mantle.xyz', etherscanName: 'Mantle scan', bridgeURL: 'https://bridge.mantle.xyz', nativeToken: { @@ -25,9 +25,9 @@ const mantle: NetworkInfo = { name: 'MNT', logo: 'https://storage.googleapis.com/ks-setting-1d682dca/2bccd96f-b100-4ca1-858e-d8353ab0d0861710387147471.png', decimal: 18, - minForGas: 10 ** 16, + minForGas: 2 * 10 ** 17, }, - defaultRpcUrl: '', + defaultRpcUrl: 'https://rpc.ankr.com/mantle', multicall: '0xcA11bde05977b3631167028862bE2a173976CA11', classic: { defaultSubgraph: '', @@ -63,10 +63,10 @@ const mantle: NetworkInfo = { helper: '0x214061F0e250A27a49f609d9caf2987a7bC8fA6B', }, }, - limitOrder: NOT_SUPPORT, + limitOrder: '*', 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 5249fc7abe..162f07201b 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 6f636b0ff3..1f441192bd 100644 --- a/src/pages/About/AboutKyberSwap/index.tsx +++ b/src/pages/About/AboutKyberSwap/index.tsx @@ -432,6 +432,8 @@ function AboutKyberSwap() { /> Blast + + mantle diff --git a/yarn.lock b/yarn.lock index 511acba8b7..4e9f16ff74 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3735,10 +3735,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"