Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: APP-3034 - Remove support for goerli based networks #1329

Merged
merged 3 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ VITE_FEATURE_FLAG_DAO_WALLET_CONNECT=true

# for networks, please use the all-caps SupportedNetworks name
VITE_FEATURE_FLAG_BASE=true
VITE_FEATURE_FLAG_BASE_GOERLI=true

VITE_FEATURE_FLAG_ARBITRUM=true
VITE_FEATURE_FLAG_ARBITRUM_GOERLI=true

VITE_FEATURE_FLAG_MONITORING=true

Expand All @@ -16,8 +14,6 @@ VITE_FEATURE_FLAG_OSX_UPDATES=true
# Enable gasless plugin on DAO creation
VITE_FEATURE_FLAG_GASLESS_PLUGIN=true

VITE_FEATURE_FLAG_HIDE_GOERLIBASED_NETWORKS=true

VITE_VOCDONI_ENV='stg'

VITE_BACKEND_URL=https://stg.app-backend.aragon.org
Expand Down
4 changes: 0 additions & 4 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ VITE_FEATURE_FLAG_DAO_WALLET_CONNECT=true

# for networks, please use the all-caps SupportedNetworks name
VITE_FEATURE_FLAG_BASE=true
VITE_FEATURE_FLAG_BASE_GOERLI=true

VITE_FEATURE_FLAG_ARBITRUM=true
VITE_FEATURE_FLAG_ARBITRUM_GOERLI=true

VITE_FEATURE_FLAG_MONITORING=true

Expand All @@ -16,8 +14,6 @@ VITE_FEATURE_FLAG_OSX_UPDATES=true
# Enable gasless plugin on DAO creation
VITE_FEATURE_FLAG_GASLESS_PLUGIN=false

VITE_FEATURE_FLAG_HIDE_GOERLIBASED_NETWORKS=true

VITE_VOCDONI_ENV='stg'

VITE_BACKEND_URL=https://app-backend.aragon.org
Expand Down
4 changes: 0 additions & 4 deletions .env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ VITE_FEATURE_FLAG_DAO_WALLET_CONNECT=true

# for networks, please use the all-caps SupportedNetworks name
VITE_FEATURE_FLAG_BASE=true
VITE_FEATURE_FLAG_BASE_GOERLI=true

VITE_FEATURE_FLAG_ARBITRUM=true
VITE_FEATURE_FLAG_ARBITRUM_GOERLI=true

VITE_FEATURE_FLAG_MONITORING=true

Expand All @@ -16,8 +14,6 @@ VITE_FEATURE_FLAG_OSX_UPDATES=true
# Enable gasless plugin on DAO creation
VITE_FEATURE_FLAG_GASLESS_PLUGIN=true

VITE_FEATURE_FLAG_HIDE_GOERLIBASED_NETWORKS=true

VITE_VOCDONI_ENV='stg'

VITE_BACKEND_URL=https://stg.app-backend.aragon.org
Expand Down
2 changes: 0 additions & 2 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import {ProposalSettingsFormData} from 'utils/types';
import {GatingMenu} from 'containers/gatingMenu';
import {DelegationGatingMenu} from 'containers/delegationGatingMenu';
import UpdateBanner from 'containers/navbar/updateBanner';
import DeprecationBanner from 'containers/navbar/deprecationBanner';
import {ActionsProvider} from './context/actions';

export const App: React.FC = () => {
Expand Down Expand Up @@ -199,7 +198,6 @@ const DaoWrapper: React.FC = () => {

return (
<GovTokensWrappingProvider>
<DeprecationBanner />
<UpdateBanner />
<Navbar />
<div className="min-h-screen">
Expand Down
10 changes: 0 additions & 10 deletions src/assets/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1064,11 +1064,8 @@
"polygon": "Polygon",
"tokenVoting": "Token-based",
"ethereum": "Ethereum",
"baseGoerli": "Base Goerli",
"polygonMumbai": "Polygon Mumbai",
"member": "Wallet-based",
"governanceType": "Governance type",
"arbitrumGoerli": "Arbitrum Goerli",
"arbitrum": "Arbitrum",
"ethereumSepolia": "Ethereum Sepolia"
},
Expand Down Expand Up @@ -1795,13 +1792,6 @@
"labelDaysAgo": "days ago"
}
},
"deprecation": {
"banner": {
"title": "This DAO will no longer be usable once support for Goerli and related testnets ends in 2024.",
"ctaLabel": "Learn more",
"ctaLink": "https://blog.ethereum.org/2023/11/30/goerli-lts-update"
}
},
"transactionDialog": {
"title": "Transaction required",
"description": "You will need to sign a transaction in your connected wallet.",
Expand Down
13 changes: 3 additions & 10 deletions src/containers/daoExplorer/daoExplorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,7 @@ export const DaoExplorer = () => {
pluginNames: filters.pluginNames,
}),
...(filters.networks?.length !== 0 && {
networks: filters.networks?.map(network => {
// TODO: Remove this Goerli based network conditions
if (network === 'arbitrum-goerli') {
return 'arbitrumGoerli';
} else if (network === 'base-goerli') {
return 'baseGoerli';
}
return network;
}),
networks: filters.networks,
}),
...(filters.quickFilter === 'memberOf' && address
? {memberAddress: address}
Expand Down Expand Up @@ -101,7 +93,8 @@ export const DaoExplorer = () => {
() =>
followedDaosResult.data?.pages
.flatMap(page => page.data)
.map(followedDaoToDao),
.map(followedDaoToDao)
.filter(dao => dao.network),
[followedDaosResult]
);

Expand Down
14 changes: 2 additions & 12 deletions src/containers/daoFilterModal/data.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import {
CHAIN_METADATA,
GOERLI_BASED_NETWORKS,
SupportedNetworks,
} from 'utils/constants';

const ShowGoerliBasedNetworks =
import.meta.env.VITE_FEATURE_FLAG_HIDE_GOERLIBASED_NETWORKS === 'false';
import {CHAIN_METADATA, SupportedNetworks} from 'utils/constants';

type NetworkFilter = {
label: string;
Expand All @@ -18,10 +11,7 @@ export const networkFilters: Array<NetworkFilter> = Object.entries(
).flatMap(([key, {name, isTestnet}]) => {
const value: SupportedNetworks = key as SupportedNetworks;

if (!ShowGoerliBasedNetworks && GOERLI_BASED_NETWORKS.includes(value))
return [];

return value !== 'goerli' && value !== 'unsupported'
return value !== 'unsupported'
? ({label: name, value, testnet: isTestnet} as NetworkFilter)
: [];
});
Expand Down
63 changes: 0 additions & 63 deletions src/containers/navbar/deprecationBanner.tsx

This file was deleted.

6 changes: 1 addition & 5 deletions src/containers/navbar/updateBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {useIsMember} from 'services/aragon-sdk/queries/use-is-member';
import {featureFlags} from 'utils/featureFlags';
import {NewProposal} from 'utils/paths';
import {ProposalTypes} from 'utils/types';
import {GOERLI_BASED_NETWORKS} from 'utils/constants';

const UpdateBanner: React.FC = () => {
const [bannerHidden, setBannerHidden] = useState(false);
Expand All @@ -42,8 +41,6 @@ const UpdateBanner: React.FC = () => {
const daoUpdateEnabled =
featureFlags.getValue('VITE_FEATURE_FLAG_OSX_UPDATES') === 'true';

const isDeprecationAlertShown = GOERLI_BASED_NETWORKS.includes(network);

const showBanner = !!(
!bannerHidden &&
isMember &&
Expand All @@ -55,8 +52,7 @@ const UpdateBanner: React.FC = () => {
location.pathname.includes('new-proposal') ||
location.pathname.includes('settings') ||
location.pathname.includes('create') ||
showBanner === false ||
isDeprecationAlertShown
showBanner === false
)
return null;

Expand Down
15 changes: 3 additions & 12 deletions src/containers/selectChainForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,15 @@ type SelectableNetworks = Record<
}
>;

const ShowGoerliBasedNetworks =
import.meta.env.VITE_FEATURE_FLAG_HIDE_GOERLIBASED_NETWORKS === 'false';

const networks: SelectableNetworks = {
main: {
cost: ['polygon', 'base', 'arbitrum', 'ethereum'],
popularity: ['ethereum', 'polygon', 'arbitrum', 'base'],
security: ['ethereum', 'base', 'arbitrum', 'polygon'],
},
test: {
cost: ShowGoerliBasedNetworks
? ['mumbai', 'base-goerli', 'arbitrum-goerli', 'sepolia', 'goerli']
: ['sepolia'],
popularity: ShowGoerliBasedNetworks
? ['goerli', 'sepolia', 'mumbai', 'arbitrum-goerli', 'base-goerli']
: ['sepolia'],
security: ShowGoerliBasedNetworks
? ['goerli', 'sepolia', 'base-goerli', 'arbitrum-goerli', 'mumbai']
: ['sepolia'],
cost: ['sepolia'],
popularity: ['sepolia'],
security: ['sepolia'],
},
};
8 changes: 1 addition & 7 deletions src/hooks/useDaoMembers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,8 @@ export const useDaoMembers = (
const countOnly = opts?.countOnly || false;
const enabled = opts?.enabled || true;

// TODO: Remove this Goerli based network conditions
const covalentSupportedNetwork = !(
network === 'goerli' ||
network === 'mumbai' ||
network === 'arbitrum' ||
network === 'arbitrum-goerli' ||
network === 'base' ||
network === 'base-goerli'
network === 'arbitrum' || network === 'base'
);

const useGraphql =
Expand Down
28 changes: 5 additions & 23 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,7 @@ import {createWeb3Modal} from '@web3modal/wagmi/react';
import {http, createConfig, WagmiProvider} from 'wagmi';
import {walletConnect, coinbaseWallet} from 'wagmi/connectors';

import {
Chain,
arbitrum,
arbitrumGoerli,
base,
baseGoerli,
goerli,
mainnet,
polygon,
polygonMumbai,
sepolia,
} from 'wagmi/chains';
import {Chain, arbitrum, base, mainnet, polygon, sepolia} from 'wagmi/chains';
import {AlertProvider} from 'context/alert';
import {GlobalModalsProvider} from 'context/globalModals';
import {NetworkProvider} from 'context/network';
Expand All @@ -43,17 +32,10 @@ import {App} from './app';
import {aragonGateway} from 'utils/aragonGateway';
import {HttpTransport} from 'viem';

const chains = [
base,
baseGoerli,
goerli,
mainnet,
polygon,
polygonMumbai,
arbitrum,
arbitrumGoerli,
sepolia,
] as [Chain, ...Chain[]];
const chains = [base, mainnet, polygon, arbitrum, sepolia] as [
Chain,
...Chain[],
];

const transports = chains.reduce(
(RPCs, value) => {
Expand Down
3 changes: 1 addition & 2 deletions src/services/aragon-backend/aragon-backend-service.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ export interface IFetchDaosParams
extends IOrderedRequest<OrderByValue>,
IPaginatedRequest {
pluginNames?: string[];
// TODO: Remove this Goerli based network conditions
networks?: Array<SupportedNetworks | 'arbitrumGoerli' | 'baseGoerli'>;
networks?: Array<SupportedNetworks>;
}
3 changes: 1 addition & 2 deletions src/services/aragon-backend/queries/use-token-holders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {UseQueryOptions, useQuery} from '@tanstack/react-query';
import {aragonBackendQueryKeys} from '../query-keys';
import type {IFetchTokenHoldersParams} from '../aragon-backend-service.api';
import {TokenHoldersResponse} from '../domain/token-holders-response';
import {supportedNetworksToBackendMap} from 'utils/constants';

const tokenHoldersQueryDocument = gql`
query Holders($network: Network!, $tokenAddress: String!, $page: Int!) {
Expand Down Expand Up @@ -37,7 +36,7 @@ const fetchTokenHolders = async (
tokenHoldersQueryDocument,
{
...params,
network: supportedNetworksToBackendMap[params.network],
network: params.network,
page: params.page ?? 0,
}
);
Expand Down
11 changes: 3 additions & 8 deletions src/services/token/token-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
CHAIN_METADATA,
COVALENT_API_KEY,
SupportedNetworks,
supportedNetworksToBackendMap,
} from 'utils/constants';
import {TOP_ETH_SYMBOL_ADDRESSES} from 'utils/constants/topSymbolAddresses';
import {isNativeToken} from 'utils/tokens';
Expand Down Expand Up @@ -105,7 +104,7 @@ class TokenService {
const {token: resp} = await request(
`${import.meta.env.VITE_BACKEND_URL}/graphql`,
this.tokenQueryDocument,
{network: supportedNetworksToBackendMap[network], tokenAddress}
{network: network, tokenAddress}
);
const currPriceUsd = resp.priceUsd || 0;
const prevPriceUsd = currPriceUsd - (resp.priceChangeOnDayUsd || 0);
Expand All @@ -127,11 +126,7 @@ class TokenService {
},
};

// TODO: Remove this Goerli based network conditions
if (
(network === 'base' || network === 'base-goerli') &&
token.address === constants.AddressZero
) {
if (network === 'base' && token.address === constants.AddressZero) {
token.imgUrl = REPLACEMENT_BASE_ETHER_LOGO_URL;
}
} catch {
Expand Down Expand Up @@ -184,7 +179,7 @@ class TokenService {
`${import.meta.env.VITE_BACKEND_URL}/graphql`,
this.tokenBalanceQueryDocument,
{
network: supportedNetworksToBackendMap[network],
network: network,
address,
currency: this.defaultCurrency,
}
Expand Down
Loading
Loading