Skip to content

Latest commit

 

History

History

examples

README.md

Examples

Integration examples show how to use the library in Daml applications. Each example builds separately and imports the library DAR through data-dependencies. Each example has a sibling -test package for Daml Script tests. See CONTRIBUTING.md for build and test commands.

Scoped Authorization Grant

Policy modules define trusted requirements; application choices bind the actor and apply the guard.

  • Licensing: delegate issuance on a registry to an operator.
  • Treasury RBAC: reusable role grants, separate authorities, and a proposal–approval–execution workflow.

Tests live in licensing-app-v1-test and treasury-rbac-v1-test.

Pausable

Consumers of openzeppelin-api-pausable-v1 and openzeppelin-pausable-utils.

Example Tests Shows
vault vault-test Minimal adoption: the interface instance, the guards, an escape hatch, and the pause authority
registry registry-test Flip choices that set CIP-0112 pauseInfo fields in the same create as the flag
retrofit-v1-0, retrofit-v1-1 retrofit-test Adoption in the next SCU version of a template with active contracts

timelock

Consumers of openzeppelin-api-timelock-v1 and openzeppelin-timelock-utils.

Example Tests Shows
treasury treasury-test A timelock, a governed config, and a treasury on separate contracts. The spending limit and the delay policy change only through timelocked operations: schedule, wait, apply, cancel, expiry cleanup, and self-administration of the delay

Token CIP-0112

Consumers of openzeppelin-token-cip112-v1, openzeppelin-token-cip112-types-v1, and openzeppelin-token-cip112-utils.

Example Tests Shows
token-cip112-trading-test scripts only Running the default templates of openzeppelin-token-cip112-v1: launching a token from the DAR, allocations funded through the standard factory, exact-cover DvP batch settlement, and the iterated-settlement deposit flow
token-cip112-custom token-cip112-custom-test A compliance-grade consumer that owns its own holding, instruction, allocation, and registry templates and reuses openzeppelin-token-cip112-types-v1 and openzeppelin-token-cip112-utils unchanged: roles, an auditor, a compliance freeze enforced through the spend hook, a pause switch, a fee on transfer built from two workflow calls, and an executor allowlist

Build and run

From the repository root, using the package path from multi-package.yaml:

DAML_PACKAGE=examples/pausable/vault dpm build
DAML_PACKAGE=examples/pausable/vault-test dpm test --all