Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add polygon mumbai support
  • Loading branch information
fensa08 committed Jan 13, 2023
commit bfd18caf7b10fc14815969119c8d9f091f3bdb48
6 changes: 5 additions & 1 deletion src/components/CurrencyLogo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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'
}
Expand Down
13 changes: 13 additions & 0 deletions src/components/DowntimeWarning/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ export default function DowntimeWarning() {
</Trans>
</div>
)
case SupportedChainId.POLYGON_MUMBAI:
return (
<div>
<Trans>
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.{' '}
<ReadMoreLink href="https://help.uniswap.org/en/articles/5406082-what-happens-if-the-optimistic-ethereum-network-experiences-downtime">
Read more.
</ReadMoreLink>
</Trans>
</div>
)
case SupportedChainId.ARBITRUM_ONE:
case SupportedChainId.ARBITRUM_RINKEBY:
return (
Expand Down
6 changes: 5 additions & 1 deletion src/constants/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down
7 changes: 7 additions & 0 deletions src/constants/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 } = {
Expand Down