Skip to content

Conversation

VolodymyrBg
Copy link

@VolodymyrBg VolodymyrBg commented Mar 2, 2025

This PR adds support for the ENS name resolution function to the FnameResolver contract.

Previously, the resolver only supported the addr(bytes32) function, but now it also supports the name(bytes32) function, which allows reverse resolution from addresses to names. This makes the resolver more compliant with ENS standards and improves its functionality.

The implementation:

  1. Adds a new INameQuery interface with the name function
  2. Updates the resolve function to accept name function calls
  3. Modifies resolveWithProof to return different data based on the original function call
  4. Adds tests to verify the new functionality

Fixes the "ResolverFunctionNotSupported" error that was previously thrown for all non-addr function calls, as indicated in the code comment.


PR-Codex overview

This PR introduces a new interface INameQuery for name resolution in the FnameResolver contract and updates the resolve and resolveWithProof functions to support both address and name resolution.

Detailed summary

  • Added interface INameQuery with function name(bytes32 node).
  • Updated resolve function to support name resolution.
  • Modified the resolveWithProof function to accept extraData and determine the original function called.
  • Enhanced the return value of resolveWithProof to include the fname when requested.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

This PR adds support for the ENS name resolution function to the FnameResolver contract.

Previously, the resolver only supported the addr(bytes32) function, but now it also
supports the name(bytes32) function, which allows reverse resolution from addresses
to names. This makes the resolver more compliant with ENS standards and improves
its functionality.

The implementation:
1. Adds a new INameQuery interface with the name function
2. Updates the resolve function to accept name function calls
3. Modifies resolveWithProof to return different data based on the original function call
4. Adds tests to verify the new functionality

Fixes the "ResolverFunctionNotSupported" error that was previously thrown for all
non-addr function calls, as indicated in the code comment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant