Skip to main content

Installation

Install the @ensdomains/ens-contracts package to access compiled ENS smart contracts and their ABIs.

Package Manager Installation

Choose your preferred package manager to install ENS Contracts:
npm install @ensdomains/ens-contracts

What’s Included

Once installed, you’ll have access to:
  • Compiled Contract JSON - ABI and bytecode for all ENS contracts
  • Solidity Source Files - Import contracts directly in your Solidity code
  • Hardhat Artifacts - Raw artifact files for advanced use cases
  • TypeScript Support - Full type definitions for contract interfaces

Package Contents

The package includes the following directories:
@ensdomains/ens-contracts/
├── build/              # Compiled contract JSON files
├── contracts/          # Solidity source files
├── artifacts/          # Hardhat artifacts
└── deployments/        # Deployment information

Version Information

Current stable version: 1.6.2This package follows semantic versioning. Check the changelog for updates.

Requirements

For JavaScript/TypeScript Projects

  • Node.js 18.0.0 or higher (recommended: 24.6.0)
  • Compatible with any framework (Hardhat, Foundry, Ethers.js, Viem, etc.)

For Solidity Projects

  • Solidity compiler version compatible with the contracts
  • Hardhat, Foundry, or other Solidity development framework

Accessing Binary Files

If your environment doesn’t have a compiler, you can access raw Hardhat artifacts directly:
node_modules/@ensdomains/ens-contracts/artifacts/contracts/{moduleName}/{contractName}.sol/{contractName}.json

Next Steps

Now that you’ve installed the package, proceed to the Quick Start guide to learn how to import and use the contracts.

Quick Start Guide

Learn how to import and use ENS contracts in your project

Build docs developers (and LLMs) love