diff --git a/dev-docs/CHANGELOG.md b/dev-docs/CHANGELOG.md index b254589db..e58285445 100644 --- a/dev-docs/CHANGELOG.md +++ b/dev-docs/CHANGELOG.md @@ -112,6 +112,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Improved Chinese localization of the documentation: PR [#1642](https://github.com/tact-lang/tact/pull/1642) - Removed the notion of the non-standard TL-B syntax `remainder`: PR [#1599](https://github.com/tact-lang/tact/pull/1599) - Added description of `.boc`, `.ts`, `.abi`, `.pkg` files and completed Compilation page: PR [#1676](https://github.com/tact-lang/tact/pull/1676) +- Marked gas-expensive functions and expressions: PR [#1703](https://github.com/tact-lang/tact/pull/1703) ### Release contributors diff --git a/docs/src/content/docs/book/expressions.mdx b/docs/src/content/docs/book/expressions.mdx index 8048c85a5..808b13cc7 100644 --- a/docs/src/content/docs/book/expressions.mdx +++ b/docs/src/content/docs/book/expressions.mdx @@ -3,6 +3,8 @@ title: Expressions description: "This page lists all the expressions in Tact" --- +import { Badge } from '@astrojs/starlight/components'; + Every operator in Tact forms an expression, but there's much more to uncover as Tact offers a wide range of expressive options to choose from. :::note @@ -252,6 +254,8 @@ contract ExampleContract { ## `initOf` +

+ Expression `initOf{:tact}` computes initial state, i.e. `StateInit{:tact}` of a [contract](/book/contracts): ```tact diff --git a/docs/src/content/docs/book/maps.mdx b/docs/src/content/docs/book/maps.mdx index ea9565b71..c47d52471 100644 --- a/docs/src/content/docs/book/maps.mdx +++ b/docs/src/content/docs/book/maps.mdx @@ -359,6 +359,7 @@ if (fizz == null) { ### Compare with `.deepEquals()` {#deepequals} +

```tact diff --git a/docs/src/content/docs/ref/core-advanced.mdx b/docs/src/content/docs/ref/core-advanced.mdx index 412367e38..39df2de14 100644 --- a/docs/src/content/docs/ref/core-advanced.mdx +++ b/docs/src/content/docs/ref/core-advanced.mdx @@ -444,6 +444,7 @@ Attempts to queue more than $255$ messages throw an exception with an [exit code ## nativeSendMessageReturnForwardFee +

```tact diff --git a/docs/src/content/docs/ref/core-cells.mdx b/docs/src/content/docs/ref/core-cells.mdx index b22b50613..a0e9f11c4 100644 --- a/docs/src/content/docs/ref/core-cells.mdx +++ b/docs/src/content/docs/ref/core-cells.mdx @@ -35,6 +35,8 @@ let fizz: Builder = beginCell(); ## emptyCell +

+ ```tact fun emptyCell(): Cell; ``` @@ -52,6 +54,8 @@ fizz == buzz; // true ## emptySlice +

+ ```tact fun emptySlice(): Slice; ``` @@ -128,6 +132,8 @@ A section to group all extension and extension mutation functions for the [`Buil ### Builder.endCell +

+ ```tact extends fun endCell(self: Builder): Cell; ``` @@ -1035,6 +1041,8 @@ try { ### Slice.hash +

+ ```tact extends fun hash(self: Slice): Int; ``` @@ -1052,6 +1060,8 @@ let fizz: Int = s.hash(); ### Slice.asCell +

+ ```tact extends fun asCell(self: Slice): Cell; ``` diff --git a/docs/src/content/docs/ref/core-common.mdx b/docs/src/content/docs/ref/core-common.mdx index e93ee2955..021c68478 100644 --- a/docs/src/content/docs/ref/core-common.mdx +++ b/docs/src/content/docs/ref/core-common.mdx @@ -3,6 +3,8 @@ title: Common description: "Commonly used global static functions from the Core library of Tact" --- +import { Badge } from '@astrojs/starlight/components'; + List of the most commonly used built-in [global static functions](/book/functions#global-static-functions). ## Contextual @@ -117,6 +119,8 @@ require(ctx.value != 68 + 1, "Invalid amount of nanoToncoins, bye!"); ### newAddress +

+ ```tact fun newAddress(chain: Int, hash: Int): Address; ``` @@ -152,6 +156,8 @@ let oldTonFoundationAddr: Address = ### contractAddress +

+ ```tact fun contractAddress(s: StateInit): Address; ``` @@ -166,6 +172,8 @@ let foundMeSome: Address = contractAddress(initOf SomeContract()); ### contractAddressExt +

+ ```tact fun contractAddressExt(chain: Int, code: Cell, data: Cell): Address; ``` @@ -196,6 +204,8 @@ let hereBeDragons: Address = contractAddressExt(0, initPkg.code, initPkg.data); ### send +

+ ```tact fun send(params: SendParameters); ``` @@ -224,6 +234,8 @@ send(SendParameters{ ### emit +

+ ```tact fun emit(body: Cell); ``` diff --git a/docs/src/content/docs/ref/core-debug.mdx b/docs/src/content/docs/ref/core-debug.mdx index 3b05cb81a..5bdb9dfc7 100644 --- a/docs/src/content/docs/ref/core-debug.mdx +++ b/docs/src/content/docs/ref/core-debug.mdx @@ -3,6 +3,8 @@ title: Debug description: "Various debugging functions from the Core library of Tact" --- +import { Badge } from '@astrojs/starlight/components'; + List of functions commonly used for debugging smart contracts in Tact. Read more about debugging on the dedicated page: [Debugging](/book/debug). @@ -40,6 +42,8 @@ try { ## dump +

+ ```tact fun dump(arg); ``` @@ -102,6 +106,8 @@ dump(emit("msg".asComment())); // As emit() function doesn't return a value, dum ## dumpStack +

+ ```tact fun dumpStack(); ``` diff --git a/docs/src/content/docs/ref/core-math.mdx b/docs/src/content/docs/ref/core-math.mdx index e4ccb1f81..9eb3b10a9 100644 --- a/docs/src/content/docs/ref/core-math.mdx +++ b/docs/src/content/docs/ref/core-math.mdx @@ -3,6 +3,8 @@ title: Math description: "Various math helper functions from the Core library of Tact" --- +import { Badge } from '@astrojs/starlight/components'; + Various math helper functions. ## min @@ -191,6 +193,8 @@ contract Example { ## checkSignature +

+ ```tact fun checkSignature(hash: Int, signature: Slice, public_key: Int): Bool; ``` @@ -232,6 +236,8 @@ contract Showcase { ## checkDataSignature +

+ ```tact fun checkDataSignature(data: Slice, signature: Slice, public_key: Int): Bool; ``` diff --git a/docs/src/content/docs/ref/core-strings.mdx b/docs/src/content/docs/ref/core-strings.mdx index 3e836cbee..b256b16ff 100644 --- a/docs/src/content/docs/ref/core-strings.mdx +++ b/docs/src/content/docs/ref/core-strings.mdx @@ -3,6 +3,8 @@ title: Strings and StringBuilders description: "Various String and StringBuilder functions from the Core library of Tact" --- +import { Badge } from '@astrojs/starlight/components'; + Strings are immutable sequences of characters, which means that once a [`String{:tact}`][p] is created, it cannot be changed. Strings are useful to store text, and so they can be converted to [`Cell{:tact}`][cell] type to be used as message bodies. To be able to concatenate strings in a gas-efficient way, use a [`StringBuilder{:tact}`][p]. @@ -105,6 +107,8 @@ let fizz: StringBuilder = beginString() ## StringBuilder.toString +

+ ```tact extends fun toString(self: StringBuilder): String; ``` @@ -122,6 +126,8 @@ let buzz: String = fizz.toString(); ## StringBuilder.toCell +

+ ```tact extends fun toCell(self: StringBuilder): Cell; ``` @@ -139,6 +145,8 @@ let buzz: Cell = fizz.toCell(); ## StringBuilder.toSlice +

+ ```tact extends fun toSlice(self: StringBuilder): Slice; ``` @@ -187,6 +195,8 @@ fizz == buzz; // true, but be careful as it's not always the case ## String.asComment +

+ ```tact extends fun asComment(self: String): Cell; ``` @@ -277,6 +287,8 @@ let fizz: Slice = s.fromBase64(); ## Int.toString +

+ ```tact extends fun toString(self: Int): String; ``` @@ -293,6 +305,8 @@ let fizz: String = (84 - 42).toString(); ## Int.toFloatString +

+ ```tact extends fun toFloatString(self: Int, digits: Int): String; ``` @@ -311,6 +325,8 @@ let fizz: String = (42).toFloatString(9); // "0.000000042" ## Int.toCoinsString +

+ ```tact extends fun toCoinsString(self: Int): String; ``` @@ -333,6 +349,8 @@ fizz == buzz; // true, both store "0.000000042" ## Address.toString +

+ ```tact extends fun toString(self: Address): String; ```