MemoryDump
EVM memory state snapshot captured during transaction execution. Memory is byte-addressable and organized in 32-byte words.Overview
MemoryDump represents the complete memory state at a point in EVM execution. EVM memory grows dynamically during execution and is organized in 32-byte word boundaries for stack operations.Type Definition
Usage
Creating Memory Dumps
Reading Memory Words
EVM operations read memory in 32-byte chunks:Slicing Memory
Extract memory ranges for analysis:EVM Memory Model
Word-Aligned Operations
EVM stack operations work with 32-byte words:MLOAD: Load 32-byte word from memoryMSTORE: Store 32-byte word to memoryMSTORE8: Store single byte to memory
Memory Expansion
Memory expands dynamically during execution with quadratic gas costs:Gas Costs
Memory expansion incurs quadratic costs:Debug Tracing
MemoryDump used with debug_traceTransaction for execution analysis:Common Patterns
ABI Encoding Analysis
Memory contains ABI-encoded data during calls:Return Data
Return data stored in memory:API Reference
Constructors
MemoryDump.from(bytes)- Create from Uint8ArrayMemoryDump.from({ data, length })- Create from object
Methods
MemoryDump.readWord(dump, offset)- Read 32-byte wordMemoryDump.slice(dump, start, end?)- Extract memory range
See Also
- StateDiff - State changes during execution
- StorageDiff - Storage slot changes
- Hex - Hex encoding for memory display

