ENS best practices

Contract naming

Display named smart contracts on Ethereum mainnet

Display ENS names instead of addresses when users interact with named smart contracts on Ethereum mainnet.

Category

Contract naming

Applies to

Apps

App support

75%

ENS best practice overview

If a contract has an ENS name, you can use its ENS profile to power additional UX improvements such as avatars, metadata, audit information, and more. More information can be found at the ENSIP Proposal.

Benefit from using ENS

Users can easily identify and interact with named smart contracts on Ethereum mainnet, improving security and user experience.

Acceptance Test 1

When users interact with named smart contracts on Ethereum mainnet the app should display the contract's name as its primary identifier.

Example test resultPassed

Below you can see how WalletChan displays the name of the contract it interacts with in addition to its address.

WalletChan displaying a smart contract ENS name next to its address during interaction

That allows the user to easily identify the contract.

Implementation recommendations

Looking up the name of a smart contract on Ethereum mainnet uses the same process as looking up the name of any other account. There are a variety of libraries capable of looking up the primary name of a contract address according to all ENS best practices:



Libraries and tools for additional languages or frameworks can be found in the ENS documentation.

Contributors

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

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