InitialCredits
int64InitialCredits is the fixed voice-credit budget every address gets to spend on each poll (shared across all of that poll's options).
Value
100
minOptions
untyped bigintValue
(2 <untyped> bigint)
maxOptions
untyped bigintValue
(8 <untyped> bigint)
poll
typeValue
v0.poll
voterState
typevoterState is one address's standing inside one poll: how many credits they've spent so far and how many votes that bought them on each option.
Value
v0.voterState
polls
v0.Tree// poll ID -> \*poll
- OID
- 0168a7…eec0:4
polls details
voters
v0.Tree// "\<pollID>:\<addr>" -> \*voterState
- OID
- 0168a7…eec0:6
voters details
nextID
intValue
0
voterKey
func(pollID string, addr .uverse.address) string- OID
- 0168a7…eec0:8
voterKey details
getPoll
func(pollID string) *v0.poll- OID
- 0168a7…eec0:10
getPoll details
getOrCreateVoter
func(pollID string, addr .uverse.address, numOptions int) *v0.voterState- OID
- 0168a7…eec0:11
getOrCreateVoter details
square
func(n int64) int64square is the quadratic-voting cost curve: N votes on one option cost N\*N credits in total.
- OID
- 0168a7…eec0:12
square details
CreatePoll
func(question string, optionsCSV string) stringCreatePoll opens a new poll with the given question and comma-separated options (at least 2, at most 8), returning its ID.
- OID
- 0168a7…eec0:13
CreatePoll details
Vote
func(pollID string, optionIdx int, delta int64) stringVote adjusts the caller's votes on one option of a poll by delta (positive to buy more, negative to sell some back for a credit refund). The credit cost of holding N votes on an option is N\*N, taken from the caller's fixed per-poll budget of InitialCredits.
- OID
- 0168a7…eec0:14
Vote details
ClosePoll
func(pollID string) stringClosePoll ends voting on a poll. Only its creator may close it.
- OID
- 0168a7…eec0:15
ClosePoll details
escapeInline
func(s string) stringescapeInline neutralizes markdown-active characters in untrusted text before it's embedded inline in Render output.
- OID
- 0168a7…eec0:16
escapeInline details
leadingOption
func(p *v0.poll) (string, int64)- OID
- 0168a7…eec0:17
leadingOption details
renderHome
func() string- OID
- 0168a7…eec0:18
renderHome details
renderPoll
func(id string) string- OID
- 0168a7…eec0:19
renderPoll details
renderVoter
func(pollID string, rawAddr string) string- OID
- 0168a7…eec0:20
renderVoter details
Render
func(path string) stringRender shows the poll board at "", one poll's results at "\<pollID>", or one voter's standing in a poll at "\<pollID>/\<addr>".
- OID
- 0168a7…eec0:21