Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v1 state

Back to all declarations

paused

bool

// XXX: replace with p/moul/authz

Value

false

setPaused

func(newPausedValue bool)
Open
OID
0ef147…2c10:4
setPaused details

Inspect func

updateUsername

func(userData *users.UserData, newName string) .uverse.error
Open
OID
0ef147…2c10:6
updateUsername details

Inspect func

deleteUserdata

func(userData *users.UserData) .uverse.error
Open
OID
0ef147…2c10:7
deleteUserdata details

Inspect func

setRegisterPrice

func(newPrice int64)
Open
OID
0ef147…2c10:8
setRegisterPrice details

Inspect func

NewSetPausedExecutor

func(newPausedValue bool) dao.ProposalRequest

NewSetPausedExecutor allows GovDAO to pause or unpause this realm

Open
OID
0ef147…2c10:9
NewSetPausedExecutor details

Inspect func

ProposeNewName

func(addr .uverse.address, newName string) dao.ProposalRequest

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.

Open
OID
0ef147…2c10:10
ProposeNewName details

Inspect func

ProposeDeleteUser

func(addr .uverse.address, reason string) dao.ProposalRequest

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.

Open
OID
0ef147…2c10:11
ProposeDeleteUser details

Inspect func

ProposeNewRegisterPrice

func(newPrice int64) dao.ProposalRequest

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.)

Open
OID
0ef147…2c10:12
ProposeNewRegisterPrice details

Inspect func

reNymFormat

untyped string

Open Nym Tier username format. Anchored. - literal \`nym-\` prefix (4 chars) - 5-13 lowercase ASCII letters (the alpha stem) - exactly 3 trailing decimal digits Total length 12-20 chars. Distinct by length from \`g1...\` addresses which are always 40 chars.

Value

"^nym-[a-z]{5,13}\\d{3}$"

reservedPrefixes

[]string (len=7)

Reserved alpha-stem prefixes. Names whose stem starts with one of these are rejected at format-validation time with ErrReservedPrefix (clearer than ErrCanonicalCollision after the fact). \`gi\` is intentionally NOT listed: in most rendering targets \`i\` is visually distinct enough from \`1\`/\`l\` that legitimate \`gi\*\` names (giggles, gimbal, gift, etc.) should remain registerable. Phishing protection for the visual class is still enforced by canonical- collision detection in r/sys/users — once any \`gi\*\` or \`gl\*\` name is registered, all variants under the {l,i,1}→i canonicalization collide. \`gl\` and \`g1\` remain listed because they're more visually confusable with the bech32 address prefix \`g1\`. \`g1\` itself is unreachable through the alpha-only stem regex; defense-in-depth for any future regex relaxation.

Open
OID
0ef147…2c10:174
reservedPrefixes details (len=7)

+7 more Inspect slice

ErrInvalidFormat

*errors.errorString

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.

Open
OID
0ef147…2c10:176
ErrInvalidFormat details

Inspect pointer

ErrReservedPrefix

*errors.errorString

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.

Open
OID
0ef147…2c10:179
ErrReservedPrefix details

Inspect pointer

ErrBlacklisted

*errors.errorString

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.

Open
OID
0ef147…2c10:182
ErrBlacklisted details

Inspect pointer

IsReserved

func(stem string) bool

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().

Open
OID
0ef147…2c10:184
IsReserved details

Inspect func

ValidateNymFormat

func(username string) .uverse.error

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).

Open
OID
0ef147…2c10:186
ValidateNymFormat details

Inspect func

IsPaused

func() bool

IsPaused exposes the realm's pause flag for cross-controller coordination.

Open
OID
0ef147…2c10:187
IsPaused details

Inspect func

reservedNames

[]string (len=93)

reservedNames lists role/system identifiers that must never be allocated as a registered name. The intent is to prevent Open Nym Tier auto-registrations like "nym-admin000" from impersonating system roles. Sources merged here: - Common role names already covered by Handshake's valid.json (the 90k curated trademark/gTLD-application list) — admin, help, support, etc. - Common role names NOT covered by Handshake — administrator, root, sysadmin, owner, staff, api, etc. - RFC 2606 / RFC 6761 reserved labels — example, invalid, localhost, local, test. Plural rule: every entry below is ALSO reserved with the literal "s" suffix appended. So "doc" reserves both "doc" and "docs"; "setting" reserves both "setting" and "settings"; "new" covers "news", and so on. Entries are stored in the singular here and the validator appends "s" at check time. This halves list maintenance and avoids the temptation to add \`name+"s"\` after every singular entry. Note on length: the Open Nym Tier regex restricts the \[a-z]{5,13} middle to 5–13 chars, so entries shorter than 5 (mod, api, bot, god, gno, ...) and longer than 13 (administrator, jesuschrist, newtendermint, ...) cannot appear in Register() even without this list. They are kept anyway because: (a) cross-reference value — a single canonical list is easier to audit than two scope-specific lists with overlapping intent; and (b) future controllers (e.g. a hypothetical DAO-allocated path) can opt in to the same blacklist by querying IsReserved, providing defense-in-depth across the registration ecosystem. IMPORTANT: this list is NOT consulted by \`ProposeNewName\` — governance renames are gated by GovDAO vote alone, not by this blacklist. Voters reviewing a rename proposal are responsible for catching collisions with reserved names. Sortedness: entries must be sorted lexicographically (Go's \< on strings, which is byte-wise ASCII). TestReservedNamesSorted enforces this.

Open
OID
0ef147…2c10:189
reservedNames details (len=93)

+93 more Inspect slice

reservedSet

map[string]struct{...}

reservedSet is the runtime O(1) lookup for the role-name blacklist. Built in init() from reservedNames in blacklist.gno: each source entry contributes BOTH \`Canonicalize(n)\` and \`Canonicalize(n+"s")\` as keys, implementing the "implicit \`s\` suffix" rule documented on reservedNames. Why canonicalize the blacklist itself: validation canonicalizes the candidate stem before checking, so the comparison set must also be in canonical form. Otherwise a candidate like "vital1k" would canonicalize to "vitaiik" but the blacklist would contain only "vitalik" — the comparison would miss the match. Keeping both sides in canonical form makes the lookup exact. The blacklist remains namereg/v1-local because it is policy specific to the Open Nym Tier. Other controllers may have entirely different reserved-name policies, or none at all.

Open
OID
0ef147…2c10:238
reservedSet details

Inspect map

Canonicalize

func(s string) string

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.

Open
OID
0ef147…2c10:193
Canonicalize details

Inspect func

ErrInvalidUsername

*errors.errorString
Open
OID
0ef147…2c10:201
ErrInvalidUsername details

Inspect pointer

ErrInvalidPayment

*errors.errorString
Open
OID
0ef147…2c10:204
ErrInvalidPayment details

Inspect pointer

errInvalidPayment

func() .uverse.error

errInvalidPayment returns the panic value for an OriginSend mismatch. Constructed lazily so the formatted price reflects the current value of registerPrice rather than the value frozen at package init time. Replaces the old \`ErrInvalidPayment = ufmt.Errorf(...)\` package var (audit finding #13) which captured registerPrice once and silently drifted out of date after every ProposeNewRegisterPrice execution.

Open
OID
0ef147…2c10:206
errInvalidPayment details

Inspect func

preRegisteredUsers

[]struct{...} (len=10)

pre-registered users

Open
OID
0ef147…2c10:211
preRegisteredUsers details (len=10)

+10 more Inspect slice

renderHomePage

func() string
Open
OID
0ef147…2c10:226
renderHomePage details

Inspect func

renderIntroParagraph

func() string
Open
OID
0ef147…2c10:227
renderIntroParagraph details

Inspect func

resolveUser

func(path string) (*users.UserData, bool, bool)

resolveUser resolves the user based on the path, determining if it's a name or address

Open
OID
0ef147…2c10:228
resolveUser details

Inspect func

renderUserPage

func(path string) string

renderUserPage generates the user page based on user data and path

Open
OID
0ef147…2c10:229
renderUserPage details

Inspect func

RenderLatestUsersWidget

func(num int) string

RenderLatestUsersWidget renders the latest num registered users. For num = -1, the maximum number (100) will be displayed.

Open
OID
0ef147…2c10:230
RenderLatestUsersWidget details

Inspect func

MinRegisterPrice

int64

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.

Value

0

registerPrice

int64

// free by default; governance can raise via ProposeNewRegisterPrice

Value

0

latestUsers

*fifo.List

// Save the latest 100 users for rendering purposes

Open
OID
0ef147…2c10:233
latestUsers details

Inspect pointer

Register

func(username string)

Register registers a new username for the caller. Valid usernames match \`nym-\[a-z]{5,13}\\d{3}\`: - literal \`nym-\` prefix (4 chars) - 5-13 lowercase letters (the alpha stem) - exactly 3 trailing decimal digits 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.

Open
OID
0ef147…2c10:235
Register details

Inspect func
paused : bool =false
setPaused : func(newPausedValue bool) Inspect
updateUsername : func(userData *users.UserData, newName string) .uverse.error Inspect
deleteUserdata : func(userData *users.UserData) .uverse.error Inspect
setRegisterPrice : func(newPrice int64) Inspect
NewSetPausedExecutor : func(newPausedValue bool) dao.ProposalRequest Inspect
ProposeNewName : func(addr .uverse.address, newName string) dao.ProposalRequest Inspect
ProposeDeleteUser : func(addr .uverse.address, reason string) dao.ProposalRequest Inspect
ProposeNewRegisterPrice : func(newPrice int64) dao.ProposalRequest Inspect
reNymFormat : untyped string ="^nym-[a-z]{5,13}\\d{3}$"
reNym : *regexp.Regexp Inspect
reservedPrefixes : []string (len=7) Inspect
ErrInvalidFormat : *errors.errorString Inspect
ErrReservedPrefix : *errors.errorString Inspect
ErrBlacklisted : *errors.errorString Inspect
IsReserved : func(stem string) bool Inspect
ValidateNymFormat : func(username string) .uverse.error Inspect
IsPaused : func() bool Inspect
reservedNames : []string (len=93) Inspect
reservedSet : map[string]struct{...} Inspect
init.20 : func() Inspect
Canonicalize : func(s string) string Inspect
ErrNonUserCall : *errors.errorString Inspect
ErrPaused : *errors.errorString Inspect
ErrInvalidUsername : *errors.errorString Inspect
ErrInvalidPayment : *errors.errorString Inspect
errInvalidPayment : func() .uverse.error Inspect
init.27 : func() Inspect
preRegisteredUsers : []struct{...} (len=10) Inspect
init.29 : func() Inspect
Render : func(path string) string Inspect
renderHomePage : func() string Inspect
renderIntroParagraph : func() string Inspect
resolveUser : func(path string) (*users.UserData, bool, bool) Inspect
renderUserPage : func(path string) string Inspect
RenderLatestUsersWidget : func(num int) string Inspect
MinRegisterPrice : int64 =0
registerPrice : int64 =0
latestUsers : *fifo.List Inspect
Register : func(username string) Inspect