@ethereumjs/vm / VM
Defined in: vm/src/vm.ts:21
The VM is a state transition machine that executes EVM bytecode and updates the state. It can be used to execute transactions, blocks, individual transactions, or snippets of EVM bytecode.
A VM can be created with the constructor method:
new VM(
opts?):VM
Defined in: vm/src/vm.ts:68
Instantiates a new VM Object.
VMOpts = {}
VM
Use createVM instead — async initialization avoids side effects from partially constructed instances.
readonlyblockchain:EVMMockBlockchainInterface
Defined in: vm/src/vm.ts:30
The blockchain the VM operates on
readonlycommon:Common
Defined in: vm/src/vm.ts:32
readonlyevents:EventEmitter<VMEvent>
Defined in: vm/src/vm.ts:34
readonlyevm:EVMInterface
Defined in: vm/src/vm.ts:38
The EVM used for bytecode execution
readonlystateManager:StateManagerInterface
Defined in: vm/src/vm.ts:25
The StateManager used by the VM
errorStr():
string
Defined in: vm/src/vm.ts:135
Return a compact error string representation of the object
string
shallowCopy(
downlevelCaches?):Promise<VM>
Defined in: vm/src/vm.ts:110
Returns a copy of the VM instance.
Note that the returned copy will share the same db as the original for the blockchain and the statemanager.
Associated caches will be deleted and caches will be re-initialized for a more short-term focused
usage, being less memory intense (the statemanager caches will switch to using an ORDERED_MAP cache
data structure more suitable for short-term usage, the trie node LRU cache will not be activated at all).
To fine-tune this behavior (if the shallow-copy-returned object has a longer life span e.g.) you can set
the downlevelCaches option to false.
boolean = true
Downlevel (so: adopted for short-term usage) associated state caches (default: true)
Promise<VM>