runTolkCompiler
Compile Tolk smart contract source code for the TON blockchain and receive generated Fift assembler code, bytecode BOC, and code hash, or a detailed compilation error.
Instructions
Compiles Tolk source code and returns the compilation result.
On success, returns:
fiftCode: Generated Fift assembler code
codeBoc64: Base64-encoded BOC (Bag of Cells) containing the compiled contract
codeHashHex: Hexadecimal hash of the compiled code
stderr: Any compiler warnings
On error, returns:
status: "error"
message: Description of the compilation error
Use this tool to verify that Tolk code compiles correctly and to obtain the compiled bytecode.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sources | Yes | A map of filename to source code content. Must include the entrypoint file and any imported files. | |
| optimizationLevel | No | Optimization level for the compiler (0-2). Default is 2. Higher levels produce more optimized code. | |
| withStackComments | No | Include stack annotations in the generated Fift output. Default is false. | |
| entrypointFileName | Yes | The name of the main .tolk file to compile | |
| experimentalOptions | No | Experimental compiler flags (space-separated) |