Zilliqa / scilla

Scilla - A Smart Contract Intermediate Level Language
https://scilla-lang.org
GNU General Public License v3.0
240 stars 79 forks source link

feat(SanityChecker): Warn about optional parameters in events #1139

Closed jubnzv closed 2 years ago

jubnzv commented 2 years ago

This is a quick workaround that partially solves #1097

jubnzv commented 2 years ago

I don't really like this solution, because it is very inaccurate. It will generate a lot of false positives, like in the ark contract in our tests.

Probably, the better idea will be to write a simple flow-insensitive analysis that iterates statements and looks for reading from maps. Then it should find occurrences of pattern matching with this value or function calls that accepts an optional argument and uses pattern-matching on it.