c4 (new state) and c5 (final actions) represent durable effects of a successful on‑chain run. Everything else is transient.
c0 — return continuation
Type: Continuation
Initial value: Quit — extraordinary continuation which terminates TVM with exit code 0.
When RET is called or the current continuation remains no instructions (implicit ret), c0 is invoked. Call-like instructions use it to store the current continuation in order to return to it after executing the inner function.
c1 — alternative return continuation
Type: Continuation
Initial value: Quit — extraordinary continuation which terminates TVM with exit code 1. Both exit codes 0 and 1 are considered successful terminations of TVM.
Same as c0, but invoked only in special control flow instructions, such as RETALT, IFRETALT, and others.
c2 — exception handler
Type: Continuation
Initial value: ExcQuit — extraordinary continuation which terminates TVM with an exception. In this case, the exit code is an exception number.
Invoked implicitly on any exception that occurs during TVM execution. Can be invoked explicitly by THROW-like instructions. To set a custom exception handler, use TRY.
c3 — function selector
Type: Continuation
Initial value: Root cell of code currently executing in TVM.
Invoked by CALLDICT instruction with a function id (integer) passed on the stack. The function selector should jump to a function with that ID.
Fift-ASM assembler constructs following function selector (Asm.fif:1624):
Fift
c4 — persistent account storage
Type: Cell
Initial value: Root cell of account data.
This register helps to store some information between smart contract invocations. When the transaction succeeds, the final value of c4 is saved as new account data.
c5 — outbound actions accumulator
Type: Cell
Initial value: Empty cell.
List of actions to perform in the action phase after TVM execution: send a message, reserve funds, update code, and install libraries.
c5 has an OutList structure:
TLB
c7 — environment information and global variables
Type: Tuple
Initial value: Tuple[Tuple[0x076ef1ea, 0, 0, ...]].
The zero element of the c7 tuple is an environment information (which itself is also a tuple). The remaining 255 slots are used for global variables. [i] SETGLOB modifies c7, inserting an element with index i, [i] GETGLOB reads i-th element from c7.
Structure of environment information tuple
| # | Instruction | Field | Type | Description |
|---|---|---|---|---|
| 0 | - | 0x076ef1ea | integer | tag of SmartContractInfo TLB structure |
| 1 | - | actions count | integer | increments when new action is pushed to c5. |
| 2 | - | messages sent | integer | increments when new action_send_msg is pushed to c5 |
| 3 | NOW | unix time | integer | current time (timestamp of block collation) |
| 4 | BLOCKLT | current block LT (logical time) | integer | |
| 5 | LTIME | current transaction LT | integer | |
| 6 | RANDSEED | random seed | integer | sha256(block_rand_seed . account_address) |
| 7 | BALANCE | smart contract balance | tuple | tuple of integer (TON balance) and cell/null (extra currencies dictionary) |
| 8 | MYADDR | smart contract address | slice | |
| 9 | CONFIGROOT | global blockchain configuration | cell/null (dictionary) | |
| 10 | MYCODE | smart contract code | cell | |
| 11 | INCOMINGVALUE | value of incoming message | tuple | tuple of integer (TON value) and cell/null (extra currencies dictionary) |
| 12 | STORAGEFEES | fees collected during storage phase | integer | |
| 13 | PREVBLOCKSINFOTUPLE, PREVMCBLOCKS_100 | last 16 masterchain blocks, last keyblock, and last 16 masterchain blocks with seqno divisible by 100 | tuple | tuple has following PrevBlocksInfo structure: [ wc:Integer shard:Integer seqno:Integer |
| 14 | UNPACKEDCONFIGTUPLE | unpacked config values | tuple |
|
| 15 | DUEPAYMENT | current debt for storage fee (nanotons) | integer | |
| 16 | GETPRECOMPILEDGAS | gas usage for the current contract if it is precompiled, null otherwise | integer/null | see ConfigParam 45 |
| 17 | INMSGPARAMS | inbound message parameters | tuple |
bounce, bounced, fwd_fee, created_lt, created_at, orig_value, value are 0, value_extra is null.For tick-tock transactions and get methods: src_addr is addr_none. |