ens-contract

ENS Contract - Ethereum Name Service Smart Contracts

Welcome to the ENS Contract repository! This project contains the core smart contracts and documentation for the Ethereum Name Service (ENS) system.

πŸ“‹ Table of Contents

Project Overview

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

πŸ“š Documentation

Core Documentation Files

This project includes comprehensive documentation for all major components:

  1. NameWrapper Documentation
    • 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
  2. 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

Key Components

NameWrapper Contract

Location: ./contracts/wrapper/
Documentation: NameWrapper README

The NameWrapper adds powerful new functionality to ENS names:

Key Features:

L2 Reverse Registrar Contract

Location: ./contracts/reverseRegistrar/
Documentation: Reverse Registrar README

The L2 Reverse Registrar combines resolver and reverse registrar functionality:

Methods for Setting Records:

Signature Formats:

For setNameForAddrWithSignature:

For setNameForOwnableWithSignature:

Quick Start

Installation

npm install

Running Tests

npm run test

Test files use suffixes (e.g., _2) to indicate which account is performing operations for multi-user scenarios.

Deploying to Rinkeby Testnet

  1. Create environment file:
    cp .env.org .env
    
  2. 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=
    
  3. Run deployment:
    bun run deploy:rinkeby
    

    This will deploy contracts and automatically verify them on Etherscan.

Seeding Test Data

After deployment:

  1. Register a name using the deployed account
  2. Set SEED_NAME= to the label in .env (e.g., matoken for matoken.eth)
  3. Run:
    bun run seed:rinkeby
    

Project Structure

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

πŸ”— Resources

Official ENS Resources

Solidity & Smart Contracts

Standards & Specifications

Testing & Verification

πŸ“– Important Notes

NameWrapper State Management

Names progress through several states during their lifecycle:

See the NameWrapper Documentation for detailed state information.

Fuse System

Fuses are irreversible permission flags that can be burned until expiry:

For complete fuse reference, see NameWrapper Fuses Documentation.

Expiry Management

Names can be extended using:

See Expiry Documentation for detailed information.

πŸ›  Development

Prerequisites

Environment Setup

All development requires proper environment configuration. See Quick Start for setup instructions.

Testing Coverage

The test suite includes tests for all major functions. Tests that require multiple accounts use the _2 suffix convention.

πŸ“ License

Please refer to the repository for license information.

🀝 Contributing

For information on contributing to this project, please check the repository guidelines.

πŸ“ž Support

For issues, questions, or discussions:


Organization: DMENTERPRISES
Repository: ens-contract
Branch: danish-main
Created by: @danishahmed111
Date: April 5, 2026