Name Existing Contracts
Many smart contracts deployed on-chain lack an associated ENS name, making them harder to identify, interact with, or showcase in user interfaces. This page outlines how Enscribe enables simple naming of already deployed contracts.
Enscribe is the only DApp that supports assigning ENS names to existing smart contracts in a user-friendly way. Naming a contract manually requires interacting with multiple ENS contracts:
- The ENS Registry
- The Public Resolver
- The Reverse Registrar
This involves several steps, custom scripts, and detailed knowledge of ENS internals.
Naming an existing contract typically involves three key actions:
- Creating a subname: under a parent ENS name, e.g.,
contract.myapp.eth
- Forward resolution: pointing the ENS name to the contract address
- Reverse resolution (primary name): making the contract resolve back to the ENS name
Enscribe abstracts this entire process into a streamlined interface, calling the appropriate ENS contracts for you, step by step, ensuring a straightforward experience.
Types of Contracts and Supported Resolution
The libraries used in a smart contract impact the type of ENS naming that is possible. If certain interfaces or mixins aren’t used, it may not be possible for a contract to claim the reverse node (used for reverse resolution) for an ENS name.
Enscribe classifies contracts into two categories based on their ability to claim reverse nodes:
- Contracts that implement Ownable, ERC173, or ReverseClaimer
- All other Contracts
Contract Type | Forward Resolution | Reverse Resolution (Primary Name) |
---|---|---|
Contracts that implement Ownable, ERC173, or ReverseClaimer | Yes | Yes |
All other contracts | Yes | No |
Why Only Certain Contracts Support Reverse Resolution?
Forward Resolution
This sets an ENS name to resolve to a contract address. Anyone can set this mapping.
Reverse Resolution (Primary Name)
This maps a contract address back to an ENS name. This is more sensitive and can only be set if:
- The address owns its reverse node:
<address>.addr.reverse
- Ownership of the reverse node is proven
Example
For the contract address: 0x8948458626811dd0c23EB25Cc74291247077cC51
,
the reverse node is: 8948458626811dd0c23eb25cc74291247077cc51.addr.reverse
Only the following entities can claim the reverse node and set the primary name:
- The contract itself
- The contract’s owner (as defined by Ownable or ERC173)
- The deployer, if the contract uses the ReverseClaimer module
Contracts that do not expose ownership (i.e., are not Ownable, ERC173, or don’t use ReverseClaimer) cannot claim their reverse node and therefore cannot set a primary name.
Name Existing Contract Form
The Name Existing Contract form requires the following inputs:
- Contract Address: The address of the deployed contract to be named.
- Label Name: The subname to register under the chosen ENS parent. For example, if Label is vault and ENS Parent is myapp.eth, the full ENS name will be vault.myapp.eth.
- ENS Parent: The parent domain under which the subname will be created. There are two options:
- Enscribe-provided ENS parent: No permissions needed; transaction called on Enscribe contract
- User’s own ENS parent: All transactions are called on ENS contracts
- Option to set Primary name or just forward resolution:
- Primary Name: Only enabled if the contract implements Ownable, ERC173, or ReverseClaimer. Enscribe automatically detects the type of your contract
The number of required transactions depends on the type of ENS parent and whether you’re setting a primary name or just forward resolution:
- Enscribe provider with primary name
- Set forward resolution
- Set primary name
- Enscribe provider with forward resolution only
- Set forward resolution
- User-owned ENS parent with primary name
- Creating subname
- Set forward resolution
- Set primary name
- User-owned ENS parent with forward resolution only
- Creating subname
- Set forward resolution
The Enscribe provides feedback to the user on progress with this action.
Once completed it provides a summary modal with the contract address and ENS name.
What Happens if Transactions Fail?
If any step in the naming flow fails (e.g., due to a rejected transaction, insufficient permissions, or gas issues), the Enscribe App will:
- Automatically detect which steps have already succeeded
- Allows you to retry only the failed steps
- Provides error messaging at each failed stage
This ensures a smooth, modular process without needing to restart from the beginning.
Using Enscribe offers a streamlined platform for naming existing contracts without dealing with the complexity of individual ENS contracts.