-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
ENS avatar resolution fails when querying using an address #2583
Comments
Just noticed this link from when you added avatar support: https://gist.github.com/Arachnid/9db60bd75277969ee1689c8742b75182
Looks like it's correct to attempt to find an avatar on the reverse resolver first however we're not passing the correct name ( |
I've added an attempt to read an avatar from the reverse record, however we could save some calls if we create a |
I definitely need to look more into this and check with Nick too. This seems like it is a bug, but I want to make sure we do the right thing. |
This should have been fixed in v5.6.0. If you still have any problems, please re-open this issue. Thanks! :) |
Describe the bug
Resolving an ENS avatar with
provider.getAvatar(nameOrAddress)
using an ENS name works correctly, however if the address this name resolves to is passed then the avatar will be returned as null.ethers.js/packages/providers/src.ts/base-provider.ts
Lines 1756 to 1779 in 0578a88
It looks to me like we're looking up the reverse record for the address provided and getting its resolver, we then query for the avatar field on here. This makes the assumption that the reverse and forwards resolvers are the same which is unlikely to be correct.
We also pass "_" as the name and so we use an incorrect namehash when pulling the avatar field.
Reproduction steps
Failing test case here: TomAFrench@50c7832
Fix
Based on the fact that we need the user's namehash in order to query the avatar, I think we have to go all they way up to the ENS name and then query using that.
I've made a PR to do this at #2582
Search Terms
ens, avatar
The text was updated successfully, but these errors were encountered: