ENS best practices

Contract naming

Name your smart contracts

Upgrade security and UX when users interact with your smart contracts.

Category

Contract naming

Applies to

Protocols

Powered by

ENS Contract Naming Season

Elevate your protocol’s onchain identity by naming your smart contracts.

ENS best practice overview

Contracts should be assigned ENS names during or after deployment. For deployment-time naming, see the Enscribe documentation which goes into greater detail on the process. For post-deployment naming we recommend using the Enscribe App. Note that setting a primary name (reverse resolution) requires the contract to implement Ownable. Contracts without Ownable can still have forward resolution configured (name → address) but cannot set a reverse record (address → name).

Benefit from using ENS

The users of your protocol can easily verify they're interacting with the correct contracts, improving security and user confidence.

Acceptance Test 1

When the contract's ENS name or address is looked up in the Enscribe App the result should display the contract's name with an appropriate icon.

Example test resultPassed

Below you can see the verification on the Enscribe App how Nouns DAO has named one of its smart contracts.

enscribe-lookup acceptance test

This is the first (but vital) step in ensuring users can easily identify the contract.

Implementation recommendations

Assigning ENS names to contracts gives users confidence they're interacting with the correct contract. This is particularly valuable for security, as users can confirm uniswap.eth instead of validating a long hexadecimal address. If you've deployed contracts without Ownable, you can still improve UX by configuring forward resolution, though full naming (with reverse resolution) provides the best user experience.

Contributors

All ENS best practices on ENSAwards are open for public contribution.

DAO Leaderboard

DeFi Leaderboard

Founded in 2022, Namehash Labs is dedicated to developing open source infrastructure that helps the Ethereum Name Service (ENS) Protocol grow.

© NameHash Labs. All Rights Reserved

Made with❤️byNameHash Labs