Summary
In MetaMask, calling wallet_switchEthereumChain for Arc Testnet (Chain ID 0x4CEF52 / 5042002) fails silently or throws an unhandled error — even when the network was previously added. The only reliable method is wallet_addEthereumChain, which both adds the network if missing and switches to it if already present.
Steps to reproduce
- Add Arc Testnet to MetaMask manually or via a previous
wallet_addEthereumChain call
- Switch to a different network (e.g. Ethereum Mainnet)
- Call:
await window.ethereum.request({
method: "wallet_switchEthereumChain",
params: [{ chainId: "0x4CEF52" }],
});
- MetaMask either throws
4902 (chain not found) or silently does nothing — the switch does not occur
Workaround
Always use wallet_addEthereumChain regardless of whether the user has already added Arc Testnet:
await window.ethereum.request({
method: "wallet_addEthereumChain",
params: [{
chainId: "0x4CEF52",
chainName: "Arc Testnet",
nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 },
rpcUrls: ["https://rpc.testnet.arc.network"],
blockExplorerUrls: ["https://testnet.arcscan.app"],
}],
});
This works reliably as both an add and a switch operation.
Environment
- MetaMask browser extension (latest)
- Arc Testnet Chain ID: 5042002 (
0x4CEF52)
- Observed in Chrome and Brave browsers, May 2025
Impact
All Arc Testnet DApp onboarding flows that use wallet_switchEthereumChain will silently fail to switch the user to the correct network. This is a significant UX issue for new users.
Suggested fix / docs update
Document that wallet_addEthereumChain is the correct and only reliable method for switching users to Arc Testnet, and remove any references to wallet_switchEthereumChain from Arc developer guides.
Summary
In MetaMask, calling
wallet_switchEthereumChainfor Arc Testnet (Chain ID0x4CEF52/ 5042002) fails silently or throws an unhandled error — even when the network was previously added. The only reliable method iswallet_addEthereumChain, which both adds the network if missing and switches to it if already present.Steps to reproduce
wallet_addEthereumChaincall4902(chain not found) or silently does nothing — the switch does not occurWorkaround
Always use
wallet_addEthereumChainregardless of whether the user has already added Arc Testnet:This works reliably as both an add and a switch operation.
Environment
0x4CEF52)Impact
All Arc Testnet DApp onboarding flows that use
wallet_switchEthereumChainwill silently fail to switch the user to the correct network. This is a significant UX issue for new users.Suggested fix / docs update
Document that
wallet_addEthereumChainis the correct and only reliable method for switching users to Arc Testnet, and remove any references towallet_switchEthereumChainfrom Arc developer guides.