Skip to content

Commit

Permalink
♻️ feat: add Avalanche support (#12)
Browse files Browse the repository at this point in the history
* feat: add avalanche support

* style: fmt

---------

Co-authored-by: Matt Solomon <[email protected]>
  • Loading branch information
PraneshASP and mds1 authored Sep 5, 2023
1 parent 0a48283 commit 244e57e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/Verify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const CHAIN_NAMES_MAP: { [index: string]: string } = {
'Arbitrum One': 'arbitrum',
Gnosis: 'x_dai',
'OP Mainnet': 'optimism',
'Avalanche C-Chain': 'avalanche',
};

const shapeFormData = (data: TxFormValues): VerifyData => {
Expand Down
1 change: 1 addition & 0 deletions src/components/ui/SelectChain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const SelectChain = ({ value, options, onChange }: Props) => {
}
if (chain.id === 42161) return 'https://icons.llamao.fi/icons/chains/rsz_arbitrum.jpg';
if (chain.id === 10) return 'https://icons.llamao.fi/icons/chains/rsz_optimism.jpg';
if (chain.id === 43114) return 'https://icons.llamao.fi/icons/chains/rsz_avalanche.jpg';
return `https://icons.llamao.fi/icons/chains/rsz_${chain.name.toLowerCase()}.jpg`;
};

Expand Down
22 changes: 20 additions & 2 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import { arbitrum, gnosis, goerli, mainnet, optimism, polygon, sepolia } from 'viem/chains';
import {
arbitrum,
avalanche,
gnosis,
goerli,
mainnet,
optimism,
polygon,
sepolia,
} from 'viem/chains';

export const SITE_NAME = 'Cove';
export const SITE_DESCRIPTION = 'Robust, open-source contract verification for the EVM';
Expand All @@ -9,7 +18,16 @@ export const TWITTER_URL = 'https://twitter.com/ScopeLift';

export const IS_DEV_MODE = process.env.NODE_ENV === 'development';

export const SUPPORTED_CHAINS = { arbitrum, gnosis, goerli, mainnet, optimism, polygon, sepolia };
export const SUPPORTED_CHAINS = {
arbitrum,
gnosis,
goerli,
mainnet,
optimism,
polygon,
sepolia,
avalanche,
};
export const COVE_API_URL = process.env.NEXT_PUBLIC_COVE_API_URL || 'https://api.covecontracts.com';

export const REQUIRED_FIELD_MSG = 'This field is required';

0 comments on commit 244e57e

Please sign in to comment.