neo-decompiler 0.11.0

Neo N3 NEF decompiler: parse, disassemble, lift bytecode to high-level pseudocode and C# skeletons, with a CLI, JSON reports, and optional WebAssembly bindings.
Documentation
use crate::OutputFormat;

/// Options for browser-oriented disassembly.
#[derive(Debug, Clone, Copy, Default)]
pub struct WebDisasmOptions {
    /// Fail fast instead of emitting `UNKNOWN_0x..` instructions and warnings.
    pub fail_on_unknown_opcodes: bool,
}

/// Options for browser-oriented decompilation.
#[derive(Debug, Clone)]
pub struct WebDecompileOptions {
    /// Optional manifest JSON string to load alongside the NEF bytes.
    pub manifest_json: Option<String>,
    /// Enforce strict manifest validation when `manifest_json` is provided.
    pub strict_manifest: bool,
    /// Fail fast instead of emitting `UNKNOWN_0x..` instructions and warnings.
    pub fail_on_unknown_opcodes: bool,
    /// Inline single-use temporaries into their consumers in the rendered
    /// high-level / C# output. Defaults to `true` so the browser surface mirrors
    /// the CLI's clean output by default; callers wanting the un-inlined form
    /// can flip this off.
    pub inline_single_use_temps: bool,
    /// Emit per-instruction `// XXXX: OPCODE` trace comments above each lifted
    /// statement. Defaults to `false` so rendered output is human-readable by
    /// default; callers debugging a specific contract can opt back in.
    pub emit_trace_comments: bool,
    /// Annotate inferred argument signatures and lifted local/static
    /// declarations with Neo VM types. Defaults to `false` to preserve
    /// historical web output.
    pub typed_declarations: bool,
    /// Select which rendered outputs should be generated.
    pub output_format: OutputFormat,
}

impl Default for WebDecompileOptions {
    fn default() -> Self {
        Self {
            manifest_json: None,
            strict_manifest: false,
            fail_on_unknown_opcodes: false,
            inline_single_use_temps: true,
            emit_trace_comments: false,
            typed_declarations: false,
            output_format: OutputFormat::All,
        }
    }
}