PermBump
untyped stringThe permission names this realm gates on. They are constants rather than caller-supplied strings for the gated actions, so a typo cannot silently create an unenforced gate.
Value
"bump"
PermNotice
untyped stringThe permission names this realm gates on. They are constants rather than caller-supplied strings for the gated actions, so a typo cannot silently create an unenforced gate.
Value
"notice"
MaxPermissions
untyped bigintValue
(8 <untyped> bigint)
MaxHolders
untyped bigintValue
(32 <untyped> bigint)
MaxNameLen
untyped bigintValue
(24 <untyped> bigint)
MaxNoticeLen
untyped bigintValue
(200 <untyped> bigint)
MaxListed
untyped bigintValue
(50 <untyped> bigint)
book
*permbook.Bookbook is the permission set. It is unexported and never returned: handing a \*permbook.Book across a realm boundary would hand out every mutator on it, and borrow rule #2 commits those writes under THIS realm's authority (permbook consumer contract 2).
- OID
- 036cd1…c358:48
book details
bumps
int64The state the gated actions move. This is the observable evidence that a gate was open at one height and closed at another.
Value
2
lastBumper
.uverse.addressThe state the gated actions move. This is the observable evidence that a gate was open at one height and closed at another.
Value
<gnolang.StringValue>
lastBumpHeight
int64The state the gated actions move. This is the observable evidence that a gate was open at one height and closed at another.
Value
612779
notice
stringThe state the gated actions move. This is the observable evidence that a gate was open at one height and closed at another.
Value
""
noticeAuthor
.uverse.addressThe state the gated actions move. This is the observable evidence that a gate was open at one height and closed at another.
Value
<zero>
noticeSetAtBlock
int64The state the gated actions move. This is the observable evidence that a gate was open at one height and closed at another.
Value
0
demoLimits
func() permbook.LimitsdemoLimits are the limits every Book this realm constructs is given.
- OID
- 036cd1…c358:10
demoLimits details
init.15
func()- OID
- 036cd1…c358:12
init.15 details
Ready
func() boolReady reports whether init captured a deploy-time admin and constructed the book. False means the realm is inert; see the note in init.
- OID
- 036cd1…c358:13
Ready details
rejectStraySend
func()rejectStraySend aborts if an EOA attached coins to an entrypoint that has no use for them. This realm never holds value; without this guard a mistyped send would be silently absorbed by the realm bank.
- OID
- 036cd1…c358:14
rejectStraySend details
Bump
func() stringBump increments the counter. Requires the "bump" permission. This is the experiment: call it with the permission and it succeeds; have the admin revoke, call it again in a later transaction, and it aborts.
- OID
- 036cd1…c358:15
Bump details
SetNotice
func(text string) stringSetNotice replaces the public notice. Requires the "notice" permission. It exists so the demo shows two INDEPENDENT permissions on one book: holding "bump" does not let an address set the notice, and revoking one leaves the other intact.
- OID
- 036cd1…c358:16
SetNotice details
Grant
func(perm string, addr .uverse.address) stringGrant gives addr a permission. Admin only.
- OID
- 036cd1…c358:17
Grant details
Revoke
func(perm string, addr .uverse.address) stringRevoke removes a permission from addr. Admin only. The revoke is committed by this transaction. Any later transaction that reaches a gate on that permission is refused — that is the claim.
- OID
- 036cd1…c358:18
Revoke details
RevokeAll
func(addr .uverse.address) stringRevokeAll removes every permission addr holds and reports how many. Admin only.
- OID
- 036cd1…c358:19
RevokeAll details
DropPermission
func(perm string) stringDropPermission removes a permission and every grant of it. Admin only.
- OID
- 036cd1…c358:20
DropPermission details
NominateAdmin
func(nominee .uverse.address) stringNominateAdmin records a nominee for the admin role. Admin only. The handoff does not take effect until the nominee calls AcceptAdmin.
- OID
- 036cd1…c358:21
NominateAdmin details
CancelNomination
func() stringCancelNomination withdraws a pending nomination. Admin only.
- OID
- 036cd1…c358:22
CancelNomination details
AcceptAdmin
func() stringAcceptAdmin completes a pending handoff. Only the nominee may call it.
- OID
- 036cd1…c358:23
AcceptAdmin details
Height
func() int64Height returns the chain height this realm is reading as "now".
- OID
- 036cd1…c358:24
Height details
Admin
func() stringAdmin returns the book's current admin.
- OID
- 036cd1…c358:25
Admin details
PendingAdmin
func() stringPendingAdmin returns the nominated-but-not-yet-accepted admin, or "".
- OID
- 036cd1…c358:26
PendingAdmin details
Has
func(perm string, addr .uverse.address) boolHas reports whether addr holds perm. This is the primitive's core query, exposed verbatim so it can be checked from off-chain.
- OID
- 036cd1…c358:27
Has details
CanBump
func(addr .uverse.address) boolCanBump reports whether addr would be allowed to call Bump right now.
- OID
- 036cd1…c358:28
CanBump details
PermissionsOf
func(addr .uverse.address) stringPermissionsOf returns the permissions addr holds, comma-separated in lexicographic order, or "" for none. Names are restricted by permbook to lowercase alphanumerics and underscore, so a comma can never appear in one and this encoding is unambiguous.
- OID
- 036cd1…c358:29
PermissionsOf details
PermissionCount
func() intPermissionCount returns how many distinct permissions currently exist.
- OID
- 036cd1…c358:30
PermissionCount details
Permissions
func() stringPermissions returns up to MaxListed permission names, comma-separated in lexicographic order.
- OID
- 036cd1…c358:31
Permissions details
HolderCount
func(perm string) intHolderCount returns how many addresses hold perm, or 0 if it does not exist.
- OID
- 036cd1…c358:32
HolderCount details
Holders
func(perm string) stringHolders returns up to MaxListed holders of perm, comma-separated in sorted order.
- OID
- 036cd1…c358:33
Holders details
Bumps
func() int64Bumps returns how many times Bump has succeeded.
- OID
- 036cd1…c358:34
Bumps details
LastBump
func() stringLastBump describes the most recent successful Bump, or "none".
- OID
- 036cd1…c358:35
LastBump details
Notice
func() stringNotice returns the current public notice, or "".
- OID
- 036cd1…c358:36
Notice details
Limits
func() stringLimits reports the book's fixed limits.
- OID
- 036cd1…c358:37
Limits details
realmPath
untyped stringrealmPath is this realm's gnoweb prefix, used to build view links.
Value
"/r/g1ut6uspuh73e02yauxpmyt8g3wwddaq8utagvm3/permbook_demo"
Render
func(path string) stringRender serves three views, selected by path. (empty) summary, the permission table, and the gated state holders every permission with its holders, up to MaxListed each about what this realm is and why it exists An inert realm (see init) reports that instead of rendering. Every view reads the book, so without this the gnoweb page would abort on a nil dereference — which is exactly the moment an operator needs it to say what is wrong. The typed read functions still abort when inert; Ready is the probe that answers the question without panicking.
- OID
- 036cd1…c358:38
Render details
renderHeader
func() string- OID
- 036cd1…c358:39
renderHeader details
renderPermissions
func() string- OID
- 036cd1…c358:40
renderPermissions details
gateFor
func(perm string) stringgateFor names the entrypoint a permission opens, or says it opens none. A permission with no gate is not a bug: the admin may grant a name this realm does not read, and saying so plainly is better than implying every permission is enforced somewhere.
- OID
- 036cd1…c358:41
gateFor details
renderHolders
func() string- OID
- 036cd1…c358:42
renderHolders details
renderState
func() string- OID
- 036cd1…c358:43
renderState details
renderAbout
func() string- OID
- 036cd1…c358:44
renderAbout details
normalizePath
func(path string) stringnormalizePath reduces a gnoweb render path to a bare view name, so "", "/", "holders" and "/holders/" all select the same view.
- OID
- 036cd1…c358:45
normalizePath details
join
func(names []string) stringjoin comma-separates names. Safe because permbook restricts permission names to lowercase alphanumerics and underscore, so no name can contain the delimiter.
- OID
- 036cd1…c358:46
join details
itoa
func(n int64) string- OID
- 036cd1…c358:47