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

From PyPI (not available yet)

pip install stylus-analyzer

From Source

git clone https://github.com/Jay-Sojitra/stylus-analyzer.git
cd stylus-analyzer
pip install -e .

Configuration

  1. Create a .env file in your project directory based on the .env.example:
cp .env.example .env
  1. Edit the .env file and add your OpenAI API key:
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

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.1.tar.gz (7.9 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.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file stylus_analyzer-0.1.1.tar.gz.

File metadata

  • Download URL: stylus_analyzer-0.1.1.tar.gz
  • Upload date:
  • Size: 7.9 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.1.tar.gz
Algorithm Hash digest
SHA256 3a69ee3cb886347ec50c4df01cbd52581ca04094b8e439e8813b049ef3ec26e9
MD5 fc6fc311d9e8caa12d8b0608df4f29aa
BLAKE2b-256 0845512b9d1baac06f5c67546c96275645f5681fa309be4e170c02e415cd8359

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stylus_analyzer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b7a558dafc5dc1a63c93f906cc9af44826e8c7060594db4d443c9b3ae60ed0d
MD5 b63aff1655872040b78ceae35afcb16a
BLAKE2b-256 b0e0f3852f0f1b3c8261cdb427398148fef600a1280f05cf964b908f49106c7a

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