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

Warn when emitting an event from a view function #44

Closed milancermak closed 2 years ago

milancermak commented 2 years ago

I'd like to suggest a new rule:

There should be a warning if an event is being emitted from a @view function.

Granted, the rule is somewhat subjective, but I don't see a point in emitting from a @view. WDYT?

fcasal commented 2 years ago

Hi @milancermak , this makes sense because emitting an event causes a state change. This will be addressed in a future iteration of https://github.com/crytic/amarna/pull/42