Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor _uses_vulnerable_solc_version() onto the base AbstractDetector class #1476

Closed
devtooligan opened this issue Nov 21, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@devtooligan
Copy link
Contributor

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 attribute VULNERABLE_SOLC_VERSIONS that defaults to []. In the main detect() on the base class we could add logic which checks if the self.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants