Skip to content

Codegen Errors (E3xxx)

Back to Error Reference

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

CodeNameDescriptionCommon Cause
E3001UnsupportedFeatureUnsupported featureUsing EVM-only features that NeoVM cannot safely represent (delegatecall, callcode, bytecode creation/introspection paths)
E3002InvalidBytecodeInvalid bytecodeInternal compiler error during bytecode emission
E3003StackOverflowStack overflowExpression too deeply nested for NeoVM stack
E3004GasLimitExceededGas limit exceededContract initialization exceeds gas budget
E3005ContractTooLargeContract too largeGenerated bytecode exceeds NEF size limit
E3006InvalidOpcodeInvalid opcodeInternal error: generated opcode not in NeoVM spec
E3007BreakOutsideLoopBreak outside loopbreak statement not inside a for/while loop
E3008ContinueOutsideLoopContinue outside loopcontinue statement not inside a for/while loop
E3009InvalidJumpOffsetInvalid jump offsetInternal 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 for the full compatibility matrix and 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.

MIT Licensed