You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/v3/guidelines/quick-start/developing-smart-contracts/tact-folder/tact-storage-and-get-methods.mdx
+9-19Lines changed: 9 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -12,22 +12,12 @@ For more details, refer to the [Tact documentation](https://docs.tact-lang.org/#
12
12
13
13
Let's create and modify our smart contract following standard steps described in the previous [Blueprint SDK overview](/v3/guidelines/quick-start/developing-smart-contracts/blueprint-sdk-overview/) section.
14
14
15
-
## Step 1: creating and modifying Tact contract
15
+
## Step 1: edit smart contract code
16
16
17
-
First, let's set up the environment for the Tact smart contract. To do that, you need a parent folder of your future project and run the following command:
18
17
19
-
```bash
20
-
npm create ton@latest
21
-
```
22
-
23
-
This will run interactive script for creating project template, you can enter anything you want, but if you want to have same paths as this guide choose the following:
24
-
1. Project name: `Example`.
25
-
2. First created contract name: `CounterInternal`.
26
-
3. Choose the project template: A **simple counter contract** on `Tact`.
27
-
28
-
At the top of the generated contract file: `counter_internal.tact`, you may see a message definition:
18
+
At the top of the generated contract file: `hello_world.tact`, you may see a message definition:
29
19
30
-
```tact title="/contracts/counter_internal.tact"
20
+
```tact title="/contracts/hello_world.tact"
31
21
message Add {
32
22
queryId: Int as uint64;
33
23
amount: Int as uint32;
@@ -36,7 +26,7 @@ message Add {
36
26
37
27
A message is a basic structure for communication between contracts. Tact automatically serializes and deserializes messages into cells. To ensure that opcodes will be the same during message structure changes, it may be added like below:
38
28
39
-
```tact title="/contracts/counter_internal.tact"
29
+
```tact title="/contracts/hello_world.tact"
40
30
message(0x7e8764ef) Add {
41
31
queryId: Int as uint64;
42
32
amount: Int as uint32;
@@ -125,7 +115,7 @@ Tact also provides handy ways to share same logic through [traits](https://docs.
125
115
import "@stdlib/ownable";
126
116
127
117
// Ownable trait introduced here
128
-
contract CounterInternal with Ownable {
118
+
contract HelloWorld with Ownable {
129
119
130
120
...
131
121
@@ -226,23 +216,23 @@ Expected output should look like this:
✅ Wrote compilation artifact to build/CounterInternal.compiled.json
219
+
✅ Wrote compilation artifact to build/HelloWorld.compiled.json
230
220
```
231
221
232
222
## Step 2: update wrapper
233
223
234
224
[Wrappers](https://docs.tact-lang.org/book/compile/#wrap-ts) facilitate contract interaction from TypeScript. Unlike in FunC or Tolk, they are generated automatically during the build process:
0 commit comments