This project extends the Midnight Network with additional developer tooling.
Warning
Internal tooling. Not audited.
These packages are built and maintained for the OpenZeppelin team's own Midnight development. They have not been audited, may contain bugs, and their APIs can change between releases without notice. Use them at your own risk. See SECURITY.md for the full disclaimer and for how to report a vulnerability.
Tools for compiling, building, testing, and deploying Compact smart contracts. This is a monorepo containing:
packages/builder— programmatic library that drives the Compact compiler + builderpackages/cli— thin bin wrapper around the builder and deployer libraries (compact-compiler,compact-builder,compact-deploy)packages/deployer— deployer library that submits a compiled contract to a Midnight network. Pins one Midnight stack: see Supported stackpackages/simulator— TypeScript simulator to run and test Compact contracts locally
See each package's README for usage, options, and examples.
Pick the package that matches what you need:
# Programmatic library — call the compiler/builder from TypeScript
yarn add --dev @openzeppelin/compact-builder
# CLI bins (compact-compiler, compact-builder) for use in package.json scripts
yarn add --dev @openzeppelin/compact-cli
# Simulator — test Compact contracts locally
yarn add --dev @openzeppelin/compact-simulator
# Deployer — deploy a compiled contract from TypeScript
yarn add --dev @openzeppelin/compact-deployercompact-cli depends transitively on compact-builder and
compact-deployer, so installing the CLI gives you both the binaries and the
underlying libraries.
yarn compact-compiler --help
yarn compact-builder --help
yarn compact-deploy --helpimport { CompactCompiler, CompactBuilder } from '@openzeppelin/compact-builder';
import { createSimulator } from '@openzeppelin/compact-simulator';- Node.js >= 22 for
packages/builderandpackages/simulator, >= 24 forpackages/cliandpackages/deployer - Yarn 4 (Berry)
- Turbo
- Optional: Midnight Compact toolchain installed and available in
PATH
Confirm your Compact toolchain:
$ compact compile --version
Compactc version: 0.29.0
0.29.0Clone the repo and install dependencies at the root:
nvm install
yarnBuild everything:
yarn buildRun tests (root runs package tests via Turbo):
yarn testFormat and lint (Biome):
yarn lint
yarn lint:fixClean generated artifacts:
yarn cleanBefore opening a PR, please read CODE_OF_CONDUCT.md. Use the root scripts to build, test, and format. For targeted work inside a package, run the scripts in that package directory.
MIT