import { FunctionL2Logs, UnencryptedL2Log } from '@aztec/circuit-types'; import { FunctionSelector, GlobalVariables, Header } from '@aztec/circuits.js'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; import { TypedOracle } from '../acvm/index.js'; import { PackedArgsCache, SideEffectCounter } from '../common/index.js'; import { CommitmentsDB, PublicContractsDB, PublicStateDB } from './db.js'; import { PublicExecution, PublicExecutionResult } from './execution.js'; /** * The execution context for a public tx simulation. */ export declare class PublicExecutionContext extends TypedOracle { /** * Data for this execution. */ readonly execution: PublicExecution; private readonly header; private readonly globalVariables; private readonly packedArgsCache; private readonly sideEffectCounter; private readonly stateDb; private readonly contractsDb; private readonly commitmentsDb; private log; private storageActions; private nestedExecutions; private unencryptedLogs; constructor( /** * Data for this execution. */ execution: PublicExecution, header: Header, globalVariables: GlobalVariables, packedArgsCache: PackedArgsCache, sideEffectCounter: SideEffectCounter, stateDb: PublicStateDB, contractsDb: PublicContractsDB, commitmentsDb: CommitmentsDB, log?: import("@aztec/foundation/log").DebugLogger); /** * Generates the initial witness for a public function. * @param args - The arguments to the function. * @param callContext - The call context of the function. * @param header - Contains data required to reconstruct a block hash (historical roots etc.). * @param globalVariables - The global variables. * @param witnessStartIndex - The index where to start inserting the parameters. * @returns The initial witness. */ getInitialWitness(witnessStartIndex?: number): Map; /** * Return the nested execution results during this execution. */ getNestedExecutions(): PublicExecutionResult[]; /** * Return the encrypted logs emitted during this execution. */ getUnencryptedLogs(): FunctionL2Logs; /** * Return the data read and updated during this execution. */ getStorageActionData(): { contractStorageReads: import("@aztec/circuits.js").ContractStorageRead[]; contractStorageUpdateRequests: import("@aztec/circuits.js").ContractStorageUpdateRequest[]; }; /** * Pack the given arguments. * @param args - Arguments to pack */ packArguments(args: Fr[]): Promise; /** * Fetches the a message from the db, given its key. * @param msgKey - A buffer representing the message key. * @returns The l1 to l2 message data */ getL1ToL2Message(msgKey: Fr): Promise; /** * Emit an unencrypted log. * @param log - The unencrypted log to be emitted. */ emitUnencryptedLog(log: UnencryptedL2Log): void; /** * Retrieves the portal contract address associated with the given contract address. * Returns zero address if the input contract address is not found or invalid. * @param contractAddress - The address of the contract whose portal address is to be fetched. * @returns The portal contract address. */ getPortalContractAddress(contractAddress: AztecAddress): Promise; /** * Read the public storage data. * @param startStorageSlot - The starting storage slot. * @param numberOfElements - Number of elements to read from the starting storage slot. */ storageRead(startStorageSlot: Fr, numberOfElements: number): Promise; /** * Write some values to the public storage. * @param startStorageSlot - The starting storage slot. * @param values - The values to be written. */ storageWrite(startStorageSlot: Fr, values: Fr[]): Promise; /** * Calls a public function as a nested execution. * @param targetContractAddress - The address of the contract to call. * @param functionSelector - The function selector of the function to call. * @param argsHash - The packed arguments to pass to the function. * @returns The return values of the public function. */ callPublicFunction(targetContractAddress: AztecAddress, functionSelector: FunctionSelector, argsHash: Fr): Promise; } //# sourceMappingURL=public_execution_context.d.ts.map