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:
Location: ./contracts/wrapper/
Documentation: NameWrapper README
The NameWrapper adds powerful new functionality to ENS names:
Key Features:
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 signatureSignature Formats:
For setNameForAddrWithSignature:
For setNameForOwnableWithSignature:
npm install
npm run test
Test files use suffixes (e.g., _2) to indicate which account is performing operations for multi-user scenarios.
cp .env.org .env
.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=
bun run deploy:rinkeby
This will deploy contracts and automatically verify them on Etherscan.
After deployment:
SEED_NAME= to the label in .env (e.g., matoken for matoken.eth)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
Names progress through several states during their lifecycle:
See the NameWrapper Documentation for detailed state information.
Fuses are irreversible permission flags that can be burned until expiry:
For complete fuse reference, see NameWrapper Fuses Documentation.
Names can be extended using:
setChildFuses()setSubnodeOwner()setSubnodeRecord()renew()extendExpiry()See Expiry Documentation for detailed information.
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:
Organization: DMENTERPRISES
Repository: ens-contract
Branch: danish-main
Created by: @danishahmed111
Date: April 5, 2026