Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Parser

crates/core decodes Soroban governance data without IO. crates/wasm exposes it to JavaScript. crates/cli is the operator tool, and network calls live there (crates/cli/src/rpc.rs), not in the core.

What it decodes

InputOutput
base64 XDR ScValJSON, total over the stellar-xdr 28 type set
contract WASMcontractspecv0 parsed into functions, structs, unions, enums, errors and events
raw eventa NormalizedEvent through a governor adapter, or unverified
proposal calla DecodedCall with named arguments when the spec is verified
proposal votestally and power reconstructed through pure replicas
simulateTransaction responsean ExecutionImpact estimate with simulatedAtLedger

What it refuses to do

  • Guess an argument name without a contract spec: the result is decoding: "unverified", not a plausible label.
  • Downgrade an unknown function to low: it is UNVERIFIED with the reason.
  • Coerce a value into JSON: integers at 64 bits and above become decimal strings, and non-representable maps are errors.
  • Emit a dry-run without a ledger: simulatedAtLedger is required, and every impact carries estimate: true.

Design rules

  • Adapters own governor knowledge. The GovernorAdapter trait (crates/core/src/adapter.rs) is where a governor’s events, calls and state are understood. See the adapter model and the authoring guide.
  • Rules are data. Risk tiers come from the published table in crates/core/src/risk.rs; every classification exposes the matched rule. See Risk rules.
  • The core does no IO. Network access is confined to crates/cli/src/rpc.rs.

Pages