Smart Contracts
Contracts
LabelValidator

LabelValidator

Git Source (opens in a new tab)

Author: Aaron Oxborrow

Inherits: ILabelValidator

State Variables

MAX_LABEL_LENGTH

uint256 public constant MAX_LABEL_LENGTH = 63;

Functions

isValidLabel

Currently using Handshake/DNS validation rules -- except that we're not allowing punycode or underscores for now. We have chosen to limit all names to alphanumeric ASCII to start, in order to avoid issues with EPP and existing registrars. In the future we may enable full Unicode, possibly with on-chain punycoding for backwards compatibility. https://github.com/handshake-org/hsd/blob/master/lib/covenants/rules.js#L183 (opens in a new tab) https://en.wikipedia.org/wiki/Domain_Name_System#Domain_name_syntax,_internationalization (opens in a new tab)

function isValidLabel(string calldata _label) external pure returns (bool);

Parameters

NameTypeDescription
_labelstringThe label to validate. Should be normalized to lowercase without spaces, periods, or non-alphanumeric characters.

Returns

NameTypeDescription
<none>boolbool Label is valid