IDotnsProtocolRegistry
Title: IDotnsProtocolRegistry
Author: Parity
Interface for the DotNS protocol-level address registry.
Single source of truth for sibling lookups. Contracts resolve each other via well-known
bytes32 constants in DotnsConstants so an upgrade or rewire only mutates the
registry, never the consumers. The registry also holds the network's top-level domain,
so every consumer reads one TLD rather than compiling its own.
Note: security-contact: admin@parity.io
Functions
get
Returns the address stored for a given key.
Returns address(0) when the key is unset; callers must validate when non-zero is
required.
function get(bytes32 key) external view returns (address addr);
set
Sets or updates the address for a given key.
Owner-restricted, otherwise @custom:reverts OwnableUnauthorizedAccount. addr
must be non-zero, otherwise @custom:reverts ZeroAddress. Idempotent when the new
value matches the stored one (no event emitted in that case). Maintains a
per-address refcount so the same contract can occupy multiple keys without losing
its registered status until every key is rewired. Emits
Note: emits: AddressUpdated on each effective change.
function set(bytes32 key, address addr) external;
remove
Clears the address stored for a given key.
Owner-restricted, otherwise @custom:reverts OwnableUnauthorizedAccount. The key must hold an address, otherwise @custom:reverts KeyNotRegistered. Decrements the removed address's refcount, so a contract still reachable under another key keeps its registered status. Exists because the registry is a discovery directory that would otherwise only ever grow: a contract retired from the protocol, or one published for lookup that should no longer be listed, has no other way out. Emits
Note: emits: AddressRemoved.
function remove(bytes32 key) external;
isRegisteredAddress
Returns true iff addr is currently registered under at least one well-known key.
O(1) refcount-backed lookup answering discovery, not authority: it reports that
governance listed an address, not that the address may act. Store writes and
StoreFactory deploys are gated on the specific components in
Note:
function: StoreAuth.isStoreWriter, not on this, precisely so that listing a
contract for discovery does not confer write authority. Treats address(0) as never
registered regardless of refcount.
function isRegisteredAddress(address addr) external view returns (bool registered);
tldNode
Returns the namehash of the network's TLD node.
namehash(0, keccak256(bytes(tldLabel))), fixed at initialisation. Consumers use it
as the root parent when deriving a name's node.
function tldNode() external view returns (bytes32 node);
tld
Returns the network's TLD suffix, including the leading dot (e.g. .dot).
Fixed at initialisation. Consumers append it when rendering a label as a full name.
function tld() external view returns (string memory suffix);
Events
AddressUpdated
Emitted when a protocol address is set or updated.
event AddressUpdated(bytes32 indexed key, address indexed addr);
AddressRemoved
Emitted when a key is cleared from the registry.
event AddressRemoved(bytes32 indexed key, address indexed addr);
Errors
ZeroAddress
Thrown when a zero address is provided where one is not allowed.
error ZeroAddress();
KeyNotRegistered
Thrown when clearing a key that holds no address.
error KeyNotRegistered();
InvalidTld
Thrown when the TLD label supplied at initialisation is not a single DNS label.
error InvalidTld();