The new Tact release v1.5.0 just landed on NPM! Here are the highlights of the most important features.
🛠 New Tact features
asm functions allow you to access the deep dark corners of TVM for more features or better performance:
asm fun keccak256(s: Slice): Int {
1 INT HASHEXT_KECCAK256
}
asm functions have some limitations at this point and the Tact team will make them even more powerful in the next releases.- A wider range of serialization options for integers can now be used, not just 8, 16, 32, 64, 128 and 256-bit integers, but anything in between:
uint1 through uint256 and int1 through int257. For instance, a 48-bit timestamp can be defined now if you'd like to build contracts that can work after the year 2038:
contract Contract {
timestamp: Int as uint48
}
- Constant definitions now support calls to user-defined functions and references to other constants:
const CONSTANT: Int =
myFunction(OTHER_CONSTANT)
👩💻 New builtin and stdlib functions and methods
- The exists method for the
Map type: m.exists(key) which is equivalent to m.get(key) != null.- The
deepEquals method for the Map type: m1.deepEquals(m2) -- you can now easily compare two maps with the same key-value pairs and get true as the result, even if their internal representations are different, so the hash-based == comparison would return false.- The
toSlice method for structs and messages: struct.toSlice().- The new
slice, rawSlice, ascii and crc32 built-in compile-time functions to help you define constant integers and slices more conveniently.- The new stdlib functions to help with fee calculations:
gasConsumed, getComputeFee, getStorageFee, getForwardFee, getSimpleComputeFee, getSimpleForwardFee, getOriginalFwdFee, myStorageDue. This brings you access to the TVM instructions from 2023.07 and 2024.04 upgrades.- The
parseStdAddress and parseVarAddress stdlib functions allow you to parse slices into structured addresses.🐞 The new release also includes a bunch of bugfixes. Thanks to all the Tacticians for all the issues you open!
📜 Full changelog for Tact v1.5.0: https://github.com/tact-lang/tact/blob/main/CHANGELOG.md#150---2024-09-15