Join our community of builders on

Telegram!Telegram
Packages

Access

The example code snippets used in this guide are experimental and have not been audited. They simply help exemplify usage of the OpenZeppelin Sui Package.

The openzeppelin_access package provides role-based access control and ownership-transfer wrappers for privileged Sui objects, such as admin capabilities, treasury capabilities, shared protocol state, and governance-controlled operations.

Use this package when direct object transfer or single-admin authorization is too permissive for your protocol. It gives you typed role checks and explicit transfer workflows that are easier to review, monitor, and constrain with policy.

Usage

Add the dependency in Move.toml:

[dependencies]
openzeppelin_access = { r.mvr = "@openzeppelin-move/access" }

Import the module you want to use:

use openzeppelin_access::access_control::{Self, AccessControl, Auth};
use openzeppelin_access::two_step_transfer;
use openzeppelin_access::delayed_transfer;

Modules

Choosing a module

ModuleUse it when
access_controlAuthority is spread across multiple actors or roles, especially for shared objects, protocol functions, and delayed root-admin operations.
two_step_transferA single-owned privileged object can transfer immediately, but the recipient should explicitly accept first.
delayed_transferA single-owned privileged object should not transfer or unwrap until a visible delay has elapsed.

The ownership-transfer modules are designed for single-owned objects. In two_step_transfer, ctx.sender() is stored as the owner-of-record for pending requests. Avoid using this policy directly in shared-object executor flows unless your design explicitly maps signer identity to cancel authority.

Next steps