Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on @web3-onboard/react ENS resolution #1774

Open
1 task done
gbonumore opened this issue Jun 14, 2023 · 2 comments
Open
1 task done

Error on @web3-onboard/react ENS resolution #1774

gbonumore opened this issue Jun 14, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@gbonumore
Copy link

Current Behavior

Using @web3-onboard/react, ENS name and avatar resolution is broken.

Expected Behavior

It is possible to retrieve ENS name and avatar.
The issue comes from the version of ethers.js used in which method getContentHash() doesn't recognize IPNS, which was introduced on a later version of ethers.

Steps To Reproduce

Error can be seen here: https://onboard.blocknative.com/examples/connect-wallet while connecting with a wallet which has a ENS name which gets resolved in a content hash data starting with 0xe5010172.

What package is effected by this issue?

@web3-onboard/react

Is this a build or a runtime issue?

Runtime

Package Version

2.8.5

Node Version

No response

What browsers are you seeing the problem on?

Chrome

Relevant log output

// Patching the relevant piece of code with this in order to make it work for now.

const ipfs = hexBytes.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);
    if (ipfs) {
        const scheme = (ipfs[1] === "e3010170") ? "ipfs": "ipns";
        const length = parseInt(ipfs[4], 16);
        if (ipfs[5].length === length * 2) {
            return `${ scheme }:/\/${ Base58.encode("0x" + ipfs[2])}`;
        }
    }

Anything else?

Screenshot 2023-06-14 at 09 22 51

Sanity Check

  • If this is a build issue, I have included my build config. If this is a runtime issue, I have included reproduction steps and/or a Minimal, Reproducible Example.
@gbonumore gbonumore added the bug Something isn't working label Jun 14, 2023
@Adamj1232
Copy link
Member

@gbonumore thanks for reporting this issue.
I am a little unclear, are you thinkingwe need to update our version of ethers to return the updated IPNS?
Does this error happen when connecting a wallet or at some other point?
Are you seeing the same issue on our demo here?
I am able to connect my wallet and see my avatar and ens at the demo notes above on Goerli.
I also dont get an error when connecting to onboard.blocknative.com with an Eth account and associated avatar and ens.

@gbonumore
Copy link
Author

I made this a little unclear, my ens domain contains a content hash record which starts with ipns://
(I am using eth.limo to serve a dapp through my ens handle, myhandle.eth.limo, which points to the ipns in question)
That's why it matches ipns scheme, 0xe5010172, which was not supported on the ethers.js version used on this library.
If I of course remove that contenthash the resolver wouldn't break.
Let me know if further informations are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants