AI-powered bug detection tool for Stylus/Rust contracts
Project description
Stylus Analyzer
An AI-powered bug detection tool for Stylus/Rust contracts, similar to Slither for Solidity.
Features
- AI-powered analysis of Stylus/Rust contracts using GPT-4o Mini
- Detect potential vulnerabilities and bugs in your contracts
- Support for analyzing entire projects or individual files
- Consider contextual information from README files (optional)
- Save analysis results to files for later review
Installation
pip install stylus-analyzer
That's it! The package will be installed with all its dependencies.
Configuration
- Create a
.envfile in your project directory:
OPENAI_API_KEY=your_openai_api_key_here
Usage
Analyze a Project
To analyze all Rust contracts in a Stylus project:
stylus-analyzer analyze /path/to/your/project
Analyze a Single File
To analyze a specific Rust contract file:
stylus-analyzer analyze-file /path/to/your/contract.rs
Optional Arguments
--outputor-o: Save analysis results to a file--modelor-m: Specify the OpenAI model to use (default: gpt-4o-mini)--verboseor-v: Enable verbose output--readmeor-r: Specify a README file for additional context (for analyze-file command)
Examples
# Analyze current directory project and save results
stylus-analyzer analyze . --output analysis_results.json
# Analyze a specific file with verbose output
stylus-analyzer analyze-file contracts/MyContract.rs --verbose
# Analyze a specific file with README context
stylus-analyzer analyze-file contracts/MyContract.rs --readme README.md
Development
If you want to contribute or modify the code, you can clone the repository:
git clone https://github.com/Jay-Sojitra/stylus-analyzer.git
cd stylus-analyzer
pip install -e .
Future Extensions
This tool is designed to be extended with additional features in the future:
- Static analysis capabilities
- Custom rule definitions
- Integration with development workflows
- Support for other smart contract languages
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stylus_analyzer-0.1.2.tar.gz.
File metadata
- Download URL: stylus_analyzer-0.1.2.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
294b5f4bd04c02318c198261bfe6f337f8b5e48031fbd3012c0eb4e24070761b
|
|
| MD5 |
e2dd2167cc2a6ae389c3a18f990513d5
|
|
| BLAKE2b-256 |
e7572852e4e11ea7ac2e26e4fba6b11f45b36905036b43f8e6a8c14d93488ab7
|
File details
Details for the file stylus_analyzer-0.1.2-py3-none-any.whl.
File metadata
- Download URL: stylus_analyzer-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10c059a2899382da2da3d0e2a5104212efed5ef316c0377f0af7ec325c9ff8cf
|
|
| MD5 |
6bb71a18b8132b005deface03dc6bb45
|
|
| BLAKE2b-256 |
fcb8425626c7406f013d985a0f50a1ee7b1a205ff692d4e7c4a146291c4f90de
|