More annotations, fix problem in predictable_vars module

pull/1047/head
Bernhard Mueller 6 years ago
parent 53ee990b2f
commit 39364503f1
  1. 2
      mythril/analysis/modules/base.py
  2. 2
      mythril/analysis/modules/delegatecall.py
  3. 4
      mythril/analysis/modules/dependence_on_predictable_vars.py
  4. 2
      mythril/analysis/modules/deprecated_ops.py
  5. 2
      mythril/analysis/modules/ether_thief.py
  6. 2
      mythril/analysis/modules/exceptions.py
  7. 2
      mythril/analysis/modules/external_calls.py
  8. 2
      mythril/analysis/modules/integer.py
  9. 2
      mythril/analysis/modules/multiple_sends.py
  10. 2
      mythril/analysis/modules/state_change_external_calls.py
  11. 2
      mythril/analysis/modules/suicide.py
  12. 2
      mythril/analysis/modules/unchecked_retval.py

@ -49,7 +49,7 @@ class DetectionModule:
"""
self._issues = []
def execute(self, statespace):
def execute(self, statespace) -> None:
"""The entry point for execution, which is being called by Mythril.
:param statespace:

@ -79,7 +79,7 @@ class DelegateCallModule(DetectionModule):
pre_hooks=["DELEGATECALL", "RETURN", "STOP"],
)
def _execute(self, state: GlobalState) -> list:
def _execute(self, state: GlobalState) -> None:
"""
:param state:

@ -21,7 +21,7 @@ final_ops = ["CALL", "SUICIDE", "STOP", "RETURN"]
def is_prehook() -> bool:
"""Check if we are in prehook. One of Bernhard's trademark hacks!"""
return "pre_hook" in traceback.format_stack()[-4]
return "pre_hook" in traceback.format_stack()[-5]
class PredictableValueAnnotation:
@ -64,7 +64,7 @@ class PredictableDependenceModule(DetectionModule):
post_hooks=["BLOCKHASH"] + predictable_ops,
)
def _execute(self, state: GlobalState) -> list:
def _execute(self, state: GlobalState) -> None:
"""
:param state:

@ -76,7 +76,7 @@ class DeprecatedOperationsModule(DetectionModule):
pre_hooks=["ORIGIN", "CALLCODE"],
)
def _execute(self, state: GlobalState):
def _execute(self, state: GlobalState) -> None:
"""
:param state:

@ -51,7 +51,7 @@ class EtherThief(DetectionModule):
super().reset_module()
self._cache_addresses = {}
def _execute(self, state: GlobalState):
def _execute(self, state: GlobalState) -> None:
"""
:param state:

@ -72,7 +72,7 @@ class ReachableExceptionsModule(DetectionModule):
pre_hooks=["ASSERT_FAIL"],
)
def _execute(self, state: GlobalState) -> list:
def _execute(self, state: GlobalState) -> None:
"""
:param state:

@ -137,7 +137,7 @@ class ExternalCalls(DetectionModule):
pre_hooks=["CALL"],
)
def _execute(self, state: GlobalState):
def _execute(self, state: GlobalState) -> None:
"""
:param state:

@ -84,7 +84,7 @@ class IntegerOverflowUnderflowModule(DetectionModule):
self._overflow_cache = {}
self._underflow_cache = {}
def _execute(self, state: GlobalState):
def _execute(self, state: GlobalState) -> None:
"""Executes analysis module for integer underflow and integer overflow.
:param state: Statespace to analyse

@ -43,7 +43,7 @@ class MultipleSendsModule(DetectionModule):
],
)
def _execute(self, state: GlobalState):
def _execute(self, state: GlobalState) -> None:
self._issues.extend(_analyze_state(state))

@ -84,7 +84,7 @@ class StateChange(DetectionModule):
],
)
def _execute(self, state: GlobalState):
def _execute(self, state: GlobalState) -> None:
self._issues.extend(self._analyze_state(state))
@staticmethod

@ -37,7 +37,7 @@ class SuicideModule(DetectionModule):
super().reset_module()
self._cache_address = {}
def _execute(self, state: GlobalState):
def _execute(self, state: GlobalState) -> None:
"""
:param state:

@ -49,7 +49,7 @@ class UncheckedRetvalModule(DetectionModule):
post_hooks=["CALL", "DELEGATECALL", "STATICCALL", "CALLCODE"],
)
def _execute(self, state: GlobalState) -> list:
def _execute(self, state: GlobalState) -> None:
"""
:param state:

Loading…
Cancel
Save