跳到主要内容

TVM Exit codes (TVM退出代码)

If TVM exits with an arbitrary 16-bit unsigned integer exit_code. exit_code higher than 1, it is considered to be an error code, therefore an exit with such a code may cause the transaction to revert/bounce.

标准退出码

信息

The list of standard exit codes contains all universal TVM exit codes defined for TON Blockchain. Alternative exit codes should be sought in the source code of corresponded contract.

Exit codeTVM Phase描述
0Compute Phase标准成功执行退出码。
1Compute Phase备选成功执行退出码。
2Compute PhaseStack underflow. Last op-code consumed more elements than there are on the stacks. 1
3Compute PhaseStack overflow. More values have been stored on a stack than allowed by this version of TVM.
4Compute Phase整数溢出。整数不适应于 −2256 ≤ x < 2256 或发生了除零操作。
5Compute PhaseInteger out of expected range.
6Compute PhaseInvalid opcode. Instruction is unknown in the current TVM version.
7Compute PhaseType check error. An argument to a primitive is of an incorrect value type. 1
8Compute PhaseCell overflow. Writing to builder is not possible since after operation there would be more than 1023 bits or 4 references.
9Compute PhaseCell underflow. Read from slice primitive tried to read more bits or references than there are.
10Compute PhaseDictionary error. Error during manipulation with dictionary (hashmaps).
11Compute Phase最常见的原因是尝试调用在代码中未找到其 ID 的 get 方法(在调用时未找到 method_id 修饰符,或者在尝试调用时指定的 get 方法名不正确)。在TVM文档中描述为"未知错误,可能由用户程序抛出"。
12Compute PhaseThrown by TVM in situations deemed impossible.
13Compute PhaseOut of gas error. Thrown by TVM when the remaining gas becomes negative.
-14Compute PhaseIt means out of gas error, same as 13. Negative, because it cannot be faked
32Action PhaseAction list is invalid. Set during action phase if c5 register after execution contains unparsable object.
-32Action Phase(与前面的 32 相同)- 未找到方法 ID。在尝试执行不存在的 get 方法时,TonLib 返回此值。
33Action PhaseAction list is too long.
34Action PhaseAction is invalid or not supported. Set during action phase if current action cannot be applied.
35Action PhaseInvalid Source address in outbound message.
36Action PhaseInvalid Destination address in outbound message.
37Action PhaseNot enough TON. Message sends too much TON (or there is not enough TON after deducting fees).
38Action Phase额外代币不足。
40Action PhaseNot enough funds to process a message. This error is thrown when there is only enough gas to cover part of the message, but does not cover it completely.
43Action PhaseThe maximum number of cells in the library is exceeded or the maximum depth of the Merkle tree is exceeded.

1 如果在 func 合约中遇到此类异常,这可能意味着汇编声明中存在类型错误。

信息

通常,您会看到Exit code 0xffff(十进制形式为 65535)。这通常意味着合约不认识接收到的操作码。在编写合约时,开发人员自己设置的此代码。