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/build module exposes a single host-assisted function, build(), that returns the code cell of a compiled Tolk contract. Because it runs inside the Acton host — not inside TVM — it can drive the full Acton build pipeline, consult an in-memory cache, read from the shared disk cache under build/cache, or simply decode a pre-built .boc file. This makes build() the standard way to get a contract’s code cell in both deployment scripts and emulation tests without hard-coding paths or manually invoking the compiler.
build() returns only the code cell. It does not deploy the contract. Pair it with a state-init helper (from your generated wrapper or manually via ContractState) to produce a deployable StateInit.Function Signature
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The contract name as declared in Acton.toml under [contracts.<name>]. This is the key, not the display-name. |
path | string | Optional explicit path. When non-empty, Acton.toml lookup is skipped entirely. |
Resolution Modes
Name lookup (default)
When
path is omitted, Acton looks up name in Acton.toml. If found, it compiles the resolved source (or reads the resolved .boc) and returns the code cell.Explicit Tolk file
When
path ends with .tolk, Acton compiles that file directly, bypassing the manifest. Useful when a contract lives at a non-standard path.Caching Behaviour
- In-memory cache — within a single
acton testoracton runinvocation, the same name resolves to the same cell without recompiling. - Disk cache — compiled cells are written to
build/cacheand reused across runs when the source has not changed. .types.tolkfiles — compiled with no entrypoint required, so interface-only files can be loaded explicitly..bocfiles — bypass both caches entirely; Acton reads and decodes the file each call.
Path Resolution
All relative paths are resolved from the project root (the directory containingActon.toml).
Usage in Tests
Usage in Scripts
Error Handling
| Scenario | Behaviour |
|---|---|
Contract name not found in Acton.toml | Runtime failure with descriptive error |
| Tolk source fails to compile | Compilation error surfaced at call site |
.boc file missing or corrupt | Runtime failure with file-read / BoC decode error |
path is an empty string | Falls back to name-lookup mode |