Acton.toml
Detailed reference for the Acton.toml configuration file
The Acton.toml file is the manifest for your Acton project. It defines package metadata, contract definitions, test settings, and custom scripts.
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 (for example
[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] Section
Defines the metadata for your Acton project.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The name of your project. |
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] Section
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 0.3.2. |
Example:
[toolchain]
acton = "0.3.2"acton up remains available when the configured version does not match, so you
can install the expected version from the same project directory.
[contracts] Section
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. |
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. |
Contract Dependencies
Dependencies can be specified in two ways:
- Simple format: Just the name of another contract defined in
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] Section
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 cwd-relative unless you pass absolute paths.
Precompiled .boc contracts are skipped for ABI and Fift output.
[wrappers] Section
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] Section
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] Section
Configures defaults for acton localnet.
| Field | Type | Default | Description |
|---|---|---|---|
port | integer | 3000 | 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). |
Example:
[localnet]
port = 3010
fork-net = "testnet"
fork-block-number = 55000000
accounts = ["deployer", "user"]
rate-limit = 1acton localnet start --port <PORT>, --fork-net <NETWORK>, --fork-block-number <SEQNO>, --accounts <NAME[,NAME...]>, and --rate-limit <RPS> override these values for a single run.
[test] Section
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. |
mutation | object | - | Configuration for mutation testing (see below). |
TonCenter 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] Section
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. |
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] Section
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
[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.
fail-on-diff is used together with baseline comparison mode (acton test --baseline-snapshot <FILE>).
[lint] Section
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 Linting.
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/types, but lint diagnostics for them are hidden.
When you pass an explicit target to acton check (contract name or file path), that target is checked even if it matches exclude.
Compiler errors are never hidden by exclude.
Project-wide discovery still 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 are never 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 (see Linting Configuration).
Suppressions use rule names (for example unused-variable) and do not affect compiler/parser diagnostics (C001).
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
You can override lint levels for specific contracts by creating a subsection with the contract's name (the NAME from [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] Section
Defines network settings used by --net/--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 | TonCenter API v2 URL. For localnet, if omitted, Acton uses http://localhost:<localnet.port>/api/v2; if [localnet].port is not set, it falls back to port 5411. |
api.v3 | string | No | TonCenter API v3 URL. For localnet, if omitted, Acton uses http://localhost:<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://localhost:<port>/explorer/tx/<hash>. |
Example:
[networks.localnet]
explorer = "http://localhost: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"You can use these networks in commands like:
acton script --net localnetacton script --net custom:my-custom-netacton test --fork-net custom:my-custom-net
[scripts] Section
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] Section
Allows defining path aliases for the Tolk compiler, similar to @stdlib. These mappings let you import 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, you can use these mappings in your Tolk source files:
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 updated with acton init 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 | Generated dependency helper files |
Example:
import "@acton/testing/expect"
import "@contracts/types"
import "@wrappers/Counter"These defaults are written into Acton.toml by project scaffolding commands
such as acton new and acton init. The exact path depends on the scaffold
layout: standard templates use contracts / tests / wrappers, while
--app scaffolds use contracts/src / contracts/tests /
contracts/wrappers. If you remove them manually, Acton does not silently
recreate them during normal compilation; add them back explicitly or rerun
acton init.
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