The issue is that And
or Or
are not like &&
/ ||
on Algorand.
All the expressions are evaluated even if the first expression fails (in the case of &&
).
In your specific case
[And(Or(Gtxn[0].xfer_asset() == Int(31566704), Gtxn[0].xfer_asset() == Int(312769), Gtxn[0].xfer_asset() == Int(465865291)), Gtxn[0].asset_receiver() == Global.current_application_address(), Gtxn[1].amount() == Global.min_txn_fee(), Gtxn[1].receiver() == Global.current_application_address()), to_nusd()],
systematically access Gtxn[1]
and crashes.
See Noob cannot deploy smart contract - #4 by fabrice
All the conditions are evaluated in order.