Skip to content

A curated list of Arbitrum Stylus code examples, libraries and resources

License

Notifications You must be signed in to change notification settings

OffchainLabs/awesome-stylus

Repository files navigation

Awesome Stylus

A curated list of Arbitrum Stylus code examples, libraries, projects and resources.

Guides

Videos

Stylus Pro Series

A detailed exploration of the Rust SDK, development tools, and high-performance use cases.

Stylus Showcase Series

In-depth conversations with the founders of early Stylus projects, exploring their experiences building with Stylus.

Talks & Presentations

Tools

  • 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

Libraries

  • 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

Projects

Examples

⚠️ IMPORTANT: Most of these examples were created using an older version of cargo-stylus (< v0.5.0), and with an older stylus-sdk version (< v0.6.0) and might not be compatible with recent versions of cargo-stylus without making some modifications to the source code.

Examples built with cargo-stylus v0.4.x and stylus-sdk v0.5.x

Examples built with cargo-stylus v0.2.x

  • 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

How to make this code compatible with stylus-sdk v0.5.0

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

Examples built with cargo-stylus v0.1.x

How to make this code compatible with stylus-sdk v0.5.0

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 of main.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 to snake_case

About

A curated list of Arbitrum Stylus code examples, libraries and resources

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published