Wallet Connect not exposing error.data when custom error is thrown
See original GitHub issueDescribe 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:
- Go to https://offchainexample2.surge.sh/name/1.offchainexample.eth/details
- ENS has various record such as ETH/LTC/email/description
- Click “Connect” on the left side
- Click “Wallet Connect”.
- Then all the record disappears.
- Click “Disconnect”
- 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.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
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 likeerror.data
is being passed now and the records are visible after connecting via WalletConnect 🎉The steps are:
ethereum-provider
prerelease that contains this upcoming fix to theens-app
deps:yarn add @walletconnect/ethereum-provider@next
web3modal.js
, replace the value forproviderOptions.walletconnect.package
with() => import('@walletconnect/ethereum-provider'),
setup.js
change theprovider.removeAllListeners()
line toprovider.events.removeAllListeners()
Let us know if you’re still seeing issues around error forwarding, and sorry again about the wait on this 🙏
@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 👍