Compile-time
This page lists all the built-in global static functions, which are evaluated at the time of building the Tact project and cannot work with non-constant, run-time data. These functions are commonly referred to as “compile-time functions”.
address
A compile-time function that converts a String
with an address into the Address
type and embeds it into the contract.
Usage example:
cell
A compile-time function that embeds a base64-encoded BoC bocBase64
as a Cell
into the contract.
Usage examples:
slice
Available since Tact 1.5A compile-time function that embeds a base64-encoded BoC bocBase64
as a Slice
into the contract.
Usage examples:
rawSlice
Available since Tact 1.5A compile-time function that converts hex
String
with hex-encoded and optionally bit-padded contents as a Slice
into the contract.
Contents are bit-padded if there’s an underscore _
at the very end of String
. The padding removes all the trailing zeros and the last bit before them:
Note, that this function is limited and only allows to specify up to bits.
Usage example:
ascii
Available since Tact 1.5A compile-time function that concatenates the hexadecimal values of the characters in str
into one and embeds the resulting Int
into the contract. Only works for strings that occupy up to bytes, which allows to represent up to ASCII codes or up to -byte Unicode code points.
Usage example:
crc32
Available since Tact 1.5A compile-time function that computes a checksum using CRC-32 algorithm and embeds the resulting Int
value into the contract.
Usage example:
ton
A compile-time function that converts the given Toncoins value
from a human-readable format String
to the nanoToncoin Int
format.
Usage example: