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.

v0 state

Back to all declarations

MaxInstances

untyped bigint

Caps. Everything a caller can grow is bounded, because all of it is storage somebody pays a deposit on.

Value

(64 <untyped> bigint)

MaxOutput

untyped bigint

Caps. Everything a caller can grow is bounded, because all of it is storage somebody pays a deposit on.

Value

(4096 <untyped> bigint)

MaxInput

untyped bigint

Caps. Everything a caller can grow is bounded, because all of it is storage somebody pays a deposit on.

Value

(1024 <untyped> bigint)

DefaultFuel

untyped bigint

Caps. Everything a caller can grow is bounded, because all of it is storage somebody pays a deposit on.

Value

(100000 <untyped> bigint)

MaxSliceFuel

untyped bigint

Caps. Everything a caller can grow is bounded, because all of it is storage somebody pays a deposit on.

Value

(5000000 <untyped> bigint)

idgen

v0.ID

Value

<zero>

count

int

Value

0

host

type

host is the realm-backed [vmkit.Host](/gno.land/p/nym-moultest123/x/vm/vmkit/v0#Host). One is built per call, wrapping the instance being stepped, so a guest's output and authority are scoped to it and nothing ambient leaks in.

Value

v0.host

Upload

func(src string, input string, budget int64) string

Upload compiles src and stores it as a new instance, returning its id. Compilation happens here rather than at the first Step, so an unbalanced program is rejected by the transaction that submitted it instead of costing somebody else the gas later.

Open
OID
01c0bf…6c45:41
Upload details

Inspect func

Step

func(id string, fuel int64) string

Step runs one slice of the instance: up to \`fuel\` guest ops, then stop and keep the snapshot. Anyone may pay for a slice, not only the owner: a paused program that only its owner can advance is a worse demo and no safer, since the program and its budget were both fixed at upload.

Open
OID
01c0bf…6c45:43
Step details

Inspect func

Remove

func(id string)

Remove deletes an instance. Owner only.

Open
OID
01c0bf…6c45:44
Remove details

Inspect func

samples

[]struct{...} (len=3)

samples are the programs the home page offers, so the realm is usable without writing Brainfuck by hand.

Open
OID
01c0bf…6c45:47
samples details (len=3)

+3 more Inspect slice

Render

func(path string) string

Render is the realm's gnoweb view. - "/" the samples, the instance list, and how the thing works. - "/\<id>" one instance: its program, status, fuel and output.

Open
OID
01c0bf…6c45:51
Render details

Inspect func

renderInstance

func(id string) string
Open
OID
01c0bf…6c45:54
renderInstance details

Inspect func

operatorsOnly

func(src string) string

operatorsOnly strips a program down to the eight characters the language defines. Everything else is a comment by definition, and a comment is attacker-controlled text that has no business reaching a renderer.

Open
OID
01c0bf…6c45:56
operatorsOnly details

Inspect func

printable

func(b []uint8, max int) string

printable renders guest output for a code fence: printable ASCII as itself, everything else as an escape. A guest writes arbitrary bytes, so this is the only form of it that is safe to show.

Open
OID
01c0bf…6c45:57
printable details

Inspect func

codeCell

func(s string) string

codeCell puts already-printable text in a code span inside a table cell. Inside backticks markdown escapes are not applied, so ui.Cell's backslashes would reach the reader verbatim ("Hello, gno\\.land"); the one character a table cell still needs escaped there is the pipe. printable has already removed the backtick and the newline, the other two that could break out.

Open
OID
01c0bf…6c45:58
codeCell details

Inspect func
MaxInstances : untyped bigint =(64 <untyped> bigint)
MaxOutput : untyped bigint =(4096 <untyped> bigint)
MaxInput : untyped bigint =(1024 <untyped> bigint)
DefaultFuel : untyped bigint =(100000 <untyped> bigint)
MaxSliceFuel : untyped bigint =(5000000 <untyped> bigint)
store : *v0.Store Inspect
inputs : *v0.Tree Inspect
idgen : v0.ID =<zero>
count : int =0
host : type =v0.host
Upload : func(src string, input string, budget int64) string Inspect
Step : func(id string, fuel int64) string Inspect
Remove : func(id string) Inspect
inputOf : func(id string) string Inspect
samples : []struct{...} (len=3) Inspect
Render : func(path string) string Inspect
renderHome : func() string Inspect
renderInstance : func(id string) string Inspect
fuelText : func(n int64) string Inspect
operatorsOnly : func(src string) string Inspect
printable : func(b []uint8, max int) string Inspect
codeCell : func(s string) string Inspect