Installation
Complete Example: Arithmetic Operations
This example demonstrates basic arithmetic operations (based on test fromtests/integration_test.rs:50):
Working with Memory
Example showing memory operations (based on test fromtests/integration_test.rs:24):
Working with Storage
Example showing persistent storage operations (also fromtests/integration_test.rs:24):
Verbose Mode
Enable verbose mode to track execution history:Checking Execution State
Access VM state after execution:Error Handling
The VM operations returnResult<(), Box<dyn Error>> for proper error handling:
Using Bytes32
TheBytes32 type is used throughout for EVM 32-byte values:
Next Steps
- Explore the Opcode Reference to understand supported operations
- Check the source code for more examples
- Review the unit tests in
src/vm.rsand integration tests intests/integration_test.rsfor additional usage patterns