Skip to content

Commit 229ce26

Browse files
authored
feat(docs): describe the limit for deeply nested expressions (#1101)
This addresses issue #7 of Trail of Bits security audit (2024)
1 parent 3ab15e8 commit 229ce26

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525
- Utility for logging errors in code that was supposed to be unreachable: PR [#991](https://github.com/tact-lang/tact/pull/991)
2626
- Docs: `preloadRef` method for the `Slice` type: PR [#1044](https://github.com/tact-lang/tact/pull/1044)
2727
- Docs: added DeDust cookbook: PR [#954](https://github.com/tact-lang/tact/pull/954)
28+
- Docs: described the limit for deeply nested expressions: PR [#1101](https://github.com/tact-lang/tact/pull/1101)
2829

2930
### Changed
3031

docs/src/content/docs/book/expressions.mdx

+19
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@ description: "This page lists all the expressions in Tact"
55

66
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.
77

8+
:::note
9+
10+
The current maximum allowed nesting level of expressions is $83$. An attempt to write a deeper expression will result in a compilation error:
11+
12+
```tact
13+
fun elegantWeaponsForCivilizedAge(): Int {
14+
return
15+
((((((((((((((((((((((((((((((((
16+
((((((((((((((((((((((((((((((((
17+
(((((((((((((((((((( // 84 parens, compilation error!
18+
42
19+
))))))))))))))))))))
20+
))))))))))))))))))))))))))))))))
21+
))))))))))))))))))))))))))))))));
22+
}
23+
```
24+
25+
:::
26+
827
## Literals
928

1029
Literals represent values in Tact. These are fixed values—not variables—that you _literally_ provide in your code. All literals in Tact are expressions themselves.

docs/src/content/docs/book/operators.mdx

+19
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,25 @@ Parentheses (also can be called round brackets, `(){:tact}`) are more of a punct
9898
5 * (5 - 2); // 15
9999
```
100100

101+
:::note
102+
103+
The current maximum allowed nesting level of expressions is $83$. An attempt to write a deeper expression will result in a compilation error:
104+
105+
```tact
106+
fun elegantWeaponsForCivilizedAge(): Int {
107+
return
108+
((((((((((((((((((((((((((((((((
109+
((((((((((((((((((((((((((((((((
110+
(((((((((((((((((((( // 84 parens, compilation error!
111+
42
112+
))))))))))))))))))))
113+
))))))))))))))))))))))))))))))))
114+
))))))))))))))))))))))))))))))));
115+
}
116+
```
117+
118+
:::
119+
101120
## Unary
102121

103122
Unary here means that they are applied only to one operand of the given expression. All unary operators, except for the [non-null assertion](#unary-non-null-assert), are of the same [precedence](#precedence).

docs/src/content/docs/cookbook/dexes/stonfi.mdx

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ sidebar:
55
order: 2
66
---
77

8-
# STON.fi
9-
108
[STON.fi](https://ston.fi) is a decentralized automated market maker (AMM) built on [TON blockchain](https://ton.org) providing virtually zero fees, low slippage, an extremely easy interface, and direct integration with TON wallets.
119

1210
:::caution

0 commit comments

Comments
 (0)