Custom precompiles allow you to run arbitrary JavaScript code in the EVM.
See the Precompile guide documentation for a deeper dive
An ever growing standard library of precompiles is provided at tevm/precompiles
Below example shows how to make a precompile so you can call fs.writeFile and fs.readFile in your contracts.
Note: this specific precompile is also provided in the standard library
For security precompiles can only be added statically when the vm is created.
Example
loggingLevel?
optionalloggingLevel: LogOptions["level"]
The logging level to run the evm at. Defaults to ‘warn’
profiler?
optionalprofiler: boolean
Enable profiler. Defaults to false.
stateManager
stateManager: StateManager
A custom Tevm state manager
Example
The EVM is normally encapsolated by both @tevm/vm Vm, TevmNode, and MemoryClient.