nowarp / misti

TON Static Analyzer
https://nowarp.io/tools/misti
Apache License 2.0
23 stars 0 forks source link

Detect if a contract modifies an inherited trait variable via direct write #64

Open anton-trunov opened 1 month ago

anton-trunov commented 1 month ago

Normally, a trait should provide setter methods for its variables which preserve invariants associated with the trait's piece of state. So, if the user of a trait tries to modify those inherited variables directly (self.traitVar = 42), thus possibly violating the trait invariant, they should get a warning.

byakuren-hijiri commented 1 month ago

Sounds good. I believe, it should be low severity and/or optional, because sometimes the developer can simply design a contract that way.