Skip to main content
Tolk is a statically typed language designed for TON smart contracts. It provides declarative structures, automatic cell serialization, first-class message handling, and a modern development experience. The language compiles to TVM (TON virtual machine) with zero overhead and full control over execution.
type AllowedMessage = CounterIncrement | CounterReset

fun onInternalMessage(in: InMessage) {
    val msg = lazy AllowedMessage.fromSlice(in.body);
    match (msg) {
        CounterIncrement => { ... }
        CounterReset => { ... }
    }
}

get fun currentCounter() {
    val storage = lazy Storage.load();
    return storage.counter;
}

Key features

Tolk offers high-level readability while remaining low-level in nature:
  • a robust type system to express any cell layout in TON
  • lazy loading: unused fields are skipped automatically
  • unified message composition and deployment
  • a gas-efficient compiler targeting the Fift assembler
  • friendly tooling and IDE integration
Tolk is fully compatible with existing TON standards and contracts.

Tolk is a replacement for FunC

Tolk started as an evolution of FunC and is now the recommended language for TON smart contracts. If you are migrating from FunC:

Quick start

  1. Run the command:
    npm create ton@latest
    
  2. Enter a project name and choose “simple counter contract”.
  3. Follow the “Your first smart contract” article to get explanations.

IDE support

All major IDEs support syntax highlighting and code completion:
  1. JetBrains IDEs (WebStorm, CLion, etc.) — via the plugin
    => search for “TON” in Marketplace and install
  2. VS Code — via the TON extension
    => search for “TON” in Marketplace and install
  3. Cursor, Windsurf, and other editors — via the language server
    => install from the .vsix file or a command palette

Where to go next

Recommended starting points:

External resources

Useful links outside this documentation: