This tool parses Solidity smart contracts using Slither and populates a Neo4j Knowledge Graph with the extracted information (Contracts, Functions, Variables, Inheritance, Calls, etc.).
You can run the tool using uv from the project root directory:
uv run solidity2kg [projectDirPath] [projectName]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".
Analyze a single file:
uv run solidity2kg ./tests/mock_project/solidity/test1.sol MyProjectAnalyze a directory:
uv run solidity2kg ./src/contracts/ FinanceAppThe 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)