TON Blockchain uses Tolk as the official language. Other languages are still available, and legacy codebases exist, but Tolk is the only actively supported language. The FunC compiler, for instance, is no longer maintained.
()is the return type, that stands for “do not return value”, similar tovoidin C;send_moneyis the name of the function;slice addressis the first parameter, address to send money to; it’s type isslice;int amountis the second parameter, amount to be sent; it’s type isint;impure inlineare specifiers, which are flags that tell the compiler to process the method in a specific way;var msg = ...defines a variable without specifying its type; it will hold a cell with a message;begin_cell()creates a cell builder;store_uint,store_slice,store_coinsmethods store data into the builder:- flags;
- receiving address;
- amount on Toncoin to attach to the message.
.end_cell()method finalizes the builder and turns it into a cell;send_raw_messagefunction sends the message, where the parameter64describes a sending mode.
Compiler
The compiler converts FunC programs into Fift assembly code. The Fift assembly code is then compiled down to the TON Virtual Machine bitcode by the Fift compiler. Developers can use the compiled bitcode, structured as a bag of cells like all data in the TON blockchain, to test smart contracts, send messages, or execute it in a local TVM instance.End-to-end tooling
The easiest way to install the FunC compiler is the@ton-community/func-js NPM package. It requires Node.js v22 or later.
The package has both the FunC and Fift compilers, and produces bitcode directly from the FunC source code, without manually invoking Fift.
To install it, run the following command in the project root folder:
contract.fc is the FunC source file in the project root, and output.boc is the compiled bitcode output.
FunC standard library is supplied separately from the language. Download smartcont_lib.zip from the latest release, extract it, and copy stdlib.fc to the project root.
Alternatively, use the Blueprint to start a project pre-configured for development in FunC.
Compile manually using the binaries
Prebuilt FunC compiler binaries for Windows, macOS (Intel or ARM64), and Ubuntu are available on the GitHub.-
Download the corresponding binary for operating system:
- Linux:
func-linux-x86_64(Intel/AMD) andfunc-linux-arm64(ARM64) - Mac:
func-mac-x86-64(Intel/AMD) andfunc-mac-arm64(ARM64) - Windows:
func.exe
func, for easier use on the command line, and add it to system’sPATH. - Linux:
-
Download the FunC standard library.
Get the
smartcont_lib.zipfrom the same GitHub, extract it, and copystdlib.fcto project root. - Compile a FunC file to Fift assembly code. Run the following command in the project root:
contract.fc is the FunC file to compile, and output.fif is the generated Fift output.
To compile the generated Fift file output.fif further down to TVM bitcode, use the Fift compiler. See the Fift for download and usage instructions.
The last FunC compiler version is v2025.07. The FunC compiler is no longer developed. New releases are focused on the Tolk compiler.
Tutorials
The tutorials in this section are provided by external contributors and may not reflect FunC’s current development status. They are offered as additional resources for exploring FunC’s applications.
- Challenge 1: Simple NFT deploy
- Challenge 2: Chatbot contract
- Challenge 3: Jetton vending machine
- Challenge 4: Lottery/raffle
- Challenge 5: Create UI to interact with the contract in 5 minutes
- Challenge 6: Analyzing NFT sales on the Getgems marketplace
- TON hello world Part 2: guide for writing your first smart contract
- TON hello world Part 4: guide for testing your first smart contract
- 10 lessons for developing contracts in FunC — Russian version
- FunC quiz — a short Telegram quiz focused on FunC, with a few general TON questions.