From bfd18caf7b10fc14815969119c8d9f091f3bdb48 Mon Sep 17 00:00:00 2001 From: fensa08 Date: Fri, 13 Jan 2023 18:04:56 +0100 Subject: [PATCH] add polygon mumbai support --- src/components/CurrencyLogo/index.tsx | 6 +++++- src/components/DowntimeWarning/index.tsx | 13 +++++++++++++ src/constants/addresses.ts | 6 +++++- src/constants/tokens.ts | 7 +++++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/components/CurrencyLogo/index.tsx b/src/components/CurrencyLogo/index.tsx index 7c3154ece75..3c1ba886456 100644 --- a/src/components/CurrencyLogo/index.tsx +++ b/src/components/CurrencyLogo/index.tsx @@ -9,7 +9,7 @@ import useHttpLocations from '../../hooks/useHttpLocations' import { WrappedTokenInfo } from '../../state/lists/wrappedTokenInfo' import Logo from '../Logo' -type Network = 'ethereum' | 'arbitrum' | 'optimism' +type Network = 'ethereum' | 'arbitrum' | 'optimism' | 'polygon' | 'mumbai' function chainIdToNetworkName(networkId: SupportedChainId): Network { switch (networkId) { @@ -19,6 +19,10 @@ function chainIdToNetworkName(networkId: SupportedChainId): Network { return 'arbitrum' case SupportedChainId.OPTIMISM: return 'optimism' + case SupportedChainId.POLYGON_MUMBAI: + return 'mumbai' + case SupportedChainId.POLYGON: + return 'polygon' default: return 'ethereum' } diff --git a/src/components/DowntimeWarning/index.tsx b/src/components/DowntimeWarning/index.tsx index 35401bcfb02..2668e183fb3 100644 --- a/src/components/DowntimeWarning/index.tsx +++ b/src/components/DowntimeWarning/index.tsx @@ -50,6 +50,19 @@ export default function DowntimeWarning() { ) + case SupportedChainId.POLYGON_MUMBAI: + return ( +
+ + Polygon Mumbai is in Beta and may experience downtime. Polygon expects planned downtime to upgrade the + network in the near future. During downtime, your position will not earn fees and you will be unable to + remove liquidity.{' '} + + Read more. + + +
+ ) case SupportedChainId.ARBITRUM_ONE: case SupportedChainId.ARBITRUM_RINKEBY: return ( diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index 6f8ab67c7e5..217c5682503 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -114,6 +114,7 @@ export const SWAP_ROUTER_ADDRESSES: AddressMap = constructSameAddressMap('0xE592 SupportedChainId.OPTIMISTIC_KOVAN, SupportedChainId.ARBITRUM_ONE, SupportedChainId.ARBITRUM_RINKEBY, + SupportedChainId.POLYGON_MUMBAI, ]) export const LIMIT_ORDER_MANAGER_ADDRESSES: AddressMap = { [SupportedChainId.KOVAN]: '0x66E15bb53c9C5fB1B9Aa19D84920A3965cEad8a7', @@ -123,6 +124,7 @@ export const LIMIT_ORDER_MANAGER_ADDRESSES: AddressMap = { [SupportedChainId.ARBITRUM_ONE]: '0x02C282F60FB2f3299458c2B85EB7E303b25fc6F0', [SupportedChainId.MAINNET]: '0xD1fDF0144be118C30a53E1d08Cc1E61d600E508e', [SupportedChainId.POLYGON]: '0xD1fDF0144be118C30a53E1d08Cc1E61d600E508e', + [SupportedChainId.POLYGON_MUMBAI]: '0xfB6dC01d0fEB05eB03e221192EEDfBB024D8808D', } export const KROM_TOKEN_ADDRESSES: AddressMap = { [SupportedChainId.KOVAN]: '0x4cEbC301Cd0E8AD64dE6B19576de7dd0B0140a1f', @@ -132,6 +134,7 @@ export const KROM_TOKEN_ADDRESSES: AddressMap = { [SupportedChainId.ARBITRUM_ONE]: '0x55fF62567f09906A85183b866dF84bf599a4bf70', [SupportedChainId.MAINNET]: '0x3af33bef05c2dcb3c7288b77fe1c8d2aeba4d789', [SupportedChainId.POLYGON]: '0x14Af1F2f02DCcB1e43402339099A05a5E363b83c', + [SupportedChainId.POLYGON_MUMBAI]: '0x5dC282A4ACdB02b6e682F78Fe54EADFF9f55be09', } export const UNISWAP_UTILS_ADDRESSES: AddressMap = { [SupportedChainId.KOVAN]: '0x9E1E4f041877f1aB604E5B109Cf699545e20E4bC', @@ -141,7 +144,8 @@ export const KROMATIKA_ROUTER_ADDRESSES: AddressMap = { [SupportedChainId.POLYGON]: '0xCe7cbDA67DE0BFdBBBAEA0DB94434a722A353CF4', } export const KROMATIKA_METASWAP_ADDRESSES: AddressMap = { - [SupportedChainId.POLYGON]: '0xE10F5F77CF90c99976BceE524Fbf88504A2e6616', + [SupportedChainId.POLYGON]: '0x6afD834f6e3D5ad5A83E7838ca45F3DBDe3E323d', + [SupportedChainId.POLYGON_MUMBAI]: '0xC266AA95553247194BDDa9dc1a364Bb35Dcd2d3E', } export const BICONOMY_DAPP_API: AddressMap = { [SupportedChainId.POLYGON]: 'lD1x8FLPD.45318b65-8ab0-45c7-b59c-2f73137fb751', diff --git a/src/constants/tokens.ts b/src/constants/tokens.ts index 88dcb16ce43..8d6bc092da5 100644 --- a/src/constants/tokens.ts +++ b/src/constants/tokens.ts @@ -214,6 +214,13 @@ export const KROM: { [chainId: number]: Token } = { 'KROM', 'Kromatika' ), + [SupportedChainId.POLYGON_MUMBAI]: new Token( + SupportedChainId.POLYGON_MUMBAI, + KROM_TOKEN_ADDRESSES[SupportedChainId.POLYGON_MUMBAI], + 18, + 'KROM', + 'Kromatika' + ), } export const WETH: { [chainId: number]: Token } = {