Skip to content

Commit

Permalink
Merge branch 'main' into move-autolock-timer
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadowfiend authored Jul 15, 2024
2 parents 2c9e156 + 25e2a72 commit 136c0d5
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 60 deletions.
10 changes: 0 additions & 10 deletions background/constants/base-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ const OPTIMISTIC_ETH: NetworkBaseAsset = {
},
}

const GOERLI_ETH: NetworkBaseAsset = {
...ETH,
chainID: "5",
metadata: {
coinGeckoID: "ethereum",
tokenLists: [],
},
}

const SEPOLIA_ETH: NetworkBaseAsset = {
...ETH,
chainID: "11155111",
Expand Down Expand Up @@ -126,7 +117,6 @@ export const BASE_ASSETS_BY_CUSTOM_NAME = {
ARBITRUM_ONE_ETH,
ARBITRUM_NOVA_ETH,
OPTIMISTIC_ETH,
GOERLI_ETH,
SEPOLIA_ETH,
ARBITRUM_SEPOLIA_ETH,
ZK_SYNC_ETH,
Expand Down
6 changes: 0 additions & 6 deletions background/constants/currencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ export const ARBITRUM_NOVA_ETH: NetworkBaseAsset & Required<CoinGeckoAsset> = {
...ETH_DATA,
}

export const GOERLI_ETH: NetworkBaseAsset & Required<CoinGeckoAsset> = {
...BASE_ASSETS_BY_CUSTOM_NAME.GOERLI_ETH,
...ETH_DATA,
}

export const SEPOLIA_ETH: NetworkBaseAsset & Required<CoinGeckoAsset> = {
...BASE_ASSETS_BY_CUSTOM_NAME.SEPOLIA_ETH,
...ETH_DATA,
Expand Down Expand Up @@ -113,7 +108,6 @@ export const BUILT_IN_NETWORK_BASE_ASSETS = [
OPTIMISTIC_ETH,
ARBITRUM_ONE_ETH,
ARBITRUM_NOVA_ETH,
GOERLI_ETH,
SEPOLIA_ETH,
ARBITRUM_SEPOLIA_ETH,
AVAX,
Expand Down
23 changes: 4 additions & 19 deletions background/constants/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
AVAX,
BNB,
ETH,
GOERLI_ETH,
SEPOLIA_ETH,
ARBITRUM_SEPOLIA_ETH,
MATIC,
Expand Down Expand Up @@ -80,14 +79,6 @@ export const OPTIMISM: EVMNetwork = {
coingeckoPlatformID: "optimistic-ethereum",
}

export const GOERLI: EVMNetwork = {
name: "Ethereum Goerli",
baseAsset: GOERLI_ETH,
chainID: "5",
family: "EVM",
coingeckoPlatformID: "ethereum",
}

export const SEPOLIA: EVMNetwork = {
name: "Ethereum Sepolia",
baseAsset: SEPOLIA_ETH,
Expand Down Expand Up @@ -115,7 +106,6 @@ export const DEFAULT_NETWORKS = [
ETHEREUM,
POLYGON,
OPTIMISM,
GOERLI,
SEPOLIA,
ARBITRUM_SEPOLIA,
ARBITRUM_ONE,
Expand Down Expand Up @@ -144,13 +134,11 @@ export const FORK: EVMNetwork = {
}

export const EIP_1559_COMPLIANT_CHAIN_IDS = new Set(
[ETHEREUM, POLYGON, GOERLI, SEPOLIA, AVALANCHE].map(
(network) => network.chainID,
),
[ETHEREUM, POLYGON, SEPOLIA, AVALANCHE].map((network) => network.chainID),
)

export const CHAINS_WITH_MEMPOOL = new Set(
[ETHEREUM, POLYGON, AVALANCHE, GOERLI, SEPOLIA, BINANCE_SMART_CHAIN].map(
[ETHEREUM, POLYGON, AVALANCHE, SEPOLIA, BINANCE_SMART_CHAIN].map(
(network) => network.chainID,
),
)
Expand All @@ -164,15 +152,14 @@ export const NETWORK_BY_CHAIN_ID = {
[ARBITRUM_NOVA.chainID]: ARBITRUM_NOVA,
[OPTIMISM.chainID]: OPTIMISM,
[BINANCE_SMART_CHAIN.chainID]: BINANCE_SMART_CHAIN,
[GOERLI.chainID]: GOERLI,
[SEPOLIA.chainID]: SEPOLIA,
[ARBITRUM_SEPOLIA.chainID]: ARBITRUM_SEPOLIA,
[FORK.chainID]: FORK,
[ZK_SYNC.chainID]: ZK_SYNC,
}

export const TEST_NETWORK_BY_CHAIN_ID = new Set(
[GOERLI, SEPOLIA, ARBITRUM_SEPOLIA].map((network) => network.chainID),
[SEPOLIA, ARBITRUM_SEPOLIA].map((network) => network.chainID),
)

export const NETWORK_FOR_LEDGER_SIGNING = [ETHEREUM, POLYGON]
Expand All @@ -185,7 +172,6 @@ export const CHAIN_ID_TO_0X_API_BASE: {
[ETHEREUM.chainID]: "api.0x.org",
[POLYGON.chainID]: "polygon.api.0x.org",
[OPTIMISM.chainID]: "optimism.api.0x.org",
[GOERLI.chainID]: "goerli.api.0x.org",
[SEPOLIA.chainID]: "sepolia.api.0x.org",
[ARBITRUM_ONE.chainID]: "arbitrum.api.0x.org",
[AVALANCHE.chainID]: "avalanche.api.0x.org",
Expand All @@ -197,7 +183,7 @@ export const NETWORKS_SUPPORTING_SWAPS = new Set(
)

export const ALCHEMY_SUPPORTED_CHAIN_IDS = new Set(
[ETHEREUM, POLYGON, ARBITRUM_ONE, OPTIMISM, GOERLI, SEPOLIA].map(
[ETHEREUM, POLYGON, ARBITRUM_ONE, OPTIMISM, SEPOLIA].map(
(network) => network.chainID,
),
)
Expand Down Expand Up @@ -227,7 +213,6 @@ export const CHAIN_ID_TO_RPC_URLS: {
"https://1rpc.io/arb",
],
[ARBITRUM_NOVA.chainID]: ["https://nova.arbitrum.io/rpc "],
[GOERLI.chainID]: ["https://ethereum-goerli-rpc.allthatnode.com"],
[SEPOLIA.chainID]: ["https://endpoints.omniatech.io/v1/eth/sepolia/public"],
[ARBITRUM_SEPOLIA.chainID]: ["https://sepolia-rollup.arbitrum.io/rpc"],
[AVALANCHE.chainID]: [
Expand Down
2 changes: 1 addition & 1 deletion background/lib/alchemy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export async function getAssetTransfers(
const category = ["external", "erc20"]

if (addressOnNetwork.network.name === "Ethereum") {
// "internal" is supported only on Ethereum Mainnet, Goerli and Sepolia atm
// "internal" is supported only on Ethereum Mainnet and Sepolia atm
// https://docs.alchemy.com/alchemy/enhanced-apis/transfers-api#alchemy_getassettransfers-testnets-and-layer-2s
category.push("internal")
}
Expand Down
6 changes: 1 addition & 5 deletions background/lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BigNumber, ethers, utils } from "ethers"
import { normalizeHexAddress, toChecksumAddress } from "@tallyho/hd-keyring"
import { NormalizedEVMAddress, UNIXTime } from "../../types"
import { EVMNetwork } from "../../networks"
import { ETHEREUM, GOERLI, SEPOLIA } from "../../constants"
import { ETHEREUM, SEPOLIA } from "../../constants"
import { AddressOnNetwork } from "../../accounts"

export function isValidChecksumAddress(
Expand Down Expand Up @@ -157,10 +157,6 @@ export function decodeJSON(input: string): unknown {
export function getEthereumNetwork(): EVMNetwork {
const ethereumNetwork = process.env.ETHEREUM_NETWORK?.toUpperCase()

if (ethereumNetwork === "GOERLI") {
return GOERLI
}

if (ethereumNetwork === "SEPOLIA") {
return SEPOLIA
}
Expand Down
2 changes: 0 additions & 2 deletions background/redux-slices/dapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
AVALANCHE,
BINANCE_SMART_CHAIN,
ETHEREUM,
GOERLI,
SEPOLIA,
ARBITRUM_SEPOLIA,
OPTIMISM,
Expand Down Expand Up @@ -136,7 +135,6 @@ const dappSlice = createSlice({
OPTIMISM,
AVALANCHE,
BINANCE_SMART_CHAIN,
GOERLI,
SEPOLIA,
ARBITRUM_SEPOLIA,
ARBITRUM_NOVA,
Expand Down
4 changes: 2 additions & 2 deletions background/services/chain/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
CHAIN_ID_TO_RPC_URLS,
DEFAULT_NETWORKS,
ETH,
GOERLI,
SEPOLIA,
isBuiltInNetwork,
NETWORK_BY_CHAIN_ID,
POLYGON,
Expand Down Expand Up @@ -140,7 +140,7 @@ export class ChainDatabase extends Dexie {
this.version(4).upgrade((tx) => {
tx.table("accountsToTrack")
.where("network.chainID")
.equals(GOERLI.chainID)
.equals(SEPOLIA.chainID)
.delete()
})

Expand Down
6 changes: 3 additions & 3 deletions background/services/chain/tests/index.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,17 @@ describe("ChainService", () => {
it("Should properly update supported networks", async () => {
chainService.supportedNetworks = []
await chainService.updateSupportedNetworks()
expect(chainService.supportedNetworks.length).toBe(10)
expect(chainService.supportedNetworks.length).toBe(9)
})
})

describe("addCustomChain", () => {
// prettier-ignore
const FANTOM_CHAIN_PARAMS = { chainId: "250", blockExplorerUrl: "https://ftmscan.com", chainName: "Fantom Opera", nativeCurrency: { name: "Fantom", symbol: "FTM", decimals: 18, }, rpcUrls: [ "https://fantom-mainnet.gateway.pokt.network/v1/lb/62759259ea1b320039c9e7ac", "https://rpc.ftm.tools", "https://rpc.ankr.com/fantom", "https://rpc.fantom.network", "https://rpc2.fantom.network", "https://rpc3.fantom.network", "https://rpcapi.fantom.network", "https://fantom-mainnet.public.blastapi.io", "https://1rpc.io/ftm", ], blockExplorerUrls: ["https://ftmscan.com"], }
it("should update supported networks after adding a chain", async () => {
expect(chainService.supportedNetworks.length).toBe(10)
expect(chainService.supportedNetworks.length).toBe(9)
await chainService.addCustomChain(FANTOM_CHAIN_PARAMS)
expect(chainService.supportedNetworks.length).toBe(11)
expect(chainService.supportedNetworks.length).toBe(10)
})

it("should create a provider for the new chain", async () => {
Expand Down
6 changes: 2 additions & 4 deletions background/services/name/resolvers/ens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
AVALANCHE,
BINANCE_SMART_CHAIN,
ETHEREUM,
GOERLI,
SEPOLIA,
ARBITRUM_SEPOLIA,
OPTIMISM,
POLYGON,
} from "../../../constants"
Expand All @@ -18,10 +18,8 @@ const ENS_SUPPORTED_NETWORKS = [
POLYGON,
OPTIMISM,
ARBITRUM_ONE,
GOERLI,
SEPOLIA,
// TODO: Add ARBITRUM_SEPOLIA once the support is added (tracked in
// https://github.com/ProjectOpenSea/opensea-js/issues/1201).
ARBITRUM_SEPOLIA,
AVALANCHE,
BINANCE_SMART_CHAIN,
]
Expand Down
6 changes: 0 additions & 6 deletions ui/components/TopMenu/TopMenuProtocolList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
AVALANCHE,
BINANCE_SMART_CHAIN,
ETHEREUM,
GOERLI,
SEPOLIA,
ARBITRUM_SEPOLIA,
isBuiltInNetwork,
Expand Down Expand Up @@ -37,11 +36,6 @@ export const productionNetworkInfo = {
const disabledChainIDs = [ARBITRUM_NOVA.chainID]

const testNetworks = [
{
network: GOERLI,
info: i18n.t("protocol.testnet"),
isDisabled: false,
},
{
network: SEPOLIA,
info: i18n.t("protocol.testnet"),
Expand Down
Binary file not shown.
Binary file removed ui/public/images/networks/ethereumgoerli@2x.png
Binary file not shown.
2 changes: 0 additions & 2 deletions ui/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
AVALANCHE,
BINANCE_SMART_CHAIN,
ETHEREUM,
GOERLI,
SEPOLIA,
ARBITRUM_SEPOLIA,
OPTIMISM,
Expand All @@ -24,7 +23,6 @@ export const blockExplorer = {
url: "https://optimistic.etherscan.io",
},
[POLYGON.chainID]: { title: "Polygonscan", url: "https://polygonscan.com" },
[GOERLI.chainID]: { title: "Etherscan", url: "https://goerli.etherscan.io/" },
[SEPOLIA.chainID]: {
title: "Etherscan",
url: "https://sepolia.etherscan.io/",
Expand Down

0 comments on commit 136c0d5

Please sign in to comment.