import { AztecNode, FunctionCall, Note, TxExecutionRequest } from '@aztec/circuit-types'; import { FunctionArtifactWithDebugMetadata } from '@aztec/foundation/abi'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; import { WasmBlackBoxFunctionSolver } from '@noir-lang/acvm_js'; import { DBOracle } from './db_oracle.js'; import { ExecutionResult } from './execution_result.js'; /** * The ACIR simulator. */ export declare class AcirSimulator { private db; private static solver; private log; constructor(db: DBOracle); /** * Gets or initializes the ACVM WasmBlackBoxFunctionSolver. * * @remarks * * Occurs only once across all instances of AcirSimulator. * Speeds up execution by only performing setup tasks (like pedersen * generator initialization) one time. * TODO(https://github.com/AztecProtocol/aztec-packages/issues/1627): * determine whether this requires a lock * * @returns ACVM WasmBlackBoxFunctionSolver */ static getSolver(): Promise; /** * Runs a private function. * @param request - The transaction request. * @param entryPointArtifact - The artifact of the entry point function. * @param contractAddress - The address of the contract (should match request.origin) * @param portalContractAddress - The address of the portal contract. * @param msgSender - The address calling the function. This can be replaced to simulate a call from another contract or a specific account. * @returns The result of the execution. */ run(request: TxExecutionRequest, entryPointArtifact: FunctionArtifactWithDebugMetadata, contractAddress: AztecAddress, portalContractAddress: EthAddress, msgSender?: Fr): Promise; /** * Runs an unconstrained function. * @param request - The transaction request. * @param entryPointArtifact - The artifact of the entry point function. * @param contractAddress - The address of the contract. * @param aztecNode - The AztecNode instance. */ runUnconstrained(request: FunctionCall, entryPointArtifact: FunctionArtifactWithDebugMetadata, contractAddress: AztecAddress, aztecNode?: AztecNode): Promise; /** * Computes the inner nullifier of a note. * @param contractAddress - The address of the contract. * @param nonce - The nonce of the note hash. * @param storageSlot - The storage slot. * @param note - The note. * @returns The nullifier. */ computeNoteHashAndNullifier(contractAddress: AztecAddress, nonce: Fr, storageSlot: Fr, note: Note): Promise<{ innerNoteHash: Fr; siloedNoteHash: Fr; uniqueSiloedNoteHash: Fr; innerNullifier: Fr; }>; /** * Computes the inner note hash of a note, which contains storage slot and the custom note hash. * @param contractAddress - The address of the contract. * @param storageSlot - The storage slot. * @param note - The note. * @returns The note hash. */ computeInnerNoteHash(contractAddress: AztecAddress, storageSlot: Fr, note: Note): Promise; /** * Computes the unique note hash of a note. * @param contractAddress - The address of the contract. * @param nonce - The nonce of the note hash. * @param storageSlot - The storage slot. * @param note - The note. * @returns The note hash. */ computeUniqueSiloedNoteHash(contractAddress: AztecAddress, nonce: Fr, storageSlot: Fr, note: Note): Promise; /** * Computes the siloed note hash of a note. * @param contractAddress - The address of the contract. * @param nonce - The nonce of the note hash. * @param storageSlot - The storage slot. * @param note - The note. * @returns The note hash. */ computeSiloedNoteHash(contractAddress: AztecAddress, nonce: Fr, storageSlot: Fr, note: Note): Promise; /** * Computes the inner note hash of a note, which contains storage slot and the custom note hash. * @param contractAddress - The address of the contract. * @param nonce - The nonce of the unique note hash. * @param storageSlot - The storage slot. * @param note - The note. * @returns The note hash. */ computeInnerNullifier(contractAddress: AztecAddress, nonce: Fr, storageSlot: Fr, note: Note): Promise; } //# sourceMappingURL=simulator.d.ts.map