@ethereumjs/vm / VMOpts
Defined in: vm/src/types.ts:101
Options for instantiating a VM.
optionalactivatePrecompiles:boolean
Defined in: vm/src/types.ts:145
If true, create entries in the state tree for the precompiled contracts, saving some gas the first time each of them is called.
If this parameter is false, each call to each of them has to pay an extra 25000 gas for creating the account. If the account is still empty after this call, it will be deleted, such that this extra cost has to be paid again.
Setting this to true has the effect of precompiled contracts’ gas costs matching mainnet’s from the very first call, which is intended for testing networks.
Default: false
optionalblockchain:EVMMockBlockchainInterface
Defined in: vm/src/types.ts:131
A Blockchain object for storing/retrieving blocks
optionalcommon:Common
Defined in: vm/src/types.ts:123
Use a Common instance if you want to change the chain setup.
chain: all chains supported by Common or a custom chainhardfork: mainnet hardforks up to the Paris hardforkeips: 2537 (usage e.g. eips: [ 2537, ])Note: check the associated @ethereumjs/evm instance options
documentation for supported EIPs.
Default setup if no Common instance is provided:
chain: mainnethardfork: pariseips: []
optionalevm:EVMInterface
Defined in: vm/src/types.ts:178
Use a custom EVM to run Messages on. If this is not present, use the default EVM.
optionalevmOpts:EVMOpts
Defined in: vm/src/types.ts:186
Often there is no need to provide a full custom EVM but only a few options need to be adopted. This option allows to provide a custom set of EVM options to be passed.
Note: This option will throw if used in conjunction with a full custom EVM passed.
optionalparams:ParamsDict
Defined in: vm/src/types.ts:173
VM parameters sorted by EIP can be found in the exported paramsVM dictionary,
which is internally passed to the associated @ethereumjs/common instance which
manages parameter selection based on the hardfork and EIP settings.
This option allows providing a custom set of parameters. Note that parameters get fully overwritten, so you need to extend the default parameter dict to provide the full parameter set.
It is recommended to deep-clone the params object for this to avoid side effects:
const params = JSON.parse(JSON.stringify(paramsVM))
params['1559']['elasticityMultiplier'] = 10 // 2
optionalprofilerOpts:VMProfilerOpts
Defined in: vm/src/types.ts:188
optionalsetHardfork:boolean|BigIntLike
Defined in: vm/src/types.ts:156
Set the hardfork either by timestamp (for HFs from Shanghai onwards) or by block number for older Hfs.
Additionally it is possible to pass in a specific TD value to support live-Merge-HF transitions. Note that this should only be needed in very rare and specific scenarios.
Default: false (HF is set to whatever default HF is set by the Common instance)
optionalstateManager:StateManagerInterface
Defined in: vm/src/types.ts:127
A StateManager instance to use as the state store