Nexus

TEAL program without #pragma version fails with "opcode was introduced in v8"

Short answer: A program with no #pragma version line is compiled as version 1, so any newer opcode is rejected.

The exact message

2: box_get opcode was introduced in v8
3: return opcode was introduced in v2

Source: POST /v2/teal/compile, HTTP 400, captured against a public TestNet node on 2026-12-03.

Why it happens

Captured with int 1, box_get, return and no pragma. Both box_get (v8) and return (v2) were reported as "introduced in" newer versions, which is what a version-1 compile looks like.

How to fix it

Wording can change between node versions. All API errors · errors.json · transaction errors · SDK errors · costs