Skip to main content

Module loader

Module loader 

Source
Expand description

Load + parse contract.mpir into typed crate::ir::MoonIr.

Wire format is RFC 8949 CBOR. See the patched compactc fork’s compiler/cbor.ss and compiler/runtime-ir-passes.ss for the emitter side; the schema itself is unchanged from the JSON era and is documented in compact/doc/runtime-ir.md.

Constants§

MIN_SCHEMA_VERSION
The oldest schema version this consumer understands. Contracts compiled by a pre-0.33 toolchain stay readable.
MOON_IR_FILENAME
Canonical filename for a compiled Moonproof IR artifact inside a contract build directory (<out>/contract.mpir or <out>/compiler/contract.mpir).
SUPPORTED_SCHEMA_VERSION
The newest schema version this consumer understands.

Functions§

from_cbor_slice
Parse a runtime-ir CBOR byte slice using the zero-copy single-pass decoder.
from_path
Read + parse a runtime-ir CBOR file.
to_cbor_vec
Encode a MoonIr into RFC 8949 CBOR bytes using the direct fast encoder.
write_cbor
Append a MoonIr’s RFC 8949 CBOR bytes into out.