Acton’s build system takes your Tolk source files and turns them into deployable bytecode, ABI descriptors, dependency helper files, and optionally typed wrappers — all governed by theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ton-blockchain/acton/llms.txt
Use this file to discover all available pages before exploring further.
Acton.toml manifest. Understanding the build pipeline is key to keeping your project fast, deterministic, and well-structured as contracts grow in complexity.
Build commands overview
Two commands drive compilation:acton build
Runs the full project pipeline: compiles all contracts registered in
Acton.toml, resolves the dependency graph, and writes artifacts to build/ and gen/.acton compile
Targets a single
.tolk file — useful for quick inspection of compiler output or producing standalone .boc and .fif files outside a project build.Running acton build
Build all contracts
[contracts.*] entry in Acton.toml, resolves the full dependency graph, compiles contracts in topological order, and writes artifacts.
Build a single contract
Provide the contract ID to limit the build to that contract and its transitive dependencies:Custom output directories
[build] inside Acton.toml:
Acton.toml
Config paths in
[build] are resolved relative to the project root. CLI flags like --out-dir are resolved relative to the current working directory unless absolute.What gets written
For each successfully compiled contract, Acton produces:| Artifact | Location | Contents |
|---|---|---|
| JSON build artifact | build/<Contract>.json | Base64-encoded code + code hash |
| ABI JSON | build/abi/<Contract>.json | Compiler ABI (when available) |
| Dependency helper | gen/<Dep>.code.tolk | Tolk asm function embedding child code |
| Fift source | build/fift/<Contract>.fif | Optional; only for .tolk source contracts |
| Binary BoC | <output> | Optional; only when output is set in Acton.toml |
Contract dependencies
Parent contracts often need child contract code at runtime — to deploy children or to verify their code hash. Declare dependencies inActon.toml:
Acton.toml
Dependency kinds
- embed_code (default)
- library_ref
The full compiled child code is embedded directly in the parent at build time. The generated helper file in Generated assembly:
gen/ contains a Tolk asm function that pushes the child BoC as a cell reference:Acton.toml
gen/Wallet.code.tolk
Detailed dependency configuration
Use the detailed form to override the generated function name or output path:Acton.toml
| Field | Required | Default | Description |
|---|---|---|---|
name | Yes | — | Contract ID to depend on. |
kind | No | "embed_code" | "embed_code" or "library_ref". |
function | No | Auto-derived from contract ID | Custom name for the generated helper function. |
path | No | {gen-dir}/{name}.code.tolk | Custom output path for the generated helper file. |
Circular dependency detection
Acton resolves the full dependency graph before compiling. A cycle aborts the build immediately:Best-effort builds
Once dependency resolution succeeds, Acton builds eligible contracts and discards those that fail to compile — it does not abort the entire run. Artifacts from successful contracts in the current run remain on disk. A parent contract may still fail if its dependency failed to build and itsgen/ helper was never produced.
Build caching
Acton maintains a file-based build cache underbuild/cache/. Each entry is keyed on:
- Source file path
- Tolk compiler version
- Optimization level and debug mode
- Fift generation flag
- Import mappings from
Acton.toml
gen/ helper files — changing a child contract’s source also invalidates the cache for any parent that imports that helper.
The cache is shared by acton build, acton compile, and acton test, so recent builds often speed up subsequent test runs.
Clear the cache to force a full rebuild:
--clear-cache removes entries under build/cache/ only. It does not delete other artifacts in build/, generated helpers in gen/, or saved traces.Wrapper generation
After building, generate typed Tolk wrappers from each contract’s ABI:Counter.gen.tolk wrapper provides:
Counter.fromStorage(storage)— initializes contract state and derives the deployment address.counter.deploy(from, config)— deploys the contract.counter.send{MessageName}(from, ...)— one method per declared incoming message type.counter.{getMethodName}()— one method per declared get method.
Acton.toml:
Acton.toml
Precompiled BoC contracts
Pointsrc at a .boc file to include a precompiled contract without running the Tolk compiler on its code:
Acton.toml
types is configured, Acton compiles the interface file to extract ABI and enable wrapper generation. Without types, acton wrapper --all skips the contract.
How BoC contracts differ from Tolk sources
How BoC contracts differ from Tolk sources
- Contract code is loaded directly from the
.bocfile — the Tolk compiler never runs on that code. acton buildalways writes the regular JSON artifact for a valid BoC contract.--output-fiftonly applies to compiled.tolkcontracts; no Fift is produced for BoC entries.- Other contracts can still declare
dependson a BoC contract; the precompiled code is embedded as-is. - The
output = "path/to/file.boc"field can still write a normalized BoC copy.
Dependency graph visualization
Generate a DOT file representing the full contract dependency graph:- macOS
- Ubuntu/Debian
embed code or library ref).
acton build reference
| Flag | Description |
|---|---|
[CONTRACT] | Optional contract ID. Builds only this contract and its dependencies. |
--clear-cache | Clears the compilation cache before building. |
--graph <PATH> | Generates a dependency graph in DOT format. |
--out-dir <DIR> | Directory for JSON build artifacts. Defaults to build/. |
--gen-dir <DIR> | Directory for generated dependency helpers. Defaults to gen/. |
--output-abi <DIR> | Directory for ABI JSON files. Defaults to build/abi/. |
--output-fift <DIR> | Directory for Fift output. Omitted by default. |
--info | Prints compiled code and code hash after a successful build. |