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 and keeps ownership on the registrar.

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.

liteNamesOf

Lists the lite-person names currently owned by user.

Reads the user's LabelStore labels and pending claims, keeps the lite-person shaped ones, and re-checks each against registrar.ownerOf 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 @custom: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.

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

Parameters

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

Returns

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

fullNamesOf

Lists the full-person names currently owned by user.

Same ownership-verified read as @custom:function liteNamesOf, keeping base-shaped labels instead of lite-shaped ones.

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

Parameters

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

Returns

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

liteNameCountOf

Counts the lite-person names currently owned by user.

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

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

Parameters

NameTypeDescription
useraddressAccount whose lite names are counted.

Returns

NameTypeDescription
countuint256Number of lite names currently owned.

fullNameCountOf

Counts the full-person names currently owned by user.

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

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

Parameters

NameTypeDescription
useraddressAccount whose full names are counted.

Returns

NameTypeDescription
countuint256Number of full 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 fullClaim because it holds the label and so its labelhash.

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

Parameters

NameTypeDescription
namestringBare DNS label (no TLD).

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 fullClaim 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; lite and full name counts are read separately via

Note: function: liteNameCountOf and @custom:function fullNameCountOf because those scan 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. deadline is the pending settlement deadline (mintedAt + reservationDuration) and is zero for a settled name.

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

Properties

NameTypeDescription
nodebytes32namehash of the name; the key for chat-key, link, and detail lookups.
labelstringFull name string.
settledboolWhether the label is written into a LabelStore.
deadlineuint64Pending settlement deadline, or zero when settled.

NameDetail

The full on-chain record for a single name, gathered from 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. tier classifies the label shape (the tier the name requires), not the owner's personhood. fullClaim is keyed by the lite labelhash, which cannot be recovered from a node alone, so it is populated by @custom:function nameDetail and left zero by @custom:function nameDetailByNode unless the label is independently resolvable.

struct NameDetail {
    bytes32 node;
    string label;
    address owner;
    bool exists;
    bool settled;
    IPopRules.PopStatus tier;
    bytes chatKey;
    bytes32 liteLink;
    bytes32 fullClaim;
}

Properties

NameTypeDescription
nodebytes32namehash of the name.
labelstringFull name string, or empty when the name is unminted or its claim is unsettled.
owneraddressCurrent registrar owner, or the zero address when the name does not exist.
existsboolWhether the name is minted.
settledboolWhether the label is written into the current owner's LabelStore.
tierIPopRules.PopStatusPopRules classification of the label.
chatKeybytesChat-key bytes recorded on the PoP resolver for the node.
liteLinkbytes32For a full name, the linked lite labelhash; zero otherwise.
fullClaimbytes32For a lite name, the promoted full 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. Name counts are excluded because counting scans the account's holdings; read them with @custom:function liteNameCountOf and

Note: function: fullNameCountOf when required. The account's personhood tier is read separately via @custom:function IPopRules.personhoodOf, 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 base label the account holds a live reservation on, or zero when none.