Actually those tests are really important when using smart signatures (previously called stateless smart contracts).
If you’re only using application / smart contracts (previously called stateful smart contracts), then you most likely don’t need those tests. Indeed, the sender of the transaction in that case is the real user. If the user is willing to pay a very high fee or rekey, it is ok. (It’s a security risk for them, not for your smart contract).
I would also suggest to switch to PyTeal. TEAL is becoming much more complex…
A few other remarks if you’re using smart signatures:
- do not hardcode 1000 as the minimum fee. This is dangerous if this fee changes. Instead use
global MinTxnFee.
- instead of using a chain of
&& (which was the only way to do it in the past), use assert:
gtxn 1 Fee
global MinTxnFee
<=
assert
gtxn 1 AssetCloseTo
global ZeroAddress
==
assert
gtxn 1 RekeyTo
global ZeroAddress
==
assert
This is much safer.