HomeOverviewValsValidatorsGovGovernanceIBCRelayersN/AInfraInfra
/
powered by GATA HUB

r/sys/namereg/v0

Gno.land

Realm
Files177 tests
Lines of code1,200excluding tests
Functions11exported
Storage272.7 KB27.27 GNOT deposit
DeployedN/A

Realm

Pathgno.land/r/sys/namereg/v0
Accountg1t2a5cfc8y8…dxx5svzy
admin.gno126 lines
1package namereg
2
3import (
4 "gno.land/p/nt/ufmt/v0"
5 "gno.land/r/gov/dao"
6 susers "gno.land/r/sys/users"
7)
8
9var paused = false // XXX: replace with p/moul/authz
10
11//----------------------------------------
12// Privileged mutators.
13
14func setPaused(cur realm, newPausedValue bool) {
15 paused = newPausedValue
16}
17
18func updateUsername(cur realm, userData *susers.UserData, newName string) error {
19 // UpdateName must be called from this realm.
20 return userData.UpdateName(0, cur, newName)
21}
22
23func deleteUserdata(cur realm, userData *susers.UserData) error {
24 // Delete must be called from this realm.
25 return userData.Delete(0, cur)
26}
27
28func setRegisterPrice(cur realm, newPrice int64) {
29 registerPrice = newPrice
30}
31
32//----------------------------------------
33// Public API
34
35// NewSetPausedExecutor allows GovDAO to pause or unpause this realm
36func NewSetPausedExecutor(cur realm, newPausedValue bool) dao.ProposalRequest {
37 cb := func(cur realm) error {
38 setPaused(cur, newPausedValue)
39 return nil
40 }
41
42 e := dao.NewSimpleExecutor(0, cur, cb, "")
43
44 if newPausedValue {
45 return dao.NewProposalRequest("User Registry V0: Pause", "", e)
46 }
47
48 return dao.NewProposalRequest("User Registry V0: Unpause", "", e)
49}
50
51// ProposeNewName allows GovDAO to propose a new name for an existing user.
52// The associated address and all previous names of a user that changes a
53// name are preserved, and all resolve to the new name.
54//
55// Governance renames bypass the Open Nym Tier `nym-...\d{3}` format intentionally.
56// The DAO is the trust root for this realm; if voters approve a rename to
57// `vitalik` (e.g. for trademark dispute resolution or system reservations),
58// the validation here imposes no further opinion. The new name is still
59// subject to the base shape enforced by `r/sys/users.validateName`
60// (`^[a-z][a-z0-9]*([_-][a-z0-9]+)*$`, max 64 chars), which runs inside
61// the updateUsername callback below.
62func ProposeNewName(cur realm, addr address, newName string) dao.ProposalRequest {
63 userData := susers.ResolveAddress(addr)
64 if userData == nil {
65 panic(susers.ErrUserNotExistOrDeleted)
66 }
67
68 cb := func(cur realm) error {
69 err := updateUsername(cur, userData, newName)
70 return err
71 }
72
73 e := dao.NewSimpleExecutor(0, cur, cb, "")
74
75 return dao.NewProposalRequest(
76 ufmt.Sprintf("User Registry V0: Rename user `%s` to `%s`", userData.Name(), newName),
77 "",
78 e,
79 )
80}
81
82// ProposeDeleteUser allows GovDAO to propose deletion of a user
83// This will make the associated address and names unresolvable.
84// WARN: After deletion, the same address WILL NOT be able to register a new name.
85func ProposeDeleteUser(cur realm, addr address, reason string) dao.ProposalRequest {
86 userData := susers.ResolveAddress(addr)
87 if userData == nil {
88 panic(susers.ErrUserNotExistOrDeleted)
89 }
90
91 cb := func(cur realm) error {
92 return deleteUserdata(cur, userData)
93 }
94
95 e := dao.NewSimpleExecutor(0, cur, cb, "")
96
97 return dao.NewProposalRequest(
98 ufmt.Sprintf("User Registry V0: Delete user `%s`", userData.Name()),
99 reason,
100 e,
101 )
102}
103
104// ProposeNewRegisterPrice allows GovDAO to update the price of registration.
105// Rejects prices below MinRegisterPrice (currently 0) at proposal-creation
106// time. (audit finding #14: original code only rejected negative values,
107// which would have been arithmetically nonsensical.)
108func ProposeNewRegisterPrice(cur realm, newPrice int64) dao.ProposalRequest {
109 if newPrice < MinRegisterPrice {
110 panic(ufmt.Sprintf("price below floor: %d ugnot < %d ugnot (MinRegisterPrice)",
111 newPrice, MinRegisterPrice))
112 }
113
114 cb := func(cur realm) error {
115 setRegisterPrice(cur, newPrice)
116 return nil
117 }
118
119 e := dao.NewSimpleExecutor(0, cur, cb, "")
120
121 return dao.NewProposalRequest(
122 ufmt.Sprintf("User Registry V0: Update registration price to `%d`", newPrice),
123 "",
124 e,
125 )
126}
FunctionParametersReturnsKind
NewSetPausedExecutor(newPausedValue bool)struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}Crossing
ProposeNewName(addr string, newName string)struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}Crossing
ProposeDeleteUser(addr string, reason string)struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}Crossing
ProposeNewRegisterPrice(newPrice int64)struct{title string; description string; executor gno.land/r/gov/dao.Executor; filter gno.land/r/gov/dao.Filter}Crossing
IsReserved(stem string)bool-
ValidateNymFormat(username string)error-
IsPaused()bool-
Canonicalize(s string)string-
Render(path string)string-
RenderLatestUsersWidget(num int)string-
Register(username string)-Crossing
1–11 of 11

Gno.land User Registry

Welcome to the Gno.land User Registry (v0). Please register a username.

Registering a username grants the registering address the right to deploy packages and realms under that username’s namespace. For example, if an address registers the username nym-alice123, it will gain permission to deploy packages and realms to package paths with the pattern gno.land/{p,r}/nym-alice123/*.

In V0, usernames must match nym-<stem><digits>, where:

  • <stem> is 5 to 13 lowercase ASCII letters
  • <digits> is exactly 3 decimal digits
  • The stem must NOT start with gno, gl, atom, atone, photon, or cosmos (reserved prefixes)
  • The stem must NOT match a reserved role name (admin, root, support, ...)
  • Confusable variants (e.g. vitaiik vs vitalik via l↔i) are blocked via canonical-form collision detection
  • Total username length: 12–20 chars (distinct from g1... addresses, which are always 40 chars)

Vanity names outside this format may be allocated by GovDAO governance through ProposeNewName.

[[Click here to register]](/r/sys/namereg/v0$help&func=Register)

Registration price: 0.000000 GNOT (0ugnot)


Latest registrations

  • @nym-choppi123
  • @nym-jimmy033
  • @nym-vikbez000
  • @nym-mikael000
  • @nym-zxxma042
  • @nym-mencos162
  • @nym-propaganda102
  • @nym-propaganda101
  • @nym-iluvsheep486
  • @nym-south000
  • @nym-slavabolisong001
  • @nym-binksq888
  • @nym-lectroluv000
  • @nym-donaldtrump900
  • @nym-alexander001
  • @nym-ballon064
  • @nym-barron456
  • @nym-parig428
  • @nym-apple333
  • @nym-garisevsk333
  • @nym-dagus005
  • @nym-newsercop377
  • @nym-jujiapapa001
  • @nym-number888
  • @nym-jackpot888
  • @nym-forever888
  • @nym-gifted777
  • @nym-agent888
  • @nym-tothemoon888
  • @nym-wagmi888
  • @nym-investor100
  • @nym-kiprr301
  • @nym-sercop451
  • @nym-masic590
  • @nym-master000
  • @nym-bronx000
  • @nym-braun000
  • @nym-mister000
  • @nym-bitok000
  • @nym-number777
  • @nym-elonmusk000
  • @nym-transtangible420
  • @nym-gcenxqtvu000
  • @nym-vashkadashka320
  • @nym-yanuariy237
  • @nym-magic001
  • @nym-counterstrike420
  • @nym-mario257
  • @nym-deficosmos000
  • @nym-legion777
  • @nym-zolushok777
  • @nym-blackraptor421
  • @nym-apollo333
  • @nym-russia888
  • @nym-serialshiller000
  • @nym-kujira860
  • @nym-drackson373
  • @nym-rugfac369
  • @nym-infomo777
  • @nym-elovha675
  • @nym-xapatwit000
  • @nym-agent007
  • @nym-satoshi003
  • @nym-satoshi002
  • @nym-satoshi001
  • @nym-circle999
  • @nym-masteratlas007
  • @nym-polux007
  • @nym-clown000
  • @nym-denispro000
  • @nym-chiter888
  • @nym-alextumi967
  • @nym-ivanivanich024
  • @nym-apple000
  • @nym-renegade999
  • @nym-propaganda100
  • @nym-jamesbond007
  • @nym-thegnomic001
  • @nym-leonh000
  • @nym-jeronimo000
  • @nym-thomas101
Loading calls…
Calls83from 81 accounts
FunctionCallerStatusBlockAge
Registerg1p4r3es…vf9znuSuccess787,45321h ago
Registerg1qgslse…u75kyeSuccess732,1733d ago
Registerg13kytw9…4p89zgSuccess631,1577d ago
Registerg1lyejww…9yeh3zSuccess606,9138d ago
Registerg1747t5m…gkx59cSuccess420,82015d ago
Registerg15nf66l…zps8ynSuccess397,87816d ago
Registerg19v5rs8…sktg9zSuccess375,27017d ago
Registerg1tdjqmt…8yety7Success375,20417d ago
Registerg1wlureh…7lqveuSuccess370,21417d ago
Registerg1dkuxl3…mwumnvSuccess358,45817d ago
Registerg1tlljkn…ek2ttrSuccess349,36918d ago
Registerg1xc2t36…uwhk3wSuccess322,49219d ago
1–12 of 831/7