Crate near_vm_logic
source ·Expand description
near-vm-logic
This crate implements the specification of the interface that Near blockchain exposes to the smart contracts. It is not dependent on the specific way the smart contract code is executed, e.g. through Wasmer or whatnot, and therefore can be used for unit tests in smart contracts.
Note, this logic assumes the little endian byte ordering of the memory used by the smart contract.
Run tests
cargo test --features mocks
Re-exports
pub use types::ReturnData;
pub use gas_counter::with_ext_cost_counter;
Modules
Structs
- An iterator over the variants of Self
- An iterator over the variants of Self
- Representation of the address slice of guest memory.
- Dynamic configuration parameters required for the WASM runtime to execute a smart contract.
- Context for the contract execution.
- Describes limits for VM and Runtime. TODO #4139: consider switching to strongly-typed wrappers instead of raw quantities
- Configuration of view methods execution, during which no costs should be charged.
Enums
- Strongly-typed representation of the fees for counting.
- Our original code for limiting WASM stack was buggy. We fixed that, but we still have to use old (
V0
) limiter for old protocol versions. - This enum represents if a storage_get call will be performed through flat storage or trie
Traits
- An external blockchain interface for the Runtime logic
- An abstraction over the memory of the smart contract.
- Logical pointer to a value in storage. Allows getting value length before getting the value itself. This is needed so that runtime can charge gas before accessing a potentially large value.