This project extends the Midnight Network with additional developer tooling.
Tools for compiling, building, and testing 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 library (compact-compiler,compact-builder)packages/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-simulatorcompact-cli depends transitively on compact-builder, so installing the CLI
gives you both the binaries and the underlying library.
yarn compact-compiler --help
yarn compact-builder --helpimport { CompactCompiler, CompactBuilder } from '@openzeppelin/compact-builder';
import { createSimulator } from '@openzeppelin/compact-simulator';- Node.js >= 20 (root and
packages/cli), >= 22 forpackages/simulator - 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