neo-devpack-solidity 0.22.0

Production-focused Solidity-to-NeoVM compilation system
Documentation
---
title: "Error Reference: Codegen Errors (E3xxx)"
description: "Codegen Errors (E3xxx) from Error Reference."
---

# Codegen Errors (E3xxx)

[Back to Error Reference](/advisory-content/error-reference)

These errors occur during Stage 5 (IR Generation) or Stage 7 (Code Generation) when the compiler translates Solidity constructs to NeoVM bytecode.

| Code    | Name                | Description           | Common Cause                                                              |
| ------- | ------------------- | --------------------- | ------------------------------------------------------------------------- |
| `E3001` | UnsupportedFeature  | Unsupported feature   | Using EVM-only features that NeoVM cannot safely represent (`delegatecall`, `callcode`, bytecode creation/introspection paths) |
| `E3002` | InvalidBytecode     | Invalid bytecode      | Internal compiler error during bytecode emission                          |
| `E3003` | StackOverflow       | Stack overflow        | Expression too deeply nested for NeoVM stack                              |
| `E3004` | GasLimitExceeded    | Gas limit exceeded    | Contract initialization exceeds gas budget                                |
| `E3005` | ContractTooLarge    | Contract too large    | Generated bytecode exceeds NEF size limit                                 |
| `E3006` | InvalidOpcode       | Invalid opcode        | Internal error: generated opcode not in NeoVM spec                        |
| `E3007` | BreakOutsideLoop    | Break outside loop    | `break` statement not inside a `for`/`while` loop                         |
| `E3008` | ContinueOutsideLoop | Continue outside loop | `continue` statement not inside a `for`/`while` loop                      |
| `E3009` | InvalidJumpOffset   | Invalid jump offset   | Internal error: jump target out of bytecode range                         |

## Example: E3001 UnsupportedFeature

```
error[E3001]: unsupported feature: delegatecall is not available on NeoVM
  --> MyContract.sol:30:9
   |
30 |         target.delegatecall(data);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^
```

**Blocked features include:**

- `delegatecall` / `callcode` (caller-storage execution semantics)
- Bytecode introspection (`extcodesize`, `extcodecopy`)
- `CREATE2` opcode semantics

**Fix:** Refactor to use Neo-native patterns. See [Solidity Feature Support](/solidity/feature-support) for the full compatibility matrix and [Parity and Limitations](/internals/parity-and-limitations) for details.

## Example: E3003 StackOverflow

```
error[E3003]: stack overflow: expression nesting depth exceeds NeoVM limit
  --> MyContract.sol:45:9
```

**Fix:** Break deeply nested expressions into intermediate variables. NeoVM has a maximum evaluation stack depth of 2048 items, but deeply nested expressions can exhaust this limit during evaluation.

## Example: E3005 ContractTooLarge

```
error[E3005]: contract too large: generated bytecode (524,800 bytes) exceeds NEF limit (524,288 bytes)
```

**Fix:** Reduce contract size by:

- Increasing the optimization level (`-O 3`)
- Splitting the contract into multiple smaller contracts
- Removing unused functions and dead code
- Using external library contracts for shared logic

::: warning
The NEF format has a maximum script size of 512 KB (524,288 bytes). Contracts approaching this limit should be refactored into smaller modules.
:::