IDotnsReverseResolver

Git Source

Title: Dotns Reverse Resolver

Interface for writing and reading reverse name records for addresses.

Reverse records bind to an EOA rather than a registry node. Two write paths exist: a registrar-only setter used by the controller during reserved registration, and a self-service claim path callable by the current NFT owner. Reads are fail-closed: if the stored record no longer maps to a name owned by the address, @custom:function nameOf returns the empty string.

Note: security-contact: admin@parity.io

Functions

setReverseName

Associates an address with a reverse name record.

Callable only by the configured registrar or its controller, otherwise

Note: reverts: NotRegistrarController. Overwrites any existing reverse record for addr and emits @custom:emits ReverseNameSet on every successful write.

function setReverseName(address addr, string calldata name) external;

Parameters

NameTypeDescription
addraddressThe address for which the reverse name is being set.
namestringThe human-readable name associated with the address.

claimReverseRecord

Self-service claim: associates msg.sender with <label>.dot.

The caller must currently own the NFT for label per the configured registrar, otherwise @custom:reverts NotNameOwner. Overwrites any existing record for the caller and emits @custom:emits ReverseNameSet on every successful write. Transferring the name away does not eagerly clear the record; @custom:function nameOf fails closed at read time when the stored record no longer matches current ownership.

function claimReverseRecord(string calldata label) external;

Parameters

NameTypeDescription
labelstringThe label (without .dot) the caller is claiming a reverse record for.

nameOf

Returns the reverse name for an address, fail-closed against current ownership.

Returns the empty string when no record is set, when the record is malformed, or when the address no longer owns the name pointed to by the stored record.

function nameOf(address addr) external view returns (string memory name);

Parameters

NameTypeDescription
addraddressThe address to query.

Returns

NameTypeDescription
namestringThe reverse name associated with addr, or the empty string.

Events

ReverseNameSet

Emitted when a name is associated with an address.

event ReverseNameSet(address indexed addr, string indexed name);

Parameters

NameTypeDescription
addraddressThe address for which the reverse name is being set.
namestringThe human-readable name associated with the address.

Errors

NotRegistrarController

Thrown when a caller is not authorised to modify reverse records.

error NotRegistrarController(address caller);

Parameters

NameTypeDescription
calleraddressThe address attempting the modification.

NotNameOwner

Thrown when a caller attempts to claim a reverse record for a name they do not own.

error NotNameOwner(address caller, uint256 tokenId);

Parameters

NameTypeDescription
calleraddressThe address attempting the claim.
tokenIduint256The token identifier derived from the claimed label.