Skip to main content

Overview

FunC is minimalist, domain-specific, functional-style language designed for writing low-level TON smart contracts, tightly bound to the TVM model.

Here is a simple example of a method for sending money written in FunC:

() send_money(slice address, int amount) impure inline {
var msg = begin_cell()
.store_uint(0x10, 6) ;; nobounce
.store_slice(address)
.store_coins(amount)
.end_cell();

send_raw_message(msg, 64);
}

The compiler converts FunC programs into Fift assembler code, generating the corresponding bytecode for the TON Virtual Machine.

Developers and engineers can use its bytecode, which is structured as a tree of cells like all data in the TON Blockchain, to create smart contracts or run it on a local instance of the TVM.

FunC cookbook

FunC documentation

Compiler

Blueprint

Using the Blueprint framework is the most convenient and quickest way to begin developing and compiling smart contracts. Read more in the Blueprint section.

GitHub

FunC binaries can be downloaded from the GitHub repository or compiled manually from sources.

Tutorials

starter tip

The best place to start developing on TON is the Quick start section.

The TON Blockchain course includes Module 4, which covers FunC and smart contract development.

Below, you can find additional materials shared by community experts:

Smart contract examples

Follow this link to find various standard smart contracts, such as wallets, electors that manage validation on TON, multi-signature wallets, etc. These can serve as helpful learning references.

Changelog

Blockchain changelog

Was this article useful?