Skip to content

Commit

Permalink
removing extra chains
Browse files Browse the repository at this point in the history
  • Loading branch information
Keegan-SourceHat committed Apr 1, 2024
1 parent 84e27ba commit bf37b25
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 105 deletions.
2 changes: 1 addition & 1 deletion src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export default function Header() {
<HeaderControls>
<HeaderElement>
<HideSmall>
{chainId && chainId !== SupportedChainId.MAINNET && NETWORK_LABELS[chainId] && (
{chainId && NETWORK_LABELS[chainId] && (
<NetworkCard title={NETWORK_LABELS[chainId]}>{NETWORK_LABELS[chainId]}</NetworkCard>
)}
</HideSmall>
Expand Down
9 changes: 0 additions & 9 deletions src/computePair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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,
Expand All @@ -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;
24 changes: 12 additions & 12 deletions src/connectors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
})
19 changes: 0 additions & 19 deletions src/constants/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'}

Expand Down Expand Up @@ -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',
Expand Down
10 changes: 0 additions & 10 deletions src/constants/chains.ts
Original file line number Diff line number Diff line change
@@ -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',
}
13 changes: 0 additions & 13 deletions src/constants/routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]],
}
Expand Down Expand Up @@ -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
Expand Down
11 changes: 0 additions & 11 deletions src/constants/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
14 changes: 0 additions & 14 deletions src/hooks/useERC20Permit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/state/transactions/updater.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down
9 changes: 0 additions & 9 deletions src/utils/constructSameAddressMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,10 @@ export function constructSameAddressMap<T extends string>(
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,
}
}
6 changes: 1 addition & 5 deletions src/utils/getExplorerLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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}`
Expand Down
2 changes: 1 addition & 1 deletion src/utils/getLibrary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit bf37b25

Please sign in to comment.