Merge branch 'develop' into add_tx_data

pull/1131/head
Nikhil Parasaram 5 years ago committed by GitHub
commit a26d8e3391
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      mythril/analysis/modules/dos.py

@ -30,7 +30,7 @@ class VisitsAnnotation(StateAnnotation):
return result
class DOS(DetectionModule):
class DosModule(DetectionModule):
"""This module consists of a makeshift loop detector that annotates the state with
a list of byte ranges likely to be loops. If a CALL or SSTORE detection is found in
one of the ranges it creates a low-severity issue. This is not super precise but
@ -54,11 +54,7 @@ class DOS(DetectionModule):
:param state:
:return:
"""
if state.get_current_instruction()["address"] in self._cache:
return
issues = self._analyze_state(state)
for issue in issues:
self._cache.add(issue.address)
self._issues.extend(issues)
def _analyze_state(self, state: GlobalState) -> List[Issue]:
@ -115,7 +111,7 @@ class DOS(DetectionModule):
)
except UnsatError:
return []
self._cache.add(annotation.loop_start)
issue = Issue(
contract=state.environment.active_account.contract_name,
function_name=state.environment.active_function_name,
@ -135,4 +131,4 @@ class DOS(DetectionModule):
return []
detector = DOS()
detector = DosModule()

Loading…
Cancel
Save