This forum is a read-only archive. Posting, replying and signing in are disabled.

Logic eval error: stack underflow in bnz

ncoin

What does the error logic eval error: stack underflow in bnz mean? I’m using pyteal…

fabrice

It means that there is nothing on the stack when you called bnz.
The stack must contain an integer before calling bnz.

For example, this program is incorrect:

#pragma version 5

bnz test

test:
int 1

but this one is correct:

#pragma version 5

int 1
bnz test

test:
int 1