Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENS Permanent Registrar Support #159

Closed
10 tasks done
barrasso opened this issue Apr 11, 2019 · 9 comments
Closed
10 tasks done

ENS Permanent Registrar Support #159

barrasso opened this issue Apr 11, 2019 · 9 comments
Assignees

Comments

@barrasso
Copy link
Contributor

barrasso commented Apr 11, 2019

The new ENS Permanent Registrar is coming out soon, and it would be nice to have a set of convenient utility classes that allow for easy interaction with the updated contracts.

Web3swift already has Util classes for the registry and resolver, but is missing the registrar. Once this is completed, we could add web3swift to the list of supported ENS libraries.

Overview

Summary from the ENS docs:

The Permanent Registrar is the code that will govern allocation and renewal of names in the .eth TLD. Presently this is governed by the legacy auction registrar, which uses a Vickery Auction process to allocate names to registrants. The new registrar aims to simplify this process, while providing a stable platform for future improvements that will minimise API changes.

In addition, the registrar is an ERC721 compliant nonfungable token contract, meaning that .eth registrations can be transferred in the same fashion as other NFTs.

The target deployment date for the permanent registrar is the 4th of May, 2019.

Functional Spec

Ideally, the utility classes would support the basic functions defined in the BaseRegistrar and ETHRegistrarController. This includes the following functionality:

BaseRegistrar:

Read functions

  • Get Name Expiry
    • Returns the unix timestamp at which a registration currently expires.
  • Get Name Owner
    • ownerOf returns the address that owns the registration identified by the label hash, or reverts if the registration does not exist. This function is part of ERC721.

Write functions

  • Transfer a Name
    • Used to transfer the registration. Behaves as specified in ERC721.
  • Reclaim ENS Record
    • Sets the owner record of the name in the ENS registry to match the owner of the registration in this registry. May only be called by the owner of the registration.

ETHRegistrarController:

Read functions

  • Check Name Availability
    • Returns true iff the name is both valid and available for registration by this controller.
  • Get Rent Price
    • Returns the cost, in wei, to register or renew the provided name for the provided duration.
  • Calculate Commitment Hash
    • Generates and returns a commitment hash from a name label (eg, 'myname', not 'myname.eth') owner, and secret value.

Write functions

  • Submit Commitment
    • Submits a precommitment generated by calling makeCommitment.
  • Register Name
  • Extend Name Registration
    • Renews a name. This function can be called by anyone, as long as sufficient funds are provided.
@BaldyAsh BaldyAsh self-assigned this Apr 11, 2019
@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 2.5 ETH (404.0 USD @ $161.6/ETH) attached to it as part of the ethsociety fund.

@gitcoinbot
Copy link

gitcoinbot commented Apr 12, 2019

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 4 days, 9 hours from now.
Please review their action plans below:

1) baldyash has been approved to start work.

  • study ens registrar
  • implement its functionality

Learn more on the Gitcoin Issue Details page.

@BaldyAsh
Copy link
Collaborator

@barrasso hi. Think its done. I've completely changed ENS classes, you can look at them here and tests for them here. Also I've added usage.
Unfortunately I can’t find the BaseRegistrar and RegistrarController contracts for tests, but think there won't occur any problems with them

@barrasso
Copy link
Contributor Author

@BaldyAsh Thanks! I'm looking over this now. Great work 😀I'll close the bounty soon.

FYI, I was also looking for the new registrar contracts to test. Here is Nick Johnson's response:

You can find them by looking up the owner of the .eth domain in the registry. (Don't hardcode the registrar address in your code - it can change, while looking up the owner will always work)

@barrasso
Copy link
Contributor Author

Side note: I want to perform a Reverse Resolution on a specific address.

Is this the correct method?

// I want to know if an address resolves to a .eth name
// e.g. wallet address = '0x3487acfb1479ad1df6c0eb56ae743d34897798ac'

let node = "3487acfb1479ad1df6c0eb56ae743d34897798ac.addr.reverse"
let name = try! ens.getName(forNode: node)

@BaldyAsh
Copy link
Collaborator

@barrasso forgot about reverse registrar, I'll make it today

@BaldyAsh
Copy link
Collaborator

@barrasso added reverse registrar

ens.setReverseRegistrar(withAddress: EthereumAddress("0x314159265dd8dbb310642f98f50c066173c1259b")!)
let name = try ens.reverseRegistrar!.getReverseRecordName(address: EthereumAddress("0x314159265dd8dbb310642f98f50c066173c1259b")!)

@gitcoinbot
Copy link

⚡️ A tip worth 2.50000 ETH (418.29 USD @ $167.31/ETH) has been granted to @BaldyAsh for this issue from @barrasso. ⚡️

Nice work @BaldyAsh! Your tip has automatically been deposited in the ETH address we have on file.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This Bounty has been completed.

Additional Tips for this Bounty:

  • barrasso tipped 2.5000 ETH worth 418.29 USD to baldyash.

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

No branches or pull requests

3 participants