Skip to content

Latest commit

 

History

History
116 lines (81 loc) · 3.44 KB

File metadata and controls

116 lines (81 loc) · 3.44 KB

Generic badge Contributor Covenant OpenSSF Scorecard

This project extends the Midnight Network with additional developer tooling.

OpenZeppelin Compact Tools

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 + builder
  • packages/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 stack
  • 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

# Deployer — deploy a compiled contract from TypeScript
yarn add --dev @openzeppelin/compact-deployer

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

Requirements

  • Node.js >= 22 for packages/builder and packages/simulator, >= 24 for packages/cli and packages/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.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