Expand description
Neo N3 Rust Development Pack
Complete Rust SDK for Neo N3 smart contract development
Re-exports§
pub use serde;pub use native_contracts::*;pub use standards::*;
Modules§
- codec
- Serialization and deserialization utilities for Neo N3 smart contracts.
- native_
contracts - Canonical Neo N3 native contract and native library script hashes.
- nep_
macros - NEP standard-library macros (L5).
- prelude
- Neo N3 Prelude - commonly used items
- standards
- Reusable Neo N3 standard traits/constants for contract authors.
- storage
- Storage utilities for Neo N3 smart contracts.
- utils
- General utility functions for Neo N3 smart contracts.
Macros§
- neo_
manifest_ overlay - Neo N3 Manifest Overlay macro
- neo_
permission - Declare manifest permissions and embed them as a custom section.
- neo_
safe_ methods - Declare safe methods for the contract manifest.
- neo_
supported_ standards - Declare supported standards for the contract manifest.
- neo_
trusts - Declare trusted contracts for the contract manifest.
- nep11
- NEP-11 (non-fungible token) standard macro.
- nep17
- NEP-17 (fungible token) standard macro.
Structs§
- BigInt
- A big signed integer type.
- Default
Contract Caller - The default
ContractCallerimpl: routescall_rawtoNeoVMSyscall::contract_call. Used by host-mode tests and by production code that needs the L6 cross-call upgrade (tracked in the audit). - Example
Contract - Neo N3 Contract Examples
- Hash160
- A 20-byte script hash used to identify accounts and contracts on Neo N3.
- Hash256
- A 32-byte hash used for transaction and block identifiers on Neo N3.
- NeoArray
- Neo N3 Array type
- NeoBoolean
- Neo N3 Boolean type
- NeoByte
String - Neo N3 ByteString type
- NeoContractABI
- Neo N3 Contract ABI
- NeoContract
Event - Neo N3 Contract Event
- NeoContract
Manifest - Neo N3 Contract Manifest
- NeoContract
Method - Neo N3 Contract Method
- NeoContract
Parameter - Neo N3 Contract Parameter
- NeoContract
Permission - Neo N3 Contract Permission
- NeoContract
Runtime - Neo N3 contract management operations.
- NeoCrypto
- Crypto helpers for Neo N3 smart contracts.
- NeoInteger
- Neo N3 Integer type (arbitrary precision)
- NeoIterator
- Neo N3 Iterator type
- NeoJSON
- Minimal JSON helpers to support tests.
- NeoMap
- Neo N3 Map type
- NeoRuntime
- Direct wrappers for the canonical System.Runtime syscalls.
- NeoRuntime
Context - Lightweight view of the runtime context.
- NeoStorage
- Storage convenience helpers built on top of the syscall layer.
- NeoStorage
Context - Neo N3 Storage Context type
- NeoString
- Neo N3 String type
- NeoStruct
- Neo N3 Struct type
- NeoVM
Syscall - Neo N3 System Call Wrapper
- NeoVM
Syscall Info - Neo N3 System Call Information
- NeoVM
Syscall Lowering - Neo N3 System Call Lowering
- NeoVM
Syscall Registry - Neo N3 System Call Registry
- RawKey
Builder - Fixed-capacity stack key builder for
RawStoragekeys. - RawStorage
- Heap-free storage facade that operates on
&[u8]slices. - Recorded
Notification
Enums§
- Contract
Call Error - Error type for the L9 typed-call helpers. Reserved for future use (the L6 cross-call executor will return this rather than panicking with “see L6 design”).
- NeoError
- Neo N3 Error type
- NeoValue
- Neo N3 Value type (union of all Neo types)
- RawStorage
Get - Outcome of
RawStorage::get_into.
Constants§
- MAX_
NOTIFICATION_ SIZE - Max serialised size for a notification (C#:
MaxNotificationSize = 1024). - MAX_
STACK_ SIZE - Max items in a serialised Array/Struct (C#:
Limits.MaxStackSize). - SYSCALLS
- Neo N3 System Calls
Statics§
- SYSCALL_
REGISTRY - Neo N3 System Call Registry Instance
Traits§
- Contract
Caller - Trait for static-method-style cross-contract calls. The L9
call_typed<T>helper invokes a remote contract’s method and decodes the return value into a typed Rust value via theFromNeoValuetrait. The default implementation delegates to the existingNeoVMSyscall::contract_callpath; contract code that wants a custom transport (e.g. off-chain simulation) can overridecall_rawand route the value throughcall_typed. - From
NeoValue - A type that can be deserialised from a NeoVM
StackItem/NeoValue. This is the L9IInteroperableequivalent in the C# devpack: any contract return type (or argument type) implements this trait, enablingNeoContract::call_typed<T>to round-trip the on-chain value into a typed Rust value. - NeoContract
- Neo N3 Contract trait
- NeoContract
Entry - Neo N3 Contract Entry Point
- NeoContract
Method Trait - Neo N3 Contract Method trait
Functions§
- call_
typed - Helper: typed cross-contract call with the default caller.
Mirrors the C#
Contract.Call<T>API. - neovm_
syscall - Neo N3 System Call Function
- record_
notification - Record a notification. Called from
NeoVMSyscall::notifyon both wasm32 and host paths so the recorder is consistent. - reset_
recorded_ notifications - Clear the recorder without returning the contents.
- serialise_
array - Serialise a
NeoArray<NeoValue>as a NeoVMArrayStackItem. - serialise_
notification - Serialise a UTF-8 event name + state array as a notification body.
The body has the same shape as C#
RuntimeNotifyexpects:[event_name as NeoVM ByteString, state as Array StackItem]. - serialise_
value - Serialise a single StackItem (used for things like
Contract.Callargs that aren’t wrapped in an outer array). - take_
recorded_ notifications - Take all recorded notifications (drains the buffer).
Type Aliases§
- NeoResult
- Neo N3 Result type
Attribute Macros§
- neo_
bench - Neo N3 Benchmark macro
- neo_
config - Neo N3 Configuration macro
- neo_
contract - Neo N3 Contract macro
- neo_doc
- Neo N3 Documentation macro
- neo_
entry - Neo N3 Entry Point macro
- neo_
error - Neo N3 Error macro
- neo_
event - Neo N3 Event macro
- neo_
method - Neo N3 Method macro
- neo_
safe - Mark a single exported function as safe in the manifest.
- neo_
serialize - Neo N3 Serialization macro
- neo_
storage - Neo N3 Storage macro
- neo_
test - Neo N3 Test macro
- neo_
validate - Neo N3 Validation macro