Skip to main content

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

  1. Create a .env file 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

  • --output or -o: Save analysis results to a file
  • --model or -m: Specify the OpenAI model to use (default: gpt-4o-mini)
  • --verbose or -v: Enable verbose output
  • --readme or -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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stylus_analyzer-0.1.2.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stylus_analyzer-0.1.2-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

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

Hashes for stylus_analyzer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 294b5f4bd04c02318c198261bfe6f337f8b5e48031fbd3012c0eb4e24070761b
MD5 e2dd2167cc2a6ae389c3a18f990513d5
BLAKE2b-256 e7572852e4e11ea7ac2e26e4fba6b11f45b36905036b43f8e6a8c14d93488ab7

See more details on using hashes here.

File details

Details for the file stylus_analyzer-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for stylus_analyzer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 10c059a2899382da2da3d0e2a5104212efed5ef316c0377f0af7ec325c9ff8cf
MD5 6bb71a18b8132b005deface03dc6bb45
BLAKE2b-256 fcb8425626c7406f013d985a0f50a1ee7b1a205ff692d4e7c4a146291c4f90de

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page