IDotnsPopLens

Git Source

Title: IDotnsPopLens

Read-only view over PoP identity data, composed from the controller, the registrar, the store factory, the PoP resolver, and PopRules.

Holds no state of its own beyond the protocol registry it resolves siblings through, and takes no part in issuance. It exists so the query surface lives outside the controller, which keeps the controller within the contract-size limit. Ownership is read from the registry, which covers device-name subnames and tokenised names alike.

Note: security-contact: admin@parity.io

Functions

protocolRegistry

The protocol registry the lens resolves siblings through.

function protocolRegistry() external view returns (address registry);

Returns

NameTypeDescription
registryaddressThe protocol registry address.

namesOf

Lists the gateway-issued names currently owned by user: device names and personhood names together.

Reads the user's LabelStore labels and pending claims, keeps the ones the gateway issued, and re-checks each against the registry owner so a name transferred away drops out and a name transferred in shows under its current owner. Ordering follows the store then the pending queue. An offset past the end returns an empty array rather than reverting, and a short return means the slice ended. A gateway name transferred before it settles has its label in no store, so it cannot appear here and is reachable only by node via

Note: function: nameDetailByNode. Gas grows with the account's holdings, so call it off-chain. A page holds at most DotnsConstants.MAX_PAGE_SIZE entries, and the pending portion covers up to that many staged claims. A name is listed only when @custom:function IDotnsPopController.isPopIssued confirms the gateway minted it, so a public registration is never listed, even one spelled joseph42, and neither is a subname stored as joseph.42 outside the gateway. Among issued names the label shape tells the kinds apart: a device name carries its separator and a personhood name doesn't. Identities minted before provenance was recorded have none to confirm, so they are not listed and are re-issued through the gateway.

function namesOf(
    address user,
    uint256 offset,
    uint256 limit
)
    external
    view
    returns (Name[] memory names);

Parameters

NameTypeDescription
useraddressAccount whose names are listed.
offsetuint256Start index into the filtered sequence.
limituint256Maximum entries to return.

Returns

NameTypeDescription
namesName[]Page of the account's gateway-issued names; see @custom:struct Name.

nameCountOf

Counts the gateway-issued names currently owned by user.

Uses the same ownership-verified read as @custom:function namesOf; counting scans the account's holdings, so gas grows with them. Call it off-chain.

function nameCountOf(address user) external view returns (uint256 count);

Parameters

NameTypeDescription
useraddressAccount whose names are counted.

Returns

NameTypeDescription
countuint256Number of gateway-issued names currently owned.

nameDetail

Returns the full on-chain record for a name given its label string.

Resolves the node internally, so a caller holding only the string needs no namehash implementation. Never reverts on an unknown name: absent fields read as zero or empty. This overload can populate personhoodNode because it holds the label and so its labelhash.

function nameDetail(string calldata name) external view returns (NameDetail memory detail);

Parameters

NameTypeDescription
namestringBare label without the TLD. A device name carries its separator and resolves here too, to its stem beneath its numeric container.

Returns

NameTypeDescription
detailNameDetailThe name's record; see @custom:struct NameDetail.

nameDetailByNode

Returns the full on-chain record for a name given its node.

The node cannot be inverted to its labelhash, so personhoodNode is populated only when the label is independently resolvable from the node and reads zero otherwise; every other field is resolved directly. Never reverts on an unknown node.

function nameDetailByNode(bytes32 node) external view returns (NameDetail memory detail);

Parameters

NameTypeDescription
nodebytes32namehash of the name.

Returns

NameTypeDescription
detailNameDetailThe name's record; see @custom:struct NameDetail.

profileOf

Returns an account-level summary of a user's PoP state.

O(1) facts only; the name count is read separately via @custom:function nameCountOf because it scans the account's holdings. Never reverts.

function profileOf(address user) external view returns (PopProfile memory profile);

Parameters

NameTypeDescription
useraddressAccount being summarised.

Returns

NameTypeDescription
profilePopProfileThe account summary; see @custom:struct PopProfile.

Structs

Name

One row in a per-account name listing: the name and the node used to look it up.

Computed on read; not stored. settled is false while the name still sits in the temporary pending-claim queue and true once its label is written into a LabelStore.

struct Name {
    bytes32 node;
    string label;
    bool settled;
}

Properties

NameTypeDescription
nodebytes32namehash of the name; the key for chat-key, link, and detail lookups.
labelstringBare label without the TLD; a device name carries its separator.
settledboolWhether the label is written into a LabelStore.

NameDetail

The full on-chain record for a single name, gathered from the registry, the registrar, the PoP resolver, and PopRules in one read.

Computed on read; not stored. Never reverts on an unminted or unsettled name: absent fields read as zero or empty. requiredTier classifies the label shape (the tier the name requires), not the owner's proof. personhoodNode is looked up by the device-name labelhash, which cannot be recovered from a node alone, so it is populated by

Notes:

  • function: nameDetail and left zero by @custom:function nameDetailByNode unless the label is independently resolvable.

  • function: nameDetailByNode reads a name whose claim is unsettled.

struct NameDetail {
    bytes32 node;
    string label;
    address owner;
    bool exists;
    bool settled;
    IPopRules.PopStatus requiredTier;
    bytes chatKey;
    bytes32 deviceLabelhash;
    bytes32 personhoodNode;
}

Properties

NameTypeDescription
nodebytes32namehash of the name.
labelstringBare label without the TLD. Empty when the name has no owner, or when
owneraddressCurrent owner in the registry, or the zero address when the name has none.
existsboolWhether the name has an owner in the registry.
settledboolWhether the label is written into the current owner's LabelStore.
requiredTierIPopRules.PopStatusPopRules classification of the label. Classification needs the label, so this reads NoStatus whenever label is empty: for a name with no owner, and for an unsettled claim read through @custom:function nameDetailByNode.
chatKeybytesChat-key bytes recorded on the PoP resolver for the node.
deviceLabelhashbytes32For a personhood name, the linked device-name labelhash; zero otherwise.
personhoodNodebytes32For a device name, the linked personhood-name node; zero otherwise or when unresolvable from a node.

PopProfile

An account-level summary of PoP state, gathered in one read.

Computed on read; not stored, and never reverts. The name count is excluded because counting scans the account's holdings; read it with @custom:function nameCountOf when required. The account's proof is read separately via @custom:function IPopRules.popStatusOf, which consults the personhood precompile and so does not belong in this precompile-free summary.

struct PopProfile {
    bool hasLabelStore;
    uint256 pendingClaimCount;
    bytes32 reservationLabelhash;
}

Properties

NameTypeDescription
hasLabelStoreboolWhether the account has a deployed LabelStore.
pendingClaimCountuint256Number of claims still staged in the pending queue.
reservationLabelhashbytes32The personhood name the account holds a live reservation on, or zero when none.