DotnsPopResolver
Inherits: Initializable, UUPSUpgradeable, OwnableUpgradeable, ERC165Upgradeable, IDotnsPopResolver
Title: DotnsPopResolver
Per-node resolver holding records produced by the PoP username flow.
Writes are gated on the protocol-registered POP_CONTROLLER rather
than on node ownership. PoP records are issued by the gateway as part
of identity issuance, not curated by the holder, so authority lives
with the controller and not the user.
Note: security-contact: admin@parity.io
State Variables
protocolRegistry
Protocol-level address registry used to resolve the authorised writer.
IDotnsProtocolRegistry public protocolRegistry
_chatKeys
Stored chat-key bytes keyed by node.
mapping(bytes32 node => bytes chatKey) private _chatKeys
_liteLinks
Stored lite-person labelhash keyed by full-person node.
Forward direction (full => lite): maps a full-person node to the labelhash of the lite username it was claimed from.
mapping(bytes32 fullNode => bytes32 liteLabelhash) private _liteLinks
_fullClaims
Reverse index mapping a lite labelhash to the full-person node it was promoted to.
Written alongside _liteLinks on every claim so consumers that look
up by lite username resolve the full name without scanning events.
Zero when the lite label has never been linked to a full claim.
mapping(bytes32 liteLabelhash => bytes32 fullNode) private _fullClaims
__gap
Reserved storage space to allow for layout changes in the future.
uint256[50] private __gap
Functions
onlyPopController
Restricts writes to the address registered as POP_CONTROLLER.
modifier onlyPopController() ;
constructor
Note: oz-upgrades-unsafe-allow: constructor
constructor() ;
initialize
Initialises the PoP resolver.
Called once through the UUPS proxy; _disableInitializers on the implementation
makes direct calls revert and any repeat call on the proxy reverts with
Note:
reverts: InvalidInitialization. The registry pointer is the only storage this
setup needs because the authorised writer is resolved dynamically through
POP_CONTROLLER. Emits @custom:emits OwnershipTransferred when msg.sender is
recorded as the initial owner and @custom:emits Initialized once setup completes.
function initialize(IDotnsProtocolRegistry registry) external initializer;
Parameters
| Name | Type | Description |
|---|---|---|
registry | IDotnsProtocolRegistry | Protocol-level address registry used for writer resolution. |
setChatKey
Sets the chat key for node.
Callable only by the address registered under DotnsProtocolRegistry.POP_CONTROLLER,
otherwise @custom:reverts NotPopController. Overwrites any previous value. The payload
must be exactly 65 bytes: the uncompressed secp256k1 public key encoding (1 prefix
byte followed by the 32-byte X and 32-byte Y affine coordinates); any other length
reverts with @custom:reverts InvalidChatKeyLength. Emits @custom:emits ChatKeyUpdated
on every successful write.
function setChatKey(
bytes32 node,
bytes calldata chatKeyBytes
)
external
override
onlyPopController;
Parameters
| Name | Type | Description |
|---|---|---|
node | bytes32 | The node whose chat key is being written. |
chatKeyBytes | bytes |
setLiteLink
Sets the lite-person link for a full-person node.
Callable only by the authorised PoP controller, otherwise
Notes:
-
reverts: NotPopController. Overwrites any previous link. When overwriting, the stale inverse entry is nulled so both the forward (
liteLink) and reverse (fullClaim) indices remain consistent: re-linking the samefullNodeto a newliteLabelhashclearsfullClaim(oldLite), and re-linking the sameliteLabelhashto a newfullNodeclearsliteLink(oldFull). The invariantfullClaim(liteLink(node)) == nodealways holds after the call. Emits -
emits: LiteLinkUpdated on every successful write.
function setLiteLink(
bytes32 fullNode,
bytes32 liteLabelhash
)
external
override
onlyPopController;
Parameters
| Name | Type | Description |
|---|---|---|
fullNode | bytes32 | The full-person node carrying the link. |
liteLabelhash | bytes32 | The labelhash of the linked lite-person username. |
chatKey
Returns the chat key associated with a node.
function chatKey(bytes32 node) external view override returns (bytes memory);
Parameters
| Name | Type | Description |
|---|---|---|
node | bytes32 | The node to query. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bytes | chatKey The stored chat key bytes, or empty if unset. |
liteLink
Returns the lite-person labelhash linked to a full-person node.
function liteLink(bytes32 fullNode) external view override returns (bytes32);
Parameters
| Name | Type | Description |
|---|---|---|
fullNode | bytes32 | The full-person node to query. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bytes32 | liteLabelhash The linked lite-person labelhash, or zero if unset. |
fullClaim
Returns the full-person node a given lite label has claimed.
Reverse of @custom:function liteLink. Written by the same setLiteLink call so the
two directions stay in lockstep. Returns zero when the lite label
has never been linked to a full claim.
function fullClaim(bytes32 liteLabelhash) external view override returns (bytes32);
Parameters
| Name | Type | Description |
|---|---|---|
liteLabelhash | bytes32 | The labelhash of the lite-person username to query. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bytes32 | fullNode The full-person node claimed from this lite label, or zero if unset. |
version
Returns implementation version.
Bumped on every upgrade. Used by deployment scripts as a post-upgrade assertion target.
function version() external pure virtual returns (string memory versionString);
Returns
| Name | Type | Description |
|---|---|---|
versionString | string | Current version string. |
supportsInterface
function supportsInterface(bytes4 interfaceId) public view override returns (bool);
_onlyPopController
Internal check enforcing PoP-controller-only access.
function _onlyPopController() internal view;
_authorizeUpgrade
Function that should revert when msg.sender is not authorized to upgrade the contract.
Called by
{upgradeToAndCall}.
Normally, this function will use an xref:access.adoc[access control] modifier such as
{Ownable-onlyOwner}.
function _authorizeUpgrade(address) internal onlyOwner {}
function _authorizeUpgrade(address newImplementation) internal override onlyOwner;