Welcome to the ENS Contract repository! This project contains the core smart contracts and documentation for the Ethereum Name Service (ENS) system.
The ENS Contract repository is the central hub for managing Ethereum Name Service smart contracts. ENS is a decentralized naming system built on the Ethereum blockchain that enables users to own and manage .eth domain names with advanced features including wrapping, emancipation, locking, and signature-based operations.
Repository: DMENTERPRISES/ens-contract
Branch: danish-main
Last Updated: 2026-04-05
This project includes comprehensive documentation for all major components:
-
- Complete guide on wrapping ENS names into ERC1155 tokens
- Advanced features: emancipation, locking, and fuse management
- Function reference and state machine lifecycle
- Installation, testing, and deployment instructions
- Signature-based operations and upgrade procedures
-
L2 Reverse Registrar Documentation
- L2 Reverse Registrar contract implementation
- Setting reverse records for addresses and contracts
- Signature verification formats and authentication methods
- Validator addresses for mainnet and testnet
Location: ./contracts/wrapper/
Documentation: NameWrapper README
The NameWrapper adds powerful new functionality to ENS names:
- ERC1155 Token Support: Convert ENS names at any level into ERC1155 tokens
- Emancipation: Allow parent names to revoke control over subdomains
- Locking: Enable name owners to protect their names from modifications
- Fuses: Irreversible permission flags that control various aspects of name management
- Expiry Management: Built-in expiration mechanisms for emancipated and locked names
- Direct Registration: Register and wrap names in a single transaction
- Subdomain Management: Create and manage wrapped subdomains directly
Key Features:
- State machine lifecycle (Unregistered β Unwrapped β Wrapped β Emancipated/Locked)
- Owner-controlled and parent-controlled fuses
- Signature-based authorization
- Built-in upgrade capabilities
Location: ./contracts/reverseRegistrar/
Documentation: Reverse Registrar README
The L2 Reverse Registrar combines resolver and reverse registrar functionality:
Methods for Setting Records:
setName()- Set record for msg.sender's addresssetNameForAddr()- Set record for specific address (owner authorization required)setNameForAddrWithSignature()- Set record with signature verificationsetNameForOwnableWithSignature()- Set record for contracts with owner signature
Signature Formats:
For setNameForAddrWithSignature:
- validatorAddress: 0xa4a5CaA360A81461158C96f2Dbad8944411CF3fd (mainnet) / 0xAe91c512BC1da8B00cd33dd9D9C734069e6E0fcd (testnet)
- functionSignature: 0x2023a04c
- name, addr, coinTypes, signatureExpiry
For setNameForOwnableWithSignature:
- validatorAddress: 0xa4a5CaA360A81461158C96f2Dbad8944411CF3fd (mainnet) / 0xAe91c512BC1da8B00cd33dd9D9C734069e6E0fcd (testnet)
- functionSignature: 0x975713ad
- name, contractAddr, owner, coinTypes, signatureExpiry
npm installnpm run testTest files use suffixes (e.g., _2) to indicate which account is performing operations for multi-user scenarios.
-
Create environment file:
cp .env.org .env
-
Set your credentials in
.env:PRIVATE_KEY=your_private_key ETHERSCAN_API_KEY=your_etherscan_api_key INFURA_API_KEY=your_infura_api_key METADATA_HOST=your_metadata_host (optional)Leave these fields blank:
SEED_NAME= METADATA_ADDRESS= WRAPPER_ADDRESS= RESOLVER_ADDRESS= -
Run deployment:
bun run deploy:rinkeby
This will deploy contracts and automatically verify them on Etherscan.
After deployment:
- Register a name using the deployed account
- Set
SEED_NAME=to the label in.env(e.g.,matokenformatoken.eth) - Run:
bun run seed:rinkeby
ens-contract/
βββ README.md # Main documentation (this file)
βββ contracts/
β βββ wrapper/
β β βββ README.md # NameWrapper comprehensive guide
β β βββ Glossary of terms
β β βββ Name lifecycle states
β β βββ Fuse definitions and management
β β βββ Function reference
β β βββ Installation & testing
β β βββ Deployment procedures
β β βββ Upgrade notes
β βββ reverseRegistrar/
β βββ README.md # L2 Reverse Registrar guide
β βββ Setting records
β βββ Signature formats
βββ scripts/
β βββ deploy.js # Deployment script for Rinkeby
β βββ seed.js # Seeding script for test data
βββ .env.org # Environment template
- ENS Official Documentation - Official ENS documentation and guides
- ENS GitHub Organization - Main ENS repository and related projects
- Ethereum Documentation - Ethereum development resources
- Solidity Documentation - Official Solidity language documentation
- OpenZeppelin Contracts - Industry-standard smart contract libraries
- Hardhat Documentation - Ethereum development environment
- ERC-1155 Token Standard - Multi-token standard used by NameWrapper
- ERC-721 Token Standard - NFT standard for .eth registrar
- Etherscan - Ethereum blockchain explorer and verification tool
- OpenSea Testnet - View wrapped NFTs on testnet
Names progress through several states during their lifecycle:
- Unregistered β Unwrapped β Wrapped β Emancipated/Locked
See the NameWrapper Documentation for detailed state information.
Fuses are irreversible permission flags that can be burned until expiry:
- CANNOT_UNWRAP - Prevents unwrapping (enables Locked state)
- CANNOT_BURN_FUSES - Locks all permissions
- CANNOT_TRANSFER - Prevents transferring the name
- CANNOT_SET_RESOLVER - Prevents changing resolver
- CANNOT_CREATE_SUBDOMAIN - Prevents creating subdomains
- PARENT_CANNOT_CONTROL - Emancipates the name from parent control
For complete fuse reference, see NameWrapper Fuses Documentation.
Names can be extended using:
setChildFuses()setSubnodeOwner()setSubnodeRecord()renew()extendExpiry()
See Expiry Documentation for detailed information.
- Node.js (v14 or higher)
- npm or yarn
- Bun (for running scripts with
bun run)
All development requires proper environment configuration. See Quick Start for setup instructions.
The test suite includes tests for all major functions. Tests that require multiple accounts use the _2 suffix convention.
Please refer to the repository for license information.
For information on contributing to this project, please check the repository guidelines.
For issues, questions, or discussions:
- Check the NameWrapper Documentation
- Check the Reverse Registrar Documentation
- Open an issue on GitHub
- Refer to Official ENS Documentation
Organization: DMENTERPRISES
Repository: ens-contract
Branch: danish-main
Created by: @danishahmed111
Date: April 5, 2026