/tealer.math_tool

Primary LanguagePythonGNU Affero General Public License v3.0AGPL-3.0

Tealer

Tealer is a static analyzer for Teal code. It parses the Teal program, and builds its CFG. The analyzer comes with a set of vulnerabilities detectors and printers allowing to quickly review the contracts.

Features

Run Tealer on a Teal contract:

tealer program.teal

For additional configuration, see the Usage documentation.

Detectors

Num Detectors What it Detects Applies To Impact Confidence
1 is-deletable Deletable Applications Stateful High High
2 is-updatable Upgradable Applications Stateful High High
3 unprotected-deletable Unprotected Deletable Applications Stateful High High
4 unprotected-updatable Unprotected Upgradable Applications Stateful High High
5 group-size-check Usage of absolute indexes without validating GroupSize Stateless, Stateful High High
6 can-close-account Missing CloseRemainderTo field Validation Stateless High High
7 can-close-asset Missing AssetCloseTo Field Validation Stateless High High
8 missing-fee-check Missing Fee Field Validation Stateless High High
9 rekey-to Rekeyable Logic Signatures Stateless High High

For more information, see

Printers

  • Print CFG (--print-cfg): Export the CFG of the contract to a dot file.
  • human-summary: Print a human-readable summary of the contract.
  • function-cfg: Export the CFG of each subroutine in the contract, works for contracts written in version 4 or greater.
  • call-graph: Export the call-graph of the contract to a dot file, works for contracts written in version 4 or greater.

Printers output dot files. Use xdot to open the files (sudo apt install xdot).

How to install

Using Git

git clone https://github.com/crytic/tealer.git && cd tealer
python3 setup.py install

We recommend to install the tool in a virtualenv.

TODO: Add License