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

memba_gov state

Back to all declarations

VotingPeriod

time.Duration

The policy's durations, in their own file so a node fixture, which cannot wait days, can replace this file alone and run the real rules faster.

Value

<zero>

ExecutionWindow

time.Duration

The policy's durations, in their own file so a node fixture, which cannot wait days, can replace this file alone and run the real rules faster.

Value

<zero>

WeightedDelay

time.Duration

// critical, weight route

Value

<zero>

HeadcountDelay

time.Duration

// critical, headcount route

Value

<zero>

RosterDelay

time.Duration

The policy's durations, in their own file so a node fixture, which cannot wait days, can replace this file alone and run the real rules faster.

Value

<zero>

InactiveDelay

time.Duration

The policy's durations, in their own file so a node fixture, which cannot wait days, can replace this file alone and run the real rules faster.

Value

<zero>

InactiveAfter

time.Duration

The policy's durations, in their own file so a node fixture, which cannot wait days, can replace this file alone and run the real rules faster.

Value

<zero>

SeedInviteTTL

time.Duration

The policy's durations, in their own file so a node fixture, which cannot wait days, can replace this file alone and run the real rules faster.

Value

<zero>

VotedInviteTTL

time.Duration

The policy's durations, in their own file so a node fixture, which cannot wait days, can replace this file alone and run the real rules faster.

Value

<zero>

corePath

untyped string

Value

"gno.land/r/samcrew/memba_gov"

MaxSeats

untyped bigint

Value

(25 <untyped> bigint)

MinSeats

untyped bigint

Value

(2 <untyped> bigint)

MaxScope

untyped bigint

Value

(160 <untyped> bigint)

MaxNote

untyped bigint

Value

(280 <untyped> bigint)

MaxAction

untyped bigint

Value

(64 <untyped> bigint)

actAddMember

untyped string

Value

"AddMember"

actRemoveMember

untyped string

Value

"RemoveMember"

actSetWeight

untyped string

Value

"SetWeight"

actRecover

untyped string

Value

"Recover"

actRemoveInactive

untyped string

Value

"RemoveInactive"

actUninvite

untyped string

Value

"Uninvite"

voteYes

untyped string

Value

"yes"

voteNo

untyped string

Value

"no"

voteAbstain

untyped string

Value

"abstain"

person

type

Value

memba_gov.person

invite

type

invite seats addr as id (a new person) or, for a recovery, gives the existing person id the new key addr, once addr itself calls Join.

Value

memba_gov.invite

ballot

type

Value

memba_gov.ballot

proposal

type

Value

memba_gov.proposal

proposals

*avl.Tree

// padded id -> \*proposal

Open
OID
04a5d3…0fc8:6
proposals details

Inspect pointer

scopes

*avl.Tree

// target + "\\n" + scope -> uint64 generation

Open
OID
04a5d3…0fc8:9
scopes details

Inspect pointer

lastID

uint64

Value

0

globalGen

uint64

Value

0

now

func() int64

now is the block time in unix seconds; every stored time uses it.

Open
OID
04a5d3…0fc8:16
now details

Inspect func

Propose

func(target string, action string, args string, scope string, class int, note string) uint64

Propose files one action. target is the realm that will consume it, or this realm for a roster action; scope is the invalidation key that realm computes for the action; class is at least the class it requires.

Open
OID
04a5d3…0fc8:18
Propose details

Inspect func

Vote

func(pid uint64, choice string)

Vote records yes, no or abstain until the voting deadline. After it, a YES can still be withdrawn while the proposal is not executed or expired, so members can stop an approval they no longer back.

Open
OID
04a5d3…0fc8:19
Vote details

Inspect func

Join

func()

Join seats the caller's invitation: a new person, or a recovered key.

Open
OID
04a5d3…0fc8:20
Join details

Inspect func

Execute

func(pid uint64)

Execute runs a ready roster action of this realm. The roster it was checked against at Propose is unchanged: any change would have invalidated it.

Open
OID
04a5d3…0fc8:21
Execute details

Inspect func

Consume

func(pid uint64, action string, args string, scope string, minClass int, executor .uverse.address)

Consume is crossing-called by a governed realm right before the step a proposal approved. It panics unless the caller is exactly the proposal's target, the action, arguments and scope are the voted ones byte for byte, the class is at least minClass, the proposal is ready, and executor, the account that called the target directly, is a seated member. It marks the proposal used and invalidates the other open proposals of (target, scope).

Open
OID
04a5d3…0fc8:22
Consume details

Inspect func

IsMember

func(addr .uverse.address) bool

IsMember reports whether addr is a seated member's current key.

Open
OID
04a5d3…0fc8:23
IsMember details

Inspect func

PersonOf

func(addr .uverse.address) string

PersonOf returns the id of the seated member whose current key is addr, or "". The id survives a key recovery.

Open
OID
04a5d3…0fc8:24
PersonOf details

Inspect func

rosterClass

func(action string) int

rosterClass and rosterDelay fix how each roster action passes.

Open
OID
04a5d3…0fc8:27
rosterClass details

Inspect func

rosterDelay

func(action string) time.Duration
Open
OID
04a5d3…0fc8:28
rosterDelay details

Inspect func

checkRosterAction

func(action string, f []daoauth.Field)

checkRosterAction validates a roster action's fields against the roster.

Open
OID
04a5d3…0fc8:29
checkRosterAction details

Inspect func

weightField

func(f daoauth.Field) int
Open
OID
04a5d3…0fc8:30
weightField details

Inspect func

addInvite

func(id string, addr .uverse.address, weight int, ttl time.Duration)
Open
OID
04a5d3…0fc8:31
addInvite details

Inspect func

removePerson

func(id string)
Open
OID
04a5d3…0fc8:33
removePerson details

Inspect func

checkRoster

func()

checkRoster enforces the bounds, valid ids, addresses and weights, and the uniqueness of ids and of addresses across seats and open invitations. An invitation may name a seated id: that is a recovery, with no weight.

Open
OID
04a5d3…0fc8:34
checkRoster details

Inspect func

addrTaken

func(a .uverse.address, id string) bool

addrTaken reports whether a is seated, or invited for someone other than id: a newer invitation for id replaces id's own.

Open
OID
04a5d3…0fc8:35
addrTaken details

Inspect func

personByAddr

func(a .uverse.address) *memba_gov.person
Open
OID
04a5d3…0fc8:37
personByAddr details

Inspect func

personByID

func(id string) *memba_gov.person
Open
OID
04a5d3…0fc8:38
personByID details

Inspect func

seatedTotals

func() (w int, n int)
Open
OID
04a5d3…0fc8:40
seatedTotals details

Inspect func

scopeGen

func(target string, scope string) uint64
Open
OID
04a5d3…0fc8:41
scopeGen details

Inspect func

mustGet

func(pid uint64) *memba_gov.proposal
Open
OID
04a5d3…0fc8:43
mustGet details

Inspect func

validTarget

func(t string) bool

validTarget accepts a realm path: no user ("") or MsgRun (gno.land/e/) identity, no sub-realm ("#"), lowercase path characters only.

Open
OID
04a5d3…0fc8:45
validTarget details

Inspect func

validAction

func(a string) bool
Open
OID
04a5d3…0fc8:46
validAction details

Inspect func

lower

untyped string

Value

"abcdefghijklmnopqrstuvwxyz"

upper

untyped string

Value

"ABCDEFGHIJKLMNOPQRSTUVWXYZ"

digits

untyped string

Value

"0123456789"

only

func(s string, set string) bool

only reports whether every byte of s is in set.

Open
OID
04a5d3…0fc8:48
only details

Inspect func

Routine

untyped bigint

Classes. A target hard-codes the minimum class of each action it governs.

Value

(1 <untyped> bigint)

Financial

untyped bigint

Classes. A target hard-codes the minimum class of each action it governs.

Value

(2 <untyped> bigint)

Critical

untyped bigint

Classes. A target hard-codes the minimum class of each action it governs.

Value

(3 <untyped> bigint)

route

type

A route is one way a proposal passes: a rule on the YES votes of the seated roster and the delay that follows. Thresholds are fractions of the seated weight W and persons N. Every rule needs at least two persons: the critical ones because N is at least 2.

Value

memba_gov.route

ruleRoutine

untyped bigint

Value

(0 <untyped> bigint)

ruleFinancial

untyped bigint

Value

(1 <untyped> bigint)

ruleWeighted

untyped bigint

Value

(2 <untyped> bigint)

ruleHeadcount

untyped bigint

Value

(3 <untyped> bigint)

meets

func(rule int, w int, p int, W int, N int) bool
Open
OID
04a5d3…0fc8:49
meets details

Inspect func

routes

func(p *memba_gov.proposal) []memba_gov.route

routes returns the ways proposal p passes: its class sets the rules, and a roster action of this realm has its own delay on every route.

Open
OID
04a5d3…0fc8:51
routes details

Inspect func

streak

type

A streak is one current YES ballot: when it began and its voter's weight.

Value

memba_gov.streak

yesStreaks

func(p *memba_gov.proposal) []memba_gov.streak

yesStreaks returns p's current YES ballots, oldest streak first.

Open
OID
04a5d3…0fc8:52
yesStreaks details

Inspect func

qualifiedSince

func(ys []memba_gov.streak, rule int, W int, N int) int64

qualifiedSince returns when (unix seconds) the earliest coalition still voting YES without interruption first met rule, or 0. The coalition of a start time is every YES streak begun no later; every rule only grows with more votes, so the first prefix of ys that meets it ends on that time (streaks begun in the same second share it). A voter the rest of the coalition does not need cannot postpone the clock by withdrawing and rejoining.

Open
OID
04a5d3…0fc8:53
qualifiedSince details

Inspect func

stExecuted

untyped string

Proposal states, in the order a reader checks them.

Value

"executed"

stInvalidated

untyped string

Proposal states, in the order a reader checks them.

Value

"invalidated"

stExpired

untyped string

Proposal states, in the order a reader checks them.

Value

"expired"

stReady

untyped string

Proposal states, in the order a reader checks them.

Value

"ready"

stTimelocked

untyped string

Proposal states, in the order a reader checks them.

Value

"timelocked"

stVoting

untyped string

Proposal states, in the order a reader checks them.

Value

"voting"

state

func(p *memba_gov.proposal) (string, int64)

state returns p's status and, once some route qualified, the earliest unix time it is or becomes executable (0 before). Voting ends just before the deadline second; readyAt and the end of the execution window are inclusive.

Open
OID
04a5d3…0fc8:54
state details

Inspect func

vetoed

func(p *memba_gov.proposal) bool

vetoed reports whether the member a RemoveInactive names has been active since the proposal: proposing, voting, executing or joining vetoes it.

Open
OID
04a5d3…0fc8:55
vetoed details

Inspect func

MaxListed

untyped bigint

MaxListed is the most proposals ProposalsJSON and Render return at once.

Value

(20 <untyped> bigint)

RosterJSON

func() string

RosterJSON lists seated members and open invitations.

Open
OID
04a5d3…0fc8:56
RosterJSON details

Inspect func

ProposalJSON

func(pid uint64) string

ProposalJSON returns one proposal with its ballots and current status, or null for an unknown id.

Open
OID
04a5d3…0fc8:58
ProposalJSON details

Inspect func

ConstantsJSON

func() string

ConstantsJSON returns the fixed policy: durations in seconds, roster bounds.

Open
OID
04a5d3…0fc8:59
ConstantsJSON details

Inspect func

ProposalsJSON

func(before uint64, limit int) string

ProposalsJSON lists up to limit proposals (at most MaxListed) with ids below before, newest first; before = 0 starts from the newest.

Open
OID
04a5d3…0fc8:60
ProposalsJSON details

Inspect func

proposalJSON

func(b []uint8, p *memba_gov.proposal) []uint8
Open
OID
04a5d3…0fc8:61
proposalJSON details

Inspect func

Render

func(string) string

Render shows the roster and the latest proposals. Each proposal's line holds only fields the realm sets (id, status, class, proposer id); every value a proposer wrote follows as its own labelled, escaped item, so none can forge a field.

Open
OID
04a5d3…0fc8:62
Render details

Inspect func

unix

func(t int64) string

unix formats a unix-second time (0 = none).

Open
OID
04a5d3…0fc8:63
unix details

Inspect func

grow

func(b []uint8, n int) []uint8

grow makes room for n more bytes. The VM's append reallocates to the exact length, so appending byte by byte past capacity would copy the whole buffer each time; doubling keeps the escapers linear.

Open
OID
04a5d3…0fc8:64
grow details

Inspect func

qClass

untyped string

Escaper classes of each ASCII byte, one table lookup per byte: '.' is copied, 'b' gets a backslash, 'u' becomes \\u00XX, 'e' a numeric character reference. Stored text is printable ASCII (0x7f masks the index; no other byte reaches here).

Value

"uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu..b...u.....................u.u.............................b..................................u"

mdClass

untyped string

Escaper classes of each ASCII byte, one table lookup per byte: '.' is copied, 'b' gets a backslash, 'u' becomes \\u00XX, 'e' a numeric character reference. Stored text is printable ASCII (0x7f masks the index; no other byte reaches here).

Value

"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee.bbbb.ebbbbb.bbb..........b.ebe.b..........................bbbbbb......e...................bbbbe"

hexDigits

untyped string

Escaper classes of each ASCII byte, one table lookup per byte: '.' is copied, 'b' gets a backslash, 'u' becomes \\u00XX, 'e' a numeric character reference. Stored text is printable ASCII (0x7f masks the index; no other byte reaches here).

Value

"0123456789abcdef"

q

func(b []uint8, s string) []uint8

q appends s as a JSON string; \< > & are escaped so the text stays inert in HTML.

Open
OID
04a5d3…0fc8:65
q details

Inspect func

md

func(b []uint8, s string) []uint8

md appends s with every character Markdown, HTML or gnoweb could act on made literal.

Open
OID
04a5d3…0fc8:66
md details

Inspect func

seat

type

Value

memba_gov.seat
VotingPeriod : time.Duration =<zero>
ExecutionWindow : time.Duration =<zero>
WeightedDelay : time.Duration =<zero>
HeadcountDelay : time.Duration =<zero>
RosterDelay : time.Duration =<zero>
InactiveDelay : time.Duration =<zero>
InactiveAfter : time.Duration =<zero>
SeedInviteTTL : time.Duration =<zero>
VotedInviteTTL : time.Duration =<zero>
corePath : untyped string ="gno.land/r/samcrew/memba_gov"
MaxSeats : untyped bigint =(25 <untyped> bigint)
MinSeats : untyped bigint =(2 <untyped> bigint)
MaxScope : untyped bigint =(160 <untyped> bigint)
MaxNote : untyped bigint =(280 <untyped> bigint)
MaxAction : untyped bigint =(64 <untyped> bigint)
actAddMember : untyped string ="AddMember"
actRemoveMember : untyped string ="RemoveMember"
actSetWeight : untyped string ="SetWeight"
actRecover : untyped string ="Recover"
actRemoveInactive : untyped string ="RemoveInactive"
actUninvite : untyped string ="Uninvite"
voteYes : untyped string ="yes"
voteNo : untyped string ="no"
voteAbstain : untyped string ="abstain"
person : type =memba_gov.person
invite : type =memba_gov.invite
ballot : type =memba_gov.ballot
proposal : type =memba_gov.proposal
seated : []*memba_gov.person (len=5) Inspect
invites : []*memba_gov.invite (len=2) Inspect
proposals : *avl.Tree Inspect
scopes : *avl.Tree Inspect
lastID : uint64 =0
globalGen : uint64 =0
init.34 : func() Inspect
seedRoster : func() Inspect
now : func() int64 Inspect
secs : func(d time.Duration) int64 Inspect
Propose : func(target string, action string, args string, scope string, class int, note string) uint64 Inspect
Vote : func(pid uint64, choice string) Inspect
Join : func() Inspect
Execute : func(pid uint64) Inspect
Consume : func(pid uint64, action string, args string, scope string, minClass int, executor .uverse.address) Inspect
IsMember : func(addr .uverse.address) bool Inspect
PersonOf : func(addr .uverse.address) string Inspect
user : func() .uverse.address Inspect
member : func() *memba_gov.person Inspect
rosterClass : func(action string) int Inspect
rosterDelay : func(action string) time.Duration Inspect
checkRosterAction : func(action string, f []daoauth.Field) Inspect
weightField : func(f daoauth.Field) int Inspect
addInvite : func(id string, addr .uverse.address, weight int, ttl time.Duration) Inspect
dropInvite : func(id string) Inspect
removePerson : func(id string) Inspect
checkRoster : func() Inspect
addrTaken : func(a .uverse.address, id string) bool Inspect
invited : func(id string) bool Inspect
personByAddr : func(a .uverse.address) *memba_gov.person Inspect
personByID : func(id string) *memba_gov.person Inspect
weightOf : func(id string) int Inspect
seatedTotals : func() (w int, n int) Inspect
scopeGen : func(target string, scope string) uint64 Inspect
isOpen : func(pid uint64) bool Inspect
mustGet : func(pid uint64) *memba_gov.proposal Inspect
key : func(id uint64) string Inspect
validTarget : func(t string) bool Inspect
validAction : func(a string) bool Inspect
validID : func(id string) bool Inspect
lower : untyped string ="abcdefghijklmnopqrstuvwxyz"
upper : untyped string ="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
digits : untyped string ="0123456789"
only : func(s string, set string) bool Inspect
Routine : untyped bigint =(1 <untyped> bigint)
Financial : untyped bigint =(2 <untyped> bigint)
Critical : untyped bigint =(3 <untyped> bigint)
route : type =memba_gov.route
ruleRoutine : untyped bigint =(0 <untyped> bigint)
ruleFinancial : untyped bigint =(1 <untyped> bigint)
ruleWeighted : untyped bigint =(2 <untyped> bigint)
ruleHeadcount : untyped bigint =(3 <untyped> bigint)
meets : func(rule int, w int, p int, W int, N int) bool Inspect
routes : func(p *memba_gov.proposal) []memba_gov.route Inspect
streak : type =memba_gov.streak
yesStreaks : func(p *memba_gov.proposal) []memba_gov.streak Inspect
qualifiedSince : func(ys []memba_gov.streak, rule int, W int, N int) int64 Inspect
stExecuted : untyped string ="executed"
stInvalidated : untyped string ="invalidated"
stExpired : untyped string ="expired"
stReady : untyped string ="ready"
stTimelocked : untyped string ="timelocked"
stVoting : untyped string ="voting"
state : func(p *memba_gov.proposal) (string, int64) Inspect
vetoed : func(p *memba_gov.proposal) bool Inspect
MaxListed : untyped bigint =(20 <untyped> bigint)
RosterJSON : func() string Inspect
ProposalJSON : func(pid uint64) string Inspect
ConstantsJSON : func() string Inspect
ProposalsJSON : func(before uint64, limit int) string Inspect
proposalJSON : func(b []uint8, p *memba_gov.proposal) []uint8 Inspect
Render : func(string) string Inspect
unix : func(t int64) string Inspect
grow : func(b []uint8, n int) []uint8 Inspect
qClass : untyped string ="uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu..b...u.....................u.u.............................b..................................u"
mdClass : untyped string ="eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee.bbbb.ebbbbb.bbb..........b.ebe.b..........................bbbbbb......e...................bbbbe"
hexDigits : untyped string ="0123456789abcdef"
q : func(b []uint8, s string) []uint8 Inspect
md : func(b []uint8, s string) []uint8 Inspect
seat : type =memba_gov.seat
seedSeated : []memba_gov.seat (len=5) Inspect
seedInvited : []memba_gov.seat (len=2) Inspect