A curated list of Arbitrum Stylus code examples, libraries, projects and resources.
- Official Docs - Official docs on Stylus
- Rust SDK - Rust SDK
- Cargo Stylus - CLI tool for compiling and deploying Stylus smart contracts
- Discord - Check out the #stylus channel in Arbitrum's Discord server
- Telegram - A dev focused chat for Stylus builders
- Offchain Labs Twitter - Follow along for Offchain Labs and Arbitrum news and info
- Stylus Repo - The repo hosting the core code
- A Gentle Introduction: Stylus
- Quickstart (Rust, Stylus)
- How To Add a New Programming Language To Stylus
- How To Run a Local Dev Node With Stylus Support
- Stylus Rust SDK: Feature Overview
A detailed exploration of the Rust SDK, development tools, and high-performance use cases.
- Day 1: Using the Rust SDK | José Franco, Chris Cordle | 2024.10.01
- Day 2: Tools and Testing | José Franco | 2024.10.02
- Day 3: Implementing Black-Scholes | Chris Cordle | 2024.10.07
In-depth conversations with the founders of early Stylus projects, exploring their experiences building with Stylus.
- Crypto Valley Exchange | Onchain Portfolio Risk Management | 2024.10.30
- Lit Protocol | Decentralizing Digital Ownership | 2024.10.17
- Fairblock | Dynamic Confidentiality Network | 2024.10.09
- OpenZeppelin | Building Stylus Tools and Contracts | 2024.09.19
- Superposition | Native Liquidity on Arbitrum | 2024.09.12
- Renegade | Building Onchain Dark Pools | 2024.09.04
- Intro to Arbitrum Stylus: NFT Contracts in Rust | José Franco | Foss Asia Summit 2024 | 2024.04.08
- Intro to Rust & Arbitrum Stylus | Chris Cordle | Foss Asia Summit 2024 | 2024.04.08
- Intro to Arbitrum Stylus: Interactions Between Solidity and Rust | José Franco | ETHGlobal London 2024 | 2024.03.15
- Onchain Chess in Rust with Arbitrum Stylus | Chris Cordle | ETH Denver 2024 | 2024.02.26
- Arbitrum Stylus | Mahsa Moosavi, Rachel Bousfield, Chris Cordle, Austin Marazza | Arbitrum Virtual Day | 2023.12.11
- Arbitrum Smart Contracts in Rust | Raul Jordan | ETHGlobal Istanbul 2023 | 2023.11.23
- Rust smart contracts? Arbitrum Stylus Interview | Rachel Bousfield, Patrick Collins | Cyfrin Audits Interview | 2023.11.02
- An Odyssey Into Arbitrum | Jose Franco | SmartCon 2023 | 2023.10.26
- Arbitrum Stylus: Smart Contract Composability | Rachel Bousfield | Stanford Blockchain Club | 2023.10.16
- Using AssemblyScript on Stylus | Jose Franco | Offchain Labs Dev Tutorials | 2023.09.28
- Arbitrum Rust Smart Contracts for Solidity Devs | Rachel Bousfield | ETHGlobal NYC | 2023.09.26
- Building a Stylus Smart Contract Pt 1 | Rachel Bousfield | Offchain Labs Dev Tutorials | 2023.09.22
- Building a Stylus Smart Contract Pt 2 | Rachel Bousfield | Offchain Labs Dev Tutorials | 2023.09.22
- Getting Started with Arbitrum Stylus | Raul Jordan | Offchain Labs Dev Tutorials | 2023.09.12
- Arbitrum Stylus: Rust Smart Contracts on L2 | Raul Jordan | Rust x Ethereum Day (Paradigm) | 2023.09.11
- Arbitrum Stylus | Rachel Bousfield | Arbitrum Day Paris | 2023.08.18
- Stylus Remix Plugin | Welldone Studio - A Remix plugin (online editor) to write your Stylus contracts and deploy them.
- Stylus Playground - An online playground for building, compiling and testing Stylus smart contracts
- Zig Stylus - Zig SDK for Stylus smart contracts
- stylus-toolkit - A toolkit of Stylus primitives and examples of their usage
- Stylus Suite - Manage your Stylus projects with this Vs Code extension. Call cargo stylus methods with simple user interface, use pre defined snippets, chat with Stylus GPT and many more
- Unit Testing | Open Zepplin - A Rust testing library that provides utilities and helpers for unit testing your smart contracts.
- E2E Testing | Open Zepplin - A Rust testing library coupled to the Nitro Dev Node to provide affordances and utilities for end to end smart contract testing.
- Open Zepplin Contracts - Canonical and audited implementations of ERC-20, ERC-721, ERC-1155, access control contracts, and more. See repository for exact audit statuses.
- Inkmate - Gas-efficient smart contracts written in Rust, including ERC20 and ERC721
- Rustmate - Blazing fast, modern, and optimized Rust building blocks for smart contract development using Stylus
- OpenStylus - Modular and gas-optimized smart contract libraries and frameworks for Stylus smart contract development
- Renegade (docs / repo / case study) - On-chain dark pool utilizing ZK-proofs for privacy preserving transactions.
- Superposition - LongTail (docs / repo / case study) - Rewards based AMM built with Stylus on a L3 Orbit Chain (Superposition).
- Ed25519 signature recovery benchmark | LimeChain
- Onchain Package Manager | Bucharest Arbitrum Hackathon | JustAnotherDevv
- ERC-20 Examples
- ERC-721 Examples
- Stylus workshop (Rust & Solidity) - An example of 3 contracts (two written in Rust, and one in Solidity) interacting with each other.
- Stylus workshop (Update Proxy logic from Solidity to Rust) - An example of a Proxy written in Solidity that updates its logic contract from an ERC-20 Solidity contract to an ERC-20 Rust contract.
- Greeter tutorial - Example of Arbitrum's cross-chain message passing system
- P256 Verification Using Arbitrum Stylus - Example of C code compiled to Stylus to verify an ECDSA signature using a standard P256 Curve
- Keccak Looper - A Rust contract that loops n times and hashes an input string repeatedly
- Stylus BLST - A C based smart contract that verifies BLS signatures onchain
- Pausable Library in Rust - A sample implementation of Pausable and Ownable in Rust
- Stylus ERC4626 - A sample implementation of OpenZeppelin ERC4626 contract in Rust
- stylus-benchmark - A project benchmarking Stylus vs EVM implementations on their gas consumption
- create2 tutorial: Deploy stylus contracts with
create2
and derive their addresses.
- Zk-sunade - An optimized , handwritten implementation of Groth16 using Arbitrum Stylus
- Stylus Proxy - An example contract for implementing minimal proxy pattern in Stylus
- Stylus AssemblyScript Example - Sieve of Erathosthenes implemented with AssemblyScript
When trying to use the latest version of cargo stylus
on a project created first on cs v0.2.x you might run into this error:
missing import pay_for_memory_grow
To make the code compatible with the latest version, you might need to update the stylus-sdk version used to v0.5.0
- ERC20 Examples
- Stylus Permit - An ERC20 Permit example in Rust
- Stylusmate - An ERC20 with Ownable module in Rust
- Rustmate ERC20 - An ERC20 + EIP-2612 implementation equivalent to Solmate
- ERC721 Examples
- Uniswap V2 In Wasm - A Uniswap v2 proof of concept implementation
- RKFall NFT - A Rust based project that uses gravitational field computation for generating NFTs
When trying to use the latest version of cargo stylus
on a project created first on cs v0.1.x you might run into this error:
error: no library targets found in package `your-package-name`
Here are some tips for making this code compatible with the latest version:
- Use
lib.rs
instead ofmain.rs
for the main logic of your program - Add also a
[lib]
target to your Cargo.toml file if you don't have one - Update the stylus-sdk version used to v0.5.0
- Modify the function names from
camelCase
tosnake_case