Skip to content

Document Stylus.toml in the project structure reference #3115

Description

@hummusonrails

Summary

The Structure of a Rust Contract page (docs/stylus/reference/project-structure.mdx) does not mention Stylus.toml, which is now required by cargo-stylus 0.10.0+ (shipped with stylus-sdk-rs v0.10.0, January 2026).

Without this file, cargo stylus deploy, cargo stylus check, and other commands fail with:

error: missing Stylus.toml

What needs updating

  1. Project layout section — Add Stylus.toml to the file tree:
- src
    - lib.rs
    - main.rs
- Cargo.toml
- rust-toolchain.toml
- Stylus.toml
  1. Add a description paragraph for Stylus.toml alongside the existing descriptions for Cargo.toml and rust-toolchain.toml. Suggested content:

Stylus.toml is required by cargo-stylus to identify the package as a Stylus contract. For a standalone contract, it contains [workspace] and [contract] section headers. In a cargo workspace with multiple contracts, the workspace root has a Stylus.toml with a [workspace] section, and each individual contract directory has its own Stylus.toml with a [contract] section. Network configurations for deployment can optionally be defined under [workspace.networks].

  1. Minimal example for a standalone contract:
[workspace]

[workspace.networks]

[contract]

Context

  • Introduced in stylus-sdk-rs v0.10.0
  • Source: stylus-tools/templates/contract/Stylus.toml and stylus-tools/src/core/manifest/mod.rs
  • The v0.10.0 changelog notes: "Contracts are marked with a Stylus.toml file. Future configuration will be added to this file."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions