Description
When users have multiple wallet extensions installed (e.g., MetaMask + Trust Wallet + Phantom), wallet connection can fail or connect to the wrong wallet due to provider conflicts.
Current Behavior
- Multiple wallets inject into
window.ethereum
- Some wallets (like Trust Wallet) set
isMetaMask: true even though they're not MetaMask
- Users selecting MetaMask may inadvertently connect to Trust Wallet
- Connection attempts may fail with unclear error messages
Expected Behavior
- Each wallet should be correctly identified and isolated
- Selecting a specific wallet should always connect to that wallet
- Clear error messages when wallet conflicts occur
Related Issues
Current Mitigation
The WalletSelector.svelte component already implements:
- EIP-6963 provider detection
- Specific provider checks (
isPhantom, isTrust, _metamask)
- Conflict detection with user confirmation dialog
Suggested Improvements
- Improve EIP-6963 adoption: Prioritize wallets that announce via EIP-6963
- Better error messages: Show which wallet is causing conflicts
- Wallet priority settings: Let users set preferred wallet order
- Connection retry logic: Implement automatic retry with exponential backoff
Environment
- Frontend: Svelte 5 with wagmi
- Wallet detection: EIP-6963 + legacy window.ethereum
Code Location
frontend/src/components/WalletSelector.svelte
Description
When users have multiple wallet extensions installed (e.g., MetaMask + Trust Wallet + Phantom), wallet connection can fail or connect to the wrong wallet due to provider conflicts.
Current Behavior
window.ethereumisMetaMask: trueeven though they're not MetaMaskExpected Behavior
Related Issues
Current Mitigation
The
WalletSelector.sveltecomponent already implements:isPhantom,isTrust,_metamask)Suggested Improvements
Environment
Code Location
frontend/src/components/WalletSelector.svelte