/** * Helper module for tracking when variables are safe to decode. * Complex types (structs, arrays, mappings, etc.) may take several VM steps to initialize, * so we need to detect when initialization is complete before attempting to decode them. */ /** * Determines if a type can be safely decoded immediately upon declaration. * Simple value types (uint, int, bool, address, fixed-size bytes) are safe to decode immediately. * Complex types (structs, arrays, mappings, strings, dynamic bytes) need initialization tracking. * * @param {string} typeString - Type string from AST (e.g., "uint256", "struct MyStruct memory") * @returns {boolean} True if the type is safe to decode immediately */ export declare function isSimpleType(typeString: string): boolean; /** * Returns a complexity score for a type, used as a fallback heuristic * to estimate how many VM steps initialization might take. * * @param {string} typeString - Type string from AST * @returns {number} Estimated number of VM steps needed for initialization */ export declare function getTypeComplexityScore(typeString: string): number; /** * Finds the VM trace step at which a variable is safe to decode by detecting * when execution moves past the variable declaration's source code range. * * This is the most reliable method because the compiler generates all initialization * code within the declaration's source location range. Once execution moves to the * next statement, initialization is complete. * * @param {Object} tree - InternalCallTree instance * @param {number} declarationStep - VM trace step where variable was declared * @param {Object} variableDeclaration - AST node for the variable declaration * @param {Object} currentSourceLocation - Source location of the declaration * @param {string} address - Contract address * @returns {Promise} VM trace step at which variable is safe to decode */ export declare function findSafeStepForVariable(tree: any, declarationStep: number, variableDeclaration: any, currentSourceLocation: any, address: string): Promise; /** * Alternative method: Finds safe step by detecting when the stack value at the * variable's position stops changing. This is less reliable than source location * tracking but can be used as a fallback. * * @param {Object} tree - InternalCallTree instance * @param {number} declarationStep - VM trace step where variable was declared * @param {number} stackIndex - Stack index where variable value is stored * @param {number} maxLookAhead - Maximum steps to look ahead (default 10) * @returns {number} VM trace step at which stack value stabilized */ export declare function findSafeStepByStackStability(tree: any, declarationStep: number, stackIndex: number, maxLookAhead?: number): number;