Book
Configuration

Configuration

The behavior of Tact compiler can be customized using its configuration file, tact.config.json — a JSON file that contains the list of settings according to the specific schema.

This page lists all of the configuration options as they're structured in the schema. Look for table of contents on the right to easily navigate them.

💡

The only requirement for that file is to be a valid JSON with proper fields, so it can be named arbitrarily. However, naming your config file as tact.config.json is a common convention encouraged and supported by all tools working with Tact.

$schema

A JSON schema (opens in a new tab) file is available for editors to provide autocompletion and hover hints: configSchema.json (opens in a new tab).

Simply add the $schema field on top your configuration file:

tact.config.json
{
  "$schema": "http://raw.githubusercontent.com/tact-lang/tact/main/schemas/configSchema.json",
  "projects": []
}

projects

List of Tact projects with respective compilation options. Each .tact file represents its own Tact project.

tact.config.json
{
  "projects": [
    { },
    { }
  ]
}

name

Name of the project. All generated files are prefixed with it.

In Blueprint (opens in a new tab), name refers to the name of the contract itself.

tact.config.json
{
  "projects": [
    {
      "name": "some_prefix"
    },
    {
      "name": "ContractUnderBlueprint"
    }
  ]
}

path

Path to the project's Tact file. You can only specify one Tact file per project.

In Blueprint (opens in a new tab), path is superseded by the target field in wrappers/ContractName.compile.ts.

tact.config.json
{
  "projects": [
    {
      "name": "some_prefix",
      "path": "./contract.tact"
    }
  ]
}

output

Path to the directory where all generated files will be placed.

In Blueprint (opens in a new tab), output is not used and all generated files are always placed in build/ProjectName/.

tact.config.json
{
  "projects": [
    {
      "name": "some_prefix",
      "path": "./contract.tact",
      "output": "./contract_output"
    }
  ]
}

options

Compilation options for the project.

In Blueprint (opens in a new tab), they act as default unless modified in wrappers/ContractName.compile.ts.

tact.config.json
{
  "projects": [
    {
      "name": "some_prefix",
      "path": "./contract.tact",
      "output": "./contract_output",
      "options": {}
    },
    {
      "name": "ContractUnderBlueprint",
      "options": {}
    }
  ]
}

debug

false by default.

If set to true, enables debug output of a contract and allows usage of dump() function, which is useful for debugging purposes. With this option enabled, the contract will report that it was compiled in debug mode using the supported_interfaces method.

tact.config.json
{
  "projects": [
    {
      "name": "some_prefix",
      "path": "./contract.tact",
      "output": "./contract_output",
      "options": {
        "debug": true
      }
    },
    {
      "name": "ContractUnderBlueprint",
      "options": {
        "debug": true
      }
    }
  ]
}
💡

Read more on the dedicated page: Debugging.

masterchain

false by default.

If set to true, enables masterchain support.

tact.config.json
{
  "projects": [
    {
      "name": "some_prefix",
      "path": "./contract.tact",
      "output": "./contract_output",
      "options": {
        "masterchain": true
      }
    },
    {
      "name": "ContractUnderBlueprint",
      "options": {
        "masterchain": true
      }
    }
  ]
}
💡

Read more on the dedicated page: Masterchain.

external

false by default.

If set to true, enables support of external message receivers.

tact.config.json
{
  "projects": [
    {
      "name": "some_prefix",
      "path": "./contract.tact",
      "output": "./contract_output",
      "options": {
        "external": true
      }
    },
    {
      "name": "ContractUnderBlueprint",
      "options": {
        "external": true
      }
    }
  ]
}
💡

Read more on the dedicated page: External messages.

ipfsAbiGetter

false by default.

If set to true, enables generation of a getter with IPFS links describing the contract's ABI.

tact.config.json
{
  "projects": [
    {
      "name": "some_prefix",
      "path": "./contract.tact",
      "output": "./contract_output",
      "options": {
        "ipfsAbiGetter": true
      }
    },
    {
      "name": "ContractUnderBlueprint",
      "options": {
        "ipfsAbiGetter": true
      }
    }
  ]
}
💡

Read more on the dedicated page: OTP-003: Self-ABI reporting.

interfacesGetter

false by default.

If set to true, enables generation of a getter with a list of interfaces provided by the contract.

tact.config.json
{
  "projects": [
    {
      "name": "some_prefix",
      "path": "./contract.tact",
      "output": "./contract_output",
      "options": {
        "interfacesGetter": true
      }
    },
    {
      "name": "ContractUnderBlueprint",
      "options": {
        "interfacesGetter": true
      }
    }
  ]
}
💡

experimental

Experimental options that might be removed in the future. Use with caution!

tact.config.json
{
  "projects": [
    {
      "name": "some_prefix",
      "path": "./contract.tact",
      "output": "./contract_output",
      "options": {
        "experimental": {}
      }
    },
    {
      "name": "ContractUnderBlueprint",
      "options": {
        "experimental": {}
      }
    }
  ]
}
inline

false by default.

If set to true, enables inlining of all functions in contracts. This can reduce gas usage at the cost of bigger contracts.

tact.config.json
{
  "projects": [
    {
      "name": "some_prefix",
      "path": "./contract.tact",
      "output": "./contract_output",
      "options": {
        "experimental": {
          "inline": true
        }
      }
    },
    {
      "name": "ContractUnderBlueprint",
      "options": {
        "experimental": {
          "inline": true
        }
      }
    }
  ]
}

mode

Compilation mode of the project. Valid values are:

ValueDescription
"full"(default) Runs the whole compilation pipeline and emits FunC code, BoC, and various utility files, including wrappers for TypeScript.
"fullWithDecompilation"Runs the whole compilation pipeline like "full", and also decompiles produced binary code in the BoC format.
"funcOnly"Only outputs intermediate FunC code, preventing further compilation.
"checkOnly"Only performs syntax and type checking, preventing further compilation.

In Blueprint (opens in a new tab), mode is always set to "full" and cannot be overwritten.

tact.config.json
{
  "projects": [
    {
      "name": "some_prefix",
      "path": "./contract.tact",
      "output": "./contract_output",
      "mode": "full"
    },
    {
      "name": "func_only",
      "path": "./contract.tact",
      "output": "./contract_output",
      "mode": "funcOnly"
    }
  ]
}

Full example

tact.config.json
{
  "$schema": "http://raw.githubusercontent.com/tact-lang/tact/main/schemas/configSchema.json",
  "projects": [
    {
      "name": "basic",
      "path": "./basic.tact",
      "output": "./basic_output",
      "mode": "full"
    },
    {
      "name": "func_only",
      "path": "./basic.tact",
      "output": "./basic_output",
      "mode": "funcOnly"
    },
    {
      "name": "debugPrefix",
      "path": "./contracts/contract.tact",
      "output": "./contracts/output",
      "options": {
        "debug": true
      }
    },
    {
      "name": "ContractUnderBlueprint",
      "options": {
        "debug": false,
        "masterchain": false,
        "external": false,
        "ipfsAbiGetter": true,
        "interfacesGetter": true,
        "experimental": {
          "inline": false
        }
      }
    }
  ]
}