tact-lang / tact-docs

Tact main documentation
https://docs.tact-lang.org
57 stars 39 forks source link

Document how to work with gas in Tact contracts #334

Open anton-trunov opened 4 months ago

anton-trunov commented 4 months ago

This is a highly non-trivial topic for TON blockchain

novusnota commented 4 months ago

By gas you mean specifically computation fees, like in TON Docs here and there?

One thing we may try to do, is calculate how much gas each function in standard library costs (except for purely compile-time ones) and outline it right in their descriptions. Maybe we could do the same with the statements as well, although it might back us into a corner with the inability to temporarily increase gas usage of some of them in Tact 2.0, hmm

anton-trunov commented 4 months ago

By gas you mean specifically computation fees

We need to have an example-based explanation how to design your gas strategy. Of course, we cannot have a universally applicable comprehensive explanation in the docs, but one or two concrete examples should convey the idea. For instance, how to avoid contract balance drainage, how to account for storage fees and so on.