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

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/moul/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
053b6b…1cf0:13
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
053b6b…1cf0:15
Step details

Inspect func

Remove

func(id string)

Remove deletes an instance. Owner only.

Open
OID
053b6b…1cf0:16
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
053b6b…1cf0:19
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
053b6b…1cf0:23
Render details

Inspect func

renderInstance

func(id string) string
Open
OID
053b6b…1cf0:26
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
053b6b…1cf0:28
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
053b6b…1cf0:29
printable 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