import { Common, Hardfork } from '@nomicfoundation/ethereumjs-common'; import { Account, Address, AsyncEventEmitter } from '@nomicfoundation/ethereumjs-util'; import { EvmError } from './exceptions.js'; import { Journal } from './journal.js'; import { EVMPerformanceLogger } from './logger.js'; import { Message } from './message.js'; import { TransientStorage } from './transientStorage.js'; import type { InterpreterOpts } from './interpreter.js'; import type { MessageWithTo } from './message.js'; import type { AsyncDynamicGasHandler, SyncDynamicGasHandler } from './opcodes/gas.js'; import type { OpHandler, OpcodeList, OpcodeMap } from './opcodes/index.js'; import type { CustomPrecompile, PrecompileFunc } from './precompiles/index.js'; import type { Block, Blockchain, CustomOpcode, EVMEvents, EVMInterface, EVMOpts, EVMResult, EVMRunCallOpts, EVMRunCodeOpts, ExecResult } from './types.js'; import type { EVMStateManagerInterface } from '@nomicfoundation/ethereumjs-common'; /** * EVM is responsible for executing an EVM message fully * (including any nested calls and creates), processing the results * and storing them to state (or discarding changes in case of exceptions). * @ignore */ export declare class EVM implements EVMInterface { protected static supportedHardforks: Hardfork[]; protected _tx?: { gasPrice: bigint; origin: Address; }; protected _block?: Block; readonly common: Common; readonly events: AsyncEventEmitter; stateManager: EVMStateManagerInterface; blockchain: Blockchain; journal: Journal; readonly transientStorage: TransientStorage; protected _opcodes: OpcodeList; readonly allowUnlimitedContractSize: boolean; readonly allowUnlimitedInitCodeSize: boolean; protected readonly _customOpcodes?: CustomOpcode[]; protected readonly _customPrecompiles?: CustomPrecompile[]; protected _handlers: Map; protected _dynamicGasHandlers: Map; protected _opcodeMap: OpcodeMap; protected _precompiles: Map; protected readonly _optsCached: EVMOpts; protected performanceLogger: EVMPerformanceLogger; get precompiles(): Map; get opcodes(): OpcodeList; /** * EVM is run in DEBUG mode (default: false) * Taken from DEBUG environment variable * * Safeguards on debug() calls are added for * performance reasons to avoid string literal evaluation * @hidden */ readonly DEBUG: boolean; protected readonly _emit: (topic: string, data: any) => Promise; constructor(opts?: EVMOpts); /** * Returns a list with the currently activated opcodes * available for EVM execution */ getActiveOpcodes(): OpcodeList; protected _executeCall(message: MessageWithTo): Promise; protected _executeCreate(message: Message): Promise; /** * Starts the actual bytecode processing for a CALL or CREATE */ protected runInterpreter(message: Message, opts?: InterpreterOpts): Promise; /** * Executes an EVM message, determining whether it's a call or create * based on the `to` address. It checkpoints the state and reverts changes * if an exception happens during the message execution. */ runCall(opts: EVMRunCallOpts): Promise; /** * Bound to the global VM and therefore * shouldn't be used directly from the evm class */ runCode(opts: EVMRunCodeOpts): Promise; /** * Returns code for precompile at the given address, or undefined * if no such precompile exists. */ getPrecompile(address: Address): PrecompileFunc | undefined; /** * Executes a precompiled contract with given data and gas limit. */ protected runPrecompile(code: PrecompileFunc, data: Uint8Array, gasLimit: bigint): Promise | ExecResult; protected _loadCode(message: Message): Promise; protected _generateAddress(message: Message): Promise
; protected _reduceSenderBalance(account: Account, message: Message): Promise; protected _addToBalance(toAccount: Account, message: MessageWithTo): Promise; /** * Once the interpreter has finished depth 0, a post-message cleanup should be done */ private postMessageCleanup; /** * This method copies the EVM, current HF and EIP settings * and returns a new EVM instance. * * Note: this is only a shallow copy and both EVM instances * will point to the same underlying state DB. * * @returns EVM */ shallowCopy(): EVM; getPerformanceLogs(): { opcodes: import("./logger.js").EVMPerformanceLogOutput[]; precompiles: import("./logger.js").EVMPerformanceLogOutput[]; }; clearPerformanceLogs(): void; } export declare function OOGResult(gasLimit: bigint): ExecResult; export declare function COOGResult(gasUsedCreateCode: bigint): ExecResult; export declare function INVALID_BYTECODE_RESULT(gasLimit: bigint): ExecResult; export declare function INVALID_EOF_RESULT(gasLimit: bigint): ExecResult; export declare function CodesizeExceedsMaximumError(gasUsed: bigint): ExecResult; export declare function EvmErrorResult(error: EvmError, gasUsed: bigint): ExecResult; export declare function defaultBlock(): Block; //# sourceMappingURL=evm.d.ts.map