Difficulty: Advanced | Type: Feature / Architecture
Background: NEXT_PUBLIC_WALLET_CHAINS restricts supported chains to a subset of mainnet, base, sepolia, validated by lib/wallet/config.ts.
Problem: If a user's wallet is connected to a chain outside the configured NEXT_PUBLIC_WALLET_CHAINS set (e.g. connected to Polygon while the app only supports mainnet/base), the app's behavior in that scenario isn't described — it likely either silently misbehaves or shows a generic wagmi error.
Expected Outcome: The app detects an unsupported connected chain and guides the user through switching to a supported one via wagmi's switchChain, with a clear explanatory UI rather than a silent failure or cryptic error.
Suggested Implementation: Add a chain-mismatch detector (comparing wagmi's active chainId against the configured supported set from lib/wallet/config.ts) rendered as a persistent banner with a "Switch to " button calling useSwitchChain(), handling the case where the wallet doesn't support programmatic switching (fallback to manual instructions).
Acceptance Criteria:
- Connecting on an unsupported chain shows a clear banner naming the required chain(s).
- "Switch" button successfully changes chain via wagmi where supported.
- Manual-switch instructions are shown for wallets/chains where programmatic switching isn't available.
- Covered by a test simulating an unsupported active chain.
Likely Affected Files/Directories: lib/wallet/config.ts, lib/wallet/providers.tsx, components/wallet/connect-button.tsx
Labels: feature, architecture, GrantFox OSS, Maybe Rewarded, Official Campaign | FWC26
Difficulty: Advanced | Type: Feature / Architecture
Background:
NEXT_PUBLIC_WALLET_CHAINSrestricts supported chains to a subset ofmainnet,base,sepolia, validated bylib/wallet/config.ts.Problem: If a user's wallet is connected to a chain outside the configured
NEXT_PUBLIC_WALLET_CHAINSset (e.g. connected to Polygon while the app only supports mainnet/base), the app's behavior in that scenario isn't described — it likely either silently misbehaves or shows a generic wagmi error.Expected Outcome: The app detects an unsupported connected chain and guides the user through switching to a supported one via wagmi's
switchChain, with a clear explanatory UI rather than a silent failure or cryptic error.Suggested Implementation: Add a chain-mismatch detector (comparing wagmi's active
chainIdagainst the configured supported set fromlib/wallet/config.ts) rendered as a persistent banner with a "Switch to " button callinguseSwitchChain(), handling the case where the wallet doesn't support programmatic switching (fallback to manual instructions).Acceptance Criteria:
Likely Affected Files/Directories:
lib/wallet/config.ts,lib/wallet/providers.tsx,components/wallet/connect-button.tsxLabels:
feature,architecture,GrantFox OSS,Maybe Rewarded,Official Campaign | FWC26