I’m currently trying to use the new RentalSubdomainRegistrar to allow users to register subdomains for my 2LD. I have deployed the contract on goerli and have used the ETH Namewrapper contract address deployed on goerli as the constructor arg.
I have some questions about how to do this. Apologies if some of them sound amateurish but this is my first time working with ENS and the documentation for the new features isn’t fully out yet. Also, I’d really like to launch my project asap:
- Do I need to deploy a separate registrar for each 2LD?
- When calling the setup domain function, what address token should I use?
- Do I need to wrap the 2LD before using it with the contract?
- If the 2LD is wrapped and has issued subdomains, can it be unwrapped and used normally again?
- Who’s address should beneficiary address be in setupDomain in the SubdomainRentalRegistrar?
- What is the gas cost for calling setup domain? I tried doing it and I got 3ETH.
I hope someone from your team can help me out with these questions.
- No, same contract can be used. And it’s not just for 2LDs.
- Any token you want to use as the fee, like WETH
- Yes, your name must first be Locked (
- No. The name is Locked, see #3
- Any address you want. Your address, presumably.
- If you’re seeing ridiculously high gas prices, it’s probably because the transaction is expected to revert, so your wallet wasn’t able to estimate gas properly. You probably still need to approve your contract as an operator for the Name Wrapper. Or perhaps there is an issue with your contract.
Note that those subdomain registrar contracts in Jeff’s PR are in a draft state, still need reviewing/testing, and are not yet recommended for use.
Thanks! I managed to set up the domain, however I have two questions:
- What units should fee be in?
- The contract interface on etherscan shows a ‘register’ input field which asks for ether amount (shown in image). If I leave it blank, I cannot write to the contract. And if I fill in a value the contract cannot estimate gas, which I assume means there’s some issue.
See the top of that rental class in the PR, it denotes that the fee is per-second of duration that a name is registered for. Each token has its own base units that determine what UIs should display, but from the ERC-20 contract perspective you’re just dealing with the smallest unit, 10^-18 I believe.
Not sure if that method is meant to be payable or not since it should be using a separate ERC-20 token contract. Filling in zero should suffice, and of course I think you’ll need to approve that contract to spend said tokens too.