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
- 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 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
- 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
- ERC-20 Examples
- ERC7-21 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.
- ERC20 Examples
- Stylus Permit
[cs v0.1.x]
- An ERC20 Permit example in Rust - Stylusmate
[cs v0.1.x]
- An ERC20 with Ownable module in Rust - Rustmate ERC20
[cs v0.1.x]
- An ERC20 + EIP-2612 implementation equivalent to Solmate
- Stylus Permit
- ERC721 Examples
- https://github.com/cygaar/ERC721Stylus/ (Rust)
[cs v0.1.x]
- https://github.com/0xcacti/stylus_erc721 (Rust)
[cs v0.1.x]
- https://github.com/gvladika/stylus-erc721 (Rust)
[cs v0.1.x]
- https://github.com/cygaar/ERC721Stylus/ (Rust)
- Uniswap V2 In Wasm
[cs v0.1.x]
- A Uniswap v2 proof of concept implementation - RKFall NFT
[cs v0.1.x]
- 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
- Zk-sunade
[cs v0.2.x]
- An optimized , handwritten implementation of Groth16 using Arbitrum Stylus - Stylus Proxy
[cs v0.2.x]
- An example contract for implementing minimal proxy pattern in Stylus - Stylus AssemblyScript Example
[cs v0.2.x]
- 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