Skip to content

fix: make ENS resolution ENSv2-ready#3008

Merged
sammdec merged 2 commits into
aave:feat/ens-viem-migrationfrom
ens-integrations:feat/ens-viem-migration
Jun 5, 2026
Merged

fix: make ENS resolution ENSv2-ready#3008
sammdec merged 2 commits into
aave:feat/ens-viem-migrationfrom
ens-integrations:feat/ens-viem-migration

Conversation

@yashgo0018
Copy link
Copy Markdown

@yashgo0018 yashgo0018 commented Jun 4, 2026

General Changes

  • Replaces the app's Ethers v5 ENS resolution paths with viem-based ENS lookups so V3 uses Universal Resolver-compatible resolution.
  • Adds a shared ensClient utility for mainnet ENS forward and reverse resolution, using the configured mainnet RPC URL and viem's mainnet Universal Resolver address.
  • Updates read-only wallet mode, bridge destination ENS input, profile ENS display, and wallet domain fetching to use the shared viem ENS helpers.
  • Removes the Ethers-backed getENSProvider helper now that ENS lookups no longer depend on StaticJsonRpcProvider.resolveName / lookupAddress.
  • Remove check what an ENS ends with '.eth' to add support for offchain DNS resolution (CCIP-Read).

Developer Notes

  • Context: ENS Labs flagged that Aave V3 still resolved ENS names through Ethers v5, which does not use the Universal Resolver and is not ENSv2-ready.
  • Routing ENS reads through viem moves these flows onto the Universal Resolver path. That is the path needed for ENSIP-10 wildcard resolution and EIP-3668 CCIP-Read records, including ENSv2 names rolling out now.
  • No new package is introduced. The implementation uses the existing direct viem dependency.
  • ENS normalization is centralized in resolveEnsAddress, so invalid .eth input is handled as a failed resolution instead of throwing from UI handlers/effects.

Validation

  • ur.integration-tests.eth resolves to 0x2222222222222222222222222222222222222222 through a viem Universal Resolver smoke test.
  • Legacy resolution returns 0x1111111111111111111111111111111111111111 for the same sentinel, so 0x2222222222222222222222222222222222222222 confirms the Universal Resolver path is being used.
  • The lint command completes successfully, with existing repository warnings unrelated to this PR.

Reviewer Checklist

Please ensure you, as the reviewer(s), have gone through this checklist to ensure that the code changes are ready to ship safely and to help mitigate any downstream issues that may occur.

  • Code changes do not significantly increase the application bundle size
  • If there are new 3rd-party packages, they do not introduce potential security threats
  • If there are new environment variables being added, they have been added to the .env.example file as well as the pertinant .github/actions/* files
  • There are no CI changes, or they have been approved by the DevOps and Engineering team(s)

Copilot AI review requested due to automatic review settings June 4, 2026 20:59
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 4, 2026

@yashgo0018 is attempting to deploy a commit to the Aave Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR migrates ENS lookups from an ethers-based provider helper to a shared viem-based ENS client.

Changes:

  • Removed getENSProvider (ethers StaticJsonRpcProvider) from network config utilities.
  • Added src/utils/ensClient.ts to centralize ENS name/address lookups via viem PublicClient.
  • Updated ENS consumers (domain fetcher, hooks, and UI inputs) to use the new ENS client and viem address utilities.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/utils/marketsAndNetworksConfig.ts Removes the legacy ethers ENS provider helper.
src/utils/ensClient.ts Introduces a cached viem PublicClient and ENS lookup/resolve helpers.
src/store/utils/domain-fetchers/ens.ts Switches ENS name lookup to the new viem-based client.
src/libs/hooks/use-get-ens.tsx Replaces ethers utils/provider usage with viem ENS lookup + hashing utilities.
src/components/transactions/Bridge/BridgeDestinationInput.tsx Uses viem isAddress and the new ENS address resolver.
src/components/WalletConnection/ReadOnlyModal.tsx Uses viem isAddress and the new ENS address resolver (removes manual normalize/provider).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/utils/ensClient.ts
Comment thread src/utils/ensClient.ts
Comment thread src/components/transactions/Bridge/BridgeDestinationInput.tsx
Comment thread src/libs/hooks/use-get-ens.tsx Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

❌ CI run has failed!
Please see logs at https://github.com/aave/interface/actions/runs/26999345786'

@sammdec sammdec changed the base branch from main to feat/ens-viem-migration June 5, 2026 13:29
@sammdec
Copy link
Copy Markdown
Contributor

sammdec commented Jun 5, 2026

thanks @yashgo0018 , i'm going to merge this to a staging branch so we can run some final tests before merging to main

@sammdec sammdec merged commit 96aa5ca into aave:feat/ens-viem-migration Jun 5, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants