compile_tolk
Compile Tolk smart contract source code to Fift and BoC format. Provide source files as a filename-content map with an entrypoint; standard library imports resolved automatically.
Instructions
Compiles Tolk smart contract source code using @ton/tolk-js. Provide source files as a map of filename->content. The entrypoint file must be included. Standard library imports (@stdlib/, @fiftlib/) are resolved automatically. Supports pathMappings for custom @alias import resolution. Returns compiled Fift code, BoC (Bag of Cells) in base64, code hash, and compiler version.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entrypointFileName | Yes | The main .tolk file to compile (e.g., "main.tolk") | |
| sources | Yes | Object mapping filename -> source code content. Must include the entrypoint file. Example: {"main.tolk": "fun main(): int { return 0; }"} | |
| optimizationLevel | No | Optimization level 0-2 (default: 2) | |
| withStackComments | No | Include stack layout comments in Fift output | |
| pathMappings | No | Maps @alias prefixes to absolute folder paths for import resolution. Example: {"@mylib": "/path/to/mylib"} |