Skip to main content

Module ir

Module ir 

Source
Expand description

Typed IR mirroring the contract.mpir schema 1:1.

The JSON schema is specified at compact/doc/runtime-ir.md. Every variant here corresponds to exactly one shape produced by the emitter pass compiler/runtime-ir-passes.ss.

Structs§

AdtOpInvocation
Argument
BindingTarget
CapabilitiesMeta
Contract-wide governance and capability metadata.
CapabilityDef
Declaration of a contract capability (e.g. Pact defcap).
CircuitBody
CircuitBoundsMeta
Static resource bounds for a single circuit.
CircuitCapUsage
Per-circuit summary of capabilities acquired, required, or emitted.
Constructor
ContractCircuitSig
DebugInfo
Source file list and symbol-to-span maps.
FrontendMeta
Identifying metadata for the compiler frontend that emitted the IR.
IntLit
An integer literal as it appears anywhere in the runtime IR.
LedgerField
MapEntry
MoonIr
Native
PrivacyMeta
Contract-wide privacy annotations and circuit bounds.
SourceSpan
Source-code span for diagnostics, coverage, and debugging.
StructField
TupleItem
VmInstr
One VM instruction. We capture the op name + remaining keys as a raw JSON object since the op-arg shape varies per op. Consumers that need typed access can match on op and decode manually, or use the helpers in crate::vm.
Witness
WorkflowMeta
Multi-step workflow definition grouping ordered step circuits.
WorkflowStepMeta
One step in a multi-step workflow (e.g. a Pact defpact step).

Enums§

CapabilityKind
Classification of a declared contract capability.
Expression
FieldRole
Architectural role of a ledger field for auditing and tooling.
FieldType
Which field an operation works in. Spelled exactly as compactc’s extract-contract-info.ss spells the corresponding type names, so a field-type string and a type-name string are the same vocabulary.
FrontendLanguage
Source frontend language that produced a MoonIr.
GovernanceSpec
Contract upgrade / administration governance declaration.
PathElement
PrivacyClass
Privacy classification for a contract field or value flow.
SemanticTypeRole
Higher-level semantic role attached to a descriptor entry so codegen and host tooling can recover frontend types lowered onto core IR primitives.
StateValue
Statement
Storage
Storage shape of a ledger field. Discriminated on a "storage" JSON tag — the wire format compactc emits is:
TypeDescriptor

Functions§

canonical_intrinsic_name
Normalize a Compact bare native name, "__compactRuntime.*" host symbol, or language-agnostic "mp:*" intrinsic URI to the single canonical intrinsic identifier shared across the runtime, privacy auditor, ZKIR compiler, and multi-language frontends.

Type Aliases§

VmOp
One VM-op argument value. This is a recursive structure because VM ops can carry nested values: {"vm": "state-value", "kind": "cell", "value": {"vm": "align", ...}}. We model it as untyped RuntimeValue for flexibility — crate::vm::VmValue provides a typed interpretation.