Stylus Crate Compatibility Registry

What Is This

A CLI tool that Stylus developers run during development to check whether their Rust dependencies are compatible with Arbitrum Stylus contracts. Stylus imposes hard constraints that most Rust crates violate: (no_std, no floats, no async, WASM-only, and a contract size limit) and developers typically only find out when their build fails. This tool catches those problems as you add dependencies, not after.

You point it at your Cargo.toml, it checks every dependency against Stylus constraints, and tells you which ones are problematic and why. It can also run in CI with --strict to block merges that introduce incompatible deps.

How It Works

The tool has two layers: a core library that does all the analysis, and a CLI that formats and presents results. They live in separate crates (crates/core and crates/cli) so fellows can work on check logic without touching CLI code, and vice versa.

The analysis pipeline is straightforward:

  1. Parse the project's Cargo.toml and extract all dependencies
  2. Look up each dependency in a curated registry of known-compatible and known-incompatible crates
  3. Run checks: no_std requirement, WASM target compatibility, floating-point usage, and async runtime detection. We may add more as the project evolves.
  4. Score each dependency (0-100) and compute an overall project score using a "weakest link" model: if one dependency is incompatible, the whole project is flagged

The curated registry is a pair of TOML files in data/ with ~50 hand-verified crate entries. Each entry says whether a crate requires std, uses floats, uses async, and optionally suggests a Stylus-friendly alternative.

What the Scaffold Provides

The scaffold is a working, tested foundation for this project. Here's what's built and what's left for fellows:

Built: