Skip to content

Idealist17/Solidity_to_KnowledgeGraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

把solidity业务逻辑导入进图数据库,可用于污点分析或AI漏扫上下文检索

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages