Back to Home

ENSRegistryWithFallback

0x00000000000c...97ba6c7d2e1e
Source VerifiedEdit this contract
Deployed January 30, 2020 (6 years ago)Block 9,380,380

The current ENS registry, deployed in January 2020 to close a flaw that let a former owner take a name back after selling it.

Verified Source

Historical Significance

Almost every human readable Ethereum address in use resolves through this contract. It is the piece of infrastructure that let addresses stop being forty hex characters, and its interface has been stable enough that wallets, block explorers and contracts written years apart all speak to it the same way.

Its deployment is also one of the clearest examples of a live protocol repairing itself. The namespace was not abandoned and not forked. A new registry was deployed with the old one wired in behind it, and names moved across gradually while continuing to resolve throughout.

Context

The original registry went live on 10 March 2017 at 0x314159265dD8dbb310642f98f50C066173C1259b and is documented separately in this archive.

In January 2020 a critical vulnerability was disclosed in it, catalogued as CVE-2020-5232. The owner of a name could leave a trapdoor in place, transfer or sell the name, and later reclaim it without the new owner's knowledge or consent. Every published version of the ENS contracts from 0.1.0 onward was affected, and the practical advice while the fix was prepared was to accept no name transfers from strangers.

This replacement was deployed on 30 January 2020, the same day the advisory went out, and a new .eth registrar at 0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85 followed six minutes later. Holders then migrated their names from the old registry to this one, with the fallback ensuring nothing broke for those who had not yet moved.

Key Facts
Deployment Block
9,380,380
Deployment Date
Jan 30, 2020, 12:37 AM
Code Size
5.2 KB
Transactions by YearPartial (capped)
202025,769
202124,231

Description

The ENS registry is the root of the whole system. It is a single mapping from a namehash to three things: the owner of that node, the resolver that answers queries about it, and a TTL. Every .eth lookup, every subdomain and every reverse record begins with a call here. The registry itself knows nothing about auctions, rent or tokens; it only records who controls a node and where to ask about it, which is why the registrars above it have been replaced three times while this layer has changed only once.

This version is ENSRegistryWithFallback. Verified on chain, old() returns 0x314159265dD8dbb310642f98f50C066173C1259b, the original 2017 registry. Any record never migrated is read from that older contract instead of coming back empty, which is what allowed the namespace to move without a flag day. It also added setRecord and setSubnodeRecord, which set owner, resolver and TTL in one transaction rather than three, and an operator approval mechanism modelled on ERC-721 so an owner can delegate control of their names without transferring them.

The root node is owned by 0xaB528d626EC275E3faD363fF1393A41F581c5897 rather than by any individual key.

Bytecode Overview

Opcodes5,346
Unique Opcodes202
Jump Instructions158
Storage Operations37

External Links

Related contracts