Tact v1.6.7 is released! We've been listening to your feedback and… — Tact Kitchen — TG.ME

🎉 Tact v1.6.7 is released!

We've been listening to your feedback and analyzing the code written throughout the Tact Smart Battle. The battle was heated, with talented developers pushing Tact to its limits and helping us uncover valuable insights to improve the language, introduce new optimizations, and squish some bugs.

❤️ Thank you for participating! The $20,000 prize pool in Toncoin has been distributed to the top 128 competitors based on the final standings. The promised Soulbound Tokens (SBTs) for participants with valid solutions will be delivered in due time, along with TON Studio interview invitations for top performers.

Now, let's explore what Tact v1.6.7 brings to the table:

🧰 Standard library additions and syntax changes

• Added the static extension function Message.opcode() — it returns the opcode of any specified message by its identifier. Note that this function works at compile-time and does not spend any gas, which makes it functionally equivalent to having a special const to store the opcode.

// Instead of this:
const SOME_OPCODE = 0xD_BA1;
message(SOME_OPCODE) TokenNumber9 {}

// You can now do this:
message(0xD_BA1) TokenNumber9 {}
fun showcase() {
TokenNumber9.opcode(); // 0xD_BA1
}


• Introduced the built-in inMsg() function as an optimized version of Message.toSlice(), which returns the original, raw body of the received message. Using inMsg() saves a lot of gas — try it out in your projects!

• Added support for map literals — expressions that provide a concise and gas-effective way to create maps with multiple entries at compile-time. If you know the key-value pairs in advance, map literals provide a significant gas usage drop compared to the series of .set() assignments.

// Declaring a map as a local variable via a map literal expression
let myMap: map<Int, Int as uint16> = map<Int, Int as uint16> {
// Key: Value
1: 100, // key 1, value 100
2: 200, // key 2, value 200
};


• Finally, init() function now can have parameters with as serialization annotations, which correspond to same annotations one can provide for contract parameters.

🛠 Bug fixes

• Error messages for bounced receivers got fixed
• Getter functions without parameters are now correctly handled
• Trailing comments after the last structure field are now correctly formatted

🧳 Miscellaneous improvements

• Formatter, tact-fmt, now supports formatting several files and directories
• Formatter now automatically applies field punning, i.e., shortens Foo { value: value } to just Foo { value }
• Reduced gas consumption of the following functions: cashback(), self.reply(), self.notify(), self.forward()
• Optimized (de)serialization code of various field types
• Optimized code generation for if...else statements

📜 See the full release notes for Tact v1.6.7
📥 And upgrade Tact in your projects

Good news, everyone! The new official Tact plugin for IntelliJ IDEA and related IDEs will have a proper public release quite soon.

Granted, it is in its very early and very alpha days. But if you're feeling adventurous, you can try installing its initial development version from this GitHub release.

🍲 another ONE bites the LAST
♨️ @tact_kitchen from the @ton_studio
⚡11
May 7, 2025 538 3