const MinRegisterPrice
MinRegisterPrice is the lowest price (in ugnot) that ProposeNewRegisterPrice will accept. Set to 0 — registration is free by default; governance can raise the price via ProposeNewRegisterPrice without a floor.
MinRegisterPrice is the lowest price (in ugnot) that ProposeNewRegisterPrice will accept. Set to 0 — registration is free by default; governance can raise the price via ProposeNewRegisterPrice without a floor.
Exported error sentinels returned by ValidateNymFormat. Use errors.Is or direct equality; do not string-match.
ErrReservedPrefix's message is built from reservedPrefixes at package init time so the surfaced list never drifts from the actual policy.
Canonical-collision detection moved to r/sys/users in Option B. Consumers that previously caught namereg.ErrCanonicalCollision should switch to susers.ErrCanonicalCollision.
1var (
2 ErrNonUserCall = errors.New("r/gnoland/users: non-user call")
3 ErrPaused = errors.New("r/gnoland/users: paused")
4 ErrInvalidUsername = errors.New("r/gnoland/users: invalid username")
5
6 // ErrInvalidPayment is the sentinel for "OriginSend amount didn't
7 // match registerPrice." It deliberately omits the price from its
8 // message — the price is read at panic time via errInvalidPayment()
9 // below, so users see the CURRENT price even after governance has
10 // changed it. Tests that match against this error use it as a
11 // substring check via uassert.AbortsWithMessage. (audit finding #13)
12 ErrInvalidPayment = errors.New("r/gnoland/users: invalid payment amount")
13)Canonicalize is a delegating shim to r/sys/users.Canonicalize.
HISTORY: namereg/v1 used to host its own per-stem canonical store and its own Canonicalize (l→i only). Option B unified the canonical lookup into r/sys/users keyed by full canonical name with broader substitutions ({l,i,1}→i, {0,o}→o, {-,.,_} stripped). This shim preserves the call-site name for local consumers (blacklist init, IsReserved) and any external consumer that imported the function from namereg/v1 before Option B.
New code should call susers.Canonicalize directly.
IsPaused exposes the realm's pause flag for cross-controller coordination.
IsReserved reports whether the given alpha stem matches a reserved role name (with implicit `s`-suffix expansion). The check is canonicalized — so `vital1k`-style l-substituted variants of a reserved name are also caught. O(1) backed by `reservedSet` built in init().
NewSetPausedExecutor allows GovDAO to pause or unpause this realm
ProposeDeleteUser allows GovDAO to propose deletion of a user This will make the associated address and names unresolvable. WARN: After deletion, the same address WILL NOT be able to register a new name.
ProposeNewName allows GovDAO to propose a new name for an existing user. The associated address and all previous names of a user that changes a name are preserved, and all resolve to the new name.
Governance renames bypass the Open Nym Tier `nym-...\d{3}` format intentionally. The DAO is the trust root for this realm; if voters approve a rename to `vitalik` (e.g. for trademark dispute resolution or system reservations), the validation here imposes no further opinion. The new name is still subject to the base shape enforced by `r/sys/users.validateName` (`^[a-z][a-z0-9]*([_-][a-z0-9]+)*$`, max 64 chars), which runs inside the updateUsername callback below.
ProposeNewRegisterPrice allows GovDAO to update the price of registration. Rejects prices below MinRegisterPrice (currently 0) at proposal-creation time. (audit finding #14: original code only rejected negative values, which would have been arithmetically nonsensical.)
Register registers a new username for the caller.
Valid usernames match `nym-[a-z]{5,13}\d{3}`:
Total length 12-20 chars. The alpha stem additionally must NOT start with `gno`/`gi`/`gl` and must not match a reserved role name (with implicit `s`-suffix expansion). See ValidateNymFormat for the format/blacklist check.
Canonical-collision detection is enforced atomically by susers.RegisterUser via the unified canonical store in r/sys/users (decision: per Option B, every controller participates in the same canonical-form lookup keyed by full canonical name).
Only direct EOA (maketx call) invocations are supported.
RenderLatestUsersWidget renders the latest num registered users. For num = -1, the maximum number (100) will be displayed.
ValidateNymFormat checks the regex, prefix-exclusion, and reserved- name rules in that order. Returns one of the exported sentinel errors per failure mode, or nil on success.
Does NOT run the canonical-collision check — that lives in r/sys/users (susers.IsCanonicalTaken or, atomically with the write, inside susers.RegisterUser).