1package rbac23import (4 prbac "gno.land/p/gnoswap/rbac/v1"5 "gno.land/p/moul/md/v0"6 "gno.land/p/moul/mdtable/v0"7)89// Render returns ownership and assignments for the protocol's fixed system roles.10func Render(path string) string {11 if path != "" {12 return "404\n"13 }1415 roles := []prbac.SystemRole{16 prbac.ROLE_ADMIN, prbac.ROLE_DEVOPS, prbac.ROLE_COMMUNITY_POOL,17 prbac.ROLE_GOVERNANCE, prbac.ROLE_GOV_STAKER, prbac.ROLE_XGNS,18 prbac.ROLE_POOL, prbac.ROLE_POSITION, prbac.ROLE_ROUTER,19 prbac.ROLE_STAKER, prbac.ROLE_EMISSION, prbac.ROLE_LAUNCHPAD,20 prbac.ROLE_PROTOCOL_FEE,21 }2223 ownershipTable := mdtable.Table{24 Headers: []string{"Field", "Address"},25 Rows: [][]string{26 {"Owner", renderOwnershipAddress(GetOwner())},27 {"Pending owner", renderOwnershipAddress(GetPendingOwner())},28 },29 }30 out := md.H1("Gnoswap RBAC") +31 "\n" +32 md.H2("Ownership") +33 "\n" +34 ownershipTable.String() +35 "\n" +36 md.H2("System roles")3738 roleTable := mdtable.Table{39 Headers: []string{"Role", "Address"},40 }41 for _, role := range roles {42 roleTable.Append([]string{role.String(), renderRoleAddress(role)})43 }44 return out + "\n" + roleTable.String()45}4647func renderOwnershipAddress(addr address) string {48 if addr == address("") {49 return "None"50 }51 return addr.String()52}5354func renderRoleAddress(role prbac.SystemRole) string {55 addr, err := GetRoleAddress(role.String())56 if err != nil || addr == address("") {57 return "Unassigned"58 }59 return md.InlineCode(addr.String())60}61AcceptOwnership(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string})
GetOwner() string
GetPendingOwner() string
GetRoleAddress(roleName string) (string, interface {Error func() string})
IsOwner(addr string) bool
IsPendingOwner(addr string) bool
RegisterRole(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, roleName string, roleAddress string)
RemoveRole(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, roleName string)
Render(path string) string
TransferOwnership(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, addr string)
UpdateRoleAddress(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, roleName string, addr string)
Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.
vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.