Expand description
wasm-neovm: WebAssembly to NeoVM translator
This crate provides functionality to translate WebAssembly modules into Neo N3 compatible NEF (Neo Executable Format) files.
§Module Organization
§Core Modules
core: Core abstractions and shared traitstypes: Type-safe identifiers and primitive wrappersconfig: Centralized configuration management
§Translation Modules
translator: Core WASM to NeoVM translation logicadapters: Cross-chain compilation adapters (Solana, Move)
§Output Modules
manifest: Neo N3 contract manifest generationmetadata: NEF metadata extraction and handlingnef: NEF file format utilities
§Definition Modules
opcodes: NeoVM opcode definitionssyscalls: NeoVM syscall definitionsneo_syscalls: Neo-specific syscall aliases
§Example
ⓘ
use wasm_neovm::{translate_module, write_nef};
let wasm_bytes = std::fs::read("contract.wasm")?;
let translation = translate_module(&wasm_bytes, "MyContract")?;
write_nef(&translation.script, "contract.nef")?;Re-exports§
pub use adapters::SourceChain;pub use config::BehaviorConfig;pub use config::DebugConfig;pub use config::LogLevel;pub use config::OutputConfig;pub use config::TranslationConfig;pub use core::traits;pub use manifest::RenderedManifest;pub use metadata::extract_nef_metadata;pub use metadata::NefMetadata;pub use nef::write_nef;pub use nef::write_nef_with_metadata;pub use nef::MethodToken;pub use translator::translate_module;pub use translator::translate_with_config;pub use translator::ManifestOverlay;pub use translator::Translation;pub use types::BytecodeOffset;pub use types::ContractName;pub use types::GlobalIndex;pub use types::LocalIndex;pub use types::MemoryOffset;pub use types::MethodIndex;pub use types::SyscallDescriptor;pub use types::WasmValueType;
Modules§
- adapters
- Chain-specific adapters for cross-chain compilation
- api
- API consistency layer
- config
- Centralized configuration management
- core
- Core abstractions and shared traits
- logging
- Standardized logging for wasm-neovm
- manifest
- Contract manifest generation for Neo N3
- metadata
- NEF metadata extraction and manipulation
- nef
- NEF (Neo Executable Format) file generation
- neo_
syscalls - numeric
- opcodes
- prelude
- Commonly used types and traits
- syscalls
- translator
- Core WASM to NeoVM translation engine
- types
- Type definitions and newtype wrappers for type-safe identifiers
Macros§
- log_
adapter - Log an adapter event at debug level
- log_
codegen - Log a codegen event at debug level
- log_
manifest - Log a manifest event at info level
- log_
parse - Log a parsing event at debug level
- log_
runtime - Log a runtime event at trace level
- log_
translation - Log a translation event at info level
- pgo_
record_ opcode - Round 90: Macro for recording opcode in PGO histogram
- profile_
scope - Macro for scoped profiling (only evaluates when feature enabled)
- wlog
- Standardized logging function
Constants§
- VERSION
- Version information for the wasm-neovm crate
Functions§
- version_
info - Get version information as a formatted string