Initialization of cc, cp, and gas limits
-
The original
cc, current continuation, is initialized using the cell slice created from thecodesection of the smart contract. If the account is frozen or uninitialized, the code must be provided in theinitfield of the incoming message. -
The
cp, current TVM codepage, is set to the default value of 0. - The gas limit values are initialized based on the results of the credit phase.
Registers initialization
For more info about registers, take a look at Registers
-
c0:Quit— extraordinary continuation which terminates TVM with exit code0. -
c1:Quit— extraordinary continuation which terminates TVM with exit code1. Both exit codes0and1are considered successful terminations of TVM. -
c2:ExcQuit— extraordinary continuation which terminates TVM with an exception. In this case, the exit code is an exception number. -
c3: root cell of code currently executing in TVM. -
c4: root cell of account data. -
c5: empty cell. -
c7:Tuple[Tuple[0x076ef1ea, 0, 0, ...]].
Stack
The contents of the stack depend on the event that triggered the transaction:- Internal message
- External message
- Tick-tock
- Split prepare
- Merge install
- Get method (off-chain)
| Id | Name | Description |
|---|---|---|
| 0 | onInternalMessage | Received an internal message |
| -1 | onExternalMessage | Received an external message |
| -2 | onRunTickTock | Received a tick-tock event |
| -3 | onSplitPrepare | Received a split prepare event (unimplemented yet) |
| -4 | onSplitInstall | Received a split install event (unimplemented yet) |
External/internal message
| Index | Name | Type | Description |
|---|---|---|---|
s0 | Function selector | Integer | -1 for external messages, 0 for internal messages. |
s1 | Message body | Slice | This is an arbitrary payload of a message, which can be used for text comments (when sending TONs from one wallet to another) or for smart contract commands. |
s2 | Message | Cell | Cell containing message metadata (sender, receiver, amount) as well as message body. |
s3 | Message value | Integer | Amount of received nanotons (0 for externals). |
s4 | Contract balance | Integer | Current account balance in nanotons. |
Tick‑tock
| Index | Name | Type | Description |
|---|---|---|---|
s0 | Function selector | Integer | -2 for tick-tock transactions. |
s1 | Tick or tock? | Integer | 0 for tick transactions, -1 for tock transactions. |
s2 | Account address | Integer | 256-bit raw account address (without workchain). |
s3 | Contract | Integer | Current account balance in nanotons. |