# CCIP v1.6.0 TON Errors API Reference
Source: https://docs.chain.link/ccip/api-reference/ton/v1.6.0/errors

> For the complete documentation index, see [llms.txt](/llms.txt).

## Errors

CCIP contracts on TON use the TVM exit code system. Each contract has a **facility ID** that namespaces its errors. Contract-level errors are computed as `FACILITY_ID × 100 + offset`.

***

## Native TVM Exit Codes

TVM itself defines a set of standard exit codes that can occur before your contract code even runs (e.g., insufficient gas, cell deserialization failure). These are not CCIP-specific. See the [TON documentation](https://docs.ton.org/tvm/exit-codes) for the complete list.

Common native exit codes you may encounter:

| Exit Code | Name                               | Description                                           |
| --------- | ---------------------------------- | ----------------------------------------------------- |
| `0`       | Success                            | Transaction executed successfully.                    |
| `2`       | Stack underflow                    | Not enough values on the stack.                       |
| `3`       | Stack overflow                     | Too many values pushed onto the stack.                |
| `4`       | Integer overflow                   | Integer value out of range.                           |
| `5`       | Integer out of expected range      | Integer out of expected range.                        |
| `6`       | Invalid opcode                     | Undefined or invalid TVM instruction.                 |
| `7`       | Type check error                   | Primitive type mismatch.                              |
| `8`       | Cell overflow                      | Cell builder: writing too many bits or references.    |
| `9`       | Cell underflow                     | Cell slice: reading more bits or refs than available. |
| `10`      | Dictionary error                   | Invalid dictionary operation.                         |
| `13`      | Out of gas                         | Execution ran out of gas (TON).                       |
| `32`      | Action list is invalid             | Invalid action list after execution.                  |
| `34`      | Action is invalid or not supported | Specific action unsupported.                          |
| `37`      | Not enough TON                     | Insufficient balance to send the required amount.     |
| `38`      | Not enough extra-currencies        | Insufficient extra-currency balance.                  |
| `65535`   | Unknown opcode                     | Unhandled message opcode in the contract.             |

***

## Router Errors

**Facility ID:** `571` — errors start at `57100`

These errors occur when sending a `Router_CCIPSend` or `Router_GetValidatedFee` message.

```tolk
enum Router_Error {
    DestChainNotEnabled = 57100
    SourceChainNotEnabled   // 57101
    SenderIsNotOffRamp      // 57102
    OffRampNotSetForSelector // 57103
    OffRampAddressMismatch  // 57104
    SubjectCursed           // 57105
    NotOnRamp               // 57106
    MissingTokenAmounts     // 57107
    NoMultiTokenTransfers   // 57108
    InsufficientFee         // 57109
}
```

| Exit Code | Symbol                  | Description                                                                                                           |
| --------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------- |
| `57100`   | `DestChainNotEnabled`   | The `destChainSelector` is not configured on this Router. Check that you are using the correct chain selector.        |
| `57101`   | `SourceChainNotEnabled` | The source chain is not enabled on the OffRamp.                                                                       |
| `57102`   | `SenderIsNotOffRamp`    | A `Router_RouteMessage` was sent by an address that is not the expected OffRamp.                                      |
| `57105`   | `SubjectCursed`         | The transfer is blocked because the source or destination chain has been cursed by the Risk Management Network (RMN). |
| `57108`   | `NoMultiTokenTransfers` | Token transfers are not yet supported on TON. Pass an empty `tokenAmounts` cell.                                      |
| `57109`   | `InsufficientFee`       | The GRAM value attached to the message is below the required minimum. Increase the attached value.                    |

***

## OnRamp Errors

**Facility ID:** `134` — errors start at `13400`

These errors occur during OnRamp processing of a CCIP send.

```tolk
enum Error {
    UnknownDestChainSelector = 13400
    Unauthorized            // 13401
    SenderNotAllowed        // 13402
    InvalidConfig           // 13403
    UnknownToken            // 13404
    InsufficientValue       // 13405
}
```

| Exit Code | Symbol                     | Description                                                                             |
| --------- | -------------------------- | --------------------------------------------------------------------------------------- |
| `13400`   | `UnknownDestChainSelector` | The destination chain selector is not registered on the OnRamp.                         |
| `13401`   | `Unauthorized`             | The caller is not authorized to perform this operation.                                 |
| `13402`   | `SenderNotAllowed`         | The sender allowlist is enabled for this destination chain and the sender is not on it. |
| `13405`   | `InsufficientValue`        | The message value is below what the OnRamp requires for processing.                     |

***

## FeeQuoter Errors

**Facility ID:** `344` — errors start at `34400`

These errors occur during fee validation. They surface when the Router forwards your `Router_CCIPSend` to the FeeQuoter, or when you call `validatedFeeCell` directly.

```tolk
enum FeeQuoter_Error {
    UnsupportedChainFamilySelector = 34400
    GasLimitTooHigh                 // 34401
    ExtraArgOutOfOrderExecutionMustBeTrue // 34402
    InvalidExtraArgsData            // 34403
    UnsupportedNumberOfTokens       // 34404
    InvalidEVMReceiverAddress       // 34405
    Invalid32ByteReceiverAddress    // 34406
    MsgDataTooLarge                 // 34411
    StaleGasPrice                   // 34412
    DestChainNotEnabled             // 34413
    FeeTokenNotSupported            // 34414
    TokenTransfersNotSupported      // 34419
    MessageFeeTooHigh               // 34427
}
```

| Exit Code | Symbol                                  | Description                                                                                                                                                |
| --------- | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `34400`   | `UnsupportedChainFamilySelector`        | The destination chain family (e.g., EVM, SVM) is not recognized. Check `extraArgs` encoding.                                                               |
| `34401`   | `GasLimitTooHigh`                       | The `gasLimit` in `extraArgs` exceeds the maximum configured for the destination chain.                                                                    |
| `34402`   | `ExtraArgOutOfOrderExecutionMustBeTrue` | `allowOutOfOrderExecution` must be `true` for this destination chain.                                                                                      |
| `34403`   | `InvalidExtraArgsData`                  | The `extraArgs` cell could not be decoded. Check encoding with [`buildExtraArgsForEVM`](/ccip/api-reference/ton/starter-kit-helpers#buildextraargsforevm). |
| `34405`   | `InvalidEVMReceiverAddress`             | The EVM receiver address is invalid (e.g., zero address).                                                                                                  |
| `34406`   | `Invalid32ByteReceiverAddress`          | The receiver address must be exactly 32 bytes.                                                                                                             |
| `34411`   | `MsgDataTooLarge`                       | The `data` payload exceeds the maximum allowed size for the destination chain.                                                                             |
| `34412`   | `StaleGasPrice`                         | The gas price data on the FeeQuoter is stale and cannot be used for fee calculation.                                                                       |
| `34413`   | `DestChainNotEnabled`                   | The destination chain is not enabled on this FeeQuoter.                                                                                                    |
| `34414`   | `FeeTokenNotSupported`                  | The specified fee token is not supported. Use native GRAM.                                                                                                 |
| `34419`   | `TokenTransfersNotSupported`            | Token transfers are not yet supported on TON. Pass an empty `tokenAmounts` cell.                                                                           |
| `34427`   | `MessageFeeTooHigh`                     | The calculated fee exceeds the maximum fee per message allowed by the FeeQuoter.                                                                           |

***

## Receiver Errors

**Facility ID:** `54` — hardcoded error values

These errors are thrown by the `validateAndConfirm` helper and the `minimal_receiver` example when validating incoming `Receiver_CCIPReceive` messages.

```tolk
enum Receiver_Error {
    Unauthorized = 5400
    LowValue     // 5401
}
```

| Exit Code | Symbol         | Description                                                                                                                                                                                           |
| --------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `5400`    | `Unauthorized` | The sender of the `Receiver_CCIPReceive` message is not the authorized CCIP Router. Ensure your receiver stores the correct Router address.                                                           |
| `5401`    | `LowValue`     | The GRAM value attached to the `Receiver_CCIPReceive` message is below `MIN_VALUE`. The EVM sender must set a higher `gasLimit` in `GenericExtraArgsV2` (minimum 0.1 GRAM = `100_000_000n` nanoGRAM). |

> **CAUTION**
>
> If your receiver throws `LowValue` (5401), the message will require manual execution. The EVM sender must set a
> sufficient `gasLimit` in nanoGRAM when building the CCIP message. See the [Manual
> Execution](/ccip/concepts/ton/manual-execution) page for recovery steps.

***

> **CAUTION: Educational Example Disclaimer**
>
> This page includes an educational example to use a Chainlink system, product, or service and is provided to
> demonstrate how to interact with Chainlink's systems, products, and services to integrate them into your own. This
> template is provided "AS IS" and "AS AVAILABLE" without warranties of any kind, it has not been audited, and it may be
> missing key checks or error handling to make the usage of the system, product or service more clear. Do not use the
> code in this example in a production environment without completing your own audits and application of best practices.
> Neither Chainlink Labs, the Chainlink Foundation, nor Chainlink node operators are responsible for unintended outputs
> that are generated due to errors in code.