IDotnsNameWhitelist
Title: IDotnsNameWhitelist
Interface for the pre-launch name whitelist. A name is Open until governance either reserves it or a claim is accepted for it. Several beneficiaries may claim the same Open name, each with a reason, and governance accepts one as the winner.
Callers never supply a hash. Every entry point takes the bare label and derives the node
from the label and the TLD in the protocol registry, so a caller cannot supply a
mismatched hash. Claims are keyed by the beneficiary user, not the submitter, so a
relayer or a cross-chain sovereign account can submit a claim on a user's behalf and the
name still binds to that user. All state is on-chain and queryable through views; no event
indexing is required. Governance is Root or the owner. Substrate Root has no address, so
the governance gates check originIsRoot before reading msg.sender. Operators are signed
role holders for day-to-day approvals; the controllers hold only the consume hook.
Note: security-contact: admin@parity.io
Functions
requestName
Claims label for user.
Permissionless within the window; the submitter may differ from user. Requires the
name Open, the window open, user non-zero, a canonical label, user without an
existing claim, and fewer than maxClaimants claims on the name.
Notes:
-
reverts: WindowClosed, @custom:reverts NameNotOpen, @custom:reverts ZeroUser,
-
reverts: InvalidLabel, @custom:reverts ReasonTooLong,
-
reverts: AlreadyClaimed, or @custom:reverts TooManyClaimants.
-
emits: NameRequested.
function requestName(string calldata label, string calldata reason, address user) external;
Parameters
| Name | Type | Description |
|---|---|---|
label | string | Bare label to claim. |
reason | string | Free-text justification, at most maxReasonBytes bytes. |
user | address | Beneficiary the name binds to if this claim wins. |
accept
Accepts user's claim as the winner of label.
Restricted to an operator, the owner, or Root. Requires user's claim Requested.
Sets the name Claimed with user the winner and clears every claim on the name, rejecting
the losers. @custom:reverts NotRequested. @custom:emits NameAccepted for the winner and
Note: emits: NameRejected for each loser.
function accept(string calldata label, address user) external;
Parameters
| Name | Type | Description |
|---|---|---|
label | string | Bare label to resolve. |
user | address | Beneficiary whose claim wins. |
reject
Rejects user's pending claim on label without resolving the name.
Restricted to an operator, the owner, or Root. Requires the claim Requested.
Note: reverts: NotRequested. @custom:emits NameRejected.
function reject(string calldata label, address user) external;
Parameters
| Name | Type | Description |
|---|---|---|
label | string | Bare label. |
user | address | Beneficiary whose claim is rejected. |
grantName
Grants label to user directly, without a prior claim.
Restricted to an operator, the owner, or Root. Requires the name Open, user non-zero
and a canonical label. Sets the name Claimed with user the winner and clears any pending
claims. @custom:reverts NameNotOpen, @custom:reverts ZeroUser or
Notes:
-
reverts: InvalidLabel. @custom:emits NameAccepted, and
-
emits: NameRejected for each cleared claim.
function grantName(string calldata label, address user) external;
Parameters
| Name | Type | Description |
|---|---|---|
label | string | Bare label to grant. |
user | address | Beneficiary the name binds to. |
grantNames
Grants several labels to one user directly.
Restricted to an operator, the owner, or Root. Applies @custom:function grantName to
each, at most maxGrantBatch labels per call.
Note:
reverts: TooManyLabels when labels exceeds the batch cap.
function grantNames(string[] calldata labels, address user) external;
Parameters
| Name | Type | Description |
|---|---|---|
labels | string[] | Bare labels to grant. |
user | address | Beneficiary each name binds to. |
revokeName
Resets label to Open, clearing any winner and claims.
Restricted to an operator, the owner, or Root. Resolves a Claimed or claim-holding name; a Reserved name is released through @custom:function setReserved, not here.
Notes:
-
reverts: NothingToRevoke when the name is not Claimed and holds no claims.
-
emits: NameRevoked, and @custom:emits NameRejected for each cleared claim.
function revokeName(string calldata label) external;
Parameters
| Name | Type | Description |
|---|---|---|
label | string | Bare label to reset. |
setReserved
Reserves or releases label.
Restricted to Root or the owner. Reserving requires the name Open and clears any
pending claims, rejecting each; releasing requires it Reserved. @custom:reverts
NameNotOpen or @custom:reverts NotReserved. @custom:emits NameReserved or @custom:emits
NameUnreserved. @param label Bare label.
function setReserved(string calldata label, bool reserved) external;
Parameters
| Name | Type | Description |
|---|---|---|
label | string | |
reserved | bool | True to reserve, false to release. |
consume
Removes the win on label as registrant registers it.
Restricted to the registrar controllers resolved through the protocol registry. Resets the name to Open. @custom:reverts NotController for any other caller and
Notes:
-
reverts: NotWinner when
labelis not won byregistrant. -
emits: NameConsumed.
function consume(string calldata label, address registrant) external;
Parameters
| Name | Type | Description |
|---|---|---|
label | string | Bare label being registered. |
registrant | address | Address registering the name. |
setWindow
Sets the request window relative to the current time.
Restricted to Root or the owner. Opens at block.timestamp + startsIn for duration.
Note:
reverts: BadWindow when duration is zero. @custom:emits WindowSet.
function setWindow(uint64 startsIn, uint64 duration) external;
Parameters
| Name | Type | Description |
|---|---|---|
startsIn | uint64 | Seconds from now until requests start being accepted. |
duration | uint64 | Seconds the window stays open. |
setOperator
Grants or revokes the operator role for account.
Restricted to Root or the owner. Root has no address, so governance uses this rather than the owner-only role-admin path. @custom:emits IAccessControl.RoleGranted on grant and @custom:emits IAccessControl.RoleRevoked on revoke.
function setOperator(address account, bool enabled) external;
Parameters
| Name | Type | Description |
|---|---|---|
account | address | Address whose operator role is changed. |
enabled | bool | True to grant, false to revoke. |
setMaxClaimants
Sets the live-claim cap per name.
Restricted to Root or the owner. The cap is bounded by
DotnsConstants.WHITELIST_MAX_CLAIMANTS_LIMIT, which bounds the resolution clear-loop.
Notes:
-
reverts: MaxClaimantsOutOfRange when
newMaxis zero or above the ceiling. -
emits: MaxClaimantsSet.
function setMaxClaimants(uint16 newMax) external;
Parameters
| Name | Type | Description |
|---|---|---|
newMax | uint16 | New per-name claim cap. |
setMaxReasonBytes
Sets the reason byte cap.
Restricted to Root or the owner, bounded by
DotnsConstants.WHITELIST_MAX_REASON_LIMIT. @custom:reverts MaxReasonBytesOutOfRange when
newMax is zero or above the ceiling. @custom:emits MaxReasonBytesSet.
function setMaxReasonBytes(uint256 newMax) external;
Parameters
| Name | Type | Description |
|---|---|---|
newMax | uint256 | New reason byte cap. |
setMaxGrantBatch
Sets the cap on labels per grantNames call.
Restricted to Root or the owner, bounded by
DotnsConstants.WHITELIST_MAX_GRANT_BATCH_LIMIT. @custom:reverts MaxGrantBatchOutOfRange
when newMax is zero or above the ceiling. @custom:emits MaxGrantBatchSet.
function setMaxGrantBatch(uint16 newMax) external;
Parameters
| Name | Type | Description |
|---|---|---|
newMax | uint16 | New batch cap. |
maxClaimants
Returns the live-claim cap per name.
function maxClaimants() external view returns (uint16 cap);
Returns
| Name | Type | Description |
|---|---|---|
cap | uint16 | Current per-name claim cap. |
maxReasonBytes
Returns the reason byte cap.
function maxReasonBytes() external view returns (uint256 cap);
Returns
| Name | Type | Description |
|---|---|---|
cap | uint256 | Current reason byte cap. |
maxGrantBatch
Returns the cap on labels per grantNames call.
function maxGrantBatch() external view returns (uint16 cap);
Returns
| Name | Type | Description |
|---|---|---|
cap | uint16 | Current batch cap. |
statusOf
Returns the status of label.
function statusOf(string calldata label) external view returns (NameStatus status);
Parameters
| Name | Type | Description |
|---|---|---|
label | string | Bare label to look up. |
Returns
| Name | Type | Description |
|---|---|---|
status | NameStatus | Name status; see NameStatus. |
isReserved
Returns whether label is reserved.
function isReserved(string calldata label) external view returns (bool reserved);
Parameters
| Name | Type | Description |
|---|---|---|
label | string | Bare label to look up. |
Returns
| Name | Type | Description |
|---|---|---|
reserved | bool | True when the name is Reserved. |
granteeOf
Returns the winner of label, or the zero address when not Claimed.
function granteeOf(string calldata label) external view returns (address winner);
Parameters
| Name | Type | Description |
|---|---|---|
label | string | Bare label to look up. |
Returns
| Name | Type | Description |
|---|---|---|
winner | address | Winning beneficiary. |
isGrantedTo
Returns whether account won label.
The pair check the controllers use to admit a registrant. False for the zero address.
function isGrantedTo(
string calldata label,
address account
)
external
view
returns (bool granted);
Parameters
| Name | Type | Description |
|---|---|---|
label | string | Bare label to look up. |
account | address | Address to test against the winner. |
Returns
| Name | Type | Description |
|---|---|---|
granted | bool | True when account is the winner. |
claimOf
Returns user's claim on label.
function claimOf(string calldata label, address user) external view returns (Claim memory claim);
Parameters
| Name | Type | Description |
|---|---|---|
label | string | Bare label to look up. |
user | address | Beneficiary to look up. |
Returns
| Name | Type | Description |
|---|---|---|
claim | Claim | The stored claim; a zeroed struct with None status when absent. |
claimantCount
Returns the number of live claims on label.
function claimantCount(string calldata label) external view returns (uint256 count);
Parameters
| Name | Type | Description |
|---|---|---|
label | string | Bare label to look up. |
Returns
| Name | Type | Description |
|---|---|---|
count | uint256 | Live claim count. |
claims
Returns a page of claims on label for review.
Reads the canonical offset and limit window.
function claims(
string calldata label,
uint256 offset,
uint256 limit
)
external
view
returns (Claim[] memory page);
Parameters
| Name | Type | Description |
|---|---|---|
label | string | Bare label to look up. |
offset | uint256 | Index of the first claim. |
limit | uint256 | Maximum number of claims to return. |
Returns
| Name | Type | Description |
|---|---|---|
page | Claim[] | Claims in the window. |
nameCount
Returns the number of names with reserved, claimed or claim-holding state.
function nameCount() external view returns (uint256 count);
Returns
| Name | Type | Description |
|---|---|---|
count | uint256 | Active name count. |
names
Returns a page of active names for review.
Reads the canonical offset and limit window. Iteration order is not stable.
function names(uint256 offset, uint256 limit) external view returns (NameView[] memory page);
Parameters
| Name | Type | Description |
|---|---|---|
offset | uint256 | Index of the first name. |
limit | uint256 | Maximum number of names to return. |
Returns
| Name | Type | Description |
|---|---|---|
page | NameView[] | Names in the window. |
window
Returns the request window.
function window() external view returns (uint64 openAt, uint64 closeAt);
Returns
| Name | Type | Description |
|---|---|---|
openAt | uint64 | Timestamp requests start being accepted. |
closeAt | uint64 | Timestamp requests stop being accepted. |
isWindowOpen
Returns whether requests are currently accepted.
function isWindowOpen() external view returns (bool open);
Returns
| Name | Type | Description |
|---|---|---|
open | bool | True when the current time is within the window. |
Events
NameRequested
Emitted when a beneficiary claims a name.
event NameRequested(bytes32 indexed node, address indexed user, string label, string reason);
NameAccepted
Emitted when a claim wins a name, including an operator direct grant.
event NameAccepted(bytes32 indexed node, address indexed user, string label);
NameRejected
Emitted when a claim is cleared without winning.
event NameRejected(bytes32 indexed node, address indexed user, string label);
NameRevoked
Emitted when a name is reset to Open by governance.
event NameRevoked(bytes32 indexed node, address indexed winner, string label);
NameConsumed
Emitted when a winner registers the name and its entry is consumed.
event NameConsumed(bytes32 indexed node, address indexed user, string label);
NameReserved
Emitted when governance withholds a name from claiming.
event NameReserved(bytes32 indexed node, string label);
NameUnreserved
Emitted when governance releases a reserved name back to Open.
event NameUnreserved(bytes32 indexed node, string label);
WindowSet
Emitted when the request window is set.
event WindowSet(uint64 openAt, uint64 closeAt);
Parameters
| Name | Type | Description |
|---|---|---|
openAt | uint64 | Timestamp requests start being accepted. |
closeAt | uint64 | Timestamp requests stop being accepted. |
MaxClaimantsSet
Emitted when the live-claim cap is set.
event MaxClaimantsSet(uint16 maxClaimants);
Parameters
| Name | Type | Description |
|---|---|---|
maxClaimants | uint16 | New per-name claim cap. |
MaxReasonBytesSet
Emitted when the reason byte cap is set.
event MaxReasonBytesSet(uint256 maxReasonBytes);
Parameters
| Name | Type | Description |
|---|---|---|
maxReasonBytes | uint256 | New reason byte cap. |
MaxGrantBatchSet
Emitted when the grant-batch cap is set.
event MaxGrantBatchSet(uint16 maxGrantBatch);
Parameters
| Name | Type | Description |
|---|---|---|
maxGrantBatch | uint16 | New grantNames batch cap. |
Errors
ZeroUser
Thrown when a claim names the zero-address beneficiary.
error ZeroUser();
InvalidLabel
Thrown when a label is not a canonical single DNS label.
error InvalidLabel();
ReasonTooLong
Thrown when a reason exceeds maxReasonBytes.
error ReasonTooLong();
NameNotOpen
Thrown when a name is not Open and the action requires it.
error NameNotOpen(bytes32 node);
Parameters
| Name | Type | Description |
|---|---|---|
node | bytes32 | Namehash of the label under the active TLD. |
AlreadyClaimed
Thrown when user already holds a claim on the name.
error AlreadyClaimed(bytes32 node, address user);
Parameters
| Name | Type | Description |
|---|---|---|
node | bytes32 | Namehash of the label under the active TLD. |
user | address | Beneficiary already holding a claim. |
TooManyClaimants
Thrown when a name already holds maxClaimants claims.
error TooManyClaimants(bytes32 node);
Parameters
| Name | Type | Description |
|---|---|---|
node | bytes32 | Namehash of the label under the active TLD. |
MaxClaimantsOutOfRange
Thrown when the claim cap is set to zero or above
DotnsConstants.WHITELIST_MAX_CLAIMANTS_LIMIT.
error MaxClaimantsOutOfRange();
MaxReasonBytesOutOfRange
Thrown when the reason cap is set to zero or above
DotnsConstants.WHITELIST_MAX_REASON_LIMIT.
error MaxReasonBytesOutOfRange();
MaxGrantBatchOutOfRange
Thrown when the grant-batch cap is set to zero or above
DotnsConstants.WHITELIST_MAX_GRANT_BATCH_LIMIT.
error MaxGrantBatchOutOfRange();
NotRequested
Thrown when a claim is not in the Requested status.
error NotRequested(bytes32 node, address user);
Parameters
| Name | Type | Description |
|---|---|---|
node | bytes32 | Namehash of the label under the active TLD. |
user | address | Beneficiary whose claim was expected to be pending. |
NotReserved
Thrown when releasing a name that is not reserved.
error NotReserved(bytes32 node);
Parameters
| Name | Type | Description |
|---|---|---|
node | bytes32 | Namehash of the label under the active TLD. |
NothingToRevoke
Thrown when revoking a name that is not Claimed and holds no claims.
error NothingToRevoke(bytes32 node);
Parameters
| Name | Type | Description |
|---|---|---|
node | bytes32 | Namehash of the label under the active TLD. |
NotController
Thrown when consume is called by any address other than a registrar controller.
error NotController(address caller);
Parameters
| Name | Type | Description |
|---|---|---|
caller | address | Rejected caller. |
NotWinner
Thrown when consume is called for a name not won by the registrant.
error NotWinner(address registrant, bytes32 node);
Parameters
| Name | Type | Description |
|---|---|---|
registrant | address | Address attempting to register the name. |
node | bytes32 | Namehash of the label under the active TLD. |
BadWindow
Thrown when the request window is set with a zero duration.
error BadWindow();
WindowClosed
Thrown when a claim is made outside the open window.
error WindowClosed();
TooManyLabels
Thrown when grantNames is passed more than maxGrantBatch labels.
error TooManyLabels();
Structs
Claim
A claim by one beneficiary on one name.
user, status and requestedAt co-locate in one storage slot; submitter takes the
next, and the dynamic reason is stored separately.
struct Claim {
address user;
ClaimStatus status;
uint64 requestedAt;
address submitter;
string reason;
}
Properties
| Name | Type | Description |
|---|---|---|
user | address | Beneficiary the name would bind to if this claim wins. |
status | ClaimStatus | Claim status; see ClaimStatus. |
requestedAt | uint64 | Timestamp the claim was made. |
submitter | address | Address that filed the claim, which may differ from the beneficiary. |
reason | string | Free-text justification for the claim. |
NameView
A name and its resolved state, for review.
struct NameView {
bytes32 node;
string label;
NameStatus status;
address winner;
}
Properties
| Name | Type | Description |
|---|---|---|
node | bytes32 | Namehash of the label under the active TLD. |
label | string | Bare label. |
status | NameStatus | Name status; see NameStatus. |
winner | address | Winning beneficiary when Claimed, otherwise the zero address. |
NameRecord
Stored resolved state of a name.
status and winner are ordered first so the 1-byte enum and 20-byte address share
one storage slot; the dynamic label is stored separately.
struct NameRecord {
NameStatus status;
address winner;
string label;
}
Properties
| Name | Type | Description |
|---|---|---|
status | NameStatus | Name status; see NameStatus. |
winner | address | Winning beneficiary when Claimed, otherwise the zero address. |
label | string | Bare label, kept so reserved and claimed names are reviewable. |
Enums
NameStatus
Status of a name.
Open is the zero-value default: claimable, not reserved, not won. Reserved is
withheld by governance. Claimed has a single winner.
enum NameStatus {
Open,
Reserved,
Claimed
}
ClaimStatus
Status of a single claim on a name.
None is the zero-value default of an absent claim. Rejected is sticky: it is kept
only when the beneficiary filed the claim themselves, so they cannot re-request; a
claim filed on their behalf is deleted on rejection and does not bind them.
enum ClaimStatus {
None,
Requested,
Rejected
}