Every Acton project is anchored by a singleDocumentation 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 file. This manifest tells Acton where your contract source files live, how contracts depend on each other, where generated artifacts should be written, and which path aliases the Tolk compiler should resolve. Understanding the manifest and the conventions Acton enforces around it is the foundation for everything else — building, testing, scripting, and deploying.
Creating a new project
Start from a template
Useacton new to scaffold a new project from one of Acton’s built-in templates:
acton new prompts for the project name, template, optional app layout, and advanced options such as description, license, Git hooks, and AGENTS.md guidance. In non-interactive or CI environments, pass --template explicitly to skip prompts.
empty
Minimal template with a single empty contract — the lightest starting point.
counter
State-management example complete with wrappers, tests, and a deploy script.
jetton
Jetton minter and wallet contracts with wrappers, tests, and scripts.
nft
NFT collection and item contracts with wrappers, tests, and scripts.
w5-extension
Wallet V5 extension contract and subscription example. Alias:
w5-plugin.--app— adds a React + Vite frontend; works with all templates.--hooks— installs a pre-commit hook under.githooks/and setscore.hooksPath.--agents— copies the template’sAGENTS.mdinto the project root.--overwrite— overwrites existing files whose paths collide with the template.
Initialize an existing directory
Useacton init to initialize or refresh an Acton project in the current directory:
Acton.toml does not yet exist, acton init scans the directory tree for .tolk files that define onInternalMessage() and registers them as contracts in a freshly created manifest. When Acton.toml already exists, acton init leaves it untouched.
acton init also refreshes Tolk libraries in .acton/ and updates .gitignore with commonly ignored Acton entries. It is safe to rerun after .acton/ goes stale or .gitignore is missing Acton patterns.
- Refresh stdlib only
- Scaffold dApp only
acton init also manages symlinks for global.wallets.toml and global.libraries.toml. If either file already exists locally it is left untouched. Dangling symlinks are recreated with a warning.When to refresh
Rerunacton init when:
Acton.tomlis missing and contract files already exist..acton/is stale or missing..gitignoreis missing Acton-related entries.
acton init does not alter other files, override project structure, or delete existing files.
Project layout
Standard layout
dApp layout
Pass--app to add a React + Vite frontend. The dApp layout nests contract files under contracts/ subdirectories and creates app/ and wrappers-ts/:
Commit policy
| Path | Commit to Git | Description |
|---|---|---|
.acton/ | No | Managed by acton init. Regenerated on demand. |
build/ | No | Compiled output. Regenerated each build. |
gen/ | No | Dependency helpers. Regenerated each build. |
wrappers/ | Yes | Tolk wrappers from acton wrapper. |
wrappers-ts/ | Yes | TypeScript wrappers from acton wrapper --ts. |
Configuring Acton.toml
Package metadata
Acton.toml
API keys and secrets
Acton loads.env automatically. Copy .env.example to .env and uncomment the keys you need:
@toncenter Telegram bot.
Build output directories
Acton.toml
Wrapper output defaults
Acton.toml
Project scripts
Store repeated commands in[scripts] and run them with acton run:
Acton.toml
acton run executes the script command from the project root via sh -c.
Managing contracts
Thecontracts/ directory can contain many .tolk files. Acton treats a file as a contract entrypoint only when it defines a top-level onInternalMessage() function.
Add a contract
Create the source file
Create a
.tolk file with a top-level onInternalMessage() function, following the PascalCase naming convention.Override the display name
Acton.toml
display-name only affects presentation. Commands still use the contract ID, e.g., acton build DnsCollection.
Declare contract dependencies
Setdepends when a parent contract needs compiled child code — for deploying children or verifying code hashes:
Acton.toml
gen/, e.g., gen/NftItem.code.tolk:
gen/NftItem.code.tolk
contracts/NftCollection.tolk
build("NftItem") helper in deployment scripts:
scripts/utils.tolk
Dependency kinds
By default,depends embeds the full compiled child code (embed_code). Use the detailed form to switch to an on-chain library reference:
Acton.toml
| Kind | Behavior |
|---|---|
embed_code | Full compiled code is embedded directly in the parent. |
library_ref | Generates a library reference; library must be deployed separately. |
Set a per-contract BoC output path
Acton.toml
Precompiled BoC contracts
Pointsrc at a .boc file to use a precompiled contract. Provide a types interface file to enable ABI extraction and wrapper generation:
Acton.toml
Import mappings
Acton uses[import-mappings] for path aliases:
Acton.toml
| Mapping | Standard layout | App layout (--app) |
|---|---|---|
@acton | .acton/ | .acton/ |
@contracts | contracts/ | contracts/src/ |
@tests | tests/ | contracts/tests/ |
@wrappers | wrappers/ | contracts/wrappers/ |
@gen | gen/ | gen/ |