Crypto Name Service (CNS) is built on Ethereum and is effectively a bundle of Solidity smart contracts. Their source code is hosted in the dot-crypto repository and maintained by the Unstoppable Domains team. This page lists the smart contracts from that repository and gives a brief description of each along with links to the source code and deployment addresses. For high-level details about how CNS works, see Architecture overview.
This page is divided into sections, grouping contracts by the following categories:
​User-facing contracts​
​Registry controllers​
​Interfaces​
​Utility contracts​
​Test smart contracts​
This section lists all the smart contracts that users can directly interact with.
Registry
is the central smart contract, which stores all CNS domains. Implementing the ERC-721 non-fungible token standard, Registry
defines domain ownership rules. It stores owner and Resolver
addresses. For more details, see Architecture overview - Registry.
Network | Contract address |
Mainnet | |
Rinkeby |
Source code: contracts/Registry.sol​
Resolver
is the smart contract that stores domain records and provides methods for domain resolution. For more details, see Architecture overview - Resolver.
Network | Contract address |
Mainnet | |
Rinkeby |
Network | Legacy addresses |
Mainnet | ​0xa1cac442be6673c49f8e74ffc7c4fd746f3cbd0d 0x878bc2f3f717766ab69c0a5f9a6144931e61aed3​ |
Source code: contracts/Resolver.sol​
ProxyReader
provides an interface that allows users to fetch information about domains from both Registry
and Resolver
smart contracts in one call. For more details, see Architecture overview - ProxyReader.
Network | Contract address |
Mainnet | |
Rinkeby |
Network | Legacy addresses |
Mainnet |
Source code: contracts/ProxyReader.sol​
SignatureController
allows any account to submit management transactions on behalf of a token owner if an owner provides a signature for that call.
Network | Contract address |
Mainnet | |
Rinkeby |
Source code: contracts/controllers/SignatureController.sol​
DomainZoneController
allows owners of a domain zone to mint subdomains. These subdomains can be managed only by the domain zone owners. For more details, see Architecture Overview - Alternative Ownership Models.
Network | Contract address |
Mainnet | |
Rinkeby |
Source code: contracts/controllers/DomainZoneController.sol​
FreeMinter
is a contract that can be used for allowing any user to freely mint a test domain with udtestdev-
prefix.
Source code: contracts/controllers/FreeMinter.sol​
Network | Contract address |
Mainnet | |
Rinkeby |
WhitelistedMinter
defines an interface for minting second-level domains. This smart contract is primarily used by the Unstoppable Domains team, but its interface also supports delegating minting process to other parties via Meta Transactions. All calls to WhitelistedMinter
are proxied to the Registry
via the MintingController smart contract.
Network | Contract address |
Mainnet | |
Rinkeby |
Source code: contracts/util/WhitelistedMinter.sol​
TwitterValidationOperator
is used when initiating Chainlink verification requests to link domain records with Twitter usernames.
Network | Contract address |
Mainnet | |
Rinkeby |
Source code: contracts/operators/TwitterValidationOperator.sol​
The Unstoppable Domains team reserves the right to mint second-level domains and edit some Registry
settings, such as token URI prefix. To avoid giving anyone absolute admin rights, Registry
utilizes controllers that implement a limited set of admin actions.
The deployed version of the Registry
smart contract only allows MintingController
to mint second-level domains. This smart contract is used by WhitelistedMinter as a proxy.
Network | Contract address |
Mainnet | |
Rinkeby |
Source code: contracts/controllers/MintingController.sol​
URIPrefixController
enables the Unstoppable Domains team to edit the token URI prefix.
Network | Contract address |
Mainnet | |
Rinkeby |
Source code: contracts/controllers/URIPrefixController.sol​
The following interfaces can be used as guidelines for the minimal implementation of custom smart contract versions. Also, Solidity developers can rely on them for making calls to the official CNS smart contracts.
The IRegistry
interface declares all the Registry
events and methods (both read and write).
Source code: contracts/IRegistry.sol​
Implemented by:
​Registry​
The IRegistryReader
interface declares only read-only Registry
methods.
Source code: contracts/IRegistryReader.sol​
Implemented by:
​Registry​
​ProxyReader​
The IResolver
interface declares the minimal set of Resolver
methods for configuring domain records.
Source code: contracts/IResolver.sol​
Implemented by:
​Resolver​
The IResolverReader
interface declares the set of methods for reading Resolver
records.
Source code: contracts/IResolverReader.sol​
Implemented by:
​Resolver​
​ProxyReader​
The IDataReader
interface declares the methods that are unique to the ProxyReader
smart contract, which returns combined data from the Registry
and Resolver
contracts.
Source code: contracts/IDataReader.sol​
Implemented by:
​ProxyReader​
The IMintingController
interface declares a set of methods for minting, which both MintingController
and WhitelistedMinter
implement.
Source code: contracts/controllers/IMintingController.sol​
Implemented by:
​MintingController​
​WhitelistedMinter​
The ISignatureController
interface declares the functions that are implemented by SignatureController
to enable Meta transactions for the Registry
smart contract.
Source code: contracts/controllers/ISignatureController.sol​
Implemented by:
​SignatureController​
The IURIPrefixController
interface declares the functions that are implemented by URIPrefixController
.
Source code: contracts/controllers/IURIPrefixController.sol​
Implemented by:
​URIPrefixController​
The ERC677Receiver
interface declares an ERC-677 method for receiving smart contracts.
Source code: contracts/util/ERC677Receiver.sol​
Implemented by:
Utility contracts are generally used to share common functionality between other smart contracts. This list also includes some contracts that are used internally by the Unstoppable Domains team.
BulkWhitelistedRole
is an extension of Open Zeppelin's WhitelistedRole
that adds bulk operations for adding and removing whitelisted accounts.
Source code: contracts/util/BulkWhitelistedRole.sol​
Used by:
​WhitelistedMinter​
The ControllerRole
smart contract defines an Open Zeppelin Role, which is used by Registry
to designate controllers.
Source code: contracts/util/ControllerRole.sol​
Used by:
​Registry​
The MultiSend
smart contract is used internally by the Unstoppable Domains team to fund worker accounts.
Source code: contracts/util/MultiSend.sol​
SignatureUtil
is a helper smart contract. Its implementation is used to extend smart contracts that require Meta Transactions.
Source code: contracts/util/SignatureUtil.sol​
Used by:
​Resolver​
​SignatureController​
The Truffle migrations smart contract.
Source code: contracts/Migrations.sol​
There are several smart contracts that are used for testing purposes without being deployed to public networks or imported by other smart contracts.
The LinkTokenMock
smart contract is used for testing TwitterValidationOperator.
Source code: contracts/test-helpers/LinkTokenMock.sol​
RelayTest
is used for testing relaying functionality for Meta Transactions.
Source code: contracts/test-helpers/RelayTest.sol​
The Simple
smart contract is used for testing ERC-721 receiver validation checks.
Source code: contracts/test-helpers/Simple.sol​