setup-stylus-contracts

Automate Stylus contract project setup with OpenZeppelin dependencies on Arbitrum.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/phpmac/foundry --skill setup-stylus-contracts-phpmac
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-stylus-contracts
Source: https://github.com/phpmac/foundry/tree/main/.agents/skills/setup-stylus-contracts
Command: npx skills add https://github.com/phpmac/foundry --skill setup-stylus-contracts-phpmac

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Set up a Stylus smart contract project with OpenZeppelin Contracts for Stylus on Arbitrum. Use when users need to: (1) install Rust toolchain and WASM target for Stylus, (2) create a new Cargo Stylus project, (3) add OpenZeppelin Stylus dependencies to Cargo.toml, or (4) understand Stylus import conventions and storage patterns for OpenZeppelin.

Core Features & Use Cases

  • Install the Rust toolchain and WASM target for Stylus.
  • Create a new Stylus project using cargo stylus.
  • Add OpenZeppelin Stylus dependencies to Cargo.toml.
  • Understand imports and storage patterns used by OpenZeppelin Stylus components.

Quick Start

Install the Rust nightly toolchain and wasm target, then create a new Stylus project and wire in OZ Stylus dependencies according to the guidelines above.

Frequently Asked Questions about setup-stylus-contracts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a Stylus contract project with OpenZeppelin on Arbitrum?

To set up a Stylus contract project, install the Rust nightly toolchain and WASM target, create a new project using cargo-stylus, and integrate the OpenZeppelin Stylus crates into your Cargo.toml. You must configure the crate-type to include both library and cdylib.

What Rust toolchain and dependencies are required for Stylus contract development?

Stylus contract development requires the Rust nightly toolchain, the WASM target, and the cargo-stylus CLI tool. You also need to specify the correct OpenZeppelin Stylus crate version in your project dependencies.

How do I add OpenZeppelin dependencies to a Cargo Stylus project?

You add OpenZeppelin dependencies to a Cargo Stylus project by integrating the OpenZeppelin Stylus crates directly into your Cargo.toml file. Ensure you use the correct crate version and configure the crate-type as both library and cdylib.

What import conventions and storage patterns does OpenZeppelin Stylus use?

OpenZeppelin Stylus uses specific import conventions and storage patterns for its components. Understanding these patterns is necessary when integrating OZ Stylus crates into your Cargo Stylus project on Arbitrum.

Can I use cargo-stylus to create Arbitrum smart contracts in Rust?

Yes, you can use cargo-stylus to create Arbitrum smart contracts written in Rust. The tool automates project creation, and you can then wire in OpenZeppelin Stylus dependencies according to standard guidelines.

Why does my Stylus contract setup fail with incorrect crate-type configuration?

Stylus contract setup fails with incorrect crate-type configuration because the project requires both library and cdylib types in Cargo.toml. You must also ensure the correct OpenZeppelin Stylus crate version is specified for successful compilation.