Skip to main content

Module storage

Module storage 

Source
Expand description

Tree-sitter extraction of state variables and inheritance specifiers, mirroring cg::extract_repo_contracts_functions but yielding storage-shaped records rather than callgraph-shaped ones. The output is project-local: contract ids match crate::cg::ExtractedContract::id and inheritance is resolved by name within the same project. Names that don’t resolve (3rd-party imports, etc.) are dropped silently.

Structs§

ExtractedInheritance
One direct is-spec edge captured per contract. parent_name is the textual reference; parent_contract_id is None if it doesn’t resolve to any project-local contract.
ExtractedStateVariable
One state variable declared inside a tree-sitter-extracted contract.
StorageExtractionResult
Bundled output of the tree-sitter storage extractor.

Functions§

extract_state_variables_and_inheritance
Walk the same .sol files used by the call-graph extractor and pull out state variables and inheritance specifiers. The caller is expected to have already parsed/extracted contracts via crate::cg::extract_repo_contracts_functions; we reuse the (id, name) mapping so the project-local ids stay consistent across the two passes.