Skip to main content

Initialization of cc, cp, and gas limits

  • The original cc, current continuation, is initialized using the cell slice created from the code section of the smart contract. If the account is frozen or uninitialized, the code must be provided in the init field 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

  • c0: Quit — extraordinary continuation which terminates TVM with exit code 0.
  • c1: Quit — extraordinary continuation which terminates TVM with exit code 1. Both exit codes 0 and 1 are 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: The top of the stack is always the function selector, an integer that identifies the event that caused the transaction. The following function selectors are defined: Get methods can have arbitrary IDs and should not overlap with the ones listed above.

External/internal message

Tick‑tock

Split/merge events

These events are not implemented yet. Possible stack layout for split/merge events is described in TON Blockchain whitepaper. However, it is subject to change.