docs

Plug-and-Play Documentation

docs.sh — Copy-paste snippets
[ _ ][ 🗗 ][ X ]

Your GitHub repository is your most important DevRel blog. Tested configs, copy-paste ready.

--tool@Stylus Rust SDK

Enables Rust/C++ smart contracts on Arbitrum with 10x gas savings vs Solidity for compute-heavy logic.

install
cargo install cargo-stylus
cargo stylus new my-project
rust
#![cfg_attr(not(feature = "export-abi"), no_main)]
extern crate alloc;
use stylus_sdk::{prelude::*, storage::StorageU256};

#[storage]
#[entrypoint]
pub struct Counter { count: StorageU256 }

#[public]
impl Counter {
    pub fn increment(&mut self) {
        let count = self.count.get() + U256::from(1);
        self.count.set(count);
    }
}