Represents the call graph, a directed graph where nodes represent functions or methods, and edges indicate calls between them.

Constructors

Methods

  • Determines if there exists a path from the source node to the destination node. This is achieved via a breadth-first search.

    Parameters

    • src: CGNodeId

      The ID of the source node.

    • dst: CGNodeId

      The ID of the destination node.

    Returns boolean

    true if a path exists; false otherwise.

  • Retrieves a node's ID by the AST ID of its definition.

    Parameters

    • astId: number

      The AST ID of the function definition.

    Returns undefined | CGNodeId

    The corresponding node ID, or undefined if not found.

  • Retrieves a node's ID by its name.

    Parameters

    • name: string

      The name of the function or method.

    Returns undefined | CGNodeId

    The corresponding node ID, or undefined if not found.

  • Derives the function call name from a static or method call expression.

    Parameters

    • expr: AstMethodCall | AstStaticCall

      The call expression.

    • OptionalcurrentContractName: string

      The name of the current contract, if available.

    Returns undefined | string

    The fully qualified function name, or undefined if it cannot be determined.