Skip to main content

Documentation 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 build compiles every contract declared in Acton.toml, resolves transitive dependencies, and writes build artifacts to the output directory. Pass a contract name to build a single contract and its dependencies. The command supports precompiled .boc sources, optional Fift output, ABI generation, and dependency-graph export.

Synopsis

acton build [OPTIONS] [CONTRACT_NAME]

Arguments & options

Positional

ArgumentDescription
[CONTRACT_NAME]Build only this contract and its transitive dependencies. Must match a [contracts.<name>] key in Acton.toml. Omit to build all contracts.

Build flags

FlagTypeDefaultDescription
--clear-cacheflagfalseClear the compilation cache before building.
--out-dir <DIR>pathbuild/Output directory for compiled JSON artifacts (<name>.json with code_boc64 and hash). Overrides [build].out-dir.
--gen-dir <DIR>pathgen/Output directory for generated dependency helper files (e.g. gen/<dep>.code.tolk). Overrides [build].gen-dir.
--output-abi <DIR>pathbuild/abi/Output directory for contract ABI JSON files. Overrides [build].output-abi.
--output-fift <DIR>pathOutput directory for compiled Fift files. Not written unless this flag or [build].output-fift is set.
--graph <PATH>pathWrite the dependency graph for the build set as a DOT file.
--infoflagfalsePrint compiled code and hash information after a successful build.

Global flags

FlagTypeDefaultDescription
--color <WHEN>auto | always | neverautoControl coloured output.
--manifest-path <PATH>pathPath to Acton.toml. Conflicts with --project-root.
--project-root <PATH>pathPath to project root. Conflicts with --manifest-path.

Acton.toml configuration

[contracts] section

Acton.toml
[contracts.Wallet]
display-name = "Wallet Contract"
src           = "contracts/Wallet.tolk"
output        = "Wallet.boc"          # optional: write compiled .boc here
depends       = ["Child"]             # optional: transitive build dep

# Precompiled contract — skip recompilation, optionally emit ABI
[contracts.Precompiled]
src   = "contracts/Precompiled.boc"
types = "contracts/Precompiled.types.tolk"  # for ABI metadata only
Contracts with .boc sources are treated as precompiled inputs. Acton loads their code, includes them in dependency resolution, and skips recompilation. Add depends = ["Precompiled"] on a .tolk contract that imports the precompiled code — do not list it as a dependency on the .boc entry itself.

[build] section

Acton.toml
[build]
out-dir      = "build"
gen-dir      = "gen"
output-abi   = "build/abi"
output-fift  = "build/fift"
CLI flags override [build] values for the current invocation.

Build output structure

build/
├── Counter.json          # { code_boc64, hash }
├── Wallet.json
└── abi/
    ├── Counter.json      # ABI metadata
    └── Wallet.json

gen/
├── Child.code.tolk       # dependency helper
└── Precompiled.code.tolk

Wallet.boc               # written to contracts[Wallet].output path

Dependency kinds

KindBehaviour
.tolk sourceFully compiled; artifacts emitted to --out-dir.
.boc source (precompiled)Code loaded as-is; types file compiled only for ABI.
depends = [...]Listed contracts are built first; their helper files are written to --gen-dir.

Best-effort behaviour

After dependency resolution succeeds, acton build continues building remaining eligible contracts even when an earlier contract fails — partial artifacts from successful builds stay on disk. Dependency-graph failures (missing contracts, cycles) abort the command before any compilation starts.

Examples

acton build
Set ACTON_DISABLE_AUTO_STDLIB=1 to skip the automatic .acton/tolk-stdlib refresh before the build — useful in CI environments where you have already initialised the project.

Build docs developers (and LLMs) love