Library

The OpenZeppelin library for Canton is a set of foundational Daml modules that other packages and applications compose on top of. It brings the patterns developers know from OpenZeppelin's Solidity contracts (role-based access control, ownership, emergency stop) to Daml, adapted to Canton's authorization and privacy model rather than translated literally.

Experimental and work in progress. All library packages are version 0.x, unaudited, and not yet a stable public API: interfaces may change before a 1.0 release, and they are not intended for production use. Source: OpenZeppelin/canton-contracts.

Packages

Each primitive ships as its own independent Daml package: its own DAR, with no dependency on the others, so a consumer imports only what it needs:

  • Access Control: role-based authorization, the AccessControl.sol analogue. An admin grants named roles as bearer credentials; gated choices verify the presented grant.
  • Ownable: single-owner authorization for privileged actions, the Ownable2Step.sol analogue. Ownership transfer is a two-step handshake, because in Daml a new owner is a signatory and cannot be bound unilaterally.
  • Pausable: an emergency stop, the Pausable.sol analogue. An authorized party halts and resumes sensitive choices; pause is origination control on a keyless ledger.

Design Philosophy

Independence at the package boundary. Daml has no inheritance, and its unit of reuse is the DAR. The library therefore delivers OpenZeppelin's decoupled-module promise at the package level: three packages, three DARs, zero cross-dependencies. A project that only needs pausing imports only openzeppelin-pausable-v1.

Versioned packages and modules. Each component is released as a versioned package (openzeppelin-<component>-v1) with a matching module suffix (OpenZeppelin.<Component>V1). Compatible upgrades keep the package name; a breaking change ships as a sibling -v2 package instead of mutating -v1.

Adapted, not transliterated. Where Daml's model differs from the EVM (monomorphic templates, no global state lookups, signatory-based authority), each primitive adopts the idiomatic Daml shape and documents the divergence on its page.

Script-free libraries. The shipped packages carry no daml-script dependency; tests and example consumers live in a separate test package. Your production DAR stays lean.

Using the Library

Add the package(s) you need as data-dependencies of your Daml project and import the module:

import OpenZeppelin.AccessControlV1
import OpenZeppelin.OwnableV1
import OpenZeppelin.PausableV1

See Get Started for toolchain setup, and each package page for its templates, choices, and usage patterns.