Minor detector improvements

pull/81/head
Josselin 6 years ago
parent 6a1c98434b
commit cc64b0a594
  1. 2
      slither/detectors/statements/assembly.py
  2. 6
      slither/detectors/variables/unused_state_variables.py

@ -30,6 +30,8 @@ class Assembly(AbstractDetector):
def detect_assembly(self, contract):
ret = []
for f in contract.functions:
if f.contract != contract:
continue
nodes = f.nodes
assembly_nodes = [n for n in nodes if
self._contains_inline_assembly_use(n)]

@ -39,10 +39,12 @@ class UnusedStateVars(AbstractDetector):
unusedVarsName = [v.name for v in unusedVars]
info = ''
for var in unusedVars:
info += "{}.{} ({}) is never used\n".format(var.contract.name, var.name, var.source_mapping_str)
info += "{}.{} ({}) is never used in {}\n".format(var.contract.name,
var.name,
var.source_mapping_str,
c.name)
all_info += info
sourceMapping = [v.source_mapping for v in unusedVars]
results.append({'vuln': 'unusedStateVars',

Loading…
Cancel
Save