Skip to content
Vara Prasad Bandaru edited this page Feb 9, 2023 · 1 revision

Usage

How to run Tealer

Teal contract

To run Slither on a Teal file:

tealer program.teal

Algoexplorer

Application

To run Tealer on an application deployed on mainnet, run

# tealer {application-id}
tealer 991196662

LogicSig of a contract account

To run Tealer on the LogicSignature of a contract account, run

# tealer {account-address}
tealer D6DDUCPSDWD4IA2L3FL4ZC6NVKXGQYOU4LJQMHKV6NVCYHRURSFKYPFN5M

LogicSignature that signed the transaction

To run Tealer on the logic signature that is used to sign a transaction, run

# tealer {transaction-id}
tealer VFFVCSPFBK36ZN2FPDPDI6PFUO44OLZPBU6XPGOIGSR5L2XK6HFQ

Tealer can be run on contracts from both Algorand Mainnet and Testnet. Tealer searches the Mainnet by default. Use --network argument to specify the Algorand network.

To run Tealer on an application deployed on testnet, run

tealer 115884263 --network testnet

Options

  • To export the result to a json file: --json file.json
    • To export to stdout instead of a file, simply replace the filename with -
  • To save all the output files in a specific directory: --dest tealer-out
    • Tealer saves the output files in the current directory if this option is not used.

Detector selection

Tealer runs all its detectors by default.

To run only selected detectors, use --detect detector1,detector2. For example:

tealer program.teal --detect is-updatable,is-deletable

To exclude detectors, use --exclude detector1,detector2. For example:

tealer program.teal --exclude group-size-check

To exclude detectors that only apply to stateless contracts, use --exclude-stateless. Similarly, use --exclude-stateful to exclude detectors that only apply to stateful contracts.

--list-detectors lists available detectors.

Printer selection

By default, no printers are run.

To run selected printers, use --print printer1,printer2. For example:

tealer program.teal --print cfg,subroutine-cfg

--list-printers lists available printers.

Filtering Reported Execution Paths

--filter-paths "1 -> 2" will exclude all the execution paths that contain 1 -> 2. Python regular expression are used for comparison. The comparison is made against the short-notation.

short-notation:

short_notation = " -> ".join(block_id(basic_block) for basic_block in execution_path)

Example:

tealer program.teal --filter-paths "1 -> . -> 3"

Filter all execution paths that contain block 1 followed by some unknown block followed by block 3.