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.

sugarproxy state

Back to all declarations

ProposeAdd

func(payload string) dao.ProposalRequest

ProposeAdd adds an item at once, with no veto window: GovDAO is the veto.

Open
OID
0dd03e…f00c:3
ProposeAdd details

Inspect func

ProposeVeto

func(id int) dao.ProposalRequest

ProposeVeto vetoes an item still in its veto window.

Open
OID
0dd03e…f00c:5
ProposeVeto details

Inspect func

ProposeRemove

func(id int) dao.ProposalRequest

ProposeRemove removes an item at once.

Open
OID
0dd03e…f00c:6
ProposeRemove details

Inspect func

ProposePause

func(on bool) dao.ProposalRequest

ProposePause pauses sugar proxy (on) or resumes it: while paused, apps carry nothing and nothing new is added except by GovDAO.

Open
OID
0dd03e…f00c:7
ProposePause details

Inspect func

ProposeDelegate

func(path string) dao.ProposalRequest

ProposeDelegate names the realm that may add and remove sites ("" for none).

Open
OID
0dd03e…f00c:8
ProposeDelegate details

Inspect func

ProposeGuardian

func(a .uverse.address) dao.ProposalRequest

ProposeGuardian names the address that may veto and pause ("" for none).

Open
OID
0dd03e…f00c:9
ProposeGuardian details

Inspect func

ProposeVetoWindow

func(kind string, seconds int64) dao.ProposalRequest

ProposeVetoWindow sets how long an added item of a kind waits before it counts, in seconds (one hour to 60 days).

Open
OID
0dd03e…f00c:10
ProposeVetoWindow details

Inspect func

describeItem

func(id int) string
Open
OID
0dd03e…f00c:11
describeItem details

Inspect func

joinFields

func(f []string) string
Open
OID
0dd03e…f00c:12
joinFields details

Inspect func

ledger

*v0.Ledger

SUGAR, the governance token: kourt's grc20votes ledger (balances checkpointed per epoch of 720 blocks, about an hour, so a vote weighs what a holder held before the proposal) and kourt's governor over it. Both packages are deployed under Jae's address on gnoland-1. The governor's proposals here are of two kinds of this realm's own: add an item, remove one. Holders propose with Propose(cur, kind, payload, title), vote with Vote, and anyone may Execute a proposal that passed and whose delay is over.

Open
OID
0dd03e…f00c:14
ledger details

Inspect pointer

engine

*v0.Governor

SUGAR, the governance token: kourt's grc20votes ledger (balances checkpointed per epoch of 720 blocks, about an hour, so a vote weighs what a holder held before the proposal) and kourt's governor over it. Both packages are deployed under Jae's address on gnoland-1. The governor's proposals here are of two kinds of this realm's own: add an item, remove one. Holders propose with Propose(cur, kind, payload, title), vote with Vote, and anyone may Execute a proposal that passed and whose delay is over.

Open
OID
0dd03e…f00c:26
engine details

Inspect pointer

InitialSupply

int64

InitialSupply is minted to the deployer at init: 1,000,000 SUGAR of 6 decimals.

Value

1000000000000

kindAdd

untyped string

Value

"govern:sugar-add"

kindRemove

untyped string

Value

"govern:sugar-remove"

rules

func() v0.Rules

rules are kourt's bootstrap rules (a fifth of the supply turns out, two thirds of the votes cast say yes, a week to vote, two days' delay, two weeks to execute), except that proposing takes 0.1% of the supply: kourt's lets anyone propose.

Open
OID
0dd03e…f00c:58
rules details

Inspect func

setupGovernor

func()

setupGovernor adopts this realm's two kinds; init calls it.

Open
OID
0dd03e…f00c:60
setupGovernor details

Inspect func

mintInitial

func(to .uverse.address)
Open
OID
0dd03e…f00c:61
mintInitial details

Inspect func

KindAdd

func() string

KindAdd and KindRemove are the names to propose under.

Open
OID
0dd03e…f00c:62
KindAdd details

Inspect func

addKind

type

Value

sugarproxy.addKind

removeKind

type

Value

sugarproxy.removeKind

errStaleRealm

untyped string

Value

"sugarproxy: that realm value is not live; pass your own cur"

Propose

func(kind string, payload string, title string) int64

Propose opens a proposal: kind is KindAdd() with a payload "kind|field|...", or KindRemove() with an item's number. It needs the governor's share of the supply to propose.

Open
OID
0dd03e…f00c:65
Propose details

Inspect func

Vote

func(id int64, choice string)

Vote casts the caller's weight: "yes", "no" or "abstain".

Open
OID
0dd03e…f00c:66
Vote details

Inspect func

Execute

func(id int64)

Execute carries out a proposal that passed, once its delay is over.

Open
OID
0dd03e…f00c:67
Execute details

Inspect func

Cancel

func(id int64)

Cancel withdraws the caller's own open proposal.

Open
OID
0dd03e…f00c:68
Cancel details

Inspect func

Settle

func(id int64)

Settle closes a proposal whose voting is over.

Open
OID
0dd03e…f00c:69
Settle details

Inspect func

State

func(id int64) string

State, Describe and Tally read a proposal.

Open
OID
0dd03e…f00c:70
State details

Inspect func

DescribeProposal

func(id int64) string
Open
OID
0dd03e…f00c:71
DescribeProposal details

Inspect func

Tally

func(id int64) (yes int64, no int64, abstain int64, total int64)
Open
OID
0dd03e…f00c:72
Tally details

Inspect func

BalanceOf

func(who .uverse.address) int64
Open
OID
0dd03e…f00c:74
BalanceOf details

Inspect func

VotesOf

func(who .uverse.address) int64
Open
OID
0dd03e…f00c:75
VotesOf details

Inspect func

DelegateOf

func(who .uverse.address) .uverse.address
Open
OID
0dd03e…f00c:76
DelegateOf details

Inspect func

Allowance

func(o .uverse.address, s .uverse.address) int64
Open
OID
0dd03e…f00c:77
Allowance details

Inspect func

Transfer

func(to .uverse.address, amount int64)

Transfer sends SUGAR from the caller.

Open
OID
0dd03e…f00c:78
Transfer details

Inspect func

Approve

func(spender .uverse.address, amount int64)

Approve lets spender move up to amount of the caller's SUGAR.

Open
OID
0dd03e…f00c:79
Approve details

Inspect func

TransferFrom

func(from .uverse.address, to .uverse.address, amount int64)

TransferFrom moves SUGAR the owner approved the caller to move.

Open
OID
0dd03e…f00c:80
TransferFrom details

Inspect func

DelegateVotes

func(to .uverse.address)

DelegateVotes gives the caller's voting weight to another address (its own, to take it back).

Open
OID
0dd03e…f00c:81
DelegateVotes details

Inspect func

LaunchDays

untyped bigint

Value

(14 <untyped> bigint)

owner

.uverse.address

Value

<gnolang.StringValue>

launcher

.uverse.address

Value

<gnolang.StringValue>

launchEnd

int64

Value

1794774381

launch

func()

launch seeds the first install's items, counting at once (they are in the deployed code, which Jae signs), and starts the launcher's window. init calls it.

Open
OID
0dd03e…f00c:87
launch details

Inspect func

Launcher

func() (.uverse.address, int64)
Open
OID
0dd03e…f00c:89
Launcher details

Inspect func

LauncherAdd

func(payload string) int

LauncherAdd adds a site ("site|pattern|customer|purpose"), counting at once, from the launcher during its window.

Open
OID
0dd03e…f00c:90
LauncherAdd details

Inspect func

LauncherRemove

func(id int)

LauncherRemove removes a site, from the launcher during its window.

Open
OID
0dd03e…f00c:91
LauncherRemove details

Inspect func

denom

untyped string

Value

"ugnot"

Totals

type

Totals is what a sharer has been paid, all told.

Value

sugarproxy.Totals

Payout

type

Payout is one call to Pay.

Value

sugarproxy.Payout

Pay

func(period string, receipts string, lines string)

Pay pays sharers with the GNOT sent along. lines has one sharer a line: "address ugnot bytes"; the amounts must add up to what was sent, and a payout is at most 500 lines. period names what it pays for ("2026-11-01", say); receipts is the hex sha256 of the payer's receipts for it (one line per confirmed download: its tag, the file's sha256 and size, who carried how much), recorded here so the receipts can be checked against it later. Only an approved payer may call it; pausing doesn't stop it (sharers are owed for what they carried).

Open
OID
0dd03e…f00c:97
Pay details

Inspect func

PaidTo

func(a .uverse.address) (ugnot int64, bytes int64, count int)

PaidTo is what a sharer has been paid, all told.

Open
OID
0dd03e…f00c:99
PaidTo details

Inspect func

payerActive

func(a .uverse.address) bool
Open
OID
0dd03e…f00c:100
payerActive details

Inspect func

coinsSent

func() int64

coinsSent returns the ugnot sent with a direct call, refusing other denoms. Coins sent with a run go to the run's own address, not here, so a run sends none.

Open
OID
0dd03e…f00c:101
coinsSent details

Inspect func

Render

func(path string) string

Render shows the rules as people read them on gno.land.

Open
OID
0dd03e…f00c:102
Render details

Inspect func

errorf

func(format string, args []interface{...}) .uverse.error
Open
OID
0dd03e…f00c:105
errorf details

Inspect func

Item

type

Item is one entry of the rules: a site, a release, a hub, a customer or a payer.

Value

sugarproxy.Item

KindSite

untyped string

// fields: pattern, customer, purpose

Value

"site"

KindRelease

untyped string

// fields: version, platform, sha256, url

Value

"release"

KindHub

untyped string

// fields: host:port, pin (hex sha256 of its certificate's public key)

Value

"hub"

KindCustomer

untyped string

// fields: name, purpose

Value

"customer"

KindPayer

untyped string

// fields: address (may call Pay)

Value

"payer"

StateApproved

untyped string

Value

"approved"

StateVetoed

untyped string

Value

"vetoed"

StateRevoked

untyped string

Value

"revoked"

nextID

int

Value

19

paused

bool

Value

false

delegate

string

// the realm path that may add and remove sites; "" is none

Value

""

guardian

.uverse.address

// may veto and pause; GovDAO names it

Value

<gnolang.StringValue>

doc

string

// the canonical JSON the apps read, as params "doc"

Value

"{\"v\":1,\"seq\":2,\"paused\":false,\"items\":[{\"id\":1,\"kind\":\"customer\",\"fields\":[\"sugar\",\"sugar.video fetches the videos its users paste, to caption, translate and dub them\"],\"state\":\"approved\",\"by\":\"init\",\"approved\":1793564781,\"after\":1793564781},{\"id\":2,\"kind\""...

digest

string

// its hex sha256

Value

"0d92648daa3583ff38bc19e1e671a2b9aa85571df9fadc7877161e565772f051"

docSeq

int

// how many times it has changed

Value

2

requests

[]*sugarproxy.Request

Value

<zero>

nextReqID

int

Value

1

launching

bool

// launch.gno: while the first install's items go in

Value

false

Request

type

Request is anyone's suggestion of an item, for the token holders or the delegate to consider. It changes nothing.

Value

sugarproxy.Request

parse

func(payload string) (string, []string, .uverse.error)

parse turns "kind|field|field..." into an item's kind and fields, checking each field.

Open
OID
0dd03e…f00c:121
parse details

Inspect func

word

func(s string, min int, max int) bool
Open
OID
0dd03e…f00c:122
word details

Inspect func

sitePattern

func(s string) bool

sitePattern is a lowercase DNS name of two or more labels, or "\*." and one: what an app matches a host against.

Open
OID
0dd03e…f00c:124
sitePattern details

Inspect func

customerActive

func(name string) bool
Open
OID
0dd03e…f00c:125
customerActive details

Inspect func

add

func(payload string, by string) (int, .uverse.error)

add puts an item in, approved. by says who: its veto window applies unless GovDAO added it.

Open
OID
0dd03e…f00c:126
add details

Inspect func

end

func(id int, veto bool, by string) .uverse.error

end vetoes or removes an item: a veto only while its window is open, a removal any time. It counts at once.

Open
OID
0dd03e…f00c:127
end details

Inspect func

setPaused

func(on bool, by string)
Open
OID
0dd03e…f00c:128
setPaused details

Inspect func

publish

func()

publish writes the doc the apps read: params "doc", at gno.land's main store key "/pv/vm:\<this realm's path>:doc", which a light client proves against a block's app hash.

Open
OID
0dd03e…f00c:130
publish details

Inspect func

render

func() string

render is the canonical JSON of the rules: every item ever approved, in order, with its state, so an app can tell what counts at any time (approved, and its After passed) without trusting anyone's clock but its own.

Open
OID
0dd03e…f00c:131
render details

Inspect func

jstr

func(s string) string

jstr quotes s as a JSON string.

Open
OID
0dd03e…f00c:132
jstr details

Inspect func

Doc

func() string

Doc is the canonical JSON the apps read (the same bytes as params "doc"); Digest is its hex sha256.

Open
OID
0dd03e…f00c:133
Doc details

Inspect func

ItemID

func(payload string) int

ItemID is the number of the approved item that says exactly payload ("kind|field|..."), or 0.

Open
OID
0dd03e…f00c:135
ItemID details

Inspect func

Paused

func() bool

Paused reports whether sugar proxy is paused: apps carry nothing while it is.

Open
OID
0dd03e…f00c:136
Paused details

Inspect func

Delegate

func() string

Delegate is the realm that may add and remove sites ("" is none); Guardian may veto and pause.

Open
OID
0dd03e…f00c:137
Delegate details

Inspect func

Guardian

func() .uverse.address
Open
OID
0dd03e…f00c:138
Guardian details

Inspect func

VetoWindow

func(kind string) int64

VetoWindow is how long an added item of a kind waits before it counts, in seconds.

Open
OID
0dd03e…f00c:139
VetoWindow details

Inspect func

Suggest

func(payload string, reason string) int

Suggest records a suggestion of an item ("kind|field|..."), for the token holders or the delegate to consider. It changes nothing. Each address may have three open at a time.

Open
OID
0dd03e…f00c:140
Suggest details

Inspect func

Withdraw

func(id int)

Withdraw closes your own suggestion.

Open
OID
0dd03e…f00c:141
Withdraw details

Inspect func

DelegateAdd

func(payload string) int

DelegateAdd adds a site ("site|pattern|customer|purpose"), from the delegate realm only; it waits out the site veto window.

Open
OID
0dd03e…f00c:142
DelegateAdd details

Inspect func

DelegateRemove

func(id int)

DelegateRemove removes a site, from the delegate realm only.

Open
OID
0dd03e…f00c:143
DelegateRemove details

Inspect func

mustDelegate

func()

mustDelegate refuses any caller but the delegate realm itself, the way r/sys/params checks its delegates: none named refuses everyone, and the caller's realm path must match exactly.

Open
OID
0dd03e…f00c:144
mustDelegate details

Inspect func

GuardianVeto

func(id int)

GuardianVeto vetoes an item still in its veto window.

Open
OID
0dd03e…f00c:145
GuardianVeto details

Inspect func

GuardianRemove

func(id int)

GuardianRemove removes a site, at once: the safe direction, so the guardian may (the launcher's sites count at once, so there is no window to veto them in).

Open
OID
0dd03e…f00c:146
GuardianRemove details

Inspect func

GuardianPause

func(on bool)

GuardianPause pauses or resumes sugar proxy.

Open
OID
0dd03e…f00c:147
GuardianPause details

Inspect func

mustUser

func() .uverse.address
Open
OID
0dd03e…f00c:149
mustUser details

Inspect func
ProposeAdd : func(payload string) dao.ProposalRequest Inspect
ProposeVeto : func(id int) dao.ProposalRequest Inspect
ProposeRemove : func(id int) dao.ProposalRequest Inspect
ProposePause : func(on bool) dao.ProposalRequest Inspect
ProposeDelegate : func(path string) dao.ProposalRequest Inspect
ProposeGuardian : func(a .uverse.address) dao.ProposalRequest Inspect
ProposeVetoWindow : func(kind string, seconds int64) dao.ProposalRequest Inspect
describeItem : func(id int) string Inspect
joinFields : func(f []string) string Inspect
ledger : *v0.Ledger Inspect
engine : *v0.Governor Inspect
InitialSupply : int64 =1000000000000
kindAdd : untyped string ="govern:sugar-add"
kindRemove : untyped string ="govern:sugar-remove"
rules : func() v0.Rules Inspect
setupGovernor : func() Inspect
mintInitial : func(to .uverse.address) Inspect
KindAdd : func() string Inspect
KindRemove : func() string Inspect
addKind : type =sugarproxy.addKind
removeKind : type =sugarproxy.removeKind
errStaleRealm : untyped string ="sugarproxy: that realm value is not live; pass your own cur"
live : func() Inspect
Propose : func(kind string, payload string, title string) int64 Inspect
Vote : func(id int64, choice string) Inspect
Execute : func(id int64) Inspect
Cancel : func(id int64) Inspect
Settle : func(id int64) Inspect
State : func(id int64) string Inspect
DescribeProposal : func(id int64) string Inspect
Tally : func(id int64) (yes int64, no int64, abstain int64, total int64) Inspect
TotalSupply : func() int64 Inspect
BalanceOf : func(who .uverse.address) int64 Inspect
VotesOf : func(who .uverse.address) int64 Inspect
DelegateOf : func(who .uverse.address) .uverse.address Inspect
Allowance : func(o .uverse.address, s .uverse.address) int64 Inspect
Transfer : func(to .uverse.address, amount int64) Inspect
Approve : func(spender .uverse.address, amount int64) Inspect
TransferFrom : func(from .uverse.address, to .uverse.address, amount int64) Inspect
DelegateVotes : func(to .uverse.address) Inspect
LaunchDays : untyped bigint =(14 <untyped> bigint)
owner : .uverse.address =<gnolang.StringValue>
launcher : .uverse.address =<gnolang.StringValue>
launchSeed : []string (len=18) Inspect
launchEnd : int64 =1794774381
launch : func() Inspect
Launcher : func() (.uverse.address, int64) Inspect
LauncherAdd : func(payload string) int Inspect
LauncherRemove : func(id int) Inspect
mustLauncher : func() Inspect
denom : untyped string ="ugnot"
Totals : type =sugarproxy.Totals
Payout : type =sugarproxy.Payout
totals : *v0.Tree Inspect
payouts : []*sugarproxy.Payout (len=1) Inspect
Pay : func(period string, receipts string, lines string) Inspect
PaidTo : func(a .uverse.address) (ugnot int64, bytes int64, count int) Inspect
payerActive : func(a .uverse.address) bool Inspect
coinsSent : func() int64 Inspect
Render : func(path string) string Inspect
days : func(s int64) string Inspect
errorf : func(format string, args []interface{...}) .uverse.error Inspect
Item : type =sugarproxy.Item
KindSite : untyped string ="site"
KindRelease : untyped string ="release"
KindHub : untyped string ="hub"
KindCustomer : untyped string ="customer"
KindPayer : untyped string ="payer"
StateApproved : untyped string ="approved"
StateVetoed : untyped string ="vetoed"
StateRevoked : untyped string ="revoked"
items : []*sugarproxy.Item (len=18) Inspect
nextID : int =19
paused : bool =false
delegate : string =""
guardian : .uverse.address =<gnolang.StringValue>
vetoWin : map[string]int64 Inspect
doc : string ="{\"v\":1,\"seq\":2,\"paused\":false,\"items\":[{\"id\":1,\"kind\":\"customer\",\"fields\":[\"sugar\",\"sugar.video fetches the videos its users paste, to caption, translate and dub them\"],\"state\":\"approved\",\"by\":\"init\",\"approved\":1793564781,\"after\":1793564781},{\"id\":2,\"kind\""...
digest : string ="0d92648daa3583ff38bc19e1e671a2b9aa85571df9fadc7877161e565772f051"
docSeq : int =2
requests : []*sugarproxy.Request =<zero>
nextReqID : int =1
launching : bool =false
Request : type =sugarproxy.Request
init.84 : func() Inspect
parse : func(payload string) (string, []string, .uverse.error) Inspect
word : func(s string, min int, max int) bool Inspect
hexOf : func(s string, n int) bool Inspect
sitePattern : func(s string) bool Inspect
customerActive : func(name string) bool Inspect
add : func(payload string, by string) (int, .uverse.error) Inspect
end : func(id int, veto bool, by string) .uverse.error Inspect
setPaused : func(on bool, by string) Inspect
find : func(id int) *sugarproxy.Item Inspect
publish : func() Inspect
render : func() string Inspect
jstr : func(s string) string Inspect
Doc : func() string Inspect
Digest : func() string Inspect
ItemID : func(payload string) int Inspect
Paused : func() bool Inspect
Delegate : func() string Inspect
Guardian : func() .uverse.address Inspect
VetoWindow : func(kind string) int64 Inspect
Suggest : func(payload string, reason string) int Inspect
Withdraw : func(id int) Inspect
DelegateAdd : func(payload string) int Inspect
DelegateRemove : func(id int) Inspect
mustDelegate : func() Inspect
GuardianVeto : func(id int) Inspect
GuardianRemove : func(id int) Inspect
GuardianPause : func(on bool) Inspect
mustGuardian : func() Inspect
mustUser : func() .uverse.address Inspect