diff --git a/.env.d.ts b/.env.d.ts index 416557b240..200cfad4f9 100644 --- a/.env.d.ts +++ b/.env.d.ts @@ -3,6 +3,8 @@ declare global { interface ProcessEnv { ALCHEMY_API_KEY: string; BSC_MAINNET_RPC: string; + ZORA_MAINNET_RPC: string; + BASE_MAINNET_RPC: string; ETHERSCAN_API_KEY: string; SEGMENT_WRITE_KEY: string; SENTRY_DSN: string; diff --git a/e2e/serial/dappInteractions/2_dappInteractionFlow.test.ts b/e2e/serial/dappInteractions/2_dappInteractionFlow.test.ts index 0b0fc83069..4871b863bd 100644 --- a/e2e/serial/dappInteractions/2_dappInteractionFlow.test.ts +++ b/e2e/serial/dappInteractions/2_dappInteractionFlow.test.ts @@ -256,7 +256,7 @@ describe('App interactions flow', () => { }); await findElementByTextAndClick(driver, 'bx-e2e-dapp.vercel.app'); - await findElementByTestIdAndClick({ id: 'switch-network-item-5', driver }); + await findElementByTestIdAndClick({ id: 'switch-network-item-7', driver }); await driver.get('https://bx-e2e-dapp.vercel.app/'); const dappHandler = await getWindowHandle({ driver }); diff --git a/e2e/serial/swap/1_swapFlow1.test.ts b/e2e/serial/swap/1_swapFlow1.test.ts index 96fc18c3bc..dbe601cc22 100644 --- a/e2e/serial/swap/1_swapFlow1.test.ts +++ b/e2e/serial/swap/1_swapFlow1.test.ts @@ -631,7 +631,7 @@ it('should be able to filter assets to buy by network', async () => { driver, }); await findElementByTestIdAndClick({ - id: 'switch-network-item-4', + id: 'switch-network-item-6', driver, }); await typeOnTextInput({ diff --git a/src/core/firebase/remoteConfig.ts b/src/core/firebase/remoteConfig.ts index 11448a520e..35d5c9326e 100644 --- a/src/core/firebase/remoteConfig.ts +++ b/src/core/firebase/remoteConfig.ts @@ -30,6 +30,8 @@ export interface RainbowConfig extends Record { [ChainName.optimism]: number; [ChainName.polygon]: number; [ChainName.arbitrum]: number; + [ChainName.base]: number; + [ChainName.zora]: number; [ChainName.bsc]: number; }; } @@ -47,6 +49,8 @@ const DEFAULT_CONFIG = { mainnet: 100, optimism: 200, polygon: 200, + base: 200, + zora: 200, bsc: 200, }, }; diff --git a/src/core/languages/_english.json b/src/core/languages/_english.json index 6bcaa8a3d0..bb7d72622e 100644 --- a/src/core/languages/_english.json +++ b/src/core/languages/_english.json @@ -773,15 +773,12 @@ "month": "1M", "year": "1Y", "approvals": "Token Approvals", - "this_token_is_on_network": "This %{symbol} is on the %{chainName} network", - "more_options": { "copy_address": "Copy Address", "hide": "Hide Token", "report": "Report Token" }, - "about": { "about_token": "About %{name}", "price": "Price", @@ -798,12 +795,10 @@ "title": "Fully Diluted Market Cap", "description": "The maximum possible market cap of a token if the total supply was available in circulation." }, - "supply": "Supply", "max_total_supply": "Max Total Supply", "holders": "Holders", "total_transfers": "Total Transfers", - "more_info": "More info", "token_standard": "Token Standard", "token_contract": "Token Contract", @@ -861,6 +856,16 @@ "description_1": "Binance Smart Chain, or BSC for short, is the blockchain network for the trading platform Binance.", "description_2": "It allows for cheaper and faster transactions, but unlike Layer 2 networks, BSC has its own security and consensus mechanisms that differ from Ethereum." }, + "base": { + "title": "What's Base?", + "description_1": "Base is a Layer 2 network that runs on top of Ethereum, enabling cheaper and faster transactions while still benefiting from the underlying security of Ethereum.", + "description_2": "It bundles lots of transactions together in a \"roll up\" before sending them down to live permanently on Ethereum." + }, + "zora": { + "title": "What's Zora?", + "description_1": "Zora is a Layer 2 network that runs on top of Ethereum, enabling cheaper and faster transactions while still benefiting from the underlying security of Ethereum.", + "description_2": "It bundles lots of transactions together in a \"roll up\" before sending them down to live permanently on Ethereum." + }, "link_button_label": "Read more", "action_label": "Got it" }, @@ -970,4 +975,4 @@ "after": " to request more." } } -} +} \ No newline at end of file diff --git a/src/core/network/refractionAddressWs.ts b/src/core/network/refractionAddressWs.ts index 8f0a67909f..8d6ea3fb20 100644 --- a/src/core/network/refractionAddressWs.ts +++ b/src/core/network/refractionAddressWs.ts @@ -5,6 +5,8 @@ export const refractionAddressMessages = { RECEIVED: 'received address assets', RECEIVED_ARBITRUM: 'received address arbitrum-assets', RECEIVED_OPTIMISM: 'received address optimism-assets', + RECEIVED_BASE: 'received address base-assets', + RECEIVED_ZORA: 'received address zora-assets', RECEIVED_POLYGON: 'received address polygon-assets', REMOVED: 'removed address assets', }, @@ -14,6 +16,8 @@ export const refractionAddressMessages = { RECEIVED: 'received address transactions', RECEIVED_ARBITRUM: 'received address arbitrum-transactions', RECEIVED_OPTIMISM: 'received address optimism-transactions', + RECEIVED_BASE: 'received address base-transactions', + RECEIVED_ZORA: 'received address zora-transactions', RECEIVED_POLYGON: 'received address polygon-transactions', REMOVED: 'removed address transactions', }, diff --git a/src/core/references/gasUnits.ts b/src/core/references/gasUnits.ts index d978e1e078..45c34c820a 100644 --- a/src/core/references/gasUnits.ts +++ b/src/core/references/gasUnits.ts @@ -8,6 +8,8 @@ export const gasUnits = { [ChainId.mainnet]: '200000', [ChainId.arbitrum]: '3500000', [ChainId.optimism]: '1000000', + [ChainId.base]: '1000000', + [ChainId.zora]: '1000000', [ChainId.bsc]: '600000', [ChainId.polygon]: '600000', }, diff --git a/src/core/references/index.ts b/src/core/references/index.ts index 4b9d824462..9daf9a64fb 100644 --- a/src/core/references/index.ts +++ b/src/core/references/index.ts @@ -61,6 +61,12 @@ export const USDC_OPTIMISM_ADDRESS = export const WBTC_OPTIMISM_ADDRESS = '0x68f180fcce6836688e9084f035309e29bf0a2095'; +// base +export const ETH_BASE_ADDRESS = AddressZero; + +// zora +export const ETH_ZORA_ADDRESS = AddressZero; + // bsc export const BSC_BNB_ADDRESS = AddressZero; @@ -91,6 +97,8 @@ export const NATIVE_ASSETS_PER_CHAIN = { [ChainId.bsc]: BSC_BNB_ADDRESS, [ChainId.mainnet]: ETH_ADDRESS, [ChainId.optimism]: ETH_OPTIMISM_ADDRESS, + [ChainId.base]: ETH_BASE_ADDRESS, + [ChainId.zora]: ETH_ZORA_ADDRESS, [ChainId.polygon]: MATIC_POLYGON_ADDRESS, [ChainId.hardhat]: ETH_ADDRESS, }; diff --git a/src/core/resources/_selectors/assets.ts b/src/core/resources/_selectors/assets.ts index f9c8ab02e0..247285b443 100644 --- a/src/core/resources/_selectors/assets.ts +++ b/src/core/resources/_selectors/assets.ts @@ -38,6 +38,8 @@ export function selectUserAssetsListByChainId(assets: ParsedAssetsDictByChain) { assets?.[ChainId.optimism], assets?.[ChainId.polygon], assets?.[ChainId.arbitrum], + assets?.[ChainId.base], + assets?.[ChainId.zora], assets?.[ChainId.bsc], ].flat(); return assetsByNetwork @@ -62,6 +64,8 @@ export function selectUserAssetAddressMapByChainId( [ChainId.bsc]: mapAddresses(assets?.[ChainId.bsc]) || [], [ChainId.polygon]: mapAddresses(assets?.[ChainId.polygon]) || [], [ChainId.arbitrum]: mapAddresses(assets?.[ChainId.arbitrum]) || [], + [ChainId.base]: mapAddresses(assets?.[ChainId.base]) || [], + [ChainId.zora]: mapAddresses(assets?.[ChainId.zora]) || [], }; } diff --git a/src/core/resources/addys/addysSummary.ts b/src/core/resources/addys/addysSummary.ts index 81b884bf50..9be1b3be76 100644 --- a/src/core/resources/addys/addysSummary.ts +++ b/src/core/resources/addys/addysSummary.ts @@ -16,6 +16,8 @@ enum SummarySupportedChainId { optimism = ChainId.optimism as number, polygon = ChainId.polygon as number, arbitrum = ChainId.arbitrum as number, + base = ChainId.base as number, + zora = ChainId.zora as number, bsc = ChainId.bsc as number, } diff --git a/src/core/resources/search/tokenSearch.ts b/src/core/resources/search/tokenSearch.ts index c0cacec676..95705522e3 100644 --- a/src/core/resources/search/tokenSearch.ts +++ b/src/core/resources/search/tokenSearch.ts @@ -99,6 +99,8 @@ function parseTokenSearch(assets: SearchAsset[], chainId: ChainId) { `${ETH_ADDRESS}_${ChainId.arbitrum}`, `${BNB_MAINNET_ADDRESS}_${ChainId.bsc}`, `${MATIC_MAINNET_ADDRESS}_${ChainId.polygon}`, + `${ETH_ADDRESS}_${ChainId.base}`, + `${ETH_ADDRESS}_${ChainId.zora}`, ].includes(`${a.uniqueId}_${chainId}`), mainnetAddress: a.uniqueId as Address, uniqueId: `${a.uniqueId}_${chainId}`, diff --git a/src/core/state/favorites/index.ts b/src/core/state/favorites/index.ts index 07dd31c893..717c3ca229 100644 --- a/src/core/state/favorites/index.ts +++ b/src/core/state/favorites/index.ts @@ -8,7 +8,9 @@ import { DAI_POLYGON_ADDRESS, ETH_ADDRESS, ETH_ARBITRUM_ADDRESS, + ETH_BASE_ADDRESS, ETH_OPTIMISM_ADDRESS, + ETH_ZORA_ADDRESS, MATIC_POLYGON_ADDRESS, OP_ADDRESS, SOCKS_ADDRESS, @@ -74,6 +76,8 @@ export const favoritesStore = createStore( USDC_OPTIMISM_ADDRESS, WBTC_OPTIMISM_ADDRESS, ], + [ChainId.base]: [ETH_BASE_ADDRESS], + [ChainId.zora]: [ETH_ZORA_ADDRESS], }, addFavorite: ({ address, chainId }: UpdateFavoritesArgs) => { const { favorites } = get(); diff --git a/src/core/types/assets.ts b/src/core/types/assets.ts index 59896d04ee..fc3097f9f2 100644 --- a/src/core/types/assets.ts +++ b/src/core/types/assets.ts @@ -69,6 +69,8 @@ export enum AssetType { eth = 'eth', nft = 'nft', optimism = 'optimism', + base = 'base', + zora = 'zora', polygon = 'polygon', token = 'token', trash = 'trash', diff --git a/src/core/types/chains.ts b/src/core/types/chains.ts index 22036a2592..678f3f9274 100644 --- a/src/core/types/chains.ts +++ b/src/core/types/chains.ts @@ -21,29 +21,35 @@ export const hardhat: Chain = { export enum ChainName { arbitrum = 'arbitrum', + base = 'base', bsc = 'bsc', goerli = 'goerli', optimism = 'optimism', polygon = 'polygon', + zora = 'zora', mainnet = 'mainnet', hardhat = 'hardhat', } export enum ChainId { arbitrum = chain.arbitrum.id, + base = chain.base.id, bsc = chain.bsc.id, goerli = chain.goerli.id, optimism = chain.optimism.id, mainnet = chain.mainnet.id, polygon = chain.polygon.id, + zora = chain.zora.id, hardhat = HARDHAT_CHAIN_ID, } export const ChainNameDisplay = { [ChainId.arbitrum]: 'Arbitrum', + [ChainId.base]: 'Base', [ChainId.bsc]: 'BSC', [ChainId.optimism]: 'Optimism', [ChainId.polygon]: 'Polygon', + [ChainId.zora]: 'Zora', [ChainId.mainnet]: 'Ethereum', [ChainId.hardhat]: 'Hardhat', }; diff --git a/src/core/utils/chains.ts b/src/core/utils/chains.ts index 2ab419a875..432c3574e4 100644 --- a/src/core/utils/chains.ts +++ b/src/core/utils/chains.ts @@ -1,4 +1,12 @@ -import { arbitrum, bsc, mainnet, optimism, polygon } from '@wagmi/chains'; +import { + arbitrum, + base, + bsc, + mainnet, + optimism, + polygon, + zora, +} from '@wagmi/chains'; import type { Address, Chain } from 'wagmi'; import { ETH_ADDRESS, NATIVE_ASSETS_PER_CHAIN } from '~/core/references'; @@ -11,6 +19,8 @@ export const SUPPORTED_CHAINS: Chain[] = [ polygon, optimism, arbitrum, + base, + zora, bsc, ].map((chain) => ({ ...chain, name: ChainNameDisplay[chain.id] })); @@ -24,13 +34,17 @@ export const SUPPORTED_CHAIN_IDS = SUPPORTED_CHAINS.map(({ id }) => id); export const isL2Chain = (chain: ChainName | ChainId): boolean => { switch (chain) { case ChainName.arbitrum: + case ChainName.base: case ChainName.bsc: case ChainName.optimism: case ChainName.polygon: + case ChainName.zora: case ChainId.arbitrum: + case ChainId.base: case ChainId.bsc: case ChainId.optimism: case ChainId.polygon: + case ChainId.zora: return true; default: return false; @@ -57,6 +71,10 @@ export function chainNameFromChainId(chainId: ChainId) { export function getBlockExplorerHostForChain(chainId: ChainId) { if (chainId === ChainId.optimism) { return 'optimistic.etherscan.io'; + } else if (chainId === ChainId.base) { + return 'basescan.org'; + } else if (chainId === ChainId.zora) { + return 'explorer.zora.energy'; } else if (chainId === ChainId.polygon) { return 'polygonscan.com'; } else if (chainId === ChainId.bsc) { diff --git a/src/core/utils/connectedApps.ts b/src/core/utils/connectedApps.ts index 3837b18038..a9df263b0f 100644 --- a/src/core/utils/connectedApps.ts +++ b/src/core/utils/connectedApps.ts @@ -203,6 +203,12 @@ const displayDappNames: { 'zora.co': { name: 'Zora', }, + 'base.org': { + name: 'Base', + }, + 'zora.energy': { + name: 'Zora Energy', + }, }; export const getHardcodedDappInformation = (hostName: string) => diff --git a/src/core/utils/gas.ts b/src/core/utils/gas.ts index 31bc6a5c2b..a7b78244d6 100644 --- a/src/core/utils/gas.ts +++ b/src/core/utils/gas.ts @@ -352,6 +352,10 @@ export const getChainWaitTime = (chainId: ChainId) => { return { safeWait: 6, proposedWait: 3, fastWait: 3 }; case ChainId.optimism: return { safeWait: 20, proposedWait: 20, fastWait: 20 }; + case ChainId.base: + return { safeWait: 20, proposedWait: 20, fastWait: 20 }; + case ChainId.zora: + return { safeWait: 20, proposedWait: 20, fastWait: 20 }; case ChainId.arbitrum: return { safeWait: 8, proposedWait: 8, fastWait: 8 }; default: diff --git a/src/core/wagmi/createTestWagmiClient.ts b/src/core/wagmi/createTestWagmiClient.ts index 83275d565e..87dc1596e3 100644 --- a/src/core/wagmi/createTestWagmiClient.ts +++ b/src/core/wagmi/createTestWagmiClient.ts @@ -1,5 +1,13 @@ import { createAsyncStoragePersister } from '@tanstack/query-async-storage-persister'; -import { arbitrum, bsc, mainnet, optimism, polygon } from '@wagmi/chains'; +import { + arbitrum, + base, + bsc, + mainnet, + optimism, + polygon, + zora, +} from '@wagmi/chains'; import { Chain, CreateClientConfig, @@ -19,7 +27,7 @@ const noopStorage = { }; const { chains, provider, webSocketProvider } = configureChains( - [mainnet, optimism, polygon, arbitrum, bsc] as Chain[], + [mainnet, optimism, polygon, arbitrum, base, zora, bsc] as Chain[], [ jsonRpcProvider({ rpc: () => { diff --git a/src/core/wagmi/createWagmiClient.ts b/src/core/wagmi/createWagmiClient.ts index ade239a1f7..22f64b22bd 100644 --- a/src/core/wagmi/createWagmiClient.ts +++ b/src/core/wagmi/createWagmiClient.ts @@ -37,6 +37,10 @@ const { chains, provider, webSocketProvider } = configureChains( return { http: process.env.ARBITRUM_MAINNET_RPC as string }; case ChainId.polygon: return { http: process.env.POLYGON_MAINNET_RPC as string }; + case ChainId.base: + return { http: process.env.BASE_MAINNET_RPC as string }; + case ChainId.zora: + return { http: process.env.ZORA_MAINNET_RPC as string }; case ChainId.bsc: return { http: process.env.BSC_MAINNET_RPC as string }; default: diff --git a/src/design-system/styles/designTokens.ts b/src/design-system/styles/designTokens.ts index ec948c098c..2842e4e4c6 100644 --- a/src/design-system/styles/designTokens.ts +++ b/src/design-system/styles/designTokens.ts @@ -483,6 +483,8 @@ export type ForegroundColor = | 'arbitrum' | 'optimism' | 'polygon' + | 'base' + | 'zora' | 'bsc'; export const foregroundColors: Record< @@ -563,6 +565,14 @@ export const foregroundColors: Record< light: '#8247E5', dark: '#BE97FF', }, + base: { + light: '#0052FF', + dark: '#3979FF', + }, + zora: { + light: '#2B5DF0', + dark: '#6183F0', + }, bsc: { light: '#EBAF09', dark: '#EBAF09', @@ -616,6 +626,8 @@ export const textColors = selectForegroundColors( 'arbitrum', 'optimism', 'polygon', + 'base', + 'zora', 'bsc', ...genericColors, ); diff --git a/src/entries/iframe/notification.tsx b/src/entries/iframe/notification.tsx index ec50f3f656..b98eb53bc7 100644 --- a/src/entries/iframe/notification.tsx +++ b/src/entries/iframe/notification.tsx @@ -24,6 +24,8 @@ const ASSET_SOURCE = { [ChainId.optimism]: 'assets/badges/optimismBadge.png', [ChainId.arbitrum]: 'assets/badges/arbitrumBadge.png', [ChainId.polygon]: 'assets/badges/polygonBadge.png', + [ChainId.base]: 'assets/badges/baseBadge.png', + [ChainId.zora]: 'assets/badges/zoraBadge.png', [ChainId.bsc]: 'assets/badges/bscBadge.png', }; diff --git a/src/entries/popup/components/ChainBadge/ChainBadge.tsx b/src/entries/popup/components/ChainBadge/ChainBadge.tsx index 0e5c74d8dc..403d7d189b 100644 --- a/src/entries/popup/components/ChainBadge/ChainBadge.tsx +++ b/src/entries/popup/components/ChainBadge/ChainBadge.tsx @@ -1,9 +1,11 @@ -import ArbitrumBadge from 'static/assets/badges/arbitrumBadge.png'; -import BscBadge from 'static/assets/badges/bscBadge.png'; -import EthereumBadge from 'static/assets/badges/ethereumBadge.png'; -import HardhatBadge from 'static/assets/badges/hardhatBadge.png'; -import OptimismBadge from 'static/assets/badges/optimismBadge.png'; -import PolygonBadge from 'static/assets/badges/polygonBadge.png'; +import ArbitrumBadge from 'static/assets/badges/arbitrumBadge@3x.png'; +import BaseBadge from 'static/assets/badges/baseBadge@3x.png'; +import BscBadge from 'static/assets/badges/bscBadge@3x.png'; +import EthereumBadge from 'static/assets/badges/ethereumBadge@3x.png'; +import HardhatBadge from 'static/assets/badges/hardhatBadge@3x.png'; +import OptimismBadge from 'static/assets/badges/optimismBadge@3x.png'; +import PolygonBadge from 'static/assets/badges/polygonBadge@3x.png'; +import ZoraBadge from 'static/assets/badges/zoraBadge@3x.png'; import { ChainId } from '~/core/types/chains'; import { Box } from '~/design-system'; @@ -27,6 +29,8 @@ const networkBadges = { [ChainId.polygon]: PolygonBadge, [ChainId.optimism]: OptimismBadge, [ChainId.arbitrum]: ArbitrumBadge, + [ChainId.base]: BaseBadge, + [ChainId.zora]: ZoraBadge, [ChainId.bsc]: BscBadge, [ChainId.hardhat]: HardhatBadge, }; diff --git a/src/entries/popup/hooks/approveAppRequest/useApproveAppRequestValidations.ts b/src/entries/popup/hooks/approveAppRequest/useApproveAppRequestValidations.ts index cbd4290790..3ccde59c94 100644 --- a/src/entries/popup/hooks/approveAppRequest/useApproveAppRequestValidations.ts +++ b/src/entries/popup/hooks/approveAppRequest/useApproveAppRequestValidations.ts @@ -1,4 +1,12 @@ -import { arbitrum, bsc, mainnet, optimism, polygon } from '@wagmi/chains'; +import { + arbitrum, + base, + bsc, + mainnet, + optimism, + polygon, + zora, +} from '@wagmi/chains'; import { useMemo } from 'react'; import { i18n } from '~/core/languages'; @@ -14,6 +22,8 @@ import { useUserAsset } from '../useUserAsset'; const DEFAULT_NATIVE_ASSET_SYMBOL = { [ChainId.mainnet]: mainnet.nativeCurrency?.symbol, [ChainId.optimism]: optimism.nativeCurrency?.symbol, + [ChainId.base]: base.nativeCurrency?.symbol, + [ChainId.zora]: zora.nativeCurrency?.symbol, [ChainId.arbitrum]: arbitrum.nativeCurrency?.symbol, [ChainId.polygon]: polygon.nativeCurrency?.symbol, [ChainId.bsc]: bsc.nativeCurrency?.symbol, diff --git a/src/entries/popup/hooks/swap/useSwapSettings.ts b/src/entries/popup/hooks/swap/useSwapSettings.ts index 0905c77f31..5b9a92c787 100644 --- a/src/entries/popup/hooks/swap/useSwapSettings.ts +++ b/src/entries/popup/hooks/swap/useSwapSettings.ts @@ -13,6 +13,8 @@ export const DEFAULT_SLIPPAGE_BIPS = { [ChainId.polygon]: 200, [ChainId.bsc]: 200, [ChainId.optimism]: 200, + [ChainId.base]: 200, + [ChainId.zora]: 200, [ChainId.arbitrum]: 200, }; @@ -21,6 +23,8 @@ export const DEFAULT_SLIPPAGE = { [ChainId.polygon]: '2', [ChainId.bsc]: '2', [ChainId.optimism]: '2', + [ChainId.base]: '2', + [ChainId.zora]: '2', [ChainId.arbitrum]: '2', }; @@ -33,6 +37,8 @@ export const getDefaultSlippage = (chainId: ChainId) => { | ChainName.optimism | ChainName.polygon | ChainName.arbitrum + | ChainName.base + | ChainName.zora | ChainName.bsc; return slippageInBipsToString( config.default_slippage_bips[chainName] || DEFAULT_SLIPPAGE_BIPS[chainId], diff --git a/src/entries/popup/hooks/useFavoriteAssets.ts b/src/entries/popup/hooks/useFavoriteAssets.ts index b20e1d6f9b..1d6a5308e7 100644 --- a/src/entries/popup/hooks/useFavoriteAssets.ts +++ b/src/entries/popup/hooks/useFavoriteAssets.ts @@ -14,6 +14,8 @@ const FAVORITES_EMPTY_STATE = { [ChainId.bsc]: [], [ChainId.polygon]: [], [ChainId.arbitrum]: [], + [ChainId.base]: [], + [ChainId.zora]: [], [ChainId.hardhat]: [], }; diff --git a/src/entries/popup/hooks/useNativeAssetForNetwork.ts b/src/entries/popup/hooks/useNativeAssetForNetwork.ts index 8450e39ef5..916465e29f 100644 --- a/src/entries/popup/hooks/useNativeAssetForNetwork.ts +++ b/src/entries/popup/hooks/useNativeAssetForNetwork.ts @@ -22,6 +22,10 @@ const getNetworkNativeMainnetAssetAddress = ({ case ChainId.mainnet: case ChainId.optimism: return ETH_ADDRESS as Address; + case ChainId.base: + return ETH_ADDRESS as Address; + case ChainId.zora: + return ETH_ADDRESS as Address; case ChainId.bsc: return BNB_MAINNET_ADDRESS; case ChainId.polygon: diff --git a/src/entries/popup/hooks/useSearchCurrencyLists.ts b/src/entries/popup/hooks/useSearchCurrencyLists.ts index c6edb6cf1b..24dde96910 100644 --- a/src/entries/popup/hooks/useSearchCurrencyLists.ts +++ b/src/entries/popup/hooks/useSearchCurrencyLists.ts @@ -133,6 +133,20 @@ export function useSearchCurrencyLists({ fromChainId, }); + const { data: baseVerifiedAssets, isLoading: baseVerifiedAssetsLoading } = + useTokenSearch({ + chainId: ChainId.base, + ...VERIFIED_ASSETS_PAYLOAD, + fromChainId, + }); + + const { data: zoraVerifiedAssets, isLoading: zoraVerifiedAssetsLoading } = + useTokenSearch({ + chainId: ChainId.zora, + ...VERIFIED_ASSETS_PAYLOAD, + fromChainId, + }); + // current search const { data: targetVerifiedAssets, isLoading: targetVerifiedAssetsLoading } = useTokenSearch({ @@ -202,6 +216,14 @@ export function useSearchCurrencyLists({ assets: arbitrumVerifiedAssets, loading: arbitrumVerifiedAssetsLoading, }, + [ChainId.base]: { + assets: baseVerifiedAssets, + loading: baseVerifiedAssetsLoading, + }, + [ChainId.zora]: { + assets: zoraVerifiedAssets, + loading: zoraVerifiedAssetsLoading, + }, }), [ mainnetVerifiedAssets, @@ -214,6 +236,10 @@ export function useSearchCurrencyLists({ polygonVerifiedAssetsLoading, arbitrumVerifiedAssets, arbitrumVerifiedAssetsLoading, + baseVerifiedAssets, + baseVerifiedAssetsLoading, + zoraVerifiedAssets, + zoraVerifiedAssetsLoading, ], ); @@ -266,6 +292,8 @@ export function useSearchCurrencyLists({ [ChainId.bsc]: getCuratedAssets(ChainId.bsc), [ChainId.polygon]: getCuratedAssets(ChainId.polygon), [ChainId.arbitrum]: getCuratedAssets(ChainId.arbitrum), + [ChainId.base]: getCuratedAssets(ChainId.base), + [ChainId.zora]: getCuratedAssets(ChainId.zora), }), [getCuratedAssets], ); diff --git a/src/entries/popup/hooks/useSwappableAssets.ts b/src/entries/popup/hooks/useSwappableAssets.ts index ff71b46f4c..8ec0a3f1ce 100644 --- a/src/entries/popup/hooks/useSwappableAssets.ts +++ b/src/entries/popup/hooks/useSwappableAssets.ts @@ -45,6 +45,24 @@ export function useSwappableAssets(toChainId?: ChainId) { toChainId, }); + const { + data: swappableBaseAddresses, + isLoading: swappableBaseAddressesAreLoading, + } = useSwappableAddresses({ + addresses: assetAddressMap[ChainId.base], + fromChainId: ChainId.base, + toChainId, + }); + + const { + data: swappableZoraAddresses, + isLoading: swappableZoraAddressesAreLoading, + } = useSwappableAddresses({ + addresses: assetAddressMap[ChainId.zora], + fromChainId: ChainId.zora, + toChainId, + }); + const { data: swappableBscAddresses, isLoading: swappableBscAddressesAreLoading, @@ -94,6 +112,14 @@ export function useSwappableAssets(toChainId?: ChainId) { addresses: swappableArbitrumAddresses, loading: swappableArbitrumAddressesAreLoading, }, + [ChainId.base]: { + addresses: swappableBaseAddresses, + loading: swappableBaseAddressesAreLoading, + }, + [ChainId.zora]: { + addresses: swappableZoraAddresses, + loading: swappableZoraAddressesAreLoading, + }, }), [ swappableArbitrumAddresses, @@ -106,6 +132,10 @@ export function useSwappableAssets(toChainId?: ChainId) { swappableOptimismAddressesAreLoading, swappablePolygonAddresses, swappablePolygonAddressesAreLoading, + swappableBaseAddresses, + swappableBaseAddressesAreLoading, + swappableZoraAddresses, + swappableZoraAddressesAreLoading, ], ); diff --git a/src/entries/popup/pages/swap/SwapTokenInput/TokenDropdown/TokenToBuySection.tsx b/src/entries/popup/pages/swap/SwapTokenInput/TokenDropdown/TokenToBuySection.tsx index 8dc30eaab5..2f9e24dcd5 100644 --- a/src/entries/popup/pages/swap/SwapTokenInput/TokenDropdown/TokenToBuySection.tsx +++ b/src/entries/popup/pages/swap/SwapTokenInput/TokenDropdown/TokenToBuySection.tsx @@ -75,6 +75,8 @@ const bridgeSectionsColorsByChain = { [ChainId.arbitrum]: 'arbitrum' as TextStyles['color'], [ChainId.optimism]: 'optimism' as TextStyles['color'], [ChainId.polygon]: 'polygon' as TextStyles['color'], + [ChainId.base]: 'base' as TextStyles['color'], + [ChainId.zora]: 'zora' as TextStyles['color'], [ChainId.bsc]: 'bsc' as TextStyles['color'], }; diff --git a/static/allowlist.json b/static/allowlist.json index 6245d9324b..c6811fb4f5 100644 --- a/static/allowlist.json +++ b/static/allowlist.json @@ -22,6 +22,8 @@ "https://fcmregistrations.googleapis.com/v1/projects/rainbow-me/", "https://rainbow-me.firebaseapp.com", "https://icons.duckduckgo.com", - "https://*.live.ledger.com" + "https://*.live.ledger.com", + "https://rpc.zora.co", + "https://falling-wandering-film.base-mainnet.quiknode.pro" ] } \ No newline at end of file diff --git a/static/assets/badges/arbitrumBadge.png b/static/assets/badges/arbitrumBadge.png index 45a6b51793..eb0daf16fd 100644 Binary files a/static/assets/badges/arbitrumBadge.png and b/static/assets/badges/arbitrumBadge.png differ diff --git a/static/assets/badges/arbitrumBadge@2x.png b/static/assets/badges/arbitrumBadge@2x.png new file mode 100644 index 0000000000..92d28d7e66 Binary files /dev/null and b/static/assets/badges/arbitrumBadge@2x.png differ diff --git a/static/assets/badges/arbitrumBadge@3x.png b/static/assets/badges/arbitrumBadge@3x.png new file mode 100644 index 0000000000..c9d539f353 Binary files /dev/null and b/static/assets/badges/arbitrumBadge@3x.png differ diff --git a/static/assets/badges/baseBadge.png b/static/assets/badges/baseBadge.png new file mode 100644 index 0000000000..76bc8d80a2 Binary files /dev/null and b/static/assets/badges/baseBadge.png differ diff --git a/static/assets/badges/baseBadge@2x.png b/static/assets/badges/baseBadge@2x.png new file mode 100644 index 0000000000..255f820d76 Binary files /dev/null and b/static/assets/badges/baseBadge@2x.png differ diff --git a/static/assets/badges/baseBadge@3x.png b/static/assets/badges/baseBadge@3x.png new file mode 100644 index 0000000000..25f4883bbd Binary files /dev/null and b/static/assets/badges/baseBadge@3x.png differ diff --git a/static/assets/badges/bscBadge.png b/static/assets/badges/bscBadge.png index 218c554075..60b5e4ab26 100644 Binary files a/static/assets/badges/bscBadge.png and b/static/assets/badges/bscBadge.png differ diff --git a/static/assets/badges/bscBadge@2x.png b/static/assets/badges/bscBadge@2x.png new file mode 100644 index 0000000000..00fc7b8049 Binary files /dev/null and b/static/assets/badges/bscBadge@2x.png differ diff --git a/static/assets/badges/bscBadge@3x.png b/static/assets/badges/bscBadge@3x.png new file mode 100644 index 0000000000..b5ba15737e Binary files /dev/null and b/static/assets/badges/bscBadge@3x.png differ diff --git a/static/assets/badges/ethereumBadge.png b/static/assets/badges/ethereumBadge.png index 633af68040..e220a22d57 100644 Binary files a/static/assets/badges/ethereumBadge.png and b/static/assets/badges/ethereumBadge.png differ diff --git a/static/assets/badges/ethereumBadge@2x.png b/static/assets/badges/ethereumBadge@2x.png new file mode 100644 index 0000000000..809106585c Binary files /dev/null and b/static/assets/badges/ethereumBadge@2x.png differ diff --git a/static/assets/badges/ethereumBadge@3x.png b/static/assets/badges/ethereumBadge@3x.png new file mode 100644 index 0000000000..73fa47f410 Binary files /dev/null and b/static/assets/badges/ethereumBadge@3x.png differ diff --git a/static/assets/badges/hardhatBadge.png b/static/assets/badges/hardhatBadge.png index 9321613240..37ed94e5c5 100644 Binary files a/static/assets/badges/hardhatBadge.png and b/static/assets/badges/hardhatBadge.png differ diff --git a/static/assets/badges/hardhatBadge@2x.png b/static/assets/badges/hardhatBadge@2x.png new file mode 100644 index 0000000000..e101d29b83 Binary files /dev/null and b/static/assets/badges/hardhatBadge@2x.png differ diff --git a/static/assets/badges/hardhatBadge@3x.png b/static/assets/badges/hardhatBadge@3x.png new file mode 100644 index 0000000000..905749b8f1 Binary files /dev/null and b/static/assets/badges/hardhatBadge@3x.png differ diff --git a/static/assets/badges/optimismBadge.png b/static/assets/badges/optimismBadge.png index 35485a9878..73922c9ee8 100644 Binary files a/static/assets/badges/optimismBadge.png and b/static/assets/badges/optimismBadge.png differ diff --git a/static/assets/badges/optimismBadge@2x.png b/static/assets/badges/optimismBadge@2x.png new file mode 100644 index 0000000000..717d325719 Binary files /dev/null and b/static/assets/badges/optimismBadge@2x.png differ diff --git a/static/assets/badges/optimismBadge@3x.png b/static/assets/badges/optimismBadge@3x.png new file mode 100644 index 0000000000..b06525887d Binary files /dev/null and b/static/assets/badges/optimismBadge@3x.png differ diff --git a/static/assets/badges/polygonBadge.png b/static/assets/badges/polygonBadge.png index c2fd33cec8..c70d449796 100644 Binary files a/static/assets/badges/polygonBadge.png and b/static/assets/badges/polygonBadge.png differ diff --git a/static/assets/badges/polygonBadge@2x.png b/static/assets/badges/polygonBadge@2x.png new file mode 100644 index 0000000000..062b02a9de Binary files /dev/null and b/static/assets/badges/polygonBadge@2x.png differ diff --git a/static/assets/badges/polygonBadge@3x.png b/static/assets/badges/polygonBadge@3x.png new file mode 100644 index 0000000000..5211305476 Binary files /dev/null and b/static/assets/badges/polygonBadge@3x.png differ diff --git a/static/assets/badges/zoraBadge.png b/static/assets/badges/zoraBadge.png new file mode 100644 index 0000000000..06e71fe161 Binary files /dev/null and b/static/assets/badges/zoraBadge.png differ diff --git a/static/assets/badges/zoraBadge@2x.png b/static/assets/badges/zoraBadge@2x.png new file mode 100644 index 0000000000..d7094d9b4c Binary files /dev/null and b/static/assets/badges/zoraBadge@2x.png differ diff --git a/static/assets/badges/zoraBadge@3x.png b/static/assets/badges/zoraBadge@3x.png new file mode 100644 index 0000000000..53de9f4239 Binary files /dev/null and b/static/assets/badges/zoraBadge@3x.png differ