OpenZeppelin / rust-contracts-stylus

A library for secure smart contract development written in Rust
MIT License
35 stars 5 forks source link

OpenZeppelin Contracts for Stylus

A library for secure smart contract development written in Rust for Arbitrum Stylus.

[!WARNING] This project is still in a very early and experimental phase. It has never been audited nor thoroughly reviewed for security vulnerabilities. Do not use in production.

Features

Usage

The library has not been published yet to crates.io, and this will be the case until we reach a stable version. However, one can specify a git dependency in a Cargo.toml, like so:

[dependencies]
openzeppelin-stylus = { git = "https://github.com/OpenZeppelin/rust-contracts-stylus" }

We recommend pinning to a specific version -- expect rapid iteration. Also note that the library's name has yet to be decided.

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

use openzeppelin_stylus::token::erc20::Erc20;

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

#[external]
#[inherit(Erc20)]
impl Erc20Example { }

For a more complex display of what this library offers, refer to our examples.

For a full example that includes deploying and querying a contract, see the basic example.

For more information on what this library will include in the future, see our roadmap.

Contribute

OpenZeppelin Contracts for Stylus exists thanks to its contributors. There are many ways you can participate and help build high-quality software. Check out the contribution guide!

Security

[!WARNING] This project is still in a very early and experimental phase. It has never been audited nor thoroughly reviewed for security vulnerabilities. Do not use in production.

Refer to our Security Policy for more details.

License

OpenZeppelin Contracts for Stylus is released under the MIT License.