Master Stylus in 30 Days
A structured learning path to take you from zero to deploying production-ready Stylus smart contracts on Arbitrum.
Introduction to Arbitrum Stylus
Learn what Stylus is, why it matters, and how it enables Rust smart contracts on Arbitrum.
Setting Up Your Development Environment
Install Rust, Cargo Stylus, and configure your IDE for Stylus development.
Your First Stylus Contract
Write, compile, and understand a simple Hello World contract in Stylus.
Understanding the Stylus SDK
Deep dive into the stylus-sdk crate and its core components.
Contract Structure & Entrypoints
Learn about #[entrypoint], #[external], and how Stylus contracts are structured.
Primitive Storage Types
Work with StorageU256, StorageBool, StorageAddress and other primitive types.
Complex Storage: Vectors & Maps
Learn to use StorageVec and StorageMap for dynamic data structures.
Custom Storage Types
Create your own storage types using #[solidity_storage] macro.
Working with Strings & Bytes
Handle StorageString and StorageBytes in your contracts.
Storage Patterns & Best Practices
Optimize storage layout and avoid common pitfalls.
Function Visibility & Modifiers
Understand public, external, and internal functions in Stylus.
Payable Functions & Ether Handling
Accept and manage ETH in your Stylus contracts.
View & Pure Functions
Write gas-efficient read-only functions.
Error Handling & Custom Errors
Implement robust error handling with custom error types.
Events & Logging
Emit events for off-chain indexing and monitoring.
Cross-Contract Calls
Call other contracts from your Stylus contract using sol_interface!.
Working with ERC-20 Tokens
Interact with ERC-20 tokens from your Stylus contract.
Reentrancy Protection
Understand and prevent reentrancy attacks in Stylus.
Access Control Patterns
Implement ownership, roles, and permission systems.
Security Best Practices
Learn common vulnerabilities and how to avoid them.
Build: Simple Token (ERC-20)
Create a complete ERC-20 token implementation in Stylus.
Build: NFT Collection (ERC-721)
Build an NFT contract with minting and metadata.
Build: Staking Contract
Create a token staking system with rewards.
Build: Simple Voting System
Implement a decentralized voting mechanism.
Build: Escrow Contract
Create a trustless escrow system for transactions.
Gas Optimization Techniques
Advanced techniques to minimize gas costs in Stylus.
Testing Stylus Contracts
Write comprehensive tests for your contracts.
Deploying to Arbitrum Testnet
Deploy your contracts to Arbitrum Sepolia testnet.
Mainnet Deployment & Verification
Prepare and deploy to Arbitrum mainnet safely.
Graduation: Build Your Own Project
Apply everything you've learned to build your own Stylus project.