ENS Contracts
Welcome to the ENS Contracts documentation. This package provides compiled smart contracts for the Ethereum Name Service (ENS), enabling human-readable names for Ethereum addresses and resources.What is ENS?
The Ethereum Name Service (ENS) is a distributed, open, and extensible naming system based on the Ethereum blockchain. ENS maps human-readable names like ‘alice.eth’ to machine-readable identifiers such as Ethereum addresses, content hashes, and metadata.Key Features
Registry Contracts
Core contracts for domain ownership and resolution
.eth Registrar
Contracts for registering and managing .eth domains
Resolvers
Smart contracts for resolving ENS names to resources
L2 Support
Layer 2 deployment and reverse registration
Package Overview
This repository doubles as an npm package with compiled JSON contracts, allowing you to:- Import contract ABIs and bytecode in JavaScript/TypeScript projects
- Import Solidity contracts directly into your smart contracts
- Access raw Hardhat artifacts for custom integrations
Contract Categories
Registry
The ENS registry is the core contract that lies at the heart of ENS resolution. All ENS lookups start by querying the registry. The registry maintains a list of domains, recording the owner, resolver, and TTL for each. Available Contracts:ENS.sol- Interface of the ENS RegistryENSRegistry- Implementation of the ENS RegistryENSRegistryWithFallback- Registry implementation after the 2020 migrationReverseRegistrar- Manages reverse resolution via .addr.reverseTestRegistrar- Test registrar for .test TLD on testnets
EthRegistrar
Implements an ENS registrar for the .eth TLD with features including:- Controller-based registration system
- Commit/reveal process to prevent frontrunning
- Flexible pricing oracles
- Bulk renewal capabilities
BaseRegistrar&BaseRegistrarImplementation- Core .eth registrarETHRegistrarController- Registration controller with commit/revealBulkRenewal- Renew multiple domains in one transactionStablePriceOracle- Fiat-pegged pricing oracleLinearPremiumPriceOracle- Premium pricing for recently expired domains
Resolvers
Resolvers implement various ENS profiles and EIPs:- EIP 137 - Contract address interface
- EIP 165 - Interface detection
- EIP 181 - Reverse resolution
- EIP 205 - ABI support
- EIP 619 - Public key support
- EIP 634 - Text records
- EIP 1577 - Content hash support
- EIP 2304 - Multicoin support
L2 Contracts
TheL2ReverseRegistrar and UniversalSigValidator contracts enable ENS functionality on Layer 2 networks with multi-chain signature support.
Next Steps
Installation
Install the package using npm, yarn, or bun
Quick Start
Get started with importing and using ENS contracts