Skip to main content

neo_devpack_solidity/
neo.rs

1//! Neo N3 Utilities Module
2//!
3//! Provides Neo N3 blockchain-specific utilities for NEF (Neo Executable Format)
4//! generation and method tokens.
5//!
6//! # Key Components
7//!
8//! - [`MethodToken`] - Cross-contract call optimization tokens
9//! - [`build_nef_with_tokens`] - NEF file generation with method tokens
10//! - [`clamp_nef_source_with_flag`] - Source code embedding in NEF
11//!
12//! # NEF Format
13//!
14//! The Neo Executable Format (NEF) is the standard container for Neo N3 smart
15//! contracts, containing bytecode, metadata, and optional method tokens.
16
17mod build;
18mod constants;
19mod contract_hash;
20mod encoding;
21mod method_token;
22mod source;
23
24// Re-export public API
25pub use build::{build_nef, build_nef_with_tokens, parse_nef, ParsedNef};
26pub use constants::{
27    MAX_CALL_FLAGS, MAX_METHOD_TOKENS, MAX_SCRIPT_SIZE, MAX_TOKEN_METHOD_LENGTH, NEF_HEADER_SIZE,
28    NEF_MAGIC, NEF_SOURCE_MAX_BYTES,
29};
30pub use contract_hash::{compute_contract_hash, format_uint160_hex_be, parse_uint160_hex_be};
31pub use method_token::MethodToken;
32pub use source::{clamp_nef_source, clamp_nef_source_with_flag};
33
34#[cfg(test)]
35mod tests;