npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@enscribe/hardhat-enscribe

v0.1.3

Published

A Hardhat v3 plugin to name smart contracts

Readme

hardhat-enscribe

A Hardhat v3 plugin that enables you to assign ENS (Ethereum Name Service) names to your smart contracts, making them easily discoverable and human-readable.

What is hardhat-enscribe?

hardhat-enscribe allows developers to automatically assign ENS names to their smart contracts during or after deployment. This plugin handles the complete ENS integration process, including:

  • Subname Creation: Creates ENS subnames for your contracts
  • Forward Resolution: Maps ENS names to contract addresses
  • Reverse Resolution: Maps contract addresses back to ENS names
  • Multi-chain Support: Works across multiple networks including Ethereum, Sepolia

Features

  • 🏷️ Primary ENS Naming: Assign human-readable names to your contracts
  • 🌐 Multi-chain Support: Works on Ethereum, Sepolia
  • 🔧 Hardhat v3 Compatible: Built specifically for Hardhat v3 with Viem integration
  • 🛡️ Contract Type Detection: Automatically detects Ownable and ReverseClaimer contracts
  • Transaction Optimization: Waits for confirmations to prevent race conditions

Installation

npm install @enscribe/hardhat-enscribe

Configuration

Add the plugin to your hardhat.config.ts:

import type { HardhatUserConfig } from "hardhat/config";
import hardhatEnscribePlugin from "@enscribe/hardhat-enscribe";
import hardhatToolboxViemPlugin from "@nomicfoundation/hardhat-toolbox-viem";

const config: HardhatUserConfig = {
  plugins: [hardhatToolboxViemPlugin, hardhatEnscribePlugin],
  // ... rest of your config
};

export default config;

Usage

Basic Command

npx hardhat enscribe name <ENS_NAME> --contract <CONTRACT_ADDRESS>

Examples

Name a contract on Sepolia

npx hardhat enscribe name mycontract.mydomain.eth --contract 0x1234...5678

Command Options

  • name (required): The ENS name to assign (e.g., mycontract.mydomain.eth)
  • --contract (required): The contract address to name
  • --chain (optional): The network/chain to use (defaults to sepolia)

Supported Networks

The plugin supports the following networks:

  • Ethereum Mainnet (mainnet)
  • Sepolia Testnet (sepolia) - Default

Contract Requirements

Your contract must implement one of the following patterns:

1. Ownable Pattern

Contracts that implement the owner() function (like OpenZeppelin's Ownable):

contract MyContract {
    address public owner;
    
    function owner() public view returns (address) {
        return owner;
    }
}

2. ReverseClaimer Pattern

Contracts that have reverse ENS resolution already set up.

How It Works

  1. Subname Creation: Creates an ENS subname record if it doesn't exist
  2. Forward Resolution: Maps the ENS name to your contract address
  3. Reverse Resolution: Maps your contract address back to the ENS name
  4. Confirmation: Waits for all transactions to be confirmed before proceeding

Example Workflow

# 1. Deploy your contract
npx hardhat run scripts/deploy.ts --network sepolia

# 2. Name your contract
npx hardhat enscribe name myawesomecontract.mydomain.eth --contract 0x1234567890123456789012345678901234567890

# 3. Your contract is now discoverable at:
# https://app.enscribe.xyz/explore/11155111/myawesomecontract.mydomain.eth

Environment Setup

Required Environment Variables

For testnets like Sepolia, you'll need:

# Set your private key (use hardhat-keystore for security)
npx hardhat keystore set SEPOLIA_PRIVATE_KEY

# Or set as environment variable
export SEPOLIA_PRIVATE_KEY="your_private_key_here"

Network Configuration

Ensure your hardhat.config.ts includes the networks you want to use:

networks: {
  sepolia: {
    type: "http",
    chainType: "l1", 
    url: configVariable("SEPOLIA_RPC_URL"),
    accounts: [configVariable("SEPOLIA_PRIVATE_KEY")],
  }
}

Troubleshooting

Common Issues

"Contract does not implement required interface"

  • Ensure your contract implements either owner() function or reverse ENS resolution
  • Check that the contract address is correct and deployed

"Insufficient funds"

  • Ensure your account has enough ETH to pay for ENS transactions
  • Gas fees vary by network and ENS operation complexity

Development

Building

npm run build

Testing

# Run all tests
npm test

# Run specific test suites
npm run test:unit
npm run test:integration
npm run test:hardhat

Linting

npm run lint
npm run format

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Links

Support

For support, please open an issue on GitHub or visit app.enscribe.xyz.