Skip to main content
T TON Adoption
← Glossary
NODE/03 · Term

Exit Code

Numeric code returned by TVM after the compute phase of a transaction. 0 means success; any other value indicates a specific error class.

Aliases: exit_code, vm exit code

Exit Code is the integer code TVM returns after running a transaction’s compute phase. It tells you whether execution succeeded or, if not, what kind of error occurred. It’s the first thing you check in an explorer when a transaction “didn’t work”.

Standard codes

TVM reserves a range of system codes and leaves the rest for user-defined ones:

CodeMeaning
0Success. Compute phase finished without errors.
1Alternative success code.
2Stack underflow — an instruction expected more items on the stack.
3Stack overflow.
4Integer overflow.
5Integer out of range.
13Out of gas — the most common failure mode.
32Invalid action list.
33Invalid signature (typical for wallet contracts).
34Invalid action mode.
37Not enough TON.
40Message too large.

Codes 100 and above are user-defined: the contract decides what they mean (require(amount > 0, code: 101) and so on).

Where to find it

  • TonViewer / TonScanexit_code field in the transaction card.
  • Blueprint sandbox — local tests return the exit code directly from runGetMethod / sendInternal.
  • Tact testsexpect(...).toHaveTransaction({ exitCode: ... }).

A subtlety

exit_code = 0 does not mean the transaction is fully successful: the action phase may still have failed with its own result_code. When debugging, check both. And remember: even a failed transaction burns gas and storage fee.

Related terms