VMOpts
Options for instantiating a VM.
Properties
activatePrecompiles?
optionalactivatePrecompiles:boolean
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
Defined in
packages/vm/src/utils/VMOpts.ts:55
blockchain?
optionalblockchain:Chain
A Blockchain object for storing/retrieving blocks
Defined in
packages/vm/src/utils/VMOpts.ts:41
common?
optionalcommon:object
Use a Common instance if you want to change the chain setup.
Possible Values
chain: all chains supported byCommonor a custom chainhardfork:mainnethardforks up to theParishardforkeips:2537(usage e.g.eips: [ 2537, ])
Note: check the associated @ethereumjs/evm instance options
documentation for supported EIPs.
Default Setup
Default setup if no Common instance is provided:
chain:mainnethardfork:pariseips:[]
blockExplorers?
optionalblockExplorers:object
Collection of block explorers
Index Signature
[key: string]: ChainBlockExplorer
blockExplorers.default
blockExplorers.default:
ChainBlockExplorer
contracts?
optionalcontracts:object
Collection of contracts
contracts.ensRegistry?
optionalcontracts.ensRegistry:ChainContract
contracts.ensUniversalResolver?
optionalcontracts.ensUniversalResolver:ChainContract
contracts.multicall3?
optionalcontracts.multicall3:ChainContract
copy()
copy: () => { blockExplorers?: { [key: string]: ChainBlockExplorer; default: ChainBlockExplorer; } | undefined; contracts?: { [x: string]: ChainContract | { …; } | undefined; ensRegistry?: ChainContract | undefined; ensUniversalResolver?: ChainContract | undefined; multicall3?: ChainContract | undefined; } | undefined; … 11…
Returns
{ blockExplorers?: { [key: string]: ChainBlockExplorer; default: ChainBlockExplorer; } | undefined; contracts?: { [x: string]: ChainContract | { …; } | undefined; ensRegistry?: ChainContract | undefined; ensUniversalResolver?: ChainContract | undefined; multicall3?: ChainContract | undefined; } | undefined; … 11…
custom?
optionalcustom:Record<string,unknown>
Custom chain data.
ethjsCommon
ethjsCommon:
Common
fees?
optionalfees:ChainFees<undefined|ChainFormatters>
Modifies how fees are derived.
formatters?
optionalformatters:ChainFormatters
Modifies how data is formatted and typed (e.g. blocks and transactions)
id
id:
number
ID in number form
name
name:
string
Human-readable name
nativeCurrency
nativeCurrency:
ChainNativeCurrency
Currency used by chain
rpcUrls
rpcUrls:
object
Collection of RPC endpoints
Index Signature
[key: string]: ChainRpcUrls
rpcUrls.default
rpcUrls.default:
ChainRpcUrls
serializers?
optionalserializers:ChainSerializers<undefined|ChainFormatters,TransactionSerializable>
Modifies how data is serialized (e.g. transactions).
sourceId?
optionalsourceId:number
Source Chain ID (ie. the L1 chain)
testnet?
optionaltestnet:boolean
Flag for test networks
Defined in
packages/vm/src/utils/VMOpts.ts:33
evm?
optionalevm:Evm
Use a custom EVM to run Messages on. If this is not present, use the default EVM.
Defined in
packages/vm/src/utils/VMOpts.ts:76
genesisState?
optionalgenesisState:GenesisState
A genesisState to generate canonical genesis for the “in-house” created stateManager if external stateManager not provided for the VM, defaults to an empty state
Defined in
packages/vm/src/utils/VMOpts.ts:60
profilerOpts?
optionalprofilerOpts:VMProfilerOpts
Defined in
packages/vm/src/utils/VMOpts.ts:78
setHardfork?
optionalsetHardfork:boolean|BigIntLike
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)
Defined in
packages/vm/src/utils/VMOpts.ts:71
stateManager?
optionalstateManager:StateManager
A StateManager instance to use as the state store