question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wallet Connect not exposing error.data when custom error is thrown

See original GitHub issue

Describe the bug

Wallet Connect does not seem to return the original error from json rpc endpoint when the smart contract throws custom error which was introduced in Solidiy 0.8.4 https://blog.soliditylang.org/2021/04/21/custom-errors/ This leads to ethersjs unable to decode custom error which ccip-read relies on showing ENS offchain record

SDK Version (if relevant)

  • Version 1.7.8

To Reproduce Steps to reproduce the behavior:

  1. Go to https://offchainexample2.surge.sh/name/1.offchainexample.eth/details
  2. ENS has various record such as ETH/LTC/email/description
  3. Click “Connect” on the left side
  4. Click “Wallet Connect”.
  5. Then all the record disappears.
  6. Click “Disconnect”
  7. Then all the record reappear.

Expected behavior

When I put the following console.log at [checkError function of ethers js] (https://github.com/ethers-io/ethers.js/blob/master/packages/providers/src.ts/json-rpc-provider.ts#L52), The provider via Infura (which we connect during read only mode) returned error.data on the left side of screenshot whereas wallet connect doesn’t have any data on the right side of the screenshot below.

function checkError(method: string, error: any, params: any): any {
    console.log('***checkError', {
        method, error, params
    })

Screenshots If applicable, add screenshots to help explain your problem.

Screenshot_2022-04-26_at_20 15 45

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bkremcommented, Jun 11, 2022

Hi @makoto,

Was great meeting you today in person!

I just had a chance to test #1151 against the ens-app offchain branch. It looks like error.data is being passed now and the records are visible after connecting via WalletConnect 🎉

The steps are:

  1. Explicitly add the ethereum-provider prerelease that contains this upcoming fix to the ens-app deps: yarn add @walletconnect/ethereum-provider@next
  2. In web3modal.js, replace the value for providerOptions.walletconnect.package with () => import('@walletconnect/ethereum-provider'),
  3. In setup.js change the provider.removeAllListeners() line to provider.events.removeAllListeners()

Let us know if you’re still seeing issues around error forwarding, and sorry again about the wait on this 🙏

1reaction
0xAsimetriqcommented, May 10, 2022

@makoto Hey, initially we thought that it was a simple addition of data field and made a PR for it here https://github.com/WalletConnect/walletconnect-monorepo/pull/1006 but after some testing it looks to be more involved. This is on our radar and once some tasks on v2 are finished, I’ll get back to it 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add WalletConnect Provider #775 - ethers-io/ethers.js - GitHub
I'm supporting MetaMask and WalletConnect in my Angular 9 DApp. ... It's a wallet connect error, not a ethers error.
Read more >
WalletConnect How to Connect your Dapp with ... - YouTube
Join Pedro Gomes of WalletConnect for a workshop titled "How to Connect your Dapp with WalletConnect." Improve your dapp by integrating ...
Read more >
WalletConnect - Algorand Developer Portal
WalletConnect is an open protocol to communicate securely between mobile wallets and decentralized applications (dApps) using QR code scanning (desktop) or ...
Read more >
WalletConnect Sign v2.0: Beginner's Guide for Android ...
In short words, WalletConnect v2.0 provides secure remote signing communication between a ... Error will be thrown if there's an isssue during initalization...
Read more >
Wallet Connect / Web3 Provider showing a lot of errors just by ...
The problem is webpack v5 made breaking changes that means that WalletConnectProvider: '@walletconnect/web3-provider' package needs to be ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found