Skip to main content
Tolk has the following types:
  • numbersint, int32, uint64, coins, and others.
  • booleantrue and false.
  • addressinternal, external, and none.
  • cells — containers with up to 1023 bits of data and up to 4 references to other cells, plus the cell manipulation primitives of TVM: builders and slices.
  • structures — multiple fields grouped into one entity.
  • generics — any struct can be generic <T>.
  • enums — distinct types containing integer variants.
  • nullable typesnull safety and safe casts.
  • union types — variables holding one of several possible values.
  • tensors — multiple values placed sequentially on the stack.
  • tuples — multiple values stored in a single TVM tuple.
  • maps — key-value dictionaries.
  • callables — first-class functions.
  • void and never — both represent the absence of a value.
To make an interchangeable alias for an existing type, including structural types, there are type aliases. Smart contracts run on a stack-based virtual machine, TVM, which imposes specific rules on how values are represented at runtime. For example, there is no distinct type for strings — they are not native to TVM and thus are emulated using slices. All on-chain data and communication rely entirely on cells, so the type system focuses on binary serialization and clear data relationships: