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:
| Code | Meaning |
|---|---|
0 | Success. Compute phase finished without errors. |
1 | Alternative success code. |
2 | Stack underflow — an instruction expected more items on the stack. |
3 | Stack overflow. |
4 | Integer overflow. |
5 | Integer out of range. |
13 | Out of gas — the most common failure mode. |
32 | Invalid action list. |
33 | Invalid signature (typical for wallet contracts). |
34 | Invalid action mode. |
37 | Not enough TON. |
40 | Message 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 / TonScan —
exit_codefield in the transaction card. - Blueprint sandbox — local tests return the exit code directly from
runGetMethod/sendInternal. - Tact tests —
expect(...).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.