Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 1.14 KB

File metadata and controls

36 lines (24 loc) · 1.14 KB

Solidity to Knowledge Graph Tool

This tool parses Solidity smart contracts using Slither and populates a Neo4j Knowledge Graph with the extracted information (Contracts, Functions, Variables, Inheritance, Calls, etc.).

Usage

You can run the tool using uv from the project root directory:

uv run solidity2kg [projectDirPath] [projectName]

Arguments

  • projectDirPath: Path to the Solidity file or directory you want to analyze.
  • projectName: (Optional) Name of the project. This is used to scope the nodes in the database. Defaults to "DefaultProject".

Examples

Analyze a single file:

uv run solidity2kg ./tests/mock_project/solidity/test1.sol MyProject

Analyze a directory:

uv run solidity2kg ./src/contracts/ FinanceApp

Environment Variables

The tool uses the following environment variables (defined in your .env or project configuration) to connect to Neo4j:

  • NEO4J_URI: Database URI (default: bolt://localhost:7687)
  • NEO4J_USER: Database username (default: neo4j)
  • NEO4J_PASSWORD: Database password (default: password)