diff --git a/src/common/utils/wallet.ts b/src/common/utils/wallet.ts index 6d186d1b6b..e1ae5534ae 100644 --- a/src/common/utils/wallet.ts +++ b/src/common/utils/wallet.ts @@ -18,6 +18,11 @@ const defaultChains: Chain[] = isProd ? [mainnet, polygon] : [goerli, polygonMumbai] +// FIXME: make contract wallet (e.g. UniPass) default chain as +// Polygon Mainnet for signing since most of the wallet providers help user +// to deplopy contract on Polygon Mainnet free of charge. +export const walletConnectConnectChain = polygon + export const { provider: wagmiProvider, chains } = configureChains( defaultChains, [alchemyProvider({ apiKey: alchemyId })] diff --git a/src/components/Forms/WalletAuthForm/Select.tsx b/src/components/Forms/WalletAuthForm/Select.tsx index ad6fea6d26..07283425a9 100644 --- a/src/components/Forms/WalletAuthForm/Select.tsx +++ b/src/components/Forms/WalletAuthForm/Select.tsx @@ -3,7 +3,7 @@ import { FormattedMessage } from 'react-intl' import { useAccount, useConnect, useDisconnect } from 'wagmi' import { EXTERNAL_LINKS, GUIDE_LINKS } from '~/common/enums' -import { analytics } from '~/common/utils' +import { analytics, walletConnectConnectChain } from '~/common/utils' import { Dialog, Form, @@ -236,7 +236,10 @@ const Select: React.FC = ({ analytics.trackEvent('click_button', { type: 'connectorWalletConnect', }) - connect({ connector: walletConnectConnector }) + connect({ + connector: walletConnectConnector, + chainId: walletConnectConnectChain.id, + }) }} role="button" right={isWalletConnectLoading ? : null}