Search Apps Documentation Source Content File Folder Download Copy Actions Download

preregister.gno

1.95 Kb · 48 lines
 1package namereg
 2
 3import (
 4	susers "gno.land/r/sys/users"
 5)
 6
 7// Pre-registered names bypass the Open Nym Tier `nym-...\d{3}` format
 8// intentionally. They are bootstrap names allocated at genesis and are
 9// not subject to the auto-registration regex. They DO appear in
10// reservedNames as a defense-in-depth (so a future governance-bypass
11// path can't accidentally reallocate them either), but at this layer
12// they are written directly via susers.RegisterUserIgnoreCanonical.
13//
14// Uses the bypass path so curated confusables in the seed (e.g.
15// `gnoland` and `gnolang` both canonicalize distinctly today, but a
16// future addition that collides must not abort chain bring-up).
17// Matches the genesis posture in r/sys/users/init.gno.
18
19// pre-registered users
20var preRegisteredUsers = []struct {
21	Name    string
22	Address address
23}{
24	// system names.
25	// the goal is to make them either team/DAO-owned or ownerless.
26	{"archive", "g1xlnyjrnf03ju82v0f98ruhpgnquk28knmjfe5k"}, // -> @archive
27	{"demo", "g13ek2zz9qurzynzvssyc4sthwppnruhnp0gdz8n"},    // -> @demo
28	{"gno", "g19602kd9tfxrfd60sgreadt9zvdyyuudcyxsz8a"},     // -> @gno
29	{"gnoland", "g1g3lsfxhvaqgdv4ccemwpnms4fv6t3aq3p5z6u7"}, // -> @gnoland
30	{"gnolang", "g1yjlnm3z2630gg5mryjd79907e0zx658wxs9hnd"}, // -> @gnolang
31	{"gov", "g1g73v2anukg4ej7axwqpthsatzrxjsh0wk797da"},     // -> @gov
32	{"nt", "g15ge0ae9077eh40erwrn2eq0xw6wupwqthpv34l"},      // -> @nt
33	{"sys", "g1r929wt2qplfawe4lvqv9zuwfdcz4vxdun7qh8l"},     // -> @sys
34	{"x", "g164sdpew3c2t3rvxj3kmfv7c7ujlvcw2punzzuz"},       // -> @x
35
36	// test1 user
37	{"test1", "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5"}, // -> @test1
38}
39
40func init() {
41	// add pre-registered users via the bypass path (genesis posture).
42	// Errors are intentionally discarded; the seed is curated and any
43	// duplicate-address / already-deleted entries (re-init across test
44	// realm reuse) just no-op.
45	for _, res := range preRegisteredUsers {
46		susers.RegisterUserIgnoreCanonical(cross, res.Name, res.Address)
47	}
48}