Welcome to Algorand!
You have a typo:
fee_cond = Txn.fee() < Int(tmpl_fee),
ends with a comma and hence fee_cond
is actually a tuple, which is the issue.
PS: I’ve modified your post so that the code is between triple back quotes ``` to facilitate reading the code.
PS2: It is in general better to include the full Python error. Here, we would see that the error is actually linked with return And(fee_cond,
from which it is much easier to see that the error stems from the comma.
PS3: This code is based on a very old version of TEAL/PyTEAL. In addition it is a smart signatures. Nowadays, you would most likely not use smart signatures but instead of smart contracts for most cases on Algorand. For a pure HTLC, it still may make sense to use smart signatures, but often you may want to go beyond a pure HTLC. In addition, nowadays, you should rather use Assert
. See PyTeal opcodes cost (Asserts vs And) - #2 by fabrice