add: GNS (.gwei) names support#2522
Open
lucadonnoh wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds support for resolving GNS (Gwei Name Service)
.gweinames, following the exact pattern Namoshi established: same ENS code path, different universal resolver contract.GNS is an ownerless, ENS-compatible naming system on Ethereum (gwei.domains, source). Names are ERC-721 tokens keyed by EIP-137 namehash, registration fees are burned, and the contracts have no owner or admin.
How it plugs in
GNS ships a universal resolver implementing the same interface viem and
EnsGetteralready speak (resolveWithGateways/reverseWithGateways):GnsUniversalResolver:0xD658131FFB6D732335d37f199374289F1b31564F, verified, stateless, no owner.defaultNetworksMode: 'testnet'works with no extra wiring..gweinames live on the Ethereum provider already used for ENS. No new network, no new RPC provider.Changes
services/ensDomains:GNS_UNIVERSAL_RESOLVERconst,getIsGweiDomain,isGweiDomainoption onresolveENSDomain/reverseLookupEns/getEnsAvatar.controllers/domains:.gweibranch inresolveDomain, a third parallel lookup in#reverseLookup(batched through the existing deploylessEnsGetter, which takes the resolver address as a parameter, so no contract changes),gweifield in the domains cache.interfaces/domains:gweifield onDomainsentries,'gwei'inresolvedAddressType.domains.test.tsresolving a real mainnet name (donnoh.gwei) in both directions, plus the unregistered-name and no-name cases. Existing spy-count tests updated because each reverse refresh now performs two Ethereum lookups (ENS and GNS).Behavior notes
nullandEnsGettertreats them ashasName: false. No new error handling needed anywhere.Verification
npm run jest -- src/controllers/domains/domains.test.ts: 24/24 (the new tests hit the live mainnet deployment).npm run jest -- src/services/ensDomains/ensDomains.test.ts: 4/4.npm run type:check: no new errors (210 pre-existing onv2, identical with and without this change).npx eslinton the touched files: clean.A companion PR adds the UI side (icon, input validation labels, account search) in the extension repo.