Tact Kitchen – Telegram
Tact Kitchen
590 subscribers
36 photos
4 videos
60 links
🧑‍🍳 Peek behind the scenes and into the steaming pot of hot updates to Tact compiler, tooling, documentation and ecosystem

⚡️ You know what's cooking — Tact!
⌨️ Sources: github.com/tact-lang
👉 t.me/boost/tact_kitchen

Brought to you by the Tact team
Download Telegram
Forwarded from TON Dev News
🎉 Tact v1.5.0 has just been released

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
14
🎉 Misti 0.3 has just landed on NPM!

⚡️Tact 1.5 Support

🔍 Five New Tact Detectors: String Receivers Overlap, Asm Is Used, Preferred Stdlib API, Inherited State Mutation, Argument Copy Mutation.

🔧 Fixes & Enhancements: More configuration options, optimization and API improvements. Check out the full changelog.

♨️ @tact_kitchen
8
🎉 Tact 1.5.2 has just landed on NPM!

Remember, that we've introduced asm functions in version 1.5.0 for you to write TVM assembly right in your Tact code?


asm fun keccak256(s: Slice): Int {
1 INT HASHEXT_KECCAK256
}


🐞 With this bugfix release, you now can use full* range of its syntax just like you could in similar asm functions of FunC. Just don't do anything too crazy, like trying to shadow (re-define) { or }, or using char } inside your newly defined instructions.

Other than that, have it your way. Note, that support of full Fift+TVM syntax is highly experimental, and will be reworked in future releases, in particular the following works now, but most likely won’t work at some point:

fun onchainSha256(data: String): Int {
_onchainShaPush(data);
while (_onchainShaShouldProceed()) {
_onchainShaOperate();
}
return _onchainShaHashExt();
}

// Helper assembly functions,
// each manipulating the stack in their own ways
// in different parts of the `onchainSha256()` function
asm fun _onchainShaPush(data: String) { ONE }
asm fun _onchainShaShouldProceed(): Bool {
OVER SREFS 0 NEQINT
}
asm fun _onchainShaOperate() {
OVER LDREF s0 POP CTOS s0 s1 XCHG INC
}
asm fun _onchainShaHashExt(): Int {
HASHEXT_SHA256
}


🐞 Additionally, all new installations of @tact-lang/compiler or @ton/blueprint via npm should work as expected. All other package managers continue to work fine, so create more awesome projects! We'll handle the rest ❤️

👀 And keep an eye on the docs, something big might happen very soon!

🍲 every contract is open source if you can read bytecode
♨️ @tact_kitchen
8
👏 Huge 👏 Revamp 👏 of Tact 👏 Docs 👏

There were a lot of things we just couldn't do nicely with the previous documentation library, Nextra. Granted, it's very good and has a lot going for it, but its rigidity in important places, as well as its overall pull towards Next.js and Vercel make some features like i18n almost impossible to implement while keeping the static build and not doing the server-side rendering.

It is finally time to move to a more flexible solution: Starlight, a documentation library powered by Astro that allows for great extensibility and bundles (among other things): advanced i18n support via i18next, site navigation, search, SEO, easy-to-read typography, code highlighting, dark mode and more. It's also very lightweight and snappy.

This move brought a lot of enhancements, here's a very short list (there's more!):

0️⃣ Translating the docs to another language (i18n) is super easy now. Just take the original English page, translate it, and put the file in the appropriate folder. That's it, the next deployments would feature your translated page as if it was always there

1️⃣ The search via Ctrl + K (fuzzy full-site search) has been greatly improved. In addition, since all the pages are located in the sidebar, you now can use Ctrl + F (content search) to quickly find the page in any of the sections: Book, Cookbook, and Ecosystem!

2️⃣ Fixed issues with highlighting of code blocks in the light mode. The similar change for inline code highlighting will follow in the future too!

3️⃣ tact-docs repo has been merged into the Tact compiler one, which means that all new feature and standard library updates will arrive in docs much faster than before! Besides, you'll see badges like "Since version X.Y.Z" under each new feature, so that you'll know when to expect things and which Tact version to use for them :)

Things that didn't make the list include updates that are mostly relevant to the team and maintainers of the docs. For example:

1. It's much easier to influence the SEO of each page with good denoscriptions and image covers where needed
2. It's super easy to customize the docs with: CSS styles, JS noscripts, Markdown pre-processing plugins, HTML pre-processing and post-processing plugins, ...
3. ...and so on and so forth


🧑‍🍳 Contributor: Novus Nota
🐙 Implementation: #880
✈️ Delivered: docs.tact-lang.org

🍲 sparkle! sunshine!
♨️ @tact_kitchen
11
Forwarded from TON Jobs
TON Studio is hiring!

TON Studio team is seeking for Lead Developer (smart contracts & audits).


You will work with both FunC and Tact smart contracts to develop highly optimized, secure, and efficient DApps, leveraging your understanding of Fift, TVM, and gas optimizations.

You can find more details about the job opening and apply here: https://jobs.ton.org/companies/ton-studio/jobs/41178106-lead-developer-smart-contracts-audits#content

We invite builders to post vacancies in the TON Jobs channel. To do this, you need to write to support @tonjobs_support
8
⚡️ Added destructuring statements

It's a concise way to unpack Structs and Messages into distinct variables, which mirrors the instantiation syntax:

// Definition of Example
struct Example { number: Int }

fun basic() {
// Basic syntax of destructuring assignment
// is shown on the left of "=":
let Example { number } =
Example { number: 42 };

// The syntax above is roughly equivalent
// to the following statements:
let example = Example { number: 42 };
let number = example.number;
}


One can also create bindings under different variable names or ignore some of the fields. Note, that the order doesn't matter:

// "first" goes first, then goes "second"
struct Two { first: Int; second: String }

// a helper function
fun makeTwo(): Two {
return Two {
first: 42,
second: "yee-haw",
};
}

// 👀
fun totalDestruction() {
// The "first" field is ignored,
// while the value of "second"
// is bound under the "cowboy"
// variable from now on:

let Two {
second: cowboy,
first: _,
} = makeTwo();
}


🧑‍🍳 Contributors: Gusarich, Novus Nota (docs)
🐙 Implementation: #856
🍽 To be released in: v1.6.0

🍲 everyone within a 100 mile radius after you eat a taco
♨️ @tact_kitchen
11
This media is not supported in your browser
VIEW IN TELEGRAM
⚡️ Added automatic links to Web IDE from code blocks in Cookbook section of the docs

Did you know, that just like the Remix for Ethereum, TON has an official Web IDE? If not, take a quick look at what it offers:

• Tact and FunC project creation
• Code highlighting and snippets for Tact and FunC
• Semi-automatic Build → Deploy pipeline on every save
• Convenient buttons to call getters and send messages to deployed contracts
• Deploy to Sandbox, testnet and mainnet
• Share button ↗️ on every file in a file tree
• ...plus a lot more!

And now any code samples from the Cookbook are right at your fingertips — just press the "Open in Web IDE" button, and the contents of the code block would automagically transfer to Web IDE!

🧑‍🍳 Contributor: Novus Nota
🐙 Implementation: #994
✈️ Delivered: docs.tact-lang.org/cookbook

🍲 «What's the TTP of Web IDE?»
♨️ @tact_kitchen
11
🎉 Misti 0.5 has just landed on NPM!

🔍 More Tact Detectors: Covered Tact-specific issues like CellOverflow, SuspiciousMessageMode, UnboundMap achieving totally 25 detectors.

⚠️ Warning Suppressions: Suppress specific warnings using // @misti:suppress DetectorName comments.

💡 Usability Enhancements: Install Misti with a single command and run it on the directory containing your contracts—no extra configuration required:
npm install -g @nowarp/misti
misti path/to/src/contracts


🔧 Fixes & Enhancements: More configuration options, optimization and improvements. Check out the full changelog.

♨️ @tact_kitchen
10
Media is too big
VIEW IN TELEGRAM
⚡️ Watch Tact & DevTools talk from 2nd day of TON Gateway
🌀 It's a whirlwind tour of progress made in Tact and ecosystem, plus the plans for the future!

🎞 If loading the video on Telegram is too much, start watching at the timestamp on YouTube
👀 For more, see the full recording of TON Gateway | Day 2

🍲 tactical advantage, strategic dominance
♨️ @tact_kitchen
8
❤️ A warm welcome to listeners of good podcasts @tonpizdev
♨️ @tact_kitchen
8
⚡️ Heads-up: there are more than 2100 Tact source files on GitHub, not counting forks and the tact-lang organization!

It would be nice to get Tact code highlighted there, don't you think? That's why we've made a PR to Linguist, a language detection and highlighting library from Github.

Here's how you can help:
1. Go to the PR
2. Leave your 👍 without writing any comments, to keep PR clean
3. Keep writing nice open source contracts in Tact 🙌
4. Wait for the best 🤞

This is not a drill. I repeat: this is not a drill.
This is the beginning of the story.

UPD:

🍲 our story, actually
♨️ @tact_kitchen
12
⚡️ Added a page on security best practices to the documentation

There are several anti-patterns and potential attack vectors that Tact smart contract developers should be aware of. These can affect the security, efficiency, and correctness of the contracts.

With the help of community contributors, we've discussed the do's and don'ts specific to writing and maintaining secure Tact smart contracts, and written a cohesive page for you!

🧑‍🍳🎉 Community contributors: PixelPlex and Aliaksandr Bahdanau
🐙 Implementation: #1070
✈️ Delivered: docs.tact-lang.org/book/security-best-practices

🍲 where did the bad actor go? they ran somewhere
♨️ @tact_kitchen
15
⚡️ Added DeDust and STON.fi cookbooks to the documentation

Ever wondered how to build your own Decentralized EXchange? Neither have I!

However, documentation on how to interact with existing DEXes from Tact was highly requested — and, with the help of community contributors, we wrote it. Read how to swap Toncoins for Jettons, Jettons for Jettons, and provide liquidity to pools of DeDust and STON.fi, all with ⚡️ Tact.

🧑‍🍳🎉 Community contributors: PixelPlex and Aliaksandr Bahdanau
🐙 Implementations: #954, #956
✈️ Delivered: DeDust, STON.fi

🍲 decentralized surprise liquidity provision
♨️ @tact_kitchen
13
⚡️ Completely overhauled exit codes page in the documentation

Sometimes pages in the Tact documentation are more detailed than you'll find elsewhere. The exit codes page is a case in point.

Not only do you get a comprehensive denoscription of what exit codes are, how they are defined, and which ones are reserved, but you also get a handy table of them with short denoscriptions and quick navigation to each exit code in the table of contents. Since each of the exit codes has its own headings, linking to a specific exit code is easier than ever!

In addition, all denoscriptions of compute phase exit codes show examples of how you might encounter them. And sometimes even help you to anticipate and avoid them.

By the way, for exit code 50 (not listed anywhere else), we've also described the current limits on config param 43 related to account state, max number of bits and cells in messages, and much more.

🧑‍🍳 Contributor: Novus Nota
🐙 Implementation: #978
✈️ Delivered: docs.tact-lang.org/book/exit-codes

🍲 code: dismissed
♨️ @tact_kitchen
18
Tact Kitchen
❤️ Thanks, folks! We really appreciate that! 🍲 melting hearts ♨️ @tact_kitchen
⚡️ GitHub supports Tact!

Now that you've clicked, let me clarify — thanks to our efforts, your support and all of you writing lots of smart contracts, Tact now has syntax highlighting all across GitHub!

— Files with a .tact extension? Boom, colored.
— Blocks of code in markdown that specify tact as their language? Got you covered.

❤️ Thanks everyone for your support and love! Without you, there would be nothing. Literally.

✈️ We're continuing to ship awesome stuff for you — expect many shiny things this December.

🍲 growth is inevitable
♨️ @tact_kitchen
21
Forwarded from TON Dev News
📣 Hey, folks! The Tact dev team kindly asks you to share some feedback regarding your experienced with smart-contract programming in Tact.

Our mission is to develop a high quality programming language that can be used for every single project on TON and make code easy to write, understand and audit.

The survey covers 4 topics and will only take about 5-8 minutes of your time.

Thank you for your contribution!

👉https://paperform.co/edit/h02jnxtq
9
Forwarded from TON Dev News
📖 Secure Smart Contract Programming in Tact: Avoiding Pitfalls in the TON Ecosystem

As The Open Network evolves, its innovative features and the Tact programming language unlock new possibilities for developers. However, common mistakes can lead to vulnerabilities.

CertiK’s latest blog post highlights critical issues like data serialization, concurrency, and gas management, offering actionable insights to optimize security in Tact smart contracts. Whether you’re new to TON or a seasoned developer, these best practices are essential for building robust and secure applications.

🔗 https://www.certik.com/resources/blog/secure-smart-contract-programming-in-tact-popular-mistakes-in-the-ton
Please open Telegram to view this post
VIEW IN TELEGRAM
9
🎉 Misti 0.6 has just landed on NPM!

🔍 More Tact Detectors: CellBounds which covers both CellOverflow and CellUnderflow, ExitCodeUsage, EtaLikeSimplifications and ShortCircuitCondition.

⚙️ More Tools: Added Callgraph that tracks function effects and is useful for auditing contracts.

🌐 Better Integrability: Misti can run in browser environments.

🔧 Fixes & Enhancements: Check out the full changelog.

♨️ @tact_kitchen
12
⚡️ Added an assembly functions page to the documentation

👉 Covering all your needs and going beyond:
▪️ Eh, what are TVM instructions anyways?
▪️ Sure, they're used in asm functions of Tact, but what's the syntax and stuff?
▪️ Stack registers, what's that?
▪️ Fine, but what if I want to re-arrange parameters or return values?
▪️ Limitations? Caveats?
▪️ How would I debug all that?
▪️ Can I apply some attributes?
▪️ Got any examples?

🧑‍🍳 Contributor: Novus Nota
🐙 Implementation: #1061
✈️ Delivered: docs.tact-lang.org/book/assembly-functions

🍲 there are 11 types of programmers: ROT, -ROT and BRAINROT
♨️ @tact_kitchen
9
🎄 Merry Christmas, Folks!

As we wrap up 2024, it's time to celebrate all that we've accomplished together.

🚀 Adoption, Features and Tooling

Your biggest achievement this year was getting GitHub to support Tact on the entire website! We say you, because it wouldn't have been possible without you writing contracts, finding and reporting bugs & suggestions, and supporting Tact elsewhere ❤️

Regarding features and compiler updates, there were so many, that Tact has practically been reborn into a fresh, secure, easy and accessible language language for complex smart contracts, quick onboarding and fast prototyping.

In terms of tools, an awesome static analyzer Misti raised from 0 to hero: with over 25 issue detectors, CI/CD and Blueprint integrations. Additionally, the tree-sitter-tact and many editor packages and highlighting plugins were frequently updated to keep up with compiler updates.

📚 Documentation

Working on the clearest and most comprehensive documentation, we often had to dig deep into TON sources and discover what was really going on under the hood. And it was and is very worth it: the exit codes and assembly functions pages are the most vivid proofs.

We try to cater to both the experienced professionals and beginners on TON Blockchain, which is why you can expect more in-depth research of TVM, more production-ready examples of common contracts in Tact, and an even more streamlined onboarding experience ✈️

🐞 Bugfixes

The release 1.4.1 in particular squashed so many bugs, that the security audit of 1.5.0 went silky smooth — no critical vulnerabilities found, as announced on TON Gateway.

As for the next release, we're fixing the internal representation of Address type, reworking the type system to support more TVM types with the most safety and convenience, and making rapid strides to reduce the gas consumption 🛠

🎁 A Small Holiday Request

Finally, we have a small holiday wish: If you’ve enjoyed our progress this year, consider gifting us a GitHub star. It’s a simple gesture, but one that means the world to us. Your support helps Tact grow and reach even greater heights.

🎅 Happy holidays from the Tact team!
❤️ Take care, get some well-deserved rest and prepare for 2025 — we've got big plans for the next year

🍲 sparkling future ahead
♨️ @tact_kitchen
12