# FunC-to-Tolk converter (https://docs-fpm2731fy-ton-core-docs.vercel.app/llms/tolk/from-func/converter/content.md)



[Acton](https://github.com/ton-blockchain/acton) provides a built-in command for converting FunC sources to Tolk:

```bash
acton func2tolk <PATH>
```

This is a syntax-level converter that assists in migrating contracts to Tolk. It rewrites FunC code with one-to-one semantics and emits a Tolk version of the contract that remains close to the FunC original.

Example input: [jetton-minter.fc](https://github.com/ton-blockchain/convert-func-to-tolk/blob/master/tests/inout/jetton-minter.fc).<br />
Example output: [jetton-minter.tolk](https://github.com/ton-blockchain/convert-func-to-tolk/blob/master/tests/inout/jetton-minter.fc.tolk).

The converted contract does not use modern Tolk features such as structures, auto-serialization, or clean message composition. After some manual fixes, it compiles, runs, and passes tests.

If a contract does not compile after conversion, refer to the [GitHub repository](https://github.com/ton-blockchain/convert-func-to-tolk). It contains common issues and provides ways to fix them.

<Callout type="note">
  For older projects not using Acton, the [standalone converter](https://github.com/ton-blockchain/convert-func-to-tolk) is also available:

  ```bash
  npx @ton/convert-func-to-tolk contracts
  ```
</Callout>

## Refactoring [#refactoring]

* Use the modern [`onInternalMessage`](/llms/languages/tolk/features/message-handling/content.md).
* Extract a [`Storage` struct](/llms/languages/tolk/features/contract-storage/content.md) with `toCell` and `fromCell`.
* Refactor incoming messages into [structs](/llms/languages/tolk/syntax/structures-fields/content.md) with 32-bit opcodes – incrementally, one message at a time.
* Define a union of possible messages and match it using [`lazy`](/llms/languages/tolk/features/lazy-loading/content.md).
* Extract outgoing messages into structs and [send](/llms/languages/tolk/features/message-sending/content.md) them.

<Callout type="tip" title="&#x22;Maintain tests at every stage&#x22;">
  Keeping tests passing throughout the refactoring process ensures safe, incremental modernization without breaking functionality.
</Callout>

## Examples [#examples]

The [Tolk contract examples](/llms/languages/tolk/examples/content.md) page features some contracts from the [Tolk vs. FunC benchmarks](https://github.com/ton-blockchain/tolk-bench) repository, all converted step by step using the migration tool. Check the Git history for each migration.
