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-3 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/yourusername/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-3-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.0.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.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stylus_analyzer-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 58aabb81f3147210a8f1e1210b34fb0102e2b1a9e08edc8be3f2a5a723968e8a
MD5 156f12bf7d8ff43cdb933a46e650825c
BLAKE2b-256 a2f8b0b725f5fc5a201deb3af7bf494c3b62cb080916de1e15a2f6f878daf44f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stylus_analyzer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 788fb16084086a60c7d157204bf0bca0f50f01bc478a5b8d20d5dbca869e9abb
MD5 7b0ca9630e1ddc1be41833575b5341f0
BLAKE2b-256 944c0652fe16baf3f7838270aeb475d9cc37d8e33b970e056843fd3f1c755344

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