setup-stylus-contracts

Set up Stylus smart contract projects with OpenZeppelin dependencies for Arbitrum deployment.

203|28|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/OpenZeppelin/openzeppelin-skills --skill setup-stylus-contracts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-stylus-contracts
Source: https://github.com/OpenZeppelin/openzeppelin-skills/tree/main/skills/setup-stylus-contracts
Command: npx skills add https://github.com/OpenZeppelin/openzeppelin-skills --skill setup-stylus-contracts

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes the friction of bootstrapping Stylus smart contract projects for Arbitrum by consolidating the Rust toolchain setup, Cargo Stylus project creation, OpenZeppelin dependency configuration, ABI export, and deployment steps into a clear, actionable workflow.

Core Features & Use Cases

  • Toolchain & Project Bootstrapping: Step-by-step guidance to install Rust, add the wasm32-unknown-unknown target, install cargo-stylus, and create a new Cargo Stylus project.
  • OpenZeppelin Integration: Instructions to add the openzeppelin-stylus crate to Cargo.toml, enable the export-abi feature, and configure crate-type for both library and cdylib outputs.
  • Build, ABI Export & Deploy: Validation and build checks, exporting a Solidity-compatible ABI, and deploying the compiled Stylus WASM to an Arbitrum Stylus endpoint.
  • Use Case: Create and deploy an ERC20-style token that composes OpenZeppelin components, export its ABI for integrations, and run it on Arbitrum.

Quick Start

Create a new Stylus project with cargo stylus, add openzeppelin-stylus to Cargo.toml with the export-abi feature and correct crate-type, compile to wasm, export the ABI, and deploy to your Arbitrum Stylus endpoint.

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 smart contract project for Arbitrum?

To set up a Stylus smart contract project, install the Rust nightly toolchain with rust-src, add the wasm32-unknown-unknown target, and use the cargo-stylus CLI to create a new Cargo project configured for Arbitrum deployment.

What Rust toolchain and targets are needed for Stylus smart contracts?

Stylus smart contracts require a Rust nightly toolchain with the rust-src component, the wasm32-unknown-unknown compilation target, and the cargo-stylus CLI to compile Rust code into WASM for Arbitrum deployment.

How do I integrate OpenZeppelin Stylus dependencies into my Cargo project?

Integrate OpenZeppelin Stylus by adding the openzeppelin-stylus crate to your Cargo.toml, enabling the export-abi feature, and configuring the crate-type to output both lib and cdylib formats for ABI export.

Can I export a Solidity-compatible ABI from a Stylus WASM contract?

Yes, you can export a Solidity-compatible ABI from a Stylus WASM contract by enabling the export-abi feature on the openzeppelin-stylus dependency and compiling your project with the correct lib and cdylib crate types.

What is the process to build and deploy a Stylus contract to an Arbitrum endpoint?

Building and deploying a Stylus contract involves running validation checks with cargo-stylus, compiling the Rust code to WASM, exporting the Solidity-compatible ABI, and deploying the binary to your configured Arbitrum Stylus endpoint.

Why does my Stylus project fail to build both lib and cdylib outputs?

Stylus projects fail to build both lib and cdylib outputs when the Cargo.toml crate-type configuration is incorrect or the openzeppelin-stylus export-abi feature is missing, which are required for proper ABI export and deployment.