Skip to content

Commit 0f0753c

Browse files
committed
Explain forgetting to init
1 parent 5b8dd9d commit 0f0753c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/routes/(examples)/02-integer-ops/content.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Since all runtime calculations with integers are done at 257-bit, overflows are
44

55
Nevertheless, if any math operation overflows, an exception will be thrown and the transaction will revert. You can say that Tact's math is safe by default.
66

7-
There's no problem with mixing variables of different state sizes in the same calculation. In runtime, they are all the same type - 257-bit signed.
7+
There's no problem with mixing variables of different state sizes in the same calculation. In runtime, they are all the same type - always 257-bit signed. This is the largest supported integer type, so they all fit.

src/routes/(examples)/02-integers/content.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ Tact supports a number of primitive data types that are tailored for smart contr
66

77
The runtime type `Int` is *always* 257-bit signed, so all runtime calculations are done at 257-bit. This should be enough for everything as it's large enough to hold the number of atoms in the universe.
88

9-
When encoding `Int` to persistent state, we will usually use smaller representations than 257-bit to reduce storage cost. The persistent state size is specified in every declaration of a state variable after the `as` keyword.
9+
When encoding `Int` to persistent state, we will usually use smaller representations than 257-bit to reduce storage cost. The persistent state size is specified in every declaration of a state variable after the `as` keyword.
10+
11+
Persistent state variables can be initialized inline or inside `init()`. If you forget to initialize a state variable, the code will not compile.

0 commit comments

Comments
 (0)