Importing code
Tact allows you to import Tact and FunC code — any given .tact
or .fc
/.func
file can be imported into your project using the import
keyword.
Additionally, Tact compiler has a versatile set of standard libraries, which come bundled in, but not included right away, see Standard libraries overview.
Import Tact code
It’s possible to import any Tact code using the import
statement and providing a relative path to the target .tact
file like so:
Specifying parent directories (../
) is also possible:
Import FunC code
It’s possible to import code written in FunC code directly just as it’s done with Tact code imports:
But in order to use functions from such file, one has to declare them as native
functions first. For example, when standard library @stdlib/dns
uses a dns.fc
FunC file, it maps FunC functions to Tact ones like so: