arbitrum-stylus

Write and deploy Arbitrum Stylus smart contracts in Rust compiled to WASM.

6|20|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/andresdefi/cryptoskills --skill arbitrum-stylus-andresdefi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: arbitrum-stylus
Source: https://github.com/andresdefi/cryptoskills/tree/main/skills/arbitrum-stylus
Command: npx skills add https://github.com/andresdefi/cryptoskills --skill arbitrum-stylus-andresdefi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? LLMs carry stale or incorrect knowledge about Arbitrum Stylus, such as treating it as a separate chain, missing the mandatory contract activation step, or using the outdated sol_storage! macro. This Skill provides current, accurate guidance for writing, testing, deploying, and interoperating Stylus WASM contracts in Rust. ## Core Features & Use Cases - Stylus Contract Development: Covers the stylus-sdk crate, #[storage] and #[entrypoint] attributes, typed storage primitives (StorageU256, StorageMap, StorageVec), events, and error handling patterns. - Deployment & Activation Workflow: Documents the two-step deploy-and-activate process via cargo stylus, WASM validation with cargo stylus check, and the ArbWasm precompile. - Solidity Interop & Testing: Explains sol_interface! cross-VM calls, shared storage layouts for proxy patterns, and unit testing with the motsu framework. - Use Case: Build a gas-efficient ERC20 token in Rust, test it with motsu, deploy it to Arbitrum Sepolia, and call it from a Solidity contract using the exported ABI. ## Quick Start Ask the agent to scaffold a new Stylus counter contract in Rust with storage, tests, and deployment commands for Arbitrum Sepolia.

Frequently Asked Questions about arbitrum-stylus

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

FAQPage Schema
How do I write a smart contract in Rust for Arbitrum Stylus?

Install Rust with the wasm32-unknown-unknown target and the cargo-stylus CLI, then run cargo stylus new to scaffold a project. Define storage with the #[storage] attribute, mark the struct with #[entrypoint], and expose functions in a #[public] impl block using the stylus-sdk crate.

How do I deploy and activate a Stylus contract on Arbitrum?

Run cargo stylus check to validate the WASM, then cargo stylus deploy with your RPC endpoint and private key. Deployment performs two transactions: bytecode deployment and activation via ArbWasm.activateProgram(), which is required before the contract can execute.

Can Stylus contracts call Solidity contracts on Arbitrum?

Yes, Stylus and Solidity contracts share state on Arbitrum One and Nova and interoperate through standard ABI-encoded calls. Use the sol_interface! macro to declare the Solidity interface and invoke methods via Call::new(), optionally sending ETH with .value().

Why does my Stylus contract revert with program not activated?

Every Stylus contract must be activated after deployment, which compiles the WASM to native code on-chain. If you deployed bytecode manually, run cargo stylus activate with the contract address; activation typically costs around 14M gas.

What are the limitations of Arbitrum Stylus contracts?

Stylus contracts cannot use CREATE/CREATE2 to deploy other contracts, cannot perform delegatecall, and disallow floating-point arithmetic due to WASM determinism. Storage gas costs match the EVM, so savings of 10-100x apply mainly to compute-heavy logic.

How do I test Stylus contracts without deploying?

Use the motsu testing framework by adding it to dev-dependencies and annotating test functions with #[motsu::test]. Tests run natively via cargo test with a mock EVM environment, so also run cargo stylus check to confirm WASM validity.