Skip to content

Conversation

@shrugs
Copy link
Collaborator

@shrugs shrugs commented Dec 23, 2025

closes #1403

  • configuration and knowledge of a contract's managed name was way too diffuse before this
  • centralizes knowledge of contracts and their managed names
  • improves naming, removes special semantic type because i think it created more confusion than necessary
  • caches the namehashing of managed names

@shrugs shrugs requested a review from a team as a code owner December 23, 2025 19:28
@changeset-bot
Copy link

changeset-bot bot commented Dec 23, 2025

⚠️ No Changeset found

Latest commit: 35f3964

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Dec 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
admin.ensnode.io Ready Ready Preview, Comment Dec 30, 2025 9:07pm
ensnode.io Ready Ready Preview, Comment Dec 30, 2025 9:07pm
ensrainbow.io Ready Ready Preview, Comment Dec 30, 2025 9:07pm

Copy link
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

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

@shrugs Hey I like making this code less diffuse 👍 Reviewed and shared a few suggestions.

Copy link
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

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

@shrugs Hey thanks for the updates 👍 Shared a few more suggestions

* @dev Caches the result of namehash(name).
*/
export const getManagedName = (contract: AccountId) => {
export const getManagedName = (contract: AccountId): { name: Name; node: Node } => {
Copy link
Member

Choose a reason for hiding this comment

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

I'd like to see the ideas being advanced here fully integrated / harmonized with existing related ideas that I cited in #1433 (comment)

Specifically how I referenced the existing related logic in apps/ensindexer/src/lib/tokenscope/nft-issuers.ts

Here's how I understand it:

  1. We have a concept of a "SupportedNFTIssuer".
  2. Each "SupportedNFTIssuer" could then have:
    1. A "managed name" (which is a function of namespace)
    2. A "managed node" (a function of the "managed name")
    3. An AccountId identifying the contract that actually issues the NFT (the "BaseRegistrar") (also a function of namespace)
    4. Some set of additional AccountId identifying all the contracts that are known to perform updates on this NFT Issuer, including the related "BaseRegistrar" from point 3 above as well as all "RegistrarControllers" associated with the "BaseRegistrar".

The idea in point 4 should then allow for a refined implementation of getManagedName where instead of the returned value being a tuple of name / node, it would return a SupportedNFTIssuer.

The getManagedName function should then also be renamed based on the ideas shared above.

Goal: I see high value in consolidating all our special logic and rules about specific NFT issuers together and not distributing it across many places. This should include the existing related work done in TokenScope.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I understand that's your preference, but I'd like to avoid that level of abstraction and introduction of another conceptual layer: I think it harms understandability, and the usage of interpretTokenIdAs(LabelHash|NameHash) within the indexing handlers for that specific contract is a perfectly concise implementation of the same statements.

Copy link
Member

Choose a reason for hiding this comment

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

@shrugs Sure open to that. What do you suggest for next steps then?

Copy link
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

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

@shrugs Sharing a thumbs up on this PR. Please take the lead to merge it in once ready. Thanks 👍

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.

3 participants