import { AztecAddress } from '@aztec/circuits.js'; import { Fr } from '@aztec/foundation/fields'; import { AvmExecutionEnvironment } from './avm_execution_environment.js'; import { AvmMessageCallResult } from './avm_message_call_result.js'; import { AvmJournal } from './journal/journal.js'; /** * Avm Executor manages the execution of the AVM * * It stores a state manager */ export declare class AvmContext { /** Contains constant variables provided by the kernel */ private executionEnvironment; /** Manages mutable state during execution - (caching, fetching) */ private journal; constructor(executionEnvironment: AvmExecutionEnvironment, journal: AvmJournal); /** * Call a contract with the given calldata * * - We get the contract from storage * - We interpret the bytecode * - We run the interpreter * */ call(): Promise; /** * Create a new forked avm context - for internal calls */ newWithForkedState(): AvmContext; /** * Create a new forked avm context - for external calls */ static newWithForkedState(executionEnvironment: AvmExecutionEnvironment, journal: AvmJournal): AvmContext; /** * Prepare a new AVM context that will be ready for an external call * - It will fork the journal * - It will set the correct execution Environment Variables for a call * - Alter both address and storageAddress * * @param address - The contract to call * @param executionEnvironment - The current execution environment * @param journal - The current journal * @returns new AvmContext instance */ static prepExternalCallContext(address: AztecAddress, calldata: Fr[], executionEnvironment: AvmExecutionEnvironment, journal: AvmJournal): AvmContext; /** * Prepare a new AVM context that will be ready for an external static call * - It will fork the journal * - It will set the correct execution Environment Variables for a call * - Alter both address and storageAddress * * @param address - The contract to call * @param executionEnvironment - The current execution environment * @param journal - The current journal * @returns new AvmContext instance */ static prepExternalStaticCallContext(address: AztecAddress, calldata: Fr[], executionEnvironment: AvmExecutionEnvironment, journal: AvmJournal): AvmContext; /** * Merge the journal of this call with it's parent * NOTE: this should never be called on a root context - only from within a nested call */ mergeJournal(): void; } //# sourceMappingURL=avm_context.d.ts.map