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

friends_surf_club state

Back to all declarations

TemplateVersion

untyped string

Value

"memba-dao/2"

APIVersion

untyped string

Value

"2.0"

maxMembers

untyped bigint

Value

(100 <untyped> bigint)

maxPower

untyped bigint

// total \<= 1e11, so x100 stays far below MaxInt64

Value

(1000000000 <untyped> bigint)

maxTitleLen

untyped bigint

Value

(128 <untyped> bigint)

maxDescLen

untyped bigint

Value

(8000 <untyped> bigint)

maxOpenPerMember

untyped bigint

Value

(10 <untyped> bigint)

maxPageSize

untyped bigint

Value

(50 <untyped> bigint)

renderPageSize

untyped bigint

Value

(20 <untyped> bigint)

kindText

untyped string

Value

"text"

kindAddMember

untyped string

Value

"add_member"

kindRemoveMember

untyped string

Value

"remove_member"

kindSetRoles

untyped string

Value

"set_roles"

kindArchive

untyped string

Value

"archive"

statusActive

untyped string

Value

"ACTIVE"

statusAccepted

untyped string

Value

"ACCEPTED"

statusRejected

untyped string

Value

"REJECTED"

statusExecuted

untyped string

Value

"EXECUTED"

statusExpired

untyped string

Value

"EXPIRED"

statusLapsed

untyped string

Value

"LAPSED"

statusInvalidated

untyped string

Value

"INVALIDATED"

statusArchived

untyped string

Value

"ARCHIVED"

Member

type

Value

friends_surf_club.Member

Action

type

Action is stored by value inside its proposal at propose time. It holds primitives only and is never modified afterwards. The handler for an action is chosen by Kind in Execute; there is no other dispatch.

Value

friends_surf_club.Action

VoteRecord

type

Value

friends_surf_club.VoteRecord

Proposal

type

Value

friends_surf_club.Proposal

name

string

Value

"Friends Surf Club"

description

string

Value

"Let's surf & ride with friends.\n#SurfTrip #Waves\n\nThis DAO is the made for testing purpose of Memba OS implementation, in order to experiment cross-features interactions, UX architecture, and UI implementations in a fun context.\n"

nameJSON

string

// JSON-encoded once by the generator

Value

"\"Friends Surf Club\""

descriptionJSON

string

Value

"\"Let's surf & ride with friends.\\n#SurfTrip #Waves\\n\\nThis DAO is the made for testing purpose of Memba OS implementation, in order to experiment cross-features interactions, UX architecture, and UI implementations in a fun context.\\n\""

threshold

int

// % of all voting power that must vote YES

Value

51

quorum

int

// % of all voting power that must vote (0 = none)

Value

0

votingPeriod

int64

// seconds

Value

259200

executionDelay

int64

// seconds after acceptance

Value

3600

executionWindow

int64

// seconds after the delay

Value

604800

memberTotalPower

int

Value

8

proposals

*v0.Tree

// zero-padded id -> \*Proposal

Open
OID
0f8f11…f22a:21
proposals details

Inspect pointer

descriptions

*v0.Tree

// zero-padded id -> string (kept apart so list reads stay cheap)

Open
OID
0f8f11…f22a:24
descriptions details

Inspect pointer

openByAuthor

*v0.Tree

// address -> \[]uint64 (ids that may still be open)

Open
OID
0f8f11…f22a:27
openByAuthor details

Inspect pointer

lastID

uint64

Value

2

electorateVersion

int

// bumped when a member is added or removed

Value

1

archived

bool

Value

false

addGenesisMember

func(addr string, power int, roles []string)
Open
OID
0f8f11…f22a:34
addGenesisMember details

Inspect func

assertNotArchived

func()
Open
OID
0f8f11…f22a:37
assertNotArchived details

Inspect func

getMember

func(addr .uverse.address) *friends_surf_club.Member
Open
OID
0f8f11…f22a:38
getMember details

Inspect func

assertMember

func(addr .uverse.address) *friends_surf_club.Member
Open
OID
0f8f11…f22a:39
assertMember details

Inspect func

isLowerCase

func(a .uverse.address) bool

isLowerCase refuses the upper-case bech32 spelling, which IsValid accepts: it names the same account under a different member key. Only call it on an address that passed IsValid: bech32 refuses mixed case, so the first character decides (a byte loop would cost gas per character per member).

Open
OID
0f8f11…f22a:40
isLowerCase details

Inspect func

contains

func(list []string, s string) bool
Open
OID
0f8f11…f22a:41
contains details

Inspect func

checkRoles

func(roles []string)
Open
OID
0f8f11…f22a:42
checkRoles details

Inspect func

parseRoles

func(csv string) []string
Open
OID
0f8f11…f22a:43
parseRoles details

Inspect func

checkDescription

func(desc string)
Open
OID
0f8f11…f22a:46
checkDescription details

Inspect func

validateAction

func(a friends_surf_club.Action)

validateAction checks an action against the current state. Propose calls it before storing the proposal and Execute calls it again before applying.

Open
OID
0f8f11…f22a:47
validateAction details

Inspect func

getProposal

func(id uint64) *friends_surf_club.Proposal
Open
OID
0f8f11…f22a:49
getProposal details

Inspect func

proposalDescription

func(id uint64) string
Open
OID
0f8f11…f22a:50
proposalDescription details

Inspect func

mustProposal

func(id uint64) *friends_surf_club.Proposal
Open
OID
0f8f11…f22a:51
mustProposal details

Inspect func

derivedStatus

func(p *friends_surf_club.Proposal) string

derivedStatus is the status every read and write relies on. Time-based and membership-based transitions are computed here, never written.

Open
OID
0f8f11…f22a:52
derivedStatus details

Inspect func

openIDs

func(author .uverse.address) []uint64

openIDs returns the author's proposals that are still open for voting. The stored list never grows past maxOpenPerMember, so this stays bounded.

Open
OID
0f8f11…f22a:53
openIDs details

Inspect func

propose

func(caller .uverse.address, title string, desc string, category string, a friends_surf_club.Action) uint64
Open
OID
0f8f11…f22a:54
propose details

Inspect func

ProposeText

func(title string, desc string, category string) uint64

ProposeText creates a proposal with no on-chain effect.

Open
OID
0f8f11…f22a:55
ProposeText details

Inspect func

ProposeAddMember

func(title string, desc string, target .uverse.address, power int, rolesCSV string) uint64

ProposeAddMember proposes adding target with power and comma-separated roles.

Open
OID
0f8f11…f22a:56
ProposeAddMember details

Inspect func

ProposeRemoveMember

func(title string, desc string, target .uverse.address) uint64

ProposeRemoveMember proposes removing target.

Open
OID
0f8f11…f22a:57
ProposeRemoveMember details

Inspect func

ProposeSetRoles

func(title string, desc string, target .uverse.address, rolesCSV string) uint64

ProposeSetRoles proposes replacing target's role labels.

Open
OID
0f8f11…f22a:58
ProposeSetRoles details

Inspect func

ProposeArchive

func(title string, desc string) uint64

ProposeArchive proposes archiving the DAO. Archiving is permanent.

Open
OID
0f8f11…f22a:59
ProposeArchive details

Inspect func

reached

func(part int, whole int, pct int) bool

reached reports part/whole >= pct/100 without division. part and whole are at most maxMembers\*maxPower (1e11), so part\*100 cannot overflow.

Open
OID
0f8f11…f22a:60
reached details

Inspect func

Vote

func(id uint64, choice string)

Vote records the caller's YES, NO or ABSTAIN. A proposal is ACCEPTED once YES alone reaches the threshold of all voting power (and quorum is met), and REJECTED once that has become impossible.

Open
OID
0f8f11…f22a:61
Vote details

Inspect func

Execute

func(id uint64)

Execute applies an accepted proposal after the execution delay and before the execution window closes. The stored action is checked again against the current state first; the proposal is marked EXECUTED only after it applied.

Open
OID
0f8f11…f22a:62
Execute details

Inspect func

GetTemplateVersion

func() string
Open
OID
0f8f11…f22a:63
GetTemplateVersion details

Inspect func

GetAPIVersion

func() string
Open
OID
0f8f11…f22a:64
GetAPIVersion details

Inspect func

IsMember

func(addr .uverse.address) bool

IsMember lets a companion realm check membership.

Open
OID
0f8f11…f22a:65
IsMember details

Inspect func

HasVoted

func(id uint64, addr .uverse.address) bool
Open
OID
0f8f11…f22a:67
HasVoted details

Inspect func

jsonBuf

type

Value

friends_surf_club.jsonBuf

checkPage

func(offset int, limit int)
Open
OID
0f8f11…f22a:68
checkPage details

Inspect func

writeConfig

func(j *friends_surf_club.jsonBuf)
Open
OID
0f8f11…f22a:69
writeConfig details

Inspect func

GetConfigJSON

func() string

GetConfigJSON returns the DAO's settings and current totals.

Open
OID
0f8f11…f22a:70
GetConfigJSON details

Inspect func

writeMembers

func(j *friends_surf_club.jsonBuf, offset int, limit int)
Open
OID
0f8f11…f22a:71
writeMembers details

Inspect func

GetMembersJSON

func(offset int, limit int) string

GetMembersJSON returns one page of members (limit 1..50).

Open
OID
0f8f11…f22a:72
GetMembersJSON details

Inspect func

fixedJSON

func(p *friends_surf_club.Proposal) string

fixedJSON encodes the proposal fields that never change. The action's target is a validated address (or empty) and its roles are identifiers.

Open
OID
0f8f11…f22a:73
fixedJSON details

Inspect func

writeProposalFields

func(j *friends_surf_club.jsonBuf, p *friends_surf_club.Proposal)
Open
OID
0f8f11…f22a:74
writeProposalFields details

Inspect func

GetProposalsJSON

func(before uint64, limit int) string

GetProposalsJSON lists proposals newest first (limit 1..50). before=0 starts at the newest; pass the returned next\_before to get the following page (next\_before 0 means there is none). Descriptions are only returned by GetProposalJSON, which keeps a full page small.

Open
OID
0f8f11…f22a:75
GetProposalsJSON details

Inspect func

GetProposalJSON

func(id uint64) string

GetProposalJSON returns one proposal including its description.

Open
OID
0f8f11…f22a:76
GetProposalJSON details

Inspect func

GetVotesJSON

func(id uint64, offset int, limit int) string

GetVotesJSON returns one page of a proposal's votes (limit 1..50).

Open
OID
0f8f11…f22a:77
GetVotesJSON details

Inspect func

GetStateJSON

func(offset int, limit int) string

GetStateJSON exports the settings and one page of members, so the DAO can be recreated elsewhere.

Open
OID
0f8f11…f22a:78
GetStateJSON details

Inspect func

escapeInline

func(s string) string

escapeInline makes a user string safe on one markdown line: markdown punctuation is backslash-escaped and control characters become spaces.

Open
OID
0f8f11…f22a:79
escapeInline details

Inspect func

quoteBlock

func(s string) string

quoteBlock renders multi-line text as a quote, one escaped line at a time.

Open
OID
0f8f11…f22a:80
quoteBlock details

Inspect func

renderHome

func(page int) string
Open
OID
0f8f11…f22a:82
renderHome details

Inspect func

renderProposal

func(p *friends_surf_club.Proposal) string
Open
OID
0f8f11…f22a:83
renderProposal details

Inspect func
TemplateVersion : untyped string ="memba-dao/2"
APIVersion : untyped string ="2.0"
maxMembers : untyped bigint =(100 <untyped> bigint)
maxPower : untyped bigint =(1000000000 <untyped> bigint)
maxTitleLen : untyped bigint =(128 <untyped> bigint)
maxDescLen : untyped bigint =(8000 <untyped> bigint)
maxOpenPerMember : untyped bigint =(10 <untyped> bigint)
maxPageSize : untyped bigint =(50 <untyped> bigint)
renderPageSize : untyped bigint =(20 <untyped> bigint)
kindText : untyped string ="text"
kindAddMember : untyped string ="add_member"
kindRemoveMember : untyped string ="remove_member"
kindSetRoles : untyped string ="set_roles"
kindArchive : untyped string ="archive"
statusActive : untyped string ="ACTIVE"
statusAccepted : untyped string ="ACCEPTED"
statusRejected : untyped string ="REJECTED"
statusExecuted : untyped string ="EXECUTED"
statusExpired : untyped string ="EXPIRED"
statusLapsed : untyped string ="LAPSED"
statusInvalidated : untyped string ="INVALIDATED"
statusArchived : untyped string ="ARCHIVED"
Member : type =friends_surf_club.Member
Action : type =friends_surf_club.Action
VoteRecord : type =friends_surf_club.VoteRecord
Proposal : type =friends_surf_club.Proposal
name : string ="Friends Surf Club"
description : string ="Let's surf & ride with friends.\n#SurfTrip #Waves\n\nThis DAO is the made for testing purpose of Memba OS implementation, in order to experiment cross-features interactions, UX architecture, and UI implementations in a fun context.\n"
nameJSON : string ="\"Friends Surf Club\""
descriptionJSON : string ="\"Let's surf & ride with friends.\\n#SurfTrip #Waves\\n\\nThis DAO is the made for testing purpose of Memba OS implementation, in order to experiment cross-features interactions, UX architecture, and UI implementations in a fun context.\\n\""
threshold : int =51
quorum : int =0
votingPeriod : int64 =259200
executionDelay : int64 =3600
executionWindow : int64 =604800
allowedCategories : []string (len=3) Inspect
allowedRoles : []string (len=2) Inspect
members : *v0.Tree Inspect
memberTotalPower : int =8
proposals : *v0.Tree Inspect
descriptions : *v0.Tree Inspect
openByAuthor : *v0.Tree Inspect
lastID : uint64 =2
electorateVersion : int =1
archived : bool =false
init.45 : func() Inspect
addGenesisMember : func(addr string, power int, roles []string) Inspect
checkGenesis : func() Inspect
now : func() int64 Inspect
assertNotArchived : func() Inspect
getMember : func(addr .uverse.address) *friends_surf_club.Member Inspect
assertMember : func(addr .uverse.address) *friends_surf_club.Member Inspect
isLowerCase : func(a .uverse.address) bool Inspect
contains : func(list []string, s string) bool Inspect
checkRoles : func(roles []string) Inspect
parseRoles : func(csv string) []string Inspect
isControl : func(r int32) bool Inspect
checkTitle : func(title string) Inspect
checkDescription : func(desc string) Inspect
validateAction : func(a friends_surf_club.Action) Inspect
padID : func(id uint64) string Inspect
getProposal : func(id uint64) *friends_surf_club.Proposal Inspect
proposalDescription : func(id uint64) string Inspect
mustProposal : func(id uint64) *friends_surf_club.Proposal Inspect
derivedStatus : func(p *friends_surf_club.Proposal) string Inspect
openIDs : func(author .uverse.address) []uint64 Inspect
propose : func(caller .uverse.address, title string, desc string, category string, a friends_surf_club.Action) uint64 Inspect
ProposeText : func(title string, desc string, category string) uint64 Inspect
ProposeAddMember : func(title string, desc string, target .uverse.address, power int, rolesCSV string) uint64 Inspect
ProposeRemoveMember : func(title string, desc string, target .uverse.address) uint64 Inspect
ProposeSetRoles : func(title string, desc string, target .uverse.address, rolesCSV string) uint64 Inspect
ProposeArchive : func(title string, desc string) uint64 Inspect
reached : func(part int, whole int, pct int) bool Inspect
Vote : func(id uint64, choice string) Inspect
Execute : func(id uint64) Inspect
GetTemplateVersion : func() string Inspect
GetAPIVersion : func() string Inspect
IsMember : func(addr .uverse.address) bool Inspect
IsArchived : func() bool Inspect
HasVoted : func(id uint64, addr .uverse.address) bool Inspect
jsonBuf : type =friends_surf_club.jsonBuf
checkPage : func(offset int, limit int) Inspect
writeConfig : func(j *friends_surf_club.jsonBuf) Inspect
GetConfigJSON : func() string Inspect
writeMembers : func(j *friends_surf_club.jsonBuf, offset int, limit int) Inspect
GetMembersJSON : func(offset int, limit int) string Inspect
fixedJSON : func(p *friends_surf_club.Proposal) string Inspect
writeProposalFields : func(j *friends_surf_club.jsonBuf, p *friends_surf_club.Proposal) Inspect
GetProposalsJSON : func(before uint64, limit int) string Inspect
GetProposalJSON : func(id uint64) string Inspect
GetVotesJSON : func(id uint64, offset int, limit int) string Inspect
GetStateJSON : func(offset int, limit int) string Inspect
escapeInline : func(s string) string Inspect
quoteBlock : func(s string) string Inspect
Render : func(path string) string Inspect
renderHome : func(page int) string Inspect
renderProposal : func(p *friends_surf_club.Proposal) string Inspect