Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

project.yaml Reference

Multi-file projects are declared in YAML and loaded with --project.

name: my-dapp
target: evm          # required: evm | lean
output_dir: build/
sources:
  - Token.cam
  - Vault.cam
  - Vault.test.cam
library_paths:
  - ${CAMBRIAN_STDLIB}     # optional; env-expanded
  - ../vendor/cam-libs
imports:
  - math.cam               # shared helpers, not entities
  - token/erc20-core.cam

Top-level keys

KeyTypeNotes
namestringOptional project name
targetstringRequired — evm or lean
output_dirstringDefault build/
sourceslist of pathsEntry-point .cam files (entities, tests)
library_pathslist of pathsExtra directories for shared .cam files. ${VAR} is expanded; then absolute or relative to the YAML. No built-in default.
importslist of pathsShared helper files (not entities). Yaml directory first, then each library_paths entry. Same program-wide names as your own files.
foundryobjectFoundry / solc settings
fuzzobjectDefault fuzz runs / seed
invariantobjectDefault invariant runs / depth
leanobjectLean emission knobs

Shared files (library_paths / imports)

Leave both keys out if you do not need them; existing projects stay unchanged.

  • imports: loads shared declaration files the same way import "…" does. They may contain pure fn, types, library, event / error, extern entity, and further imports — not entity, test, fuzz, or invariant. Put those under sources:.
  • Each path is tried next to the YAML, then in each library_paths directory, in order. The first file that exists wins.
  • If nothing matches, the error lists every directory that was tried. An unset ${VAR} stays as the text ${VAR} (it does not become the project directory).
  • A path listed in both sources: and imports: is treated as a project source.
  • import "./math.cam" / import "../lib/math.cam" stay relative to the importing file and do not search library_paths. A path without ./ or ../ (import "token/erc20-core.cam") tries the importer’s directory first, then library_paths.
  • Imported names are not namespaced. See Program Structure and the Contract Standard Library.

foundry

KeyNotes
solc_version, evm_versionCompiler / EVM revision
optimizer, optimizer_runs, via_irOptimizer
fuzz_runsDefault Foundry fuzz runs
profilesPer-profile fuzz/invariant runs, depth, fail_on_revert
remappingsSolc remappings

fuzz / invariant

SectionTypical keys
fuzzruns (default 256), seed, shrink, max_local_rejects
invariantruns, depth, fail_on_revert, seed, max_local_rejects

lean

KeyNotes
numericsoverflow-wrap (default; legacy alias bitvec), overflow-panic, or nat
proof_helpersHelper emission
intrinsicsopaque or executable

See also