Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

$$ \newcommand \LogicSig {\mathrm{LSig}} \newcommand \LogicSigMaxSize {\LogicSig_{\max}} \newcommand \LogicSigMaxCost {\LogicSig_{c,\max}} \newcommand \App {\mathrm{App}} \newcommand \MaxAppTotalProgramLen {\App_{\mathrm{prog},t,\max}} \newcommand \MaxExtraAppProgramPages {\App_{\mathrm{page},\max}} \newcommand \MaxAppProgramCost {\App_{c,\max}} $$

Execution Modes

Starting from Version 2, the AVM can run programs in two modes:

  1. Logic Signature (or stateless) mode, used to execute Logic Signatures;

  2. Application (or stateful) mode, used to execute Smart Contracts.

Differences between modes include:

  • The maximum allowed program size, defined by the following Ledger parameters:

    • \( \LogicSigMaxSize \)
    • \( \MaxAppTotalProgramLen \)
    • \( \MaxExtraAppProgramPages \)
  • The maximum allowed program cost, defined by the following Ledger parameters:

    • \( \LogicSigMaxCost \)
    • \( \MaxAppProgramCost \)
  • Opcode availability (refer to the Opcodes Specifications for details).

  • Some Global Fields are only available in Application mode.

  • Only Applications can observe transaction effects, such as Logs or IDs allocated to ASAs or new Applications.