Skip to content

Commit 40c928c

Browse files
committed
check
1 parent 0fabb13 commit 40c928c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/v3/guidelines/quick-start/developing-smart-contracts/tact-folder/tact-storage-and-get-methods.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ message Add {
2828
A **message** is a structure that sends data into a contract from another contract or outside the blockchain.
2929
Tact simplifies working with messages by automatically serializing and deserializing them into [TVM cells](https://docs.ton.org/v3/documentation/data-formats/tlb/msg-tlb). You don’t need to write low-level serialization code or think about bit layout manually — Tact handles that for you.
3030

31-
For example, if you want to assign a fixed opcode to the message, which is useful when evolving message structures, you can define it like this:
31+
Every message is assigned a unique 32-bit identifier called an **opcode** (short for operation code). This identifier is stored at the beginning of the serialized message and helps the contract understand what type of message it is *receiving*.
32+
33+
By default, Tact automatically assigns this identifier. However, you can also define it manually, for example, when evolving the structure of your messages over time:
3234

3335
```tact title="/contracts/hello_world.tact"
3436
message(0x7e8764ef) Add {
@@ -234,12 +236,16 @@ Expected output should look like this:
234236

235237
## Step 2: update wrapper
236238

237-
[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:
239+
After building your contract, Tact automatically generates a special wrapper file. This [wrapper]((https://docs.tact-lang.org/book/compile/#wrap-ts)) simplifies interaction with your contract from TypeScript, such as calling its methods or sending messages.
240+
241+
In the wrapper file, you'll find this line of code:
238242

239243
```typescript title="/wrappers/HelloWorld.ts"
240244
export * from '../build/HelloWorld/tact_HelloWorld';
241245
```
242246

247+
This code exports everything inside the `tact_HelloWorld.ts` file in the build folder, making it available for use in other files.
248+
243249
## Step 3: updating tests
244250

245251
Now let's ensure that our smart contract code fails when we try to send `add` message from non-owner:

0 commit comments

Comments
 (0)