Acton.toml
Detailed reference for the Acton.toml configuration file
The Acton.toml file is the project manifest. It defines package metadata, contract definitions, test settings, and custom scripts.
The manifest conforms to the TOML 1.1 specification.
Project Root Resolution
Acton resolves project root for each CLI invocation using global flags:
--project-root <PATH>sets project root explicitly (no search).- Without
--project-root, Acton searches from current directory up through parent directories forActon.toml(up to git boundary) and uses its directory as project root. - If no
Acton.tomlis found in that search range, project root falls back to current working directory. --manifest-path <PATH>selectsActon.tomlfor config loading only and does not change project root resolution.
This matters for all relative paths from config sections, e.g., [contracts].src, [build], [test], and [import-mappings], because they are resolved relative to project root for the current invocation.
Relative CLI path flags are a separate rule:
- Relative paths written inside
Acton.tomlare resolved from project root. - Relative CLI path flags stay relative to the current working directory unless they are absolute.
--manifest-pathchooses which manifest to load, but it does not rebase unrelated CLI path flags to the manifest directory.
Examples:
[build].out-dir = "artifacts"writes under<project-root>/artifacts.acton build --out-dir artifactswrites under<cwd>/artifacts.[wrappers.tolk].output-dir = "wrappers"resolves from project root, butacton wrapper Counter --output-dir wrappersresolves from the current working directory.
Root section
The top-level of Acton.toml contains the following sections:
[package]— Project metadata.[toolchain]— Required Acton CLI version for this project.[contracts]— Definition of smart contracts in the project.[build]— Build command output settings.[wrappers]— Default output settings foracton wrapper.[fmt]— Tolk formatter settings foracton fmt.[localnet]— Default settings foracton localnetcommands.[test]— Configuration for the test runner.[lint]— General linter configuration.[networks]— Custom network definitions.[scripts]— Custom shell commands or scripts.[import-mappings]— Path mappings for Tolk compiler imports.
[package]
Defines project metadata.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Project name. |
description | string | Yes | A short description of the project. |
version | string | Yes | The current version of the project (e.g., 0.1.0). |
repository | string | No | The URL of the project's source code repository. |
license | string | No | The license under which the project is distributed (e.g., MIT). |
Example:
[package]
name = "my-awesome-contract"
description = "A project with Tolk smart contracts"
version = "0.1.0"
repository = "https://github.com/user/my-awesome-contract"
license = "MIT"[toolchain]
Pins project-level tooling versions. Acton checks this section before running project commands and exits with an error when the installed CLI version does not match the configured version.
| Field | Type | Required | Description |
|---|---|---|---|
acton | string | No | Required Acton CLI version without a leading v, for example 1.1.0. |
Example:
[toolchain]
acton = "1.1.0"For preview-channel builds installed with acton up --trunk, set the pin to
trunk instead of the numbered stable release:
[toolchain]
acton = "trunk"acton up remains available when the configured version does not match, so the
expected version can be installed from the same project directory.
[contracts]
This section is a map where each key is a contract name and the value is a contract configuration object.
| Field | Type | Required | Description |
|---|---|---|---|
display-name | string | No | Human-readable name of the contract. Defaults to the contract name. |
src | string | Yes | Path to the contract source file (.tolk) or a precompiled .boc. |
types | string | No | Tolk interface file used to produce ABI for a precompiled .boc. |
depends | array | No | List of contract dependencies. Can be simple names or detailed objects. |
output | string | No | Custom path where the compiled .boc should be saved. |
For precompiled .boc contracts, types can point to a Tolk file that contains
the contract header, message/storage types, and getters. Acton still loads code
from src, but uses the types file to produce ABI and generate wrappers.
[contracts.Precompiled]
display-name = "Precompiled"
src = "contracts/Precompiled.boc"
types = "contracts/Precompiled.types.tolk"Do not put dependencies on the BoC contract itself: it is already compiled.
Instead, put depends = ["Precompiled"] on the .tolk contract that needs the
BoC code.
Contract dependencies
Dependencies can be specified in two ways:
-
Simple format: Just the name of another contract defined in
Acton.toml.Acton.toml depends = ["AnotherContract"] -
Detailed format: An object with additional settings.
name: Name of the contract to depend on.kind: Dependency type. Eitherembed_code(default) orlibrary_ref.function: Custom name for the generated code function.path: Custom output path for the generated code file.
Dependency helper naming uses the contract key from [contracts.<name>], not display-name. Relative dependency path values are resolved from the project root.
Example:
[contracts.MainContract]
display-name = "Main Contract"
src = "contracts/MainContract.tolk"
depends = [
"ChildContract",
{ name = "LibraryContract", kind = "library_ref", function = "get_lib_code" }
][build]
Configures defaults for acton build.
| Field | Type | Required | Description |
|---|---|---|---|
out-dir | string | No | Directory where build JSON artifacts are written (default: build). |
gen-dir | string | No | Directory where generated dependency files are written (default: gen). |
output-abi | string | No | Directory where contract ABI JSON files are written (default: build/abi). |
output-fift | string | No | Directory where compiled Fift files are written (<contract>.fif per .tolk contract). |
Example:
[build]
out-dir = "build"
gen-dir = "gen"
output-abi = "build/abi"
output-fift = "build/fift"acton build --out-dir <DIR>, acton build --gen-dir <DIR>, acton build --output-abi <DIR>, and acton build --output-fift <DIR> override these values for a single run. Config values here are project-root-relative. The CLI flags stay relative to the current working directory unless absolute paths are passed. Precompiled .boc contracts emit ABI only when their contract config sets types; they never emit Fift output.
[wrappers]
Configures default output locations for acton wrapper.
[wrappers.tolk]
| Field | Type | Default | Description |
|---|---|---|---|
output-dir | string | - | Default directory for generated Tolk wrappers. |
generate-test | boolean | false | Generate a Tolk test stub by default for non-TypeScript wrapper runs. |
test-output-dir | string | - | Default directory for generated Tolk test stubs. |
[wrappers.typescript]
| Field | Type | Default | Description |
|---|---|---|---|
output-dir | string | - | Default directory for generated TypeScript wrappers. |
Example:
[wrappers.tolk]
output-dir = "wrappers"
generate-test = true
test-output-dir = "tests"
[wrappers.typescript]
output-dir = "app/src/wrappers-ts"Override rules:
- For Tolk wrappers,
--outputhas highest priority, then--output-dir, then[wrappers.tolk].output-dir, then the@wrappersmapping when present, then the wrapper command's built-inwrappers/location. - For TypeScript wrappers,
--outputhas highest priority, then--output-dir, then[wrappers.typescript].output-dir, then the wrapper command's built-in default location. - For Tolk test stubs,
--test-outputhas highest priority, then--test-output-dir, then[wrappers.tolk].test-output-dir, then the wrapper command's built-in default test location. [wrappers.tolk].generate-testaffects only non-TypeScript wrapper generation.acton wrapper --tsstill cannot be combined with test-stub generation.
Configured wrapper paths are resolved from project root. CLI paths such as --output, --output-dir, --test-output, and --test-output-dir stay relative to the current working directory unless absolute.
For full CLI behavior, see acton wrapper.
[fmt]
Configures defaults for acton fmt.
| Field | Type | Default | Description |
|---|---|---|---|
width | integer | 100 | Maximum line width for formatting. |
ignore | string[] | - | Glob patterns of files to exclude from formatting. |
separate-import-groups | boolean | false | Adds an empty line between import groups. |
Import groups are ordered as: @stdlib, @acton, @<other>, plain imports (import "foo"), ./, ../.
Example:
[fmt]
width = 100
ignore = ["contracts/generated/*.tolk"]
separate-import-groups = trueCLI flags still override config values for a single run (for example acton fmt --check).
[localnet]
Configures defaults for acton localnet.
| Field | Type | Default | Description |
|---|---|---|---|
port | integer | 5411 | Port used by acton localnet commands when --port is omitted. |
fork-net | string | - | Network used by acton localnet start when --fork-net is omitted. |
fork-block-number | integer | - | Block sequence number used by acton localnet start for historical state fork. |
accounts | string[] | - | Wallet names from [wallets] to auto-fund and auto-deploy on localnet start. |
rate-limit | integer | - | Maximum /api requests per second to simulate provider limits (429 on overflow). |
response-delay-ms | integer | - | Response delay for /api/v2, /api/v3, and /api/emulate/v1 endpoints; streaming/control/UI are not delayed. |
Example:
[localnet]
port = 3010
fork-net = "testnet"
fork-block-number = 55000000
accounts = ["deployer", "user"]
rate-limit = 1
response-delay-ms = 300acton localnet start --port <PORT>, --fork-net <NETWORK>, --fork-block-number <SEQNO>, --accounts <NAME[,NAME...]>, --rate-limit <RPS>, and --response-delay-ms <MS> override these values for a single run.
[test]
Configures the behavior of acton test.
| Field | Type | Default | Description |
|---|---|---|---|
filter | string | - | Regex pattern to filter tests by name. |
reporter | string[] | ["console"] | List of reporters: console, teamcity, junit, dot. |
debug | boolean | false | Enable debug mode (activates debugger). |
debug-port | integer | 12345 | Port for the debug server. |
backtrace | string | - | Set to full to enable full stack traces on failure. |
coverage | object | - | Coverage settings subtree under [test.coverage] (see below). |
fuzz | object | - | Default fuzz settings under [test.fuzz] for annotated tests. |
exclude | string[] | - | Glob patterns of files to exclude from testing. |
include | string[] | - | Glob patterns of files to include in testing. |
junit-path | string | - | Directory for JUnit XML reports. |
junit-merge | boolean | false | Merge all test results into a single JUnit file. |
fork-net | string | - | Network to fork for state (e.g., mainnet, testnet). |
fork-block-number | integer | - | Specific block number to fork from. |
fail-fast | boolean | false | Stop execution after the first test failure. |
fail-on-diff | boolean | false | Exit with non-zero code when profiling differs from baseline snapshot. |
gas-profile | string | - | Path to write a gas-weighted execution profile. |
gas-profile-format | string | cpuprofile | Gas profile output format: cpuprofile or collapsed. |
gas-profile-include-tests | boolean | false | Include .test.tolk unit-test get-method execution in the profile. |
ui | boolean | false | Enable the browser test UI server. |
ui-port | integer | 12344 | Port for the browser test UI server. |
mutation | object | - | Configuration for mutation testing (see below). |
TON Center API keys are configured through the process environment, not Acton.toml: use TONCENTER_TESTNET_API_KEY or TONCENTER_MAINNET_API_KEY when the built-in fork target needs authentication.
[test.coverage]
Configures default coverage behavior for acton test.
| Field | Type | Default | Description |
|---|---|---|---|
enabled | boolean | false | Enable code coverage collection. |
format | string | lcov | Format for coverage report (lcov, text). |
output-file | string | - | Path to save the coverage report. |
minimum-percent | float | - | Fail non-UI coverage runs below this final coverage score. |
include-wrappers | boolean | false | Include files from the @wrappers mapping in coverage reports. |
include-tests | boolean | false | Include .test.tolk files in coverage reports. |
[test.fuzz]
Configures defaults for parameterized tests that explicitly opt into fuzzing with @test.fuzz, @test.fuzz(<runs>), or @test.fuzz({ ... }). Per-test annotations can override individual values with @test.fuzz({ runs: ..., max_test_rejects: ..., seed: ... }).
| Field | Type | Default | Description |
|---|---|---|---|
runs | integer | 256 | Number of accepted fuzz cases to execute for each fuzz test. |
max-test-rejects | integer | runs * 256 | Maximum number of assume(...) rejections before the fuzz test fails. |
seed | integer | - | Seed for reproducible fuzz input generation. |
Mutation testing configuration
The [test.mutation] subsection configures default filters for
acton test --mutate. Available rule IDs are documented in
Mutation Rules.
| Field | Type | Description |
|---|---|---|
diff | string | Changed-line scope: worktree, ref, or branch. |
diff-ref | string | Base ref used by ref mode and optional override for branch. |
mutation-levels | string[] | List of mutation levels to run: critical, major, minor. |
minimum-percent | float | Minimum mutation score required for the run to succeed. |
disable-rules | string[] | List of rule IDs to disable during mutation testing. |
rules-file | string | Path to a JSON file with custom query-based mutation rules. |
diff = "worktree"compares the current worktree withHEAD. Use it for uncommitted local changes. Untracked files are treated as fully changed.diff = "ref"compares against an explicit ref, tag, or commit and requiresdiff-ref.diff = "branch"compares the current branch against the merge-base with its upstream branch. Usediff-refto override the base branch explicitly, or when the current branch has no upstream.mutation-levelskeeps only selected rule levels. For example,["critical", "major"]skipsminormutations.minimum-percentfails the run when the resulting mutation score drops below the threshold. Valid range:0..=100.disable-rulesexcludes individual rule IDs after diff and level filters are applied.rules-fileadds custom query-based rules from JSON. If a custom rule uses the same ID as a built-in rule, it overrides the built-in one. Runacton meta get-schema mutation-rulesto print the JSON schema for that file format.
All filters compose, and the reported mutation score reflects only the mutants that remain after filtering. Compile errors are excluded from the score, and minimum-percent applies to that final mutation score.
Example:
[test]
reporter = ["console", "junit"]
fail-fast = true
fail-on-diff = true
gas-profile = "build/gas.cpuprofile"
gas-profile-format = "cpuprofile"
gas-profile-include-tests = false
[test.coverage]
enabled = true
format = "lcov"
include-wrappers = true
include-tests = true
[test.fuzz]
runs = 512
max-test-rejects = 4096
seed = 42
[test.mutation]
diff = "branch"
diff-ref = "origin/main"
mutation-levels = ["critical", "major"]
minimum-percent = 85
disable-rules = ["replace_plus_with_minus"]
rules-file = "mutation-rules.json"CLI flags such as --mutation-diff, --mutation-diff-ref, --mutation-levels, --mutation-minimum-percent, --mutation-disable-rules, and --mutation-rules-file override these defaults for the current run.
The fail-on-diff is used together with baseline comparison mode (acton test --baseline-snapshot <FILE>). Gas profile options apply when gas-profile or --gas-profile <FILE> is set.
Combine them with ui = true or acton test --gas-profile <FILE> --ui to
browse flamegraphs in Test UI. Set gas-profile-include-tests = true when
.test.tolk unit-test get methods contain the hot path you want to inspect.
[lint]
Configures the Tolk linter (acton check).
Use [lint] for linter-wide settings and [lint.rules] for rule severities. For practical workflows and CI usage, see the linting page.
General settings
| Field | Type | Description |
|---|---|---|
exclude | string[] | Glob patterns for files to exclude from lint diagnostics. Excluded contract roots are skipped entirely. |
max-warnings | integer | Maximum warning count allowed before acton check exits with non-zero code. Default: unlimited. |
output-format | string | Default report format for acton check: plain, json, sarif, github, or gitlab. |
Example:
[lint]
exclude = ["contracts/generated/*.tolk", "contracts/legacy.tolk"]
max-warnings = 0 # fail on any warning
output-format = "sarif"Excluded dependency files are still parsed for imports and types, but lint diagnostics for them are hidden. When passing an explicit target to acton check, either a contract name or a file path, that target is checked even if it matches exclude. Compiler errors are never hidden by exclude.
Project-wide discovery skips built-in directories such as .git, .github, .idea, .acton, node_modules, target, tolk-stdlib, .codex, and .claude, and non-.tolk contract entries such as .boc artifacts never become lint roots.
CLI flag acton check --output-format <FORMAT> overrides [lint].output-format for the current run. Use acton check --output-file <PATH> to write non-plain output into a file.
For one-off line-level suppressions in source code, use // check-disable-next-line ... comments. Suppressions use rule names, e.g., unused-variable, and do not affect compiler or parser diagnostics like C001: compiler-error.
See the project lint policy configuration for more.
Global configuration
Specify rules under [lint.rules] to apply them to all contracts in the project.
Example:
[lint.rules]
unused-variable = "deny"
mutable-variable-can-be-immutable = "warn"| Level | Description |
|---|---|
allow | Rule is disabled. |
warn | Rule violation is reported as a warning (default for most rules). |
deny | Rule violation is reported as an error, failing the check. |
Contract overrides
Override lint levels for specific contracts by creating a subsection named after the contract: the NAME in [contracts.NAME].
Example:
[contracts.Counter]
display-name = "My Counter"
src = "contracts/Counter.tolk"
[lint.rules]
unused-variable = "deny"
[lint.rules.Counter]
unused-variable = "allow" # Disable for the Counter contract only[networks]
Defines network settings used by --net and --fork-net.
mainnetandtestnetare built in.localnetis a first-class network and is always available.- Extra entries under
[networks.<name>]are used ascustom:<name>.
| Field | Type | Required | Description |
|---|---|---|---|
api.v2 | string | Yes for custom, optional for localnet | TON Center API v2 URL. For localnet, if omitted, Acton uses http://127.0.0.1:<localnet.port>/api/v2; if [localnet].port is not set, it falls back to port 5411. |
api.v3 | string | No | TON Center API v3 URL. For localnet, if omitted, Acton uses http://127.0.0.1:<localnet.port>/api/v3; if [localnet].port is not set, it falls back to port 5411. |
explorer | string | No | Base explorer URL for transaction links. Acton appends /tx/<hash> automatically (adds /tx/ if missing). If omitted, Acton derives explorer links from api.v2 (<scheme>://<host>/explorer/tx/<hash>). For default localnet, this becomes http://127.0.0.1:<port>/explorer/tx/<hash>. |
Example:
[networks.localnet]
explorer = "http://127.0.0.1:3006"
[networks.my-custom-net]
api = { v2 = "https://my-custom-net.com/api/v2", v3 = "https://my-custom-net.com/api/v3" }
explorer = "https://my-custom-net.com/explorer"These networks work in commands such as:
acton script --net localnetacton script --net custom:my-custom-netacton test --fork-net custom:my-custom-net
[scripts]
Allows defining custom scripts that can be executed via acton run <name>.
Example:
[scripts]
deploy = "acton script scripts/deploy.tolk"
check = "acton test --filter='.*_check'"[import-mappings]
Allows defining path aliases for the Tolk compiler, similar to @stdlib. These mappings allow importing files using logical names instead of relative paths.
| Field | Type | Description |
|---|---|---|
key | string | The alias prefix (e.g., @core). If @ is omitted (preferred), it will be added. |
value | string | The relative or absolute path the prefix points to. |
Example:
[import-mappings]
utils = "./libs/utils" # Equivalent to "@utils" and preferred
"@core" = "./libs/core"With the above configuration, Tolk source files can import using those mappings:
import "@core/math" // Resolves to ./libs/core/math.tolk
import "@utils/logic" // Resolves to ./libs/utils/logic.tolkBuilt-in project mappings
Projects created with acton new, or initialized with acton init when
Acton.toml did not exist yet, usually contain
these default mappings:
| Mapping | Default path | Common use |
|---|---|---|
@acton | .acton | Standard library imports such as @acton/testing/expect |
@contracts | contracts or contracts/src | Local contract-side modules such as @contracts/types |
@tests | tests or contracts/tests | Shared test helpers and fixtures |
@wrappers | wrappers or contracts/wrappers | Generated wrappers such as @wrappers/Counter.gen |
@gen | gen | Generated dependency helper files |
Example:
import "@acton/testing/expect"
import "@contracts/types"
import "@wrappers/Counter.gen"These defaults are written into Acton.toml by project scaffolding commands such as acton new and by acton init only when it creates a missing manifest. The exact path depends on the scaffold layout: standard templates use contracts/, tests/, and wrappers/, while --app scaffolds use contracts/src/, contracts/tests/, and contracts/wrappers/.
Acton does not silently recreate deleted folders during normal workflows. To recreate missing folders, manually restore them from Git within the Git-managed project.
Prefix resolution rules
- Exact Match: Acton matches the first part of the path (before the first slash) against the defined mappings. For example, in
import "@core/math", it looks for the@coremapping. - Normalization: If a mapping key doesn't start with
@(preferred), Acton automatically prepends it. - Relative Paths: Relative paths in mappings are resolved relative to project root for the current invocation.
Additional properties
Acton allows adding arbitrary metadata fields to any section of Acton.toml. These fields are ignored by Acton itself but can be used by third-party tools or for project-specific metadata.
Last updated on