PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/p/moul/x/vm/vmkit/v0

Package
Open in gnoweb ↗

Overview

Kind
Pure package
Name
v0
Namespace
moul / x / vm / vmkit
Files
9 (README)(gnomod.toml)
Exported functions
n/a — not supported for pure packages by the node (vm/qfuncs)
Module
gno.land/p/moul/x/vm/vmkit/v0
gno
0.9

Files (9)

  • README.mdmarkdown
  • gnomod.tomltoml
  • codec.gnogno
  • fuel.gnogno
  • host.gnogno
  • instance.gnogno
  • machine.gnogno
  • testhost.gnogno
  • vmkit_test.gnogno
  • host.gnogno
    1package vmkit23import "errors"45// ErrNotGranted is returned by a [Host] for a capability the instance was6// never given. A guest that ignores the error and keeps going is a guest bug;7// a machine should turn it into a [Trapped] status.8var ErrNotGranted = errors.New("vmkit: capability not granted")910// Host is everything a guest program can reach outside its own memory.11//12// It is deliberately small, and deliberately handed in rather than looked up:13// a guest has exactly the authority its [Host] carries. Gno realm code has14// ambient authority through the realm frame, so the guest is where the15// capability-secure version can actually be tried.16//17// Every method must be deterministic across replays of the same block. Now18// and Height come from the chain, never from a wall clock.19type Host interface {20	// Caller is the address that called the realm running this guest.21	Caller() address22	// Origin is the address that signed the transaction.23	Origin() address24	// Now is block time in Unix seconds, never wall time.25	Now() int6426	// Height is the block height.27	Height() int642829	// Get reads from storage scoped to this instance. A miss is nil.30	Get(key []byte) []byte31	// Set writes to storage scoped to this instance.32	Set(key, val []byte)3334	// Input is the immutable call input for this slice of execution: the35	// guest's calldata, argv, or stdin depending on the machine. A machine36	// tracks its own read cursor, in its snapshot, so that resuming reads37	// the byte it had not read yet.38	Input() []byte39	// Output appends to the guest's output buffer.40	Output(p []byte)4142	// Emit writes a chain event. kv is a flat list of alternating keys and43	// values; an odd trailing element is dropped.44	Emit(typ string, kv ...string)45	// Send transfers amount ugnot to `to`, and returns [ErrNotGranted]46	// unless the deploying realm funded this instance with a budget.47	Send(to address, amount int64) error48	// Log records a diagnostic line. Never consensus-relevant.49	Log(msg string)50}51

    Functions

    not supported for pure packages by the node (vm/qfuncs)

    Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.