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

v0 state

Back to all declarations

denom

untyped string

Value

"ugnot"

Window

int64

The rules, fixed at deploy. Times are block heights.

Value

2000

Floor

int64

The rules, fixed at deploy. Times are block heights.

Value

300

Life

int64

The rules, fixed at deploy. Times are block heights.

Value

100000

BumpPct

int64

The rules, fixed at deploy. Times are block heights.

Value

20

DividendPct

int64

The rules, fixed at deploy. Times are block heights.

Value

50

MinWrite

int64

The rules, fixed at deploy. Times are block heights.

Value

1000000

PerByte

int64

The rules, fixed at deploy. Times are block heights.

Value

1000

MaxLen

untyped bigint

The rules, fixed at deploy. Times are block heights.

Value

(280 <untyped> bigint)

message

string

Value

""

author

.uverse.address

Value

<gnolang.StringValue>

paid

int64

// what the current holder paid

Value

0

pot

int64

// what settlement will split

Value

0

writers

v0.Tree

// address string -> int64 total paid

Open
OID
0110e8…6f8e:38
writers details

Inspect ref

order

[]string

// writers in first-write order, so the split is deterministic

Value

<zero>

writes

int64

Value

0

settled

bool

Value

false

open

func(h int64)

open resets the game to a fresh slot at height h. It is the only place the clock is built, so tests and init cannot disagree about the rules.

Open
OID
0110e8…6f8e:19
open details

Inspect func

Price

func(msg string) int64

Price returns what msg costs to write right now, in ugnot: a base, plus a charge per byte, and always at least one ugnot more than the current holder paid. Query it before sending; an underpaying write is refused, not refunded.

Open
OID
0110e8…6f8e:20
Price details

Inspect func

Write

func(msg string)

Write puts msg in the slot and makes the caller its holder. The caller must send at least Price(msg) ugnot with the transaction. Half of the payment is credited to the writer being displaced and the rest joins the pot. The deadline is pushed a fifth of the way toward the hard end, never past it, and never to less than Floor from now. Only a direct user transaction may write, so the payment envelope cannot be spoofed by an ephemeral MsgRun realm.

Open
OID
0110e8…6f8e:21
Write details

Inspect func

Settle

func()

Settle closes the game once the clock has run out, splitting the pot among every writer EXCEPT the one holding the slot, pro rata to what each paid. Anyone may call it: leaving settlement to an interested party is how a pot stays unclaimed. It moves no coins, it credits the ledger; Withdraw is what pays. If the holder is the only writer there is nobody else to split with, so the pot returns to them.

Open
OID
0110e8…6f8e:22
Settle details

Inspect func

Withdraw

func() int64

Withdraw pays the caller everything credited to them and returns the amount. Dividends are claimable while the game runs; settlement shares only after Settle.

Open
OID
0110e8…6f8e:23
Withdraw details

Inspect func

Message

func() string

Message returns the slot's current contents, raw. Render is what escapes it.

Open
OID
0110e8…6f8e:24
Message details

Inspect func

Pot

func() int64

Pot returns what settlement will split.

Open
OID
0110e8…6f8e:26
Pot details

Inspect func

Deadline

func() int64

Deadline returns the height the slot closes at.

Open
OID
0110e8…6f8e:27
Deadline details

Inspect func

Owed

func(addr .uverse.address) int64

Owed returns what an address can Withdraw right now.

Open
OID
0110e8…6f8e:28
Owed details

Inspect func

totalPaid

func(key string) int64

totalPaid returns what an address has paid in total, zero if it never wrote.

Open
OID
0110e8…6f8e:29
totalPaid details

Inspect func

Render

func(path string) string

Render shows the slot, the clock and the money. The message is caller-typed text, so it goes through ui.Inline: a stored string that renders as markdown is a phishing link on a page nobody can edit, and this realm's whole product is a string somebody else wrote.

Open
OID
0110e8…6f8e:31
Render details

Inspect func
denom : untyped string ="ugnot"
Window : int64 =2000
Floor : int64 =300
Life : int64 =100000
BumpPct : int64 =20
DividendPct : int64 =50
MinWrite : int64 =1000000
PerByte : int64 =1000
MaxLen : untyped bigint =(280 <untyped> bigint)
clk : *v0.Clock Inspect
ledger : *v0.Ledger Inspect
message : string =""
author : .uverse.address =<gnolang.StringValue>
paid : int64 =0
pot : int64 =0
writers : v0.Tree Inspect
order : []string =<zero>
writes : int64 =0
settled : bool =false
init.19 : func() Inspect
open : func(h int64) Inspect
Price : func(msg string) int64 Inspect
Write : func(msg string) Inspect
Settle : func() Inspect
Withdraw : func() int64 Inspect
Message : func() string Inspect
Author : func() .uverse.address Inspect
Pot : func() int64 Inspect
Deadline : func() int64 Inspect
Owed : func(addr .uverse.address) int64 Inspect
totalPaid : func(key string) int64 Inspect
gnot : func(ugnot int64) string Inspect
Render : func(path string) string Inspect