How to fuse an NFT with an ENS subdomains?

Hey guys,

I’m creating a website which allows users to buy subdomains for certain domains I own. I’d also like to issue every subdomain owner with a specific NFT which is attached to the domain. I’d like to make it so that when the NFT is transferred, so is the domain, and all relevant records are updated accordingly.

I went through this thread which was really helpful: Implementation of "ENS subdomains for NFT owners e.g. X.bayc.eth" however I still have a few questions.

In the above post, @serenae says that the NFT contract should be the owner/operator of the ENS name and that the transferFrom should also call setSubnodeOwner.

In my case, I am going to be creating the nft contract from scratch, and also be using a custom registrar. So would I make the NFT contract and the registrar the same contract or would I inherit the registrar into the NFT contract? Also, how do I make the NFT contract the owner of the 2LD (isn’t the namewrapper made the owner?)

Would be great if I could get a high-level overview of the steps I need to take to get this done.


1 Like