Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

clubpoll source realm

Package clubpoll is a Remix Lab "club-poll" app generated from a project configuration. Members join by invitation; m...

Overview

Package clubpoll is a Remix Lab "club-poll" app generated from a project configuration. Members join by invitation; members vote in single-choice polls whose electorate is frozen when each poll opens.

Authority model: every write derives the actor from cur.Previous(), the immediate caller. An intermediary realm calling on a user's behalf acts as itself and gains none of that user's roles. Block state lives in unexported variables and only inert views leave the realm.

Functions 21

func CancelPoll

crossing Action
1func CancelPoll(cur realm, id uint64)
source

CancelPoll deletes a draft poll that was never opened, freeing its slot. The poll's creator may cancel it, and so may anyone allowed to open polls.

func CreatePoll

crossing Action
1func CreatePoll(cur realm, title string, options string, durationSeconds int64) uint64
source

CreatePoll creates a draft poll. options are separated by "|".

func Descriptor

Action
1func Descriptor() core.AppDescriptor
source

Descriptor identifies this app's recipe and components.

func Finalize

crossing Action
1func Finalize(cur realm, id uint64)
source

Finalize commits a poll's result once its deadline has passed. Anyone may call it; the result depends only on rules frozen at opening.

func HasVoted

Action
1func HasVoted(id uint64, addr address) bool
source

HasVoted reports whether addr voted in poll id.

func Invite

crossing Action
1func Invite(cur realm, addr address, role string)
source

Invite lets addr join with role. Inviting a reviewer or owner also requires the members.set_role permission.

func Invites

Action
1func Invites(offset, limit int) []core.MemberView
source

Invites returns up to limit pending invitations (at most 25) starting at offset, with the role each one grants.

func Join

crossing Action
1func Join(cur realm)
source

Join accepts the caller's pending invitation.

func Leave

crossing Action
1func Leave(cur realm)
source

Leave removes the caller from the club. Open polls keep their frozen electorate.

func Members

Action
1func Members(offset, limit int) []core.MemberView
source

Members pages through members ordered by address.

func OpenPoll

crossing Action
1func OpenPoll(cur realm, id uint64)
source

OpenPoll freezes the poll's options and captures the current members as its electorate.

func Poll

Action
1func Poll(id uint64) (core.BallotView, bool)
source

Poll returns an inert summary of poll id.

func Polls

Action
1func Polls(offset, limit int) []core.BallotView
source

Polls pages through polls, newest first.

func Render

1func Render(path string) string
source

Render serves the native pages: overview, polls, a single poll, members and rules.

func RevokeInvite

crossing Action
1func RevokeInvite(cur realm, addr address)
source

RevokeInvite cancels a pending invitation. Revoking an invitation for a reviewer or owner also requires the members.set_role permission.

func Rules

Action
1func Rules() []policies.RuleView
source

Rules lists every operation's current rule.

func SetRole

crossing Action
1func SetRole(cur realm, addr address, role string)
source

SetRole changes addr's role.

func SetRule

crossing Action
1func SetRule(cur realm, op string, rule string)
source

SetRule changes the rule for an operation, within that operation's floor.

func Vote

crossing Action
1func Vote(cur realm, id uint64, choice int)
source

Vote casts the caller's vote for option index choice.

Dependencies

Source Files 4