Commit 1bc6eb9a authored by Charles Bachmeier's avatar Charles Bachmeier Committed by GitHub

feat: Add support for Sepolia (#6610)

* initial sepolia const setup

* uni sepolia

* add more consts for sepolia

* better comment

* upgrade ur sdk

* need to request BE add Ethereum sepolia to supported chains

* update weth address

* remove sepolia from defaults

* add tick lens addr

* add multicall && quoter

* use weth9 checksum

* successful wrap

* use supportedChainId over magic num

* upgrade default-token-list && deduplicate

* cleanup

* use checksum for usdc

* upgrade SOR

* placeholder setProperty

* comment cleanup

* add to anonymizeLink

* bump core-sdk

* deduplicate

* update infura fork block

* add comment

---------
Co-authored-by: default avatarCharles Bachmeier <charlie@genie.xyz>
parent 8954aa79
...@@ -3,7 +3,8 @@ require('dotenv').config() ...@@ -3,7 +3,8 @@ require('dotenv').config()
// Block selection is arbitrary, as e2e tests will build up their own state. // Block selection is arbitrary, as e2e tests will build up their own state.
// The only requirement is that all infrastructure under test (eg Permit2 contracts) are already deployed. // The only requirement is that all infrastructure under test (eg Permit2 contracts) are already deployed.
const BLOCK_NUMBER = 17023328 // TODO(WEB-2187): Make more dynamic to avoid manually updating
const BLOCK_NUMBER = 17388567
const mainnetFork = { const mainnetFork = {
url: `https://mainnet.infura.io/v3/${process.env.REACT_APP_INFURA_KEY}`, url: `https://mainnet.infura.io/v3/${process.env.REACT_APP_INFURA_KEY}`,
......
...@@ -5,7 +5,7 @@ import { SupportedChainId } from './chains' ...@@ -5,7 +5,7 @@ import { SupportedChainId } from './chains'
type AddressMap = { [chainId: number]: string } type AddressMap = { [chainId: number]: string }
const DEFAULT_NETWORKS = [SupportedChainId.MAINNET, SupportedChainId.GOERLI] const DEFAULT_NETWORKS = [SupportedChainId.MAINNET, SupportedChainId.GOERLI, SupportedChainId.SEPOLIA]
function constructSameAddressMap(address: string, additionalNetworks: SupportedChainId[] = []): AddressMap { function constructSameAddressMap(address: string, additionalNetworks: SupportedChainId[] = []): AddressMap {
return DEFAULT_NETWORKS.concat(additionalNetworks).reduce<AddressMap>((memo, chainId) => { return DEFAULT_NETWORKS.concat(additionalNetworks).reduce<AddressMap>((memo, chainId) => {
...@@ -53,6 +53,14 @@ const ARBITRUM_GOERLI_QUOTER_ADDRESSES = '0x1dd92b83591781D0C6d98d07391eea4b9a60 ...@@ -53,6 +53,14 @@ const ARBITRUM_GOERLI_QUOTER_ADDRESSES = '0x1dd92b83591781D0C6d98d07391eea4b9a60
const ARBITRUM_GOERLI_NONFUNGIBLE_POSITION_MANAGER_ADDRESSES = '0x622e4726a167799826d1E1D150b076A7725f5D81' const ARBITRUM_GOERLI_NONFUNGIBLE_POSITION_MANAGER_ADDRESSES = '0x622e4726a167799826d1E1D150b076A7725f5D81'
const ARBITRUM_GOERLI_TICK_LENS_ADDRESSES = '0xb52429333da969a0C79a60930a4Bf0020E5D1DE8' const ARBITRUM_GOERLI_TICK_LENS_ADDRESSES = '0xb52429333da969a0C79a60930a4Bf0020E5D1DE8'
// sepolia v3 addresses
const SEPOLIA_V3_CORE_FACTORY_ADDRESSES = '0x0227628f3F023bb0B980b67D528571c95c6DaC1c'
const SEPOLIA_V3_MIGRATOR_ADDRESSES = '0x729004182cF005CEC8Bd85df140094b6aCbe8b15'
const SEPOLIA_MULTICALL_ADDRESS = '0xD7F33bCdb21b359c8ee6F0251d30E94832baAd07'
const SEPOLIA_QUOTER_ADDRESSES = '0xEd1f6473345F45b75F8179591dd5bA1888cf2FB3'
const SEPOLIA_NONFUNGIBLE_POSITION_MANAGER_ADDRESSES = '0x1238536071E1c677A632429e3655c799b22cDA52'
const SEPOLIA_TICK_LENS_ADDRESSES = '0xd7f33bcdb21b359c8ee6f0251d30e94832baad07'
/* V3 Contract Addresses */ /* V3 Contract Addresses */
export const V3_CORE_FACTORY_ADDRESSES: AddressMap = { export const V3_CORE_FACTORY_ADDRESSES: AddressMap = {
...constructSameAddressMap(V3_FACTORY_ADDRESS, [ ...constructSameAddressMap(V3_FACTORY_ADDRESS, [
...@@ -66,6 +74,7 @@ export const V3_CORE_FACTORY_ADDRESSES: AddressMap = { ...@@ -66,6 +74,7 @@ export const V3_CORE_FACTORY_ADDRESSES: AddressMap = {
[SupportedChainId.BNB]: BNB_V3_CORE_FACTORY_ADDRESSES, [SupportedChainId.BNB]: BNB_V3_CORE_FACTORY_ADDRESSES,
[SupportedChainId.OPTIMISM_GOERLI]: OPTIMISM_GOERLI_V3_CORE_FACTORY_ADDRESSES, [SupportedChainId.OPTIMISM_GOERLI]: OPTIMISM_GOERLI_V3_CORE_FACTORY_ADDRESSES,
[SupportedChainId.ARBITRUM_GOERLI]: ARBITRUM_GOERLI_V3_CORE_FACTORY_ADDRESSES, [SupportedChainId.ARBITRUM_GOERLI]: ARBITRUM_GOERLI_V3_CORE_FACTORY_ADDRESSES,
[SupportedChainId.SEPOLIA]: SEPOLIA_V3_CORE_FACTORY_ADDRESSES,
} }
export const V3_MIGRATOR_ADDRESSES: AddressMap = { export const V3_MIGRATOR_ADDRESSES: AddressMap = {
...@@ -79,6 +88,7 @@ export const V3_MIGRATOR_ADDRESSES: AddressMap = { ...@@ -79,6 +88,7 @@ export const V3_MIGRATOR_ADDRESSES: AddressMap = {
[SupportedChainId.BNB]: BNB_V3_MIGRATOR_ADDRESSES, [SupportedChainId.BNB]: BNB_V3_MIGRATOR_ADDRESSES,
[SupportedChainId.OPTIMISM_GOERLI]: OPTIMISM_GOERLI_V3_MIGRATOR_ADDRESSES, [SupportedChainId.OPTIMISM_GOERLI]: OPTIMISM_GOERLI_V3_MIGRATOR_ADDRESSES,
[SupportedChainId.ARBITRUM_GOERLI]: ARBITRUM_GOERLI_V3_MIGRATOR_ADDRESSES, [SupportedChainId.ARBITRUM_GOERLI]: ARBITRUM_GOERLI_V3_MIGRATOR_ADDRESSES,
[SupportedChainId.SEPOLIA]: SEPOLIA_V3_MIGRATOR_ADDRESSES,
} }
export const MULTICALL_ADDRESS: AddressMap = { export const MULTICALL_ADDRESS: AddressMap = {
...@@ -93,6 +103,7 @@ export const MULTICALL_ADDRESS: AddressMap = { ...@@ -93,6 +103,7 @@ export const MULTICALL_ADDRESS: AddressMap = {
[SupportedChainId.BNB]: BNB_MULTICALL_ADDRESS, [SupportedChainId.BNB]: BNB_MULTICALL_ADDRESS,
[SupportedChainId.OPTIMISM_GOERLI]: OPTIMISM_GOERLI_MULTICALL_ADDRESS, [SupportedChainId.OPTIMISM_GOERLI]: OPTIMISM_GOERLI_MULTICALL_ADDRESS,
[SupportedChainId.ARBITRUM_GOERLI]: ARBITRUM_GOERLI_MULTICALL_ADDRESS, [SupportedChainId.ARBITRUM_GOERLI]: ARBITRUM_GOERLI_MULTICALL_ADDRESS,
[SupportedChainId.SEPOLIA]: SEPOLIA_MULTICALL_ADDRESS,
} }
/** /**
...@@ -136,6 +147,7 @@ export const QUOTER_ADDRESSES: AddressMap = { ...@@ -136,6 +147,7 @@ export const QUOTER_ADDRESSES: AddressMap = {
[SupportedChainId.BNB]: BNB_QUOTER_ADDRESSES, [SupportedChainId.BNB]: BNB_QUOTER_ADDRESSES,
[SupportedChainId.OPTIMISM_GOERLI]: OPTIMISM_GOERLI_QUOTER_ADDRESSES, [SupportedChainId.OPTIMISM_GOERLI]: OPTIMISM_GOERLI_QUOTER_ADDRESSES,
[SupportedChainId.ARBITRUM_GOERLI]: ARBITRUM_GOERLI_QUOTER_ADDRESSES, [SupportedChainId.ARBITRUM_GOERLI]: ARBITRUM_GOERLI_QUOTER_ADDRESSES,
[SupportedChainId.SEPOLIA]: SEPOLIA_QUOTER_ADDRESSES,
} }
export const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES: AddressMap = { export const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES: AddressMap = {
...@@ -150,6 +162,7 @@ export const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES: AddressMap = { ...@@ -150,6 +162,7 @@ export const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES: AddressMap = {
[SupportedChainId.BNB]: BNB_NONFUNGIBLE_POSITION_MANAGER_ADDRESSES, [SupportedChainId.BNB]: BNB_NONFUNGIBLE_POSITION_MANAGER_ADDRESSES,
[SupportedChainId.OPTIMISM_GOERLI]: OPTIMISM_GOERLI_NONFUNGIBLE_POSITION_MANAGER_ADDRESSES, [SupportedChainId.OPTIMISM_GOERLI]: OPTIMISM_GOERLI_NONFUNGIBLE_POSITION_MANAGER_ADDRESSES,
[SupportedChainId.ARBITRUM_GOERLI]: ARBITRUM_GOERLI_NONFUNGIBLE_POSITION_MANAGER_ADDRESSES, [SupportedChainId.ARBITRUM_GOERLI]: ARBITRUM_GOERLI_NONFUNGIBLE_POSITION_MANAGER_ADDRESSES,
[SupportedChainId.SEPOLIA]: SEPOLIA_NONFUNGIBLE_POSITION_MANAGER_ADDRESSES,
} }
export const ENS_REGISTRAR_ADDRESSES: AddressMap = { export const ENS_REGISTRAR_ADDRESSES: AddressMap = {
...@@ -168,4 +181,5 @@ export const TICK_LENS_ADDRESSES: AddressMap = { ...@@ -168,4 +181,5 @@ export const TICK_LENS_ADDRESSES: AddressMap = {
[SupportedChainId.CELO_ALFAJORES]: CELO_TICK_LENS_ADDRESSES, [SupportedChainId.CELO_ALFAJORES]: CELO_TICK_LENS_ADDRESSES,
[SupportedChainId.BNB]: BNB_TICK_LENS_ADDRESSES, [SupportedChainId.BNB]: BNB_TICK_LENS_ADDRESSES,
[SupportedChainId.OPTIMISM_GOERLI]: OPTIMISM_GOERLI_TICK_LENS_ADDRESSES, [SupportedChainId.OPTIMISM_GOERLI]: OPTIMISM_GOERLI_TICK_LENS_ADDRESSES,
[SupportedChainId.SEPOLIA]: SEPOLIA_TICK_LENS_ADDRESSES,
} }
...@@ -81,6 +81,16 @@ const CHAIN_INFO: ChainInfoMap = { ...@@ -81,6 +81,16 @@ const CHAIN_INFO: ChainInfoMap = {
nativeCurrency: { name: 'Görli Ether', symbol: 'görETH', decimals: 18 }, nativeCurrency: { name: 'Görli Ether', symbol: 'görETH', decimals: 18 },
color: darkTheme.chain_5, color: darkTheme.chain_5,
}, },
[SupportedChainId.SEPOLIA]: {
networkType: NetworkType.L1,
docs: 'https://docs.uniswap.org/',
explorer: 'https://sepolia.etherscan.io/',
infoLink: 'https://info.uniswap.org/#/',
label: 'Sepolia',
logoUrl: ethereumLogoUrl,
nativeCurrency: { name: 'Sepolia Ether', symbol: 'SepoliaETH', decimals: 18 },
color: darkTheme.chain_5,
},
[SupportedChainId.OPTIMISM]: { [SupportedChainId.OPTIMISM]: {
networkType: NetworkType.L2, networkType: NetworkType.L2,
blockWaitMsBeforeWarning: ms`25m`, blockWaitMsBeforeWarning: ms`25m`,
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
export enum SupportedChainId { export enum SupportedChainId {
MAINNET = 1, MAINNET = 1,
GOERLI = 5, GOERLI = 5,
SEPOLIA = 11155111,
ARBITRUM_ONE = 42161, ARBITRUM_ONE = 42161,
ARBITRUM_GOERLI = 421613, ARBITRUM_GOERLI = 421613,
...@@ -35,6 +36,7 @@ export const UniWalletSupportedChains = [ ...@@ -35,6 +36,7 @@ export const UniWalletSupportedChains = [
export const CHAIN_IDS_TO_NAMES = { export const CHAIN_IDS_TO_NAMES = {
[SupportedChainId.MAINNET]: 'mainnet', [SupportedChainId.MAINNET]: 'mainnet',
[SupportedChainId.GOERLI]: 'goerli', [SupportedChainId.GOERLI]: 'goerli',
[SupportedChainId.SEPOLIA]: 'sepolia',
[SupportedChainId.POLYGON]: 'polygon', [SupportedChainId.POLYGON]: 'polygon',
[SupportedChainId.POLYGON_MUMBAI]: 'polygon_mumbai', [SupportedChainId.POLYGON_MUMBAI]: 'polygon_mumbai',
[SupportedChainId.CELO]: 'celo', [SupportedChainId.CELO]: 'celo',
...@@ -79,6 +81,7 @@ export const UNSUPPORTED_V2POOL_CHAIN_IDS = [ ...@@ -79,6 +81,7 @@ export const UNSUPPORTED_V2POOL_CHAIN_IDS = [
export const TESTNET_CHAIN_IDS = [ export const TESTNET_CHAIN_IDS = [
SupportedChainId.GOERLI, SupportedChainId.GOERLI,
SupportedChainId.SEPOLIA,
SupportedChainId.POLYGON_MUMBAI, SupportedChainId.POLYGON_MUMBAI,
SupportedChainId.ARBITRUM_GOERLI, SupportedChainId.ARBITRUM_GOERLI,
SupportedChainId.OPTIMISM_GOERLI, SupportedChainId.OPTIMISM_GOERLI,
...@@ -92,6 +95,7 @@ export type SupportedTestnetChainId = typeof TESTNET_CHAIN_IDS[number] ...@@ -92,6 +95,7 @@ export type SupportedTestnetChainId = typeof TESTNET_CHAIN_IDS[number]
export const L1_CHAIN_IDS = [ export const L1_CHAIN_IDS = [
SupportedChainId.MAINNET, SupportedChainId.MAINNET,
SupportedChainId.GOERLI, SupportedChainId.GOERLI,
SupportedChainId.SEPOLIA,
SupportedChainId.POLYGON, SupportedChainId.POLYGON,
SupportedChainId.POLYGON_MUMBAI, SupportedChainId.POLYGON_MUMBAI,
SupportedChainId.CELO, SupportedChainId.CELO,
......
...@@ -34,6 +34,17 @@ export const FALLBACK_URLS = { ...@@ -34,6 +34,17 @@ export const FALLBACK_URLS = {
// "Fallback" URLs // "Fallback" URLs
'https://rpc.ankr.com/eth_goerli', 'https://rpc.ankr.com/eth_goerli',
], ],
[SupportedChainId.SEPOLIA]: [
// "Safe" URLs
'https://rpc.sepolia.dev/',
// "Fallback" URLs
'https://rpc.sepolia.org/',
'https://rpc2.sepolia.org/',
'https://rpc.sepolia.online/',
'https://www.sepoliarpc.space/',
'https://rpc-sepolia.rockx.com/',
'https://rpc.bordel.wtf/sepolia',
],
[SupportedChainId.POLYGON]: [ [SupportedChainId.POLYGON]: [
// "Safe" URLs // "Safe" URLs
'https://polygon-rpc.com/', 'https://polygon-rpc.com/',
...@@ -101,6 +112,10 @@ export const RPC_URLS = { ...@@ -101,6 +112,10 @@ export const RPC_URLS = {
...FALLBACK_URLS[SupportedChainId.MAINNET], ...FALLBACK_URLS[SupportedChainId.MAINNET],
], ],
[SupportedChainId.GOERLI]: [`https://goerli.infura.io/v3/${INFURA_KEY}`, ...FALLBACK_URLS[SupportedChainId.GOERLI]], [SupportedChainId.GOERLI]: [`https://goerli.infura.io/v3/${INFURA_KEY}`, ...FALLBACK_URLS[SupportedChainId.GOERLI]],
[SupportedChainId.SEPOLIA]: [
`https://sepolia.infura.io/v3/${INFURA_KEY}`,
...FALLBACK_URLS[SupportedChainId.SEPOLIA],
],
[SupportedChainId.OPTIMISM]: [ [SupportedChainId.OPTIMISM]: [
`https://optimism-mainnet.infura.io/v3/${INFURA_KEY}`, `https://optimism-mainnet.infura.io/v3/${INFURA_KEY}`,
...FALLBACK_URLS[SupportedChainId.OPTIMISM], ...FALLBACK_URLS[SupportedChainId.OPTIMISM],
......
...@@ -60,6 +60,7 @@ class AppJsonRpcProvider extends StaticJsonRpcProvider { ...@@ -60,6 +60,7 @@ class AppJsonRpcProvider extends StaticJsonRpcProvider {
export const RPC_PROVIDERS: { [key in SupportedChainId]: StaticJsonRpcProvider } = { export const RPC_PROVIDERS: { [key in SupportedChainId]: StaticJsonRpcProvider } = {
[SupportedChainId.MAINNET]: new AppJsonRpcProvider(SupportedChainId.MAINNET), [SupportedChainId.MAINNET]: new AppJsonRpcProvider(SupportedChainId.MAINNET),
[SupportedChainId.GOERLI]: new AppJsonRpcProvider(SupportedChainId.GOERLI), [SupportedChainId.GOERLI]: new AppJsonRpcProvider(SupportedChainId.GOERLI),
[SupportedChainId.SEPOLIA]: new AppJsonRpcProvider(SupportedChainId.SEPOLIA),
[SupportedChainId.OPTIMISM]: new AppJsonRpcProvider(SupportedChainId.OPTIMISM), [SupportedChainId.OPTIMISM]: new AppJsonRpcProvider(SupportedChainId.OPTIMISM),
[SupportedChainId.OPTIMISM_GOERLI]: new AppJsonRpcProvider(SupportedChainId.OPTIMISM_GOERLI), [SupportedChainId.OPTIMISM_GOERLI]: new AppJsonRpcProvider(SupportedChainId.OPTIMISM_GOERLI),
[SupportedChainId.ARBITRUM_ONE]: new AppJsonRpcProvider(SupportedChainId.ARBITRUM_ONE), [SupportedChainId.ARBITRUM_ONE]: new AppJsonRpcProvider(SupportedChainId.ARBITRUM_ONE),
......
...@@ -146,6 +146,10 @@ export const COMMON_BASES: ChainCurrencyList = { ...@@ -146,6 +146,10 @@ export const COMMON_BASES: ChainCurrencyList = {
nativeOnChain(SupportedChainId.GOERLI), nativeOnChain(SupportedChainId.GOERLI),
WRAPPED_NATIVE_CURRENCY[SupportedChainId.GOERLI] as Token, WRAPPED_NATIVE_CURRENCY[SupportedChainId.GOERLI] as Token,
], ],
[SupportedChainId.SEPOLIA]: [
nativeOnChain(SupportedChainId.SEPOLIA),
WRAPPED_NATIVE_CURRENCY[SupportedChainId.SEPOLIA] as Token,
],
[SupportedChainId.ARBITRUM_ONE]: [ [SupportedChainId.ARBITRUM_ONE]: [
nativeOnChain(SupportedChainId.ARBITRUM_ONE), nativeOnChain(SupportedChainId.ARBITRUM_ONE),
DAI_ARBITRUM_ONE, DAI_ARBITRUM_ONE,
......
...@@ -25,6 +25,13 @@ const USDC_GOERLI = new Token( ...@@ -25,6 +25,13 @@ const USDC_GOERLI = new Token(
'USDC', 'USDC',
'USD//C' 'USD//C'
) )
const USDC_SEPOLIA = new Token(
SupportedChainId.SEPOLIA,
'0x6f14C02Fc1F78322cFd7d707aB90f18baD3B54f5',
6,
'USDC',
'USD//C'
)
export const USDC_OPTIMISM = new Token( export const USDC_OPTIMISM = new Token(
SupportedChainId.OPTIMISM, SupportedChainId.OPTIMISM,
'0x7F5c764cBc14f9669B88837ca1490cCa17c31607', '0x7F5c764cBc14f9669B88837ca1490cCa17c31607',
...@@ -355,8 +362,27 @@ export const BUSD_BSC = new Token( ...@@ -355,8 +362,27 @@ export const BUSD_BSC = new Token(
export const DAI_BSC = new Token(SupportedChainId.BNB, '0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3', 18, 'DAI', 'DAI') export const DAI_BSC = new Token(SupportedChainId.BNB, '0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3', 18, 'DAI', 'DAI')
export const UNI: { [chainId: number]: Token } = { export const UNI: { [chainId: number]: Token } = {
[SupportedChainId.MAINNET]: new Token(SupportedChainId.MAINNET, UNI_ADDRESS[1], 18, 'UNI', 'Uniswap'), [SupportedChainId.MAINNET]: new Token(
[SupportedChainId.GOERLI]: new Token(SupportedChainId.GOERLI, UNI_ADDRESS[5], 18, 'UNI', 'Uniswap'), SupportedChainId.MAINNET,
UNI_ADDRESS[SupportedChainId.MAINNET],
18,
'UNI',
'Uniswap'
),
[SupportedChainId.GOERLI]: new Token(
SupportedChainId.GOERLI,
UNI_ADDRESS[SupportedChainId.GOERLI],
18,
'UNI',
'Uniswap'
),
[SupportedChainId.SEPOLIA]: new Token(
SupportedChainId.SEPOLIA,
UNI_ADDRESS[SupportedChainId.SEPOLIA],
18,
'UNI',
'Uniswap'
),
} }
export const ARB = new Token( export const ARB = new Token(
...@@ -397,6 +423,13 @@ export const WRAPPED_NATIVE_CURRENCY: { [chainId: number]: Token | undefined } = ...@@ -397,6 +423,13 @@ export const WRAPPED_NATIVE_CURRENCY: { [chainId: number]: Token | undefined } =
'WETH', 'WETH',
'Wrapped Ether' 'Wrapped Ether'
), ),
[SupportedChainId.SEPOLIA]: new Token(
SupportedChainId.SEPOLIA,
'0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14',
18,
'WETH',
'Wrapped Ether'
),
[SupportedChainId.POLYGON]: new Token( [SupportedChainId.POLYGON]: new Token(
SupportedChainId.POLYGON, SupportedChainId.POLYGON,
'0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270', '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270',
...@@ -543,5 +576,6 @@ export const TOKEN_SHORTHANDS: { [shorthand: string]: { [chainId in SupportedCha ...@@ -543,5 +576,6 @@ export const TOKEN_SHORTHANDS: { [shorthand: string]: { [chainId in SupportedCha
[SupportedChainId.CELO]: PORTAL_USDC_CELO.address, [SupportedChainId.CELO]: PORTAL_USDC_CELO.address,
[SupportedChainId.CELO_ALFAJORES]: PORTAL_USDC_CELO.address, [SupportedChainId.CELO_ALFAJORES]: PORTAL_USDC_CELO.address,
[SupportedChainId.GOERLI]: USDC_GOERLI.address, [SupportedChainId.GOERLI]: USDC_GOERLI.address,
[SupportedChainId.SEPOLIA]: USDC_SEPOLIA.address,
}, },
} }
...@@ -56,6 +56,7 @@ export function isPricePoint(p: PricePoint | null): p is PricePoint { ...@@ -56,6 +56,7 @@ export function isPricePoint(p: PricePoint | null): p is PricePoint {
return p !== null return p !== null
} }
// TODO(DAT-33) Update when BE adds Ethereum Sepolia to supported chains
export const CHAIN_ID_TO_BACKEND_NAME: { [key: number]: Chain } = { export const CHAIN_ID_TO_BACKEND_NAME: { [key: number]: Chain } = {
[SupportedChainId.MAINNET]: Chain.Ethereum, [SupportedChainId.MAINNET]: Chain.Ethereum,
[SupportedChainId.GOERLI]: Chain.EthereumGoerli, [SupportedChainId.GOERLI]: Chain.EthereumGoerli,
......
...@@ -40,6 +40,9 @@ const PERMITTABLE_TOKENS: { ...@@ -40,6 +40,9 @@ const PERMITTABLE_TOKENS: {
[SupportedChainId.GOERLI]: { [SupportedChainId.GOERLI]: {
[UNI[SupportedChainId.GOERLI].address]: { type: PermitType.AMOUNT, name: 'Uniswap' }, [UNI[SupportedChainId.GOERLI].address]: { type: PermitType.AMOUNT, name: 'Uniswap' },
}, },
[SupportedChainId.SEPOLIA]: {
[UNI[SupportedChainId.SEPOLIA].address]: { type: PermitType.AMOUNT, name: 'Uniswap' },
},
} }
enum UseERC20PermitState { enum UseERC20PermitState {
......
...@@ -103,6 +103,10 @@ class GAMetric extends IMetric { ...@@ -103,6 +103,10 @@ class GAMetric extends IMetric {
putMetric(key: string, value: number, unit?: MetricLoggerUnit) { putMetric(key: string, value: number, unit?: MetricLoggerUnit) {
sendTiming('Routing API', `${key} | ${unit}`, value, 'client') sendTiming('Routing API', `${key} | ${unit}`, value, 'client')
} }
setProperty() {
return
}
} }
setGlobalMetric(new GAMetric()) setGlobalMetric(new GAMetric())
...@@ -2,6 +2,7 @@ const EXPLORER_HOSTNAMES: { [hostname: string]: true } = { ...@@ -2,6 +2,7 @@ const EXPLORER_HOSTNAMES: { [hostname: string]: true } = {
'bscscan.com': true, 'bscscan.com': true,
'etherscan.io': true, 'etherscan.io': true,
'goerli.etherscan.io': true, 'goerli.etherscan.io': true,
'sepolia.etherscan.io': true,
'optimistic.etherscan.io': true, 'optimistic.etherscan.io': true,
'goerli-optimism.etherscan.io': true, 'goerli-optimism.etherscan.io': true,
'arbiscan.io': true, 'arbiscan.io': true,
......
...@@ -3,6 +3,7 @@ import { SupportedChainId } from 'constants/chains' ...@@ -3,6 +3,7 @@ import { SupportedChainId } from 'constants/chains'
const BLOCK_EXPLORER_PREFIXES: { [chainId: number]: string } = { const BLOCK_EXPLORER_PREFIXES: { [chainId: number]: string } = {
[SupportedChainId.MAINNET]: 'https://etherscan.io', [SupportedChainId.MAINNET]: 'https://etherscan.io',
[SupportedChainId.GOERLI]: 'https://goerli.etherscan.io', [SupportedChainId.GOERLI]: 'https://goerli.etherscan.io',
[SupportedChainId.SEPOLIA]: 'https://sepolia.etherscan.io',
[SupportedChainId.OPTIMISM]: 'https://optimistic.etherscan.io', [SupportedChainId.OPTIMISM]: 'https://optimistic.etherscan.io',
[SupportedChainId.OPTIMISM_GOERLI]: 'https://goerli-optimism.etherscan.io', [SupportedChainId.OPTIMISM_GOERLI]: 'https://goerli-optimism.etherscan.io',
[SupportedChainId.POLYGON]: 'https://polygonscan.com', [SupportedChainId.POLYGON]: 'https://polygonscan.com',
......
...@@ -8,6 +8,7 @@ function getRpcUrl(chainId: SupportedChainId): string { ...@@ -8,6 +8,7 @@ function getRpcUrl(chainId: SupportedChainId): string {
switch (chainId) { switch (chainId) {
case SupportedChainId.MAINNET: case SupportedChainId.MAINNET:
case SupportedChainId.GOERLI: case SupportedChainId.GOERLI:
case SupportedChainId.SEPOLIA:
return RPC_URLS[chainId][0] return RPC_URLS[chainId][0]
// Attempting to add a chain using an infura URL will not work, as the URL will be unreachable from the MetaMask background page. // Attempting to add a chain using an infura URL will not work, as the URL will be unreachable from the MetaMask background page.
// MetaMask allows switching to any publicly reachable URL, but for novel chains, it will display a warning if it is not on the "Safe" list. // MetaMask allows switching to any publicly reachable URL, but for novel chains, it will display a warning if it is not on the "Safe" list.
......
...@@ -5345,10 +5345,10 @@ ...@@ -5345,10 +5345,10 @@
resolved "https://registry.yarnpkg.com/@uniswap/default-token-list/-/default-token-list-2.2.0.tgz#d85a5c2520f57f4920bd989dfc9f01e1b701a567" resolved "https://registry.yarnpkg.com/@uniswap/default-token-list/-/default-token-list-2.2.0.tgz#d85a5c2520f57f4920bd989dfc9f01e1b701a567"
integrity sha512-vFPWoGzDjHP4i2l7yLaober/lZMmzOZXXirVF8XNyfNzRxgmYCWKO6SzKtfEUwxpd3/KUebgdK55II4Mnak62A== integrity sha512-vFPWoGzDjHP4i2l7yLaober/lZMmzOZXXirVF8XNyfNzRxgmYCWKO6SzKtfEUwxpd3/KUebgdK55II4Mnak62A==
"@uniswap/default-token-list@^9.4.0": "@uniswap/default-token-list@^9.6.0":
version "9.4.0" version "9.6.0"
resolved "https://registry.yarnpkg.com/@uniswap/default-token-list/-/default-token-list-9.4.0.tgz#60c4d249b3be5d0123480e5a4fd092a1fd10ef0c" resolved "https://registry.yarnpkg.com/@uniswap/default-token-list/-/default-token-list-9.6.0.tgz#641176b482f5f7dcae37b39c073ea26dad3667c3"
integrity sha512-PsYsEPpFs0CIjWHel2FDPo6T/EkZ+RuH9NfX55FbMbZMTuw9TSQEfl8p1fYt6KAMWi0Zy/Mfqp16y+OiYJyoBA== integrity sha512-uUHykitpCom9xngh9fst6xqOKe3p3rdBRW17+sRkU7ukWIRRIwQ/YxxC6+zVlo0YMpMMkKMJ4oTVmCqtSNnhxw==
"@uniswap/eslint-config@^1.2.0": "@uniswap/eslint-config@^1.2.0":
version "1.2.0" version "1.2.0"
...@@ -5421,10 +5421,10 @@ ...@@ -5421,10 +5421,10 @@
"@uniswap/v2-sdk" "^3.0.1" "@uniswap/v2-sdk" "^3.0.1"
"@uniswap/v3-sdk" "^3.8.3" "@uniswap/v3-sdk" "^3.8.3"
"@uniswap/sdk-core@^3.0.0-alpha.3", "@uniswap/sdk-core@^3.0.1", "@uniswap/sdk-core@^3.1.0", "@uniswap/sdk-core@^3.2.2": "@uniswap/sdk-core@^3.0.0-alpha.3", "@uniswap/sdk-core@^3.0.1", "@uniswap/sdk-core@^3.1.0", "@uniswap/sdk-core@^3.2.3":
version "3.2.2" version "3.2.3"
resolved "https://registry.yarnpkg.com/@uniswap/sdk-core/-/sdk-core-3.2.2.tgz#50dbc6f2543d088680f36fb61e01bb90d4d8fa71" resolved "https://registry.yarnpkg.com/@uniswap/sdk-core/-/sdk-core-3.2.3.tgz#66e1353fcb78cfb7314a5d84c8a8fdd8734daff0"
integrity sha512-dPA34T8EVfFzKtw1NC1Mr7M0aXpY1UN+lUpdBv757JxKKMlGQTg96XTIfjYCflqEshxlBdz2+IVQgk6H+dMu5g== integrity sha512-ERVYKa5ENPwDA6/UZ45H1D5xIqTFcvDYpLxcncOzX8vRXuCAupMUoFFH5s/xx8IMcstONsAOPR1h4vRCzUkSsA==
dependencies: dependencies:
"@ethersproject/address" "^5.0.2" "@ethersproject/address" "^5.0.2"
big.js "^5.2.2" big.js "^5.2.2"
...@@ -5433,10 +5433,10 @@ ...@@ -5433,10 +5433,10 @@
tiny-invariant "^1.1.0" tiny-invariant "^1.1.0"
toformat "^2.0.0" toformat "^2.0.0"
"@uniswap/smart-order-router@^3.6.1": "@uniswap/smart-order-router@^3.12.1":
version "3.6.1" version "3.12.1"
resolved "https://registry.yarnpkg.com/@uniswap/smart-order-router/-/smart-order-router-3.6.1.tgz#658497b907b1033d68fe8b7f613d624d31e33d80" resolved "https://registry.yarnpkg.com/@uniswap/smart-order-router/-/smart-order-router-3.12.1.tgz#a6b0debd4bacbd2f744a7dbdf53d906e5582527e"
integrity sha512-UKCEeqzryu8kREOGEG2gomXApkGGJ301rp1j1sdDhTeMW2C6EiDo2jkfGjKYMb9CHJnb0YkXB7E6XIT8U4UYXA== integrity sha512-clMYdxs0rEkLMfeHM5stxNFOR7yACTfPct4QzX0vZU/hHjVozswRaSzq4dzwkDFUD8xlxOyycyCI3fdifLXgyA==
dependencies: dependencies:
"@uniswap/default-token-list" "^2.0.0" "@uniswap/default-token-list" "^2.0.0"
"@uniswap/permit2-sdk" "^1.2.0" "@uniswap/permit2-sdk" "^1.2.0"
...@@ -5488,33 +5488,24 @@ ...@@ -5488,33 +5488,24 @@
resolved "https://registry.yarnpkg.com/@uniswap/token-lists/-/token-lists-1.0.0-beta.31.tgz#ff3852bd505ec7b4c276625c762ea79a93a919ec" resolved "https://registry.yarnpkg.com/@uniswap/token-lists/-/token-lists-1.0.0-beta.31.tgz#ff3852bd505ec7b4c276625c762ea79a93a919ec"
integrity sha512-BQVoelKCRf64IToPEs1wxiXOnhr/ukwPOF78XG11PrTAOL4F8umjYKFb8ZPv1/dIJsPaC7GhLSriEqyp94SasQ== integrity sha512-BQVoelKCRf64IToPEs1wxiXOnhr/ukwPOF78XG11PrTAOL4F8umjYKFb8ZPv1/dIJsPaC7GhLSriEqyp94SasQ==
"@uniswap/universal-router-sdk@^1.3.8", "@uniswap/universal-router-sdk@^1.3.9": "@uniswap/universal-router-sdk@^1.3.8", "@uniswap/universal-router-sdk@^1.3.9", "@uniswap/universal-router-sdk@^1.5.1":
version "1.3.9" version "1.5.1"
resolved "https://registry.yarnpkg.com/@uniswap/universal-router-sdk/-/universal-router-sdk-1.3.9.tgz#75a1b354457b85e1e0271ecd5956ea3323a40eca" resolved "https://registry.yarnpkg.com/@uniswap/universal-router-sdk/-/universal-router-sdk-1.5.1.tgz#72acb13908d95ea2c3224e0de33ee4ebd20fefc6"
integrity sha512-uXhdK8IDuyZZRMKiua9dJ6jj5MJ5xUrGflczWwhp6i0cb2VvXoLNQqc7aq3130NfIrKEYfkBGMjsqStZmqqKug== integrity sha512-5E9kCMJOZ2V5jQYOHLAFCzO4j6wg2pKqJDkcS9FVrPS/lXf0jSarzp3DpAFrVr2MKKpvg5l70PA3PNH/8n9McQ==
dependencies: dependencies:
"@uniswap/permit2-sdk" "^1.2.0" "@uniswap/permit2-sdk" "^1.2.0"
"@uniswap/router-sdk" "^1.4.0" "@uniswap/router-sdk" "^1.4.0"
"@uniswap/sdk-core" "^3.1.0" "@uniswap/sdk-core" "^3.1.0"
"@uniswap/universal-router" "1.2.1" "@uniswap/universal-router" "1.4.2"
"@uniswap/v2-sdk" "^3.0.1" "@uniswap/v2-sdk" "^3.0.1"
"@uniswap/v3-sdk" "^3.9.0" "@uniswap/v3-sdk" "^3.9.0"
bignumber.js "^9.0.2" bignumber.js "^9.0.2"
ethers "^5.3.1" ethers "^5.3.1"
"@uniswap/universal-router@1.2.1": "@uniswap/universal-router@1.4.2", "@uniswap/universal-router@^1.0.1":
version "1.2.1" version "1.4.2"
resolved "https://registry.yarnpkg.com/@uniswap/universal-router/-/universal-router-1.2.1.tgz#5fe4aa21d6bc89314d99f26407f28154f8e16f42" resolved "https://registry.yarnpkg.com/@uniswap/universal-router/-/universal-router-1.4.2.tgz#7f46f83ae8e69cf38cc2391891965785b1da253f"
integrity sha512-F3S1wKylncuvIG2qwC1ciXXc1z1QmKsalo4p6H2A90LSRylEEhNp7ITxs7qCcnfRh+ZNkGJ0yQ0zmuVJSBezOQ== integrity sha512-oNa9e+dYB/QnwYy59i5bRwrUIgq/e66TEVd/np/wk+FnUGMemblyRwDgg2sSqmLu90XAUQYpe1IYFEh1a0XYZg==
dependencies:
"@openzeppelin/contracts" "4.7.0"
"@uniswap/v2-core" "1.0.1"
"@uniswap/v3-core" "1.0.0"
"@uniswap/universal-router@^1.0.1":
version "1.2.2"
resolved "https://registry.yarnpkg.com/@uniswap/universal-router/-/universal-router-1.2.2.tgz#7b3704a307fad53ba2a80718362b1b7718ada4cc"
integrity sha512-ipQQpo3xO21EIS5pBjJazZbh9Vth6wzeta85Xva2HKoJ0uBvnugCjqvjkJMqiiz+osBnC12yemitjTOOxcqXjA==
dependencies: dependencies:
"@openzeppelin/contracts" "4.7.0" "@openzeppelin/contracts" "4.7.0"
"@uniswap/v2-core" "1.0.1" "@uniswap/v2-core" "1.0.1"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment