metamask-mobile icon indicating copy to clipboard operation
metamask-mobile copied to clipboard

Unable to use Paymaster with WalletConnect

Open equalogix opened this issue 3 years ago • 7 comments

Describe the bug I'm trying to sign and send a type 113 transaction using MetaMask mobile. I can send a transaction without out any problems when it is sent using the MetaMask Browser, but when trying to send it from the default browser using Walletconnect it fails. The strange thing is that with WC it gets to the MM submit pop-up, but when you click submit the transaction fails. When using MM-Browser you get the exact same transaction that pop-ups and when one submits it, it succeeds.

I'm trying to send the transaction on zkSync-Era chain using a Paymaster, and my guess is that the Paymaster is causing the problem. If remove the paymaster from the transaction, that is I don't include the customData prop in the overrides, then the transaction is sent normally. When eliminating the paymaster from the transaction, the transaction that is sent is not type 113.

When the transaction fails the error is: Internal JSON-RPC error.

Screenshots Here is a screen cap of the transaction pop-up from MM. image

To Reproduce Note due to the use of the paymaster it is complicated to create an easily accessible environment where one could reproduce this error. I do have dev environment where this can be tested but it is not open to public.

Expected behavior When the transaction pop-up appears in Metamask and you click submit the transaction should be submitted.

Smartphone (please complete the following information):

  • Device: Samsung S20 Ultra
  • OS: Android / Latest version [13]
  • Browser: Google Chrome
  • Version 114.05753.196

Additional info I opened an issue for this at WalletConnect: https://github.com/WalletConnect/walletconnect-monorepo/issues/3269 They suggest that the bug is within Metamask's code.


to be added after bug submission by internal support / PM Severity

  • How critical is the impact of this bug on a user?
  • Add stats if available on % of customers impacted
  • Is this visible to all users?
  • Is this tech debt?

equalogix avatar Jul 26 '23 14:07 equalogix

Hello, @equalogix Thanks for reporting! I will pass this on to the team.

anaamolnar avatar Jul 26 '23 18:07 anaamolnar

Any update on this?

equalogix avatar Aug 17 '23 01:08 equalogix

Any updates? We are also having the same issues.

tevanrobin avatar Sep 06 '23 16:09 tevanrobin

Any updates? We are also having the same issues.

I was able to use MetaMask SDK to get this to work. Unfortunately Metamask SDK has issues connecting on Android devices. But it works fine on iOS and desktop.

equalogix avatar Sep 12 '23 16:09 equalogix

Hello, I have a working example here which uses web3modal, ethers and zksync2-js. There is exactly the same error as posted above. I've done some debugging with WalletConnect and Metamask mobile code and it seems the problem is with eth_sendRawTransaction request that WC redirects to Metamask mobile. If I post this request with the same data directly to zksync testnet node everything is fine. Metamask browser extension also works fine. The problem is only when using WC with Metamask mobile.

Any progress with this?

mariopil avatar Nov 29 '23 13:11 mariopil

Hi all! Thank you for reporting and providing an example. We are currently trying to understand the root cause of it as it may be related to the fact that on the metamask mobile we support a subset of WC v2 protocol and not the full protocol.

christopherferreira9 avatar Dec 06 '23 10:12 christopherferreira9

Hi all! As of now, we only support a subset of WC v2 protocol and as seen in https://github.com/zkSync-Community-Hub/zksync-developers/discussions/63 the complete SDK doesn't seem to support it and therefore our sdk-se doesn't support it either.

christopherferreira9 avatar Jan 25 '24 10:01 christopherferreira9