Logic eval error: stack underflow in bnz - General - Algorand

Logic eval error: stack underflow in bnz

post by ncoin on Mar 17, 2022

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

526 views

post by fabrice on Mar 17, 2022

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

post by ncoin on Mar 17, 2022

What is the most common way to get this error in pyteal?

Related topics

Topic Replies Views Activity
Teal debugging - Invocation error 7 1.0k May 2021
Can i use ‘bz’ and ‘return’ in stateless smart contract 1 337 Aug 2021
How to deal with integer overflows in PyTeal 6 959 Jan 2022
Passing in parameters into teal programs: type error 3 517 Nov 2019
algokit_utils.logic_error.LogicError: Txn {txn hash} had error ‘unavailable Asset 1335’ at PC 428 and Source Line 245 0 313 Aug 2023