diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index bc2e0051f15..4e11041bade 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -350,7 +350,7 @@ export default function Header() { - {chainId && chainId !== SupportedChainId.MAINNET && NETWORK_LABELS[chainId] && ( + {chainId && NETWORK_LABELS[chainId] && ( {NETWORK_LABELS[chainId]} )} diff --git a/src/computePair.ts b/src/computePair.ts index 1a5fd788285..9d74aecd5af 100644 --- a/src/computePair.ts +++ b/src/computePair.ts @@ -2,10 +2,6 @@ import { SupportedChainId } from 'constants/chains' -// Object.defineProperty(exports, '__esModule', { value: true }); - -// function _interopDefault (ex: { [x: string]: any; }) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - type AddressMap = { [chainId: number]: string } var solidity = require('@ethersproject/solidity'); @@ -14,9 +10,6 @@ var address = require('@ethersproject/address'); const initHashes: AddressMap = {[SupportedChainId.SEPOLIA]: '0x4156ccc01dad273e6c65c4335c428a2ff4a4b0c95a9a228f6bfed45a069d3fe7', [SupportedChainId.BASE_SEPOLIA]: '0xeae33bc258560cf23b48dbe95209a6b4d6293ec42cdbea3e3471e5360f8af8a2'} -// var INIT_CODE_HASH = '0x4156ccc01dad273e6c65c4335c428a2ff4a4b0c95a9a228f6bfed45a069d3fe7'; -// var INIT_CODE_HASH = '0xeae33bc258560cf23b48dbe95209a6b4d6293ec42cdbea3e3471e5360f8af8a2'; - export var computePairAddress = function computePairAddress(_ref: { factoryAddress: any; tokenA: any; tokenB: any; chainId: any}) { var factoryAddress = _ref.factoryAddress, tokenA = _ref.tokenA, @@ -30,5 +23,3 @@ export var computePairAddress = function computePairAddress(_ref: { factoryAddre return address.getCreate2Address(factoryAddress, solidity.keccak256(['bytes'], [solidity.pack(['address', 'address'], [token0.address, token1.address])]), INIT_CODE_HASH); }; - -// exports.computePairAddress = computePairAddress; \ No newline at end of file diff --git a/src/connectors/index.ts b/src/connectors/index.ts index 714723087da..0ba811bc6cd 100644 --- a/src/connectors/index.ts +++ b/src/connectors/index.ts @@ -23,29 +23,29 @@ const NETWORK_URLS: { [chainId in SupportedChainId]: string } = { [SupportedChainId.MAINNET]: `https://mainnet.infura.io/v3/${INFURA_KEY}`, - [SupportedChainId.RINKEBY]: `https://rinkeby.infura.io/v3/${INFURA_KEY}`, - [SupportedChainId.ROPSTEN]: `https://ropsten.infura.io/v3/${INFURA_KEY}`, - [SupportedChainId.GOERLI]: `https://goerli.infura.io/v3/${INFURA_KEY}`, - [SupportedChainId.KOVAN]: `https://kovan.infura.io/v3/${INFURA_KEY}`, - [SupportedChainId.ARBITRUM_ONE]: `https://arb1.arbitrum.io/rpc`, + // [SupportedChainId.RINKEBY]: `https://rinkeby.infura.io/v3/${INFURA_KEY}`, + // [SupportedChainId.ROPSTEN]: `https://ropsten.infura.io/v3/${INFURA_KEY}`, + // [SupportedChainId.GOERLI]: `https://goerli.infura.io/v3/${INFURA_KEY}`, + // [SupportedChainId.KOVAN]: `https://kovan.infura.io/v3/${INFURA_KEY}`, + // [SupportedChainId.ARBITRUM_ONE]: `https://arb1.arbitrum.io/rpc`, [SupportedChainId.SEPOLIA]: `https://sepolia.gateway.tenderly.co`, [SupportedChainId.BASE_SEPOLIA]: `https://sepolia.base.org`, } const SUPPORTED_CHAIN_IDS: SupportedChainId[] = [ SupportedChainId.MAINNET, - SupportedChainId.KOVAN, - SupportedChainId.GOERLI, - SupportedChainId.RINKEBY, - SupportedChainId.ROPSTEN, - SupportedChainId.ARBITRUM_ONE, + // SupportedChainId.KOVAN, + // SupportedChainId.GOERLI, + // SupportedChainId.RINKEBY, + // SupportedChainId.ROPSTEN, + // SupportedChainId.ARBITRUM_ONE, SupportedChainId.SEPOLIA, SupportedChainId.BASE_SEPOLIA, ] export const network = new NetworkConnector({ urls: NETWORK_URLS, - defaultChainId: 1, + defaultChainId: 11155111, }) let networkLibrary: Web3Provider | undefined @@ -79,7 +79,7 @@ export const portis = new PortisConnector({ // mainnet only export const walletlink = new WalletLinkConnector({ - url: NETWORK_URLS[1], + url: NETWORK_URLS[11155111], appName: 'Uniswap', appLogoUrl: UNISWAP_LOGO_URL, }) diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index eeef30da2bf..ca41a670ad5 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -5,24 +5,8 @@ import { SupportedChainId } from './chains' type AddressMap = { [chainId: number]: string } -// export const UNI_ADDRESS: AddressMap = constructSameAddressMap('0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984', false) -// export const MULTICALL2_ADDRESSES: AddressMap = { -// ...constructSameAddressMap('0x43cDB3cb3cD47727B0C25f01bcB27fa822668544', false), -// [SupportedChainId.ARBITRUM_ONE]: '0x021CeAC7e681dBCE9b5039d2535ED97590eB395c', -// } -// prettier-ignore -// export const V2_FACTORY_ADDRESSES: AddressMap = constructSameAddressMap('0x7E0987E5b3a30e3f2828572Bb659A548460a3003', false) -// export const V2_ROUTER_ADDRESS: AddressMap = constructSameAddressMap( -// '0xC532a74256D3Db42D0Bf7a0400fEFDbad7694008', -// false -// ) export const UNI_ADDRESS: AddressMap = { [SupportedChainId.MAINNET]: '0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984', - [SupportedChainId.ROPSTEN]: '0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984', - [SupportedChainId.RINKEBY]: '0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984', - [SupportedChainId.GOERLI]: '0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984', - [SupportedChainId.KOVAN]: '0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984', - [SupportedChainId.ARBITRUM_ONE]: '0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984', [SupportedChainId.SEPOLIA]: '0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984', [SupportedChainId.BASE_SEPOLIA]: '0x3298e4a83fB1E7af3C557bE074e2992861aeEB04'} @@ -61,9 +45,6 @@ export const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES: AddressMap = constructSameA ) export const ENS_REGISTRAR_ADDRESSES: AddressMap = { [SupportedChainId.MAINNET]: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', - [SupportedChainId.ROPSTEN]: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', - [SupportedChainId.GOERLI]: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', - [SupportedChainId.RINKEBY]: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e', } export const SOCKS_CONTROLLER_ADDRESSES: AddressMap = { [SupportedChainId.MAINNET]: '0x65770b5283117639760beA3F867b69b3697a91dd', diff --git a/src/constants/chains.ts b/src/constants/chains.ts index 43bd4164c67..42518fe568a 100644 --- a/src/constants/chains.ts +++ b/src/constants/chains.ts @@ -1,21 +1,11 @@ export enum SupportedChainId { MAINNET = 1, - ROPSTEN = 3, - RINKEBY = 4, - GOERLI = 5, - KOVAN = 42, - ARBITRUM_ONE = 42161, SEPOLIA = 11155111, BASE_SEPOLIA = 84532, } export const NETWORK_LABELS: { [chainId in SupportedChainId | number]: string } = { [SupportedChainId.MAINNET]: 'Mainnet', - [SupportedChainId.RINKEBY]: 'Rinkeby', - [SupportedChainId.ROPSTEN]: 'Ropsten', - [SupportedChainId.GOERLI]: 'Görli', - [SupportedChainId.KOVAN]: 'Kovan', - [SupportedChainId.ARBITRUM_ONE]: 'Arbitrum One', [SupportedChainId.SEPOLIA]: 'Sepolia', [SupportedChainId.BASE_SEPOLIA]: 'Base Sepolia', } diff --git a/src/constants/routing.ts b/src/constants/routing.ts index d60331c70e6..4a92b5d6b38 100644 --- a/src/constants/routing.ts +++ b/src/constants/routing.ts @@ -51,11 +51,6 @@ const mAssetsAdditionalBases: { [tokenAddress: string]: Token[] } = { } const WETH_ONLY: ChainTokenList = { [SupportedChainId.MAINNET]: [WETH9_EXTENDED[SupportedChainId.MAINNET]], - [SupportedChainId.ROPSTEN]: [WETH9_EXTENDED[SupportedChainId.ROPSTEN]], - [SupportedChainId.RINKEBY]: [WETH9_EXTENDED[SupportedChainId.RINKEBY]], - [SupportedChainId.GOERLI]: [WETH9_EXTENDED[SupportedChainId.GOERLI]], - [SupportedChainId.KOVAN]: [WETH9_EXTENDED[SupportedChainId.KOVAN]], - [SupportedChainId.ARBITRUM_ONE]: [WETH9_EXTENDED[SupportedChainId.ARBITRUM_ONE]], [SupportedChainId.SEPOLIA]: [WETH9_EXTENDED[SupportedChainId.SEPOLIA]], [SupportedChainId.BASE_SEPOLIA]: [WETH9_EXTENDED[SupportedChainId.BASE_SEPOLIA]], } @@ -96,16 +91,8 @@ export const CUSTOM_BASES: { [chainId: number]: { [tokenAddress: string]: Token[ */ export const COMMON_BASES: ChainCurrencyList = { [1]: [ExtendedEther.onChain(1), DAI, USDC, USDT, WBTC, WETH9_EXTENDED[1]], - [3]: [ExtendedEther.onChain(3), WETH9_EXTENDED[3]], - [4]: [ExtendedEther.onChain(4), WETH9_EXTENDED[4]], - [5]: [ExtendedEther.onChain(5), WETH9_EXTENDED[5]], - [42]: [ExtendedEther.onChain(42), WETH9_EXTENDED[42]], [11155111]: [ExtendedEther.onChain(11155111), WETH9_EXTENDED[11155111]], [84532]: [ExtendedEther.onChain(84532), WETH9_EXTENDED[84532]], - [SupportedChainId.ARBITRUM_ONE]: [ - ExtendedEther.onChain(SupportedChainId.ARBITRUM_ONE), - WETH9_EXTENDED[SupportedChainId.ARBITRUM_ONE], - ], } // used to construct the list of all pairs we consider by default in the frontend diff --git a/src/constants/tokens.ts b/src/constants/tokens.ts index 93c1308fa22..ecf7c1f5393 100644 --- a/src/constants/tokens.ts +++ b/src/constants/tokens.ts @@ -25,22 +25,11 @@ export const UST = new Token(1, '0xa47c8bf37f92abed4a126bda807a7b7498661acd', 18 export const MIR = new Token(1, '0x09a3ecafa817268f77be1283176b946c4ff2e608', 18, 'MIR', 'Wrapped MIR') export const UNI: { [chainId: number]: Token } = { [SupportedChainId.MAINNET]: new Token(SupportedChainId.MAINNET, UNI_ADDRESS[1], 18, 'UNI', 'Uniswap'), - [SupportedChainId.RINKEBY]: new Token(SupportedChainId.RINKEBY, UNI_ADDRESS[4], 18, 'UNI', 'Uniswap'), - [SupportedChainId.ROPSTEN]: new Token(SupportedChainId.ROPSTEN, UNI_ADDRESS[3], 18, 'UNI', 'Uniswap'), - [SupportedChainId.GOERLI]: new Token(SupportedChainId.GOERLI, UNI_ADDRESS[5], 18, 'UNI', 'Uniswap'), - [SupportedChainId.KOVAN]: new Token(SupportedChainId.KOVAN, UNI_ADDRESS[42], 18, 'UNI', 'Uniswap'), [SupportedChainId.SEPOLIA]: new Token(SupportedChainId.SEPOLIA, UNI_ADDRESS[11155111], 18, 'UNI', 'Uniswap'), [SupportedChainId.BASE_SEPOLIA]: new Token(SupportedChainId.BASE_SEPOLIA, UNI_ADDRESS[84532], 18, 'UNI', 'Uniswap'), } export const WETH9_EXTENDED: { [chainId: number]: Token } = { ...WETH9, - [SupportedChainId.ARBITRUM_ONE]: new Token( - SupportedChainId.ARBITRUM_ONE, - '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', - 18, - 'WETH', - 'Wrapped Ether' - ), [SupportedChainId.SEPOLIA]: new Token( SupportedChainId.SEPOLIA, '0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9', diff --git a/src/hooks/useERC20Permit.ts b/src/hooks/useERC20Permit.ts index c0677ea2f93..96fe56bbeaa 100644 --- a/src/hooks/useERC20Permit.ts +++ b/src/hooks/useERC20Permit.ts @@ -38,20 +38,6 @@ const PERMITTABLE_TOKENS: { [DAI.address]: { type: PermitType.ALLOWED, name: 'Dai Stablecoin', version: '1' }, [UNI[1].address]: { type: PermitType.AMOUNT, name: 'Uniswap' }, }, - [4]: { - ['0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735']: { type: PermitType.ALLOWED, name: 'Dai Stablecoin', version: '1' }, - [UNI[4].address]: { type: PermitType.AMOUNT, name: 'Uniswap' }, - }, - [3]: { - [UNI[3].address]: { type: PermitType.AMOUNT, name: 'Uniswap' }, - ['0x07865c6E87B9F70255377e024ace6630C1Eaa37F']: { type: PermitType.AMOUNT, name: 'USD Coin', version: '2' }, - }, - [5]: { - [UNI[5].address]: { type: PermitType.AMOUNT, name: 'Uniswap' }, - }, - [42]: { - [UNI[42].address]: { type: PermitType.AMOUNT, name: 'Uniswap' }, - }, } export enum UseERC20PermitState { diff --git a/src/state/transactions/updater.tsx b/src/state/transactions/updater.tsx index 195b152109e..4e53230a77c 100644 --- a/src/state/transactions/updater.tsx +++ b/src/state/transactions/updater.tsx @@ -32,7 +32,7 @@ export function shouldCheck(lastBlockNumber: number, tx: TxInterface): boolean { } const RETRY_OPTIONS_BY_CHAIN_ID: { [chainId: number]: RetryOptions } = { - [SupportedChainId.ARBITRUM_ONE]: { n: 10, minWait: 250, maxWait: 1000 }, + } const DEFAULT_RETRY_OPTIONS: RetryOptions = { n: 3, minWait: 1000, maxWait: 3000 } diff --git a/src/utils/constructSameAddressMap.ts b/src/utils/constructSameAddressMap.ts index 8f0602ca3dd..aca2a850f7b 100644 --- a/src/utils/constructSameAddressMap.ts +++ b/src/utils/constructSameAddressMap.ts @@ -7,19 +7,10 @@ export function constructSameAddressMap( if (includeArbitrum) return { [SupportedChainId.MAINNET]: address, - [SupportedChainId.ROPSTEN]: address, - [SupportedChainId.RINKEBY]: address, - [SupportedChainId.GOERLI]: address, - [SupportedChainId.KOVAN]: address, - [SupportedChainId.ARBITRUM_ONE]: address, [SupportedChainId.SEPOLIA]: address, } return { [SupportedChainId.MAINNET]: address, - [SupportedChainId.ROPSTEN]: address, - [SupportedChainId.RINKEBY]: address, - [SupportedChainId.GOERLI]: address, - [SupportedChainId.KOVAN]: address, [SupportedChainId.SEPOLIA]: address, } } diff --git a/src/utils/getExplorerLink.ts b/src/utils/getExplorerLink.ts index d048a3b7bab..671e20ff8f9 100644 --- a/src/utils/getExplorerLink.ts +++ b/src/utils/getExplorerLink.ts @@ -2,10 +2,6 @@ import { SupportedChainId } from '../constants/chains' const ETHERSCAN_PREFIXES: { [chainId: number]: string } = { [SupportedChainId.MAINNET]: '', - [SupportedChainId.ROPSTEN]: 'ropsten.', - [SupportedChainId.RINKEBY]: 'rinkeby.', - [SupportedChainId.GOERLI]: 'goerli.', - [SupportedChainId.KOVAN]: 'kovan.', } export enum ExplorerDataType { @@ -22,7 +18,7 @@ export enum ExplorerDataType { * @param type the type of the data */ export function getExplorerLink(chainId: number, data: string, type: ExplorerDataType): string { - if (chainId === SupportedChainId.ARBITRUM_ONE) { + if (chainId === SupportedChainId.SEPOLIA) { switch (type) { case ExplorerDataType.TRANSACTION: return `https://mainnet-arb-explorer.netlify.app/tx/${data}` diff --git a/src/utils/getLibrary.ts b/src/utils/getLibrary.ts index 47719e4f543..3613e90aeb4 100644 --- a/src/utils/getLibrary.ts +++ b/src/utils/getLibrary.ts @@ -2,7 +2,7 @@ import { Web3Provider } from '@ethersproject/providers' import { SupportedChainId } from '../constants/chains' const NETWORK_POLLING_INTERVALS: { [chainId: number]: number } = { - [SupportedChainId.ARBITRUM_ONE]: 1_000, + [SupportedChainId.SEPOLIA]: 1_000, } export default function getLibrary(provider: any): Web3Provider {