You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a dapp wants to connect to a wallet using WalletConnect V2, it needs to propose a session. In the proposed session, the dapp declares which RPC methods are required for it to work properly. It can also declare additional optional methods.
If the wallet application supports the required methods, but only a subset of the optional methods, it should approve the session with only the method/namespace it supports.
Instead of approving the session with all the requested methods, only supported methods should be approved.
The list of currently supported methods can be found in the safe-apps-provider.
Impact
This bug is currently affecting users that use wagmi to connect their dapp to the WalletConnect Safe App. Personally, it's impacting me in my work (Immunefi)), but also other users in the internet. See https://twitter.com/0xDrewF/status/1665724631360077825, for example.
Release a new version of the WalletConnect Safe App.
Fix the bug by checking the list of required and optional methods, and only approve the session if the required can be fulfilled, and only with the supported optional methods.
I'll be happy to assist with these changes. As a starting point, here's a PR: #710
Description
When a dapp wants to connect to a wallet using WalletConnect V2, it needs to propose a session. In the proposed session, the dapp declares which RPC methods are required for it to work properly. It can also declare additional optional methods.
If the wallet application supports the required methods, but only a subset of the optional methods, it should approve the session with only the method/namespace it supports.
In the WalletConnect Safe App, we're approving ALL the methods requested (required + optional) even when the Wallet Connect Safe App doesn't support them. This is happening here: https://github.com/safe-global/safe-react-apps/blob/development/apps/wallet-connect/src/hooks/useWalletConnectV2.tsx#L221
Instead of approving the session with all the requested methods, only supported methods should be approved.
The list of currently supported methods can be found in the safe-apps-provider.
Impact
This bug is currently affecting users that use
wagmi
to connect their dapp to the WalletConnect Safe App. Personally, it's impacting me in my work (Immunefi)), but also other users in the internet. See https://twitter.com/0xDrewF/status/1665724631360077825, for example.The bug is blowing up for
wagmi
users because their connector asks if there is support forwallet_addEthereumChain
, the the Safe App is saying yes. See https://github.com/wagmi-dev/references/blob/main/packages/connectors/src/walletConnect.ts#LL239C34-L239C34. It then proceeds to use a mehtod which isn't supported.Suggested changes
I'll be happy to assist with these changes. As a starting point, here's a PR: #710
Environment
Steps to reproduce
"wallet_addEthereumChain" not implemented
.Expected result
No error. Successful WalletConnect v2 connection
Obtained result
An error on both apps:
"wallet_addEthereumChain" not implemented
.Screenshots
The text was updated successfully, but these errors were encountered: