stylus-debug-0.1.0 is not a library.
Stylus Debug Suite
A local-first Stylus developer toolkit by ILE Labs for the Arbitrum ecosystem.
Install
Once installed, the stylus-debug CLI is available globally with three subcommands:
What This Toolkit Does
| Capability | Description |
|---|---|
| Integration Test Runner | VM-backed execution of contract scenarios with YAML-defined assertions. |
| Execution Trace | Step-by-step opcode trace + memory snapshots, powered by a core simulation engine. |
| Gas Profiler | Dynamic hotspot analysis from real traces with 5 contextual optimization tips. |
| Security Analysis | Detects 5 patterns including reentrancy risk, unchecked calls, and gas-heavy loops. |
| Storage Snapshot | Detailed ledger of storage changes (before/after) with change markers. |
| Migration Assistant | AST-based analysis of Solidity files using @solidity-parser/parser for precise Stylus Rust equivalents. |
| Interactive Dashboard | Glassmorphism-styled HTML report with a clickable Trace Explorer and Source Inspector. |
| DAP Protocol Hub | Engineering Ready: Functional DAP server for direct IDE (VS Code) integration. |
Quick Start
Install from crates.io
Or build from source
Usage
# Run the full end-to-end demo
# Export a self-contained HTML report
# Analyze your own Solidity contracts
# Start the DAP-compatible debug adapter (for IDE integration)
Development (from source)
# Build the full workspace
# Run tests
# Run the demo directly from workspace
# Analyze Solidity contracts
Workspace Layout
| Crate | Purpose |
|---|---|
stylus-debug |
CLI entrypoint — unified binary with migrate, adapter, and demo subcommands. |
core-engine/debug-engine |
Core VM: stack-based simulator and security analyzer engine. |
core-engine/test-runtime |
Assertion Engine: YAML-driven testing with post-execution validation. |
core-engine/gas-profiler |
Profiler: Opcode aggregation and Stylus-specific efficiency tips. |
core-engine/model |
Shared data structures (events, storage diffs, config). |
migration-cli |
Analyzer: AST-Based transformation engine for Solidity → Stylus (Rust) guidance. |
debug-adapter |
DAP server: standalone Debug Adapter Protocol adapter. |
examples/demo-contracts |
Example Solidity/Rust contracts + structured test config. |
vscode-extension |
Demo VS Code extension shell for IDE integration. |
What the Demo Shows
When you run stylus-debug demo, you will see:
- Integration tests — VM-executed scenarios with structured pass/fail assertion results.
- Execution trace — A live-computed trace showing opcodes, stack state, and storage diffs.
- Gas profiler — Visual distribution of gas usage and tailored optimization suggestions.
- Security analysis — Detections for reentrancy risk, unchecked calls, and CEI pattern violations.
- Storage snapshot — Comparison of initial vs final values for every modified storage slot.
- Migration assistant — Mapping of detected Solidity patterns to Stylus equivalents using real AST parsing.
License
MIT