Crate openzeppelin_stylus

Source
Expand description

§OpenZeppelin Contracts for Stylus

A library for secure smart contract development written in Rust for Arbitrum Stylus. This library offers common smart contract primitives and affordances that take advantage of the nature of Stylus.

§Usage

To start using it, add openzeppelin-stylus to your Cargo.toml, or simply run cargo add openzeppelin-stylus.

[dependencies]
openzeppelin-stylus = "x.x.x"

We recommend pinning to a specific version – expect rapid iteration.

Once defined as a dependency, use one of our pre-defined implementations by importing them:

use stylus_sdk::prelude::*;
use openzeppelin_stylus::token::erc20::Erc20;

sol_storage! {
    #[entrypoint]
    struct MyContract {
        #[borrow]
        Erc20 erc20;
    }
}

#[public]
#[inherit(Erc20)]
impl MyContract { }

Modules§

access
Contracts implementing access control mechanisms.
token
Token standards.
utils
Common Smart Contracts utilities.