Refactor _uses_vulnerable_solc_version()
onto the base AbstractDetector class
#1476
Labels
enhancement
New feature or request
Describe the desired feature
I was looking at ticket #1424 and trying to figure out how we would limit the solc versions that the detector would run on.
I noticed one place we already do this is with
_uses_vulnerable_solc_version()
in enum_conversion.py.I was thinking we could move that logic to the
AbstractDetector
base class and add a class attributeVULNERABLE_SOLC_VERSIONS
that defaults to []. In the maindetect()
on the base class we could add logic which checks if theself.compilation_unit.solc_version
is included in the list. (Skip the check if the list is empty)This way, whenever we want to limit the vulnerable solc versions for a detector, we just add the new
VULNERABLE_SOLC_VERSIONS
attribute to the subclass, and done. No need to change any logic.I think there may be other detectors that need to be limited to certain solc versions like this too, so this should make that easier.
I am planning to do this work before working on #1424 so am documenting this here and will submit separate prs.
The text was updated successfully, but these errors were encountered: