import type { InternalCallTree, StepDetail } from "../internalCallTree"; /** * Checks if the call depth changes between consecutive steps. * * @param {number} step - Current step index * @param {Array} trace - The VM trace array * @returns {boolean} True if depth changes between current and next step */ export declare function callDepthChange(step: any, trace: any): boolean; /** * Checks if one source location is completely included within another. * * @param {Object} source - Outer source location to check against * @param {Object} included - Inner source location to check * @returns {boolean} True if included is completely within source */ export declare function includedSource(source: any, included: any): boolean; /** * Compare 2 source locations * * @param {Object} source - Outer source location to check against * @param {Object} included - Inner source location to check * @returns {boolean} True if included is completely within source */ export declare function compareSource(source: any, included: any): boolean; /** * Adds a VM trace index to the reduced trace. * The reduced trace contains only indices where the source location changes. * * @param {InternalCallTree} tree - The call tree instance * @param {number} index - VM trace step index to add */ export declare function addReducedTrace(tree: any, index: any): void; /** * Retrieves compiler-generated sources (e.g., Yul IR) for a given scope if debugging with generated sources is enabled. * * @param {InternalCallTree} tree - The call tree instance * @param {string} scopeId - Scope identifier * @param {Object} contractObj - Contract object containing bytecode and deployment data * @returns {Array|null} Array of generated source objects, or null if not available */ export declare function getGeneratedSources(tree: any, scopeId: any, contractObj: any): any; /** * Registers function parameters and return parameters in the scope's locals. * Extracts parameter types from the function definition and maps them to stack positions. * * @param {InternalCallTree} tree - The call tree instance * @param {Object} functionDefinition - AST function definition node * @param {Object} contractDefinition - AST function definition node * @param {number} step - VM trace step index at function entry * @param {string} scopeId - Scope identifier for this function * @param {Object} contractObj - Contract object with ABI * @param {Object} sourceLocation - Source location of the function * @param {string} address - Contract address */ export declare function registerFunctionParameters(tree: InternalCallTree, functionDefinition: any, contractDefinition: any, step: any, scopeId: any, contractObj: any, sourceLocation: any, address: any): Promise; /** * Includes variable declarations in the current scope if a new local variable is encountered at this step. * Checks the AST for variable declarations at the current source location and adds them to scope locals. * * @param {InternalCallTree} tree - The call tree instance * @param {number} step - Current VM trace step index * @param {Object} sourceLocation - Current source location * @param {string} scopeId - Current scope identifier * @param {Object} contractObj - Contract object with name and ABI * @param {Array} generatedSources - Compiler-generated sources * @param {string} address - Contract address */ export declare function includeVariableDeclaration(tree: InternalCallTree, step: any, sourceLocation: any, scopeId: any, contractObj: any, generatedSources: any, address: any, blocksDefinition: any): Promise; /** * Enhanced variable declaration resolution with better AST analysis and scope filtering. * Returns the variable declaration(s) matching the given source location and current scope. * * @param {InternalCallTree} tree - The call tree instance * @param {Object} sourceLocation - Source location to resolve * @param {Array} generatedSources - Compiler-generated sources * @param {string} address - Contract address * @param {string} scopeId - Current scope identifier * @returns {Promise} Array of variable declaration nodes, or null if AST is unavailable */ export declare function resolveVariableDeclarationEnhanced(tree: any, sourceLocation: any, generatedSources: any, address: any, scopeId: any): Promise; /** * Legacy function for backward compatibility */ export declare function resolveVariableDeclaration(tree: any, sourceLocation: any, generatedSources: any, address: any): Promise; /** * Extracts all function definitions for a given AST and file, caching the results. * Returns the function definition matching the given source location. * * @param {InternalCallTree} tree - The call tree instance * @param {Object} sourceLocation - Source location to resolve * @param {Array} generatedSources - Compiler-generated sources * @param {string} address - Contract address * @returns {Promise} Function definition node, or null if AST is unavailable */ export declare function resolveFunctionDefinition(tree: any, sourceLocation: any, generatedSources: any, address: any): Promise; /** * Walks the AST and extracts all variable declarations, indexing them by source location. * Handles both Solidity and Yul variable declarations. * * @param {Object} ast - Abstract Syntax Tree to walk * @param {AstWalker} astWalker - AST walker instance * @returns {Object} Map of source locations to variable declaration nodes */ export declare function extractVariableDeclarations(ast: any, astWalker: any): {}; /** * Walks the AST and extracts all function definitions, indexing them by source location. * Handles both Solidity and Yul function definitions. * * @param {Object} ast - Abstract Syntax Tree to walk * @param {AstWalker} astWalker - AST walker instance * @returns {Object} Map of source locations to function definition nodes */ export declare function extractFunctionDefinitions(ast: any, astWalker: any): {}; /** * Adds function input parameters to the scope's locals. * Input parameters are at the bottom of the stack when entering a function. * * @param {number} step - current step * @param {Object} functionDefinition - FunctionDefinition * @param {Object} parameterList - Input parameter list from function AST node * @param {InternalCallTree} tree - The call tree instance * @param {string} scopeId - Current scope identifier * @param {Object} states - State variable definitions * @param {Object} contractObj - Contract object with name and ABI * @param {Object} sourceLocation - Source location of the parameter * @param {number} stackLength - Current stack depth at function entry * @returns {Array} Array of parameter names added to the scope */ export declare function addInputParams(step: any, functionDefinition: any, parameterList: any, tree: InternalCallTree, scopeId: any, states: any, contractObj: any, sourceLocation: any, stackLength: any, forceFreeSlot: any): { params: any[]; freeStackIndex: any; }; /** * Adds function return parameters to the scope's locals. * Return parameters are declared but not initially on the stack. * * @param {number} step - current step * @param {Object} functionDefinition - FunctionDefinition * @param {Object} parameterList - Return parameter list from function AST node * @param {InternalCallTree} tree - The call tree instance * @param {string} scopeId - Current scope identifier * @param {Object} states - State variable definitions * @param {Object} contractObj - Contract object with name and ABI * @param {Object} sourceLocation - Source location of the parameter */ export declare function addReturnParams(step: any, availableSlot: any, functionDefinition: any, parameterList: any, tree: InternalCallTree, scopeId: any, states: any, contractObj: any, sourceLocation: any): void; /** * Counts the number of consecutive POP opcodes that occur just before the current step. * If the previous opcode isn't a POP, the count is 0. Otherwise, counts backwards until * a non-POP opcode is found. * * @param {Array} trace - The VM execution trace * @param {number} currentStep - Current step index * @returns {number} Number of consecutive POP opcodes before current step */ export declare function countConsecutivePopOpcodes(trace: StepDetail[], currentStep: number): number; /** * Gets the current scope ID from blocks definition hierarchy. * Finds the innermost scope that can contain variables. * * @param {Array} blocksDefinition - Array of block/function definition nodes * @returns {number|undefined} Scope ID of the innermost block or function */ export declare function getCurrentScopeId(blocksDefinition: any): any; /** * Checks if a variable declaration is within the current function/block scope. * * @param {Object} declaration - Variable declaration AST node * @param {Object} functionDefinition - Current function definition * @returns {boolean} True if declaration is within the scope */ export declare function isWithinScope(declaration: any, functionDefinition: any): boolean; /** * Validates stack consistency for debugging purposes. * Checks if the symbolic stack matches the actual EVM stack. * * @param {InternalCallTree} tree - The call tree instance * @param {number} step - Current VM trace step * @param {string} scopeId - Current scope identifier */ export declare function validateStackConsistency(tree: InternalCallTree, step: number, scopeId: string): void; /** * Comprehensive debugging function for variable and parameter tracking. * * @param {InternalCallTree} tree - The call tree instance * @param {number} step - Current VM trace step * @param {string} scopeId - Current scope identifier * @param {string} context - Context description for logging */ export declare function debugVariableTracking(tree: InternalCallTree, step: number, scopeId: string, context?: string): void; export declare function resolveNodesAtSourceLocation(tree: any, sourceLocation: any, generatedSources: any, address: any): Promise<{ nodes: any[]; functionDefinitionInScope: any; contractDefinition: any; blocksDefinition: any[]; }>;