crytic / tealer

Static Analyzer for Teal
GNU Affero General Public License v3.0
62 stars 14 forks source link

Add group transaction support for stateful detectors #193

Closed S3v3ru5 closed 1 year ago

S3v3ru5 commented 1 year ago

The PR adds group support tests for the stateful detectors.

The PR also fixes an issue in the transaction fiedl analysis of transaction types. The developers generally check the creation transaction using

txn ApplicationId # ApplicationId will be 0 in the creation transaction
int 0
==/!=
bz/bnz

The analysis did not consider the integer value compared against the ApplicationId. It is only checked if the Application is compared against an integer. if so, the analysis considered it to be an Application creation transaction. For example, below pattern is considered to be a check for the creation transaction.

txn AppplicationId
int 1337
==
bnz

The fix is simply to ensure that compared integer is 0.