Skip to content

Switching chain in a dApp connected to Safe causes dApp disconnection #6202

@jeffrifwaldsmartcontract

Description

Bug description

A dApp that connects to Safe{Wallet} via WalletConnect cannot seem to successfully switch chains. Instead switching chains, it appears to try to re-authorize and loses context causing a disconnect on the dApp side. The Safe app still shows an active connection though. This appears to happen when connected through both the Safe web app and the iOS app. The safe web app will sometimes show an alert that says "The {dApp} wants to switch the network to Eth" or something similar, but by this time the dApp has lost the connection. I've seen this behavior with local dApps and with popular dApps like pancakeswap and uniswap. This could also potentially be a bug in the WalletConnect or wagmi code.

Environment

  • Browser: Chrome
  • Wallet: WalletConnect
  • Chain: Ethereum mainnet

Steps to reproduce

  1. Go to https://pancakeswap.finance/
  2. Click the "Connect Wallet" button at the top of the screen
  3. Click the "WalletConnect" button in the modal
  4. Find Safe in the WalletConnect modal and connect via QR code or WebApp
  5. Switch the chain from the selector at the top of the screen
  6. Re-authorize and go back to pancakeswap, notice the wallet connection was broken

Expected result

A dApp can switch chains successfully without disconnecting.

Obtained result

A disconnection occurs.

Screenshots

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions