Skip to content

OpenZeppelin/compact-tools

Repository files navigation

Generic badge Contributor Covenant OpenSSF Scorecard

This project extends the Midnight Network with additional developer tooling.

OpenZeppelin Compact Tools

Tools for compiling, building, and testing Compact smart contracts. This is a monorepo containing:

  • packages/builder — programmatic library that drives the Compact compiler + builder
  • packages/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.

Installation

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

compact-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 --help
import { CompactCompiler, CompactBuilder } from '@openzeppelin/compact-builder';
import { createSimulator } from '@openzeppelin/compact-simulator';

Requirements

  • Node.js >= 20 (root and packages/cli), >= 22 for packages/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.0

Development

Clone the repo and install dependencies at the root:

nvm install
yarn

Build everything:

yarn build

Run tests (root runs package tests via Turbo):

yarn test

Format and lint (Biome):

yarn lint
yarn lint:fix

Clean generated artifacts:

yarn clean

Contributing

Before 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.

License

MIT

About

A monorepo for collecting all the shared Compact tools

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors