diff --git a/src/constants/routing.ts b/src/constants/routing.ts index 283e8a238e..943fd9b78e 100644 --- a/src/constants/routing.ts +++ b/src/constants/routing.ts @@ -20,6 +20,7 @@ import { OP, PORTAL_ETH_CELO, PORTAL_USDC_CELO, + USDbC_BASE, USDC_ARBITRUM, USDC_ARBITRUM_GOERLI, USDC_AVALANCHE, @@ -89,7 +90,7 @@ export const COMMON_BASES: ChainCurrencyList = { ], [ChainId.OPTIMISM]: [nativeOnChain(ChainId.OPTIMISM), OP, DAI_OPTIMISM, USDC_OPTIMISM, USDT_OPTIMISM, WBTC_OPTIMISM], [ChainId.OPTIMISM_GOERLI]: [nativeOnChain(ChainId.OPTIMISM_GOERLI)], - [ChainId.BASE]: [nativeOnChain(ChainId.BASE), WRAPPED_NATIVE_CURRENCY[ChainId.BASE] as Token, USDC_BASE], + [ChainId.BASE]: [nativeOnChain(ChainId.BASE), WRAPPED_NATIVE_CURRENCY[ChainId.BASE] as Token, USDC_BASE, USDbC_BASE], [ChainId.POLYGON]: [ nativeOnChain(ChainId.POLYGON), WETH_POLYGON, diff --git a/src/constants/tokens.ts b/src/constants/tokens.ts index 05767faf3c..5802786af2 100644 --- a/src/constants/tokens.ts +++ b/src/constants/tokens.ts @@ -66,13 +66,14 @@ export const PORTAL_USDC_CELO = new Token( 'USDCet', 'USDC (Portal from Ethereum)' ) -export const USDC_BASE = new Token( +export const USDbC_BASE = new Token( ChainId.BASE, '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA', 6, - 'USD Base Coin', - 'USDbC' + 'USDbC', + 'USD Base Coin' ) +export const USDC_BASE = new Token(ChainId.BASE, '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', 6, 'USDC', 'USD Coin') export const DAI = new Token(ChainId.MAINNET, '0x6B175474E89094C44Da98b954EedeAC495271d0F', 18, 'DAI', 'Dai Stablecoin') export const DAI_ARBITRUM_ONE = new Token( @@ -103,6 +104,7 @@ export const DAI_POLYGON = new Token( 'DAI', 'Dai Stablecoin' ) + export const USDT_POLYGON = new Token( ChainId.POLYGON, '0xc2132d05d31c914a87c6611c10748aeb04b58e8f', @@ -468,6 +470,7 @@ export const TOKEN_SHORTHANDS: { [shorthand: string]: { [chainId in ChainId]?: s [ChainId.POLYGON]: USDC_POLYGON.address, [ChainId.POLYGON_MUMBAI]: USDC_POLYGON_MUMBAI.address, [ChainId.BNB]: USDC_BSC.address, + [ChainId.BASE]: USDC_BASE.address, [ChainId.CELO]: PORTAL_USDC_CELO.address, [ChainId.CELO_ALFAJORES]: PORTAL_USDC_CELO.address, [ChainId.GOERLI]: USDC_GOERLI.address, diff --git a/src/hooks/useStablecoinPrice.ts b/src/hooks/useStablecoinPrice.ts index d20250c4d0..70851a0ef0 100644 --- a/src/hooks/useStablecoinPrice.ts +++ b/src/hooks/useStablecoinPrice.ts @@ -10,6 +10,7 @@ import { DAI_OPTIMISM, USDC_ARBITRUM, USDC_AVALANCHE, + USDC_BASE, USDC_MAINNET, USDC_POLYGON, USDT_BSC, @@ -25,6 +26,7 @@ const STABLECOIN_AMOUNT_OUT: { [chainId: number]: CurrencyAmount } = { [ChainId.CELO]: CurrencyAmount.fromRawAmount(CUSD_CELO, 10_000e18), [ChainId.BNB]: CurrencyAmount.fromRawAmount(USDT_BSC, 100e18), [ChainId.AVALANCHE]: CurrencyAmount.fromRawAmount(USDC_AVALANCHE, 10_000e6), + [ChainId.BASE]: CurrencyAmount.fromRawAmount(USDC_BASE, 10_000e6), } /** diff --git a/src/lib/hooks/transactions/updater.tsx b/src/lib/hooks/transactions/updater.tsx index a27e24bacb..c636f358ee 100644 --- a/src/lib/hooks/transactions/updater.tsx +++ b/src/lib/hooks/transactions/updater.tsx @@ -39,6 +39,7 @@ const RETRY_OPTIONS_BY_CHAIN_ID: { [chainId: number]: RetryOptions } = { [ChainId.ARBITRUM_GOERLI]: { n: 10, minWait: 250, maxWait: 1000 }, [ChainId.OPTIMISM]: { n: 10, minWait: 250, maxWait: 1000 }, [ChainId.OPTIMISM_GOERLI]: { n: 10, minWait: 250, maxWait: 1000 }, + [ChainId.BASE]: { n: 10, minWait: 250, maxWait: 1000 }, } const DEFAULT_RETRY_OPTIONS: RetryOptions = { n: 1, minWait: 0, maxWait: 0 } diff --git a/src/lib/hooks/useCurrencyLogoURIs.ts b/src/lib/hooks/useCurrencyLogoURIs.ts index f3e693b22e..e0e9fbf3a1 100644 --- a/src/lib/hooks/useCurrencyLogoURIs.ts +++ b/src/lib/hooks/useCurrencyLogoURIs.ts @@ -10,7 +10,7 @@ import CeloLogo from '../../assets/svg/celo_logo.svg' import MaticLogo from '../../assets/svg/matic-token-icon.svg' import { isCelo, NATIVE_CHAIN_ID, nativeOnChain } from '../../constants/tokens' -type Network = 'ethereum' | 'arbitrum' | 'optimism' | 'polygon' | 'smartchain' | 'celo' | 'avalanchec' +type Network = 'ethereum' | 'arbitrum' | 'optimism' | 'polygon' | 'smartchain' | 'celo' | 'avalanchec' | 'base' export function chainIdToNetworkName(networkId: ChainId): Network { switch (networkId) { @@ -28,6 +28,8 @@ export function chainIdToNetworkName(networkId: ChainId): Network { return 'celo' case ChainId.AVALANCHE: return 'avalanchec' + case ChainId.BASE: + return 'base' default: return 'ethereum' } @@ -52,7 +54,14 @@ export function getNativeLogoURI(chainId: ChainId = ChainId.MAINNET): string { function getTokenLogoURI(address: string, chainId: ChainId = ChainId.MAINNET): string | void { const networkName = chainIdToNetworkName(chainId) - const networksWithUrls = [ChainId.ARBITRUM_ONE, ChainId.MAINNET, ChainId.OPTIMISM, ChainId.BNB, ChainId.AVALANCHE] + const networksWithUrls = [ + ChainId.ARBITRUM_ONE, + ChainId.MAINNET, + ChainId.OPTIMISM, + ChainId.BNB, + ChainId.AVALANCHE, + ChainId.BASE, + ] if (isCelo(chainId) && address === nativeOnChain(chainId).wrapped.address) { return CeloLogo }