Skip to content

Commit

Permalink
Rename zksync to zksync mainnet to keep it in sync with backend
Browse files Browse the repository at this point in the history
  • Loading branch information
cgero-eth committed Jun 28, 2024
1 parent 88915fc commit 303d555
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 22 deletions.
6 changes: 4 additions & 2 deletions src/components/executionWidget/actions/mintTokenCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ export const MintTokenCard: React.FC<{
);

const explorerTokenPath =
network === 'zksync' || network === 'zksyncSepolia' ? 'address/' : 'token/';
network === 'zksyncMainnet' || network === 'zksyncSepolia'
? 'address/'
: 'token/';

/*************************************************
* Render *
Expand Down Expand Up @@ -170,7 +172,7 @@ export const MintTokenCard: React.FC<{
</p>
</HStack>
)}
{network !== 'zksync' && network !== 'zksyncSepolia' && (
{network !== 'zksyncMainnet' && network !== 'zksyncSepolia' && (
<Link
label={t('labels.seeAllHolders')}
href={`${CHAIN_METADATA[network].explorer}/token/tokenholderchart/${action.summary.daoTokenAddress}`}
Expand Down
4 changes: 3 additions & 1 deletion src/components/executionWidget/actions/withdrawCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ export const WithdrawCard: React.FC<{
const recipientURL = `${explorerURL}address/${recipient}`;

const explorerTokenPath =
network === 'zksync' || network === 'zksyncSepolia' ? 'address/' : 'token/';
network === 'zksyncMainnet' || network === 'zksyncSepolia'
? 'address/'
: 'token/';

return (
<AccordionMethod
Expand Down
4 changes: 3 additions & 1 deletion src/containers/actionBuilder/mintTokens/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ const MintTokens: React.FC<MintTokensProps> = ({
})();

const explorerPath =
network === 'zksync' || network === 'zksyncSepolia' ? 'address/' : 'token/';
network === 'zksyncMainnet' || network === 'zksyncSepolia'
? 'address/'
: 'token/';

return (
<AccordionMethod
Expand Down
4 changes: 3 additions & 1 deletion src/containers/actionBuilder/withdraw/withdrawAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ const WithdrawAction: React.FC<WithdrawActionProps> = ({
})();

const explorerPath =
network === 'zksync' || network === 'zksyncSepolia' ? 'address/' : 'token/';
network === 'zksyncMainnet' || network === 'zksyncSepolia'
? 'address/'
: 'token/';

return (
<AccordionMethod
Expand Down
3 changes: 2 additions & 1 deletion src/containers/goLive/community.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ const Community: React.FC = () => {
</Dl>
)}
{(isCustomToken ||
(network !== 'zksync' && network !== 'zksyncSepolia')) && (
(network !== 'zksyncMainnet' &&
network !== 'zksyncSepolia')) && (
<Dl>
<Dt>{t('labels.review.distribution')}</Dt>
<Dd>
Expand Down
6 changes: 3 additions & 3 deletions src/containers/selectChainForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ type SelectableNetworks = Record<

const networks: SelectableNetworks = {
main: {
cost: ['polygon', 'base', 'arbitrum', 'ethereum', 'zksync'],
popularity: ['ethereum', 'arbitrum', 'base', 'zksync'],
security: ['ethereum', 'base', 'arbitrum', 'polygon', 'zksync'],
cost: ['polygon', 'base', 'arbitrum', 'ethereum', 'zksyncMainnet'],
popularity: ['ethereum', 'arbitrum', 'base', 'zksyncMainnet'],
security: ['ethereum', 'base', 'arbitrum', 'polygon', 'zksyncMainnet'],
},
test: {
cost: ['sepolia', 'zksyncSepolia'],
Expand Down
4 changes: 3 additions & 1 deletion src/containers/settings/majorityVoting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ const MajorityVotingSettings: React.FC<IPluginSettings> = ({daoDetails}) => {
};

const explorerPath =
network === 'zksync' || network === 'zksyncSepolia' ? 'address/' : 'token/';
network === 'zksyncMainnet' || network === 'zksyncSepolia'
? 'address/'
: 'token/';
const daoTokenBlockUrl = `${CHAIN_METADATA[network].explorer}${explorerPath}${daoToken?.address}`;

return (
Expand Down
4 changes: 3 additions & 1 deletion src/containers/setupCommunity/addExistingToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ const AddExistingToken: React.FC = () => {
const provider = aragonGateway.getRpcProvider(blockchain.id);
const nativeCurrency = CHAIN_METADATA[network].nativeCurrency;
const explorerPath =
network === 'zksync' || network === 'zksyncSepolia' ? 'address/' : 'token/';
network === 'zksyncMainnet' || network === 'zksyncSepolia'
? 'address/'
: 'token/';
const tokenAddressBlockExplorerURL = `${CHAIN_METADATA[network].explorer}${explorerPath}`;

// get plugin Client
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useDaoMembers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const useDaoMembers = (
network === 'arbitrum' ||
network === 'base' ||
network === 'zksyncSepolia' ||
network === 'zksync'
network === 'zksyncMainnet'
);

const useGraphql =
Expand Down
4 changes: 3 additions & 1 deletion src/pages/community.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ export const Community: React.FC = () => {

// Await to load daoToken address to prevent null see all holders button
const seeAllHoldersBtn =
daoToken?.address && network !== 'zksync' && network !== 'zksyncSepolia'
daoToken?.address &&
network !== 'zksyncMainnet' &&
network !== 'zksyncSepolia'
? {
label: t('labels.seeAllHolders'),
iconLeft: <Icon icon={IconType.LINK_EXTERNAL} />,
Expand Down
4 changes: 2 additions & 2 deletions src/utils/aragonGateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ class AragonGateway {

const {gatewayNetwork} = CHAIN_METADATA[network];
const gatewayKey =
network === 'zksyncSepolia' || network === 'zksync'
network === 'zksyncSepolia' || network === 'zksyncMainnet'
? import.meta.env.VITE_GATEWAY_RPC_API_KEY_ALCHEMY
: import.meta.env.VITE_GATEWAY_RPC_API_KEY;

const baseUrl =
network === 'zksyncSepolia' || network === 'zksync'
network === 'zksyncSepolia' || network === 'zksyncMainnet'
? this.baseUrl.replace('app', 'alchemy')
: this.baseUrl;

Expand Down
2 changes: 1 addition & 1 deletion src/utils/constants/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const SUBGRAPH_API_URL: SubgraphNetworkUrl = {
'https://subgraph.satsuma-prod.com/qHR2wGfc5RLi6/aragon/osx-polygon/version/1.4.2/api',
sepolia:
'https://subgraph.satsuma-prod.com/qHR2wGfc5RLi6/aragon/osx-sepolia/version/1.4.2/api',
zksync:
zksyncMainnet:
'https://subgraph.satsuma-prod.com/qHR2wGfc5RLi6/aragon/osx-zksync-era/version/1.4.3/api',
zksyncSepolia:
'https://subgraph.satsuma-prod.com/qHR2wGfc5RLi6/aragon/osx-zksync-era-sepolia/version/1.4.2/api',
Expand Down
8 changes: 4 additions & 4 deletions src/utils/constants/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const NETWORKS_WITH_CUSTOM_REGISTRY: SupportedNetworks[] = [
'base',
'polygon',
'sepolia',
'zksync',
'zksyncMainnet',
'zksyncSepolia',
];

Expand All @@ -35,7 +35,7 @@ const SUPPORTED_NETWORKS = [
'ethereum',
'polygon',
'sepolia',
'zksync',
'zksyncMainnet',
'zksyncSepolia',
] as const;

Expand Down Expand Up @@ -234,7 +234,7 @@ export const CHAIN_METADATA: Record<SupportedNetworks, ChainData> = {
},
supportsEns: false,
},
zksync: {
zksyncMainnet: {
id: 324,
name: i18n.t('explore.modal.filterDAOs.label.zksync'),
domain: 'L2 Blockchain',
Expand Down Expand Up @@ -264,7 +264,7 @@ export const CHAIN_METADATA: Record<SupportedNetworks, ChainData> = {
logo: 'https://static.debank.com/image/chain/logo_url/era/2cfcd0c8436b05d811b03935f6c1d7da.png',
explorer: 'https://sepolia.explorer.zksync.io/',
isTestnet: true,
mainnet: 'zksync',
mainnet: 'zksyncMainnet',
explorerName: 'zkSync Sepolia Explorer',
publicRpc: 'https://endpoints.omniatech.io/v1/zksync-era/sepolia/public',
gatewayNetwork: 'zksync/sepolia',
Expand Down
4 changes: 2 additions & 2 deletions src/utils/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ export const translateToAppNetwork = (
case SdkSupportedNetworks.ZKSYNC_SEPOLIA:
return 'zksyncSepolia';
case SdkSupportedNetworks.ZKSYNC_MAINNET:
return 'zksync';
return 'zksyncMainnet';
default:
return 'unsupported';
}
Expand Down Expand Up @@ -903,7 +903,7 @@ export function translateToNetworkishName(
return SdkSupportedNetworks.SEPOLIA;
case 'zksyncSepolia':
return SdkSupportedNetworks.ZKSYNC_SEPOLIA;
case 'zksync':
case 'zksyncMainnet':
return SdkSupportedNetworks.ZKSYNC_MAINNET;
}

Expand Down

0 comments on commit 303d555

Please sign in to comment.