Skip to main content

Module state

Module state 

Source
Expand description

ContractRuntimeState — the per-contract client-side view.

Holds a plain read-only snapshot the caller owns by value. Private state is the caller’s responsibility — see the crate-level lib.rs docs for the witness-bytes-at-call-time contract.

§What lives here

The indexer-driven fold helper (fold_contract_actions) lives in [moonproof_contracts::state_fold] — it consumes [moonproof_indexer_client::ContractActionTickRaw] which would pull a heavy network dep into this wasm-friendly crate.

Structs§

ContractRuntimeState
The client-side view of a single deployed contract.

Functions§

contract_address_to_hex
Hex-encode a ContractAddress in the same lower-case-64-char convention the indexer uses on the wire.
decode_contract_address
Parse a 64-hex-char address into a ContractAddress.
decode_contract_state
Parse a hex-encoded tagged ContractState blob into a ContractState<InMemoryDB>.
encode_contract_state
Tagged-serialize a ContractState<InMemoryDB> to hex — inverse of decode_contract_state.