crytic / amarna

Amarna is a static-analyzer and linter for the Cairo programming language.
https://blog.trailofbits.com/2022/04/20/amarna-static-analysis-for-cairo-programs/
GNU Affero General Public License v3.0
149 stars 7 forks source link

Cairo 0.9.1 support #66

Closed ca11ab1e closed 1 year ago

ca11ab1e commented 1 year ago

Cairo 0.9.1 introduced support for and in if statements (if x == y and z == w). And running Amarna on a contract using such statement will fail:

Could not parse contract.cairo: Unexpected token Token('IDENTIFIER', 'and') at line 1158, column 31.
Expected one of: 
        * LBRACE
        * DOT
        * SLASH
        * LPAR
        * LSQB
        * MINUS
        * COLON
        * STAR
        * PLUS
        * _DBL_STAR
ca11ab1e commented 1 year ago

Wow you were blazing fast, thanks!

coolhill commented 1 year ago

This will make it into a release on PyPi soon enough. For now you can install the latest amarna version from the repo manually:

git clone https://github.com/crytic/amarna.git && cd amarna
pip install -e .
ca11ab1e commented 1 year ago

Tested, and I confirm the fix works :+1: