Handle missing self.slither.solc_version

pull/380/head
Josselin 5 years ago
parent f4413c097e
commit a0b8ffcbd6
  1. 3
      slither/detectors/attributes/const_functions_asm.py
  2. 3
      slither/detectors/attributes/const_functions_state.py

@ -50,7 +50,8 @@ All the calls to `get` revert, breaking Bob's smart contract execution.'''
list: {'vuln', 'filename,'contract','func','#varsWritten'} list: {'vuln', 'filename,'contract','func','#varsWritten'}
""" """
results = [] results = []
if self.slither.solc_version < "0.5.0": if self.slither.solc_version and self.slither.solc_version >= "0.5.0":
return results
for c in self.contracts: for c in self.contracts:
for f in c.functions: for f in c.functions:
if f.contract_declarer != c: if f.contract_declarer != c:

@ -50,7 +50,8 @@ All the calls to `get` revert, breaking Bob's smart contract execution.'''
list: {'vuln', 'filename,'contract','func','#varsWritten'} list: {'vuln', 'filename,'contract','func','#varsWritten'}
""" """
results = [] results = []
if self.slither.solc_version < "0.5.0": if self.slither.solc_version and self.slither.solc_version >= "0.5.0":
return results
for c in self.contracts: for c in self.contracts:
for f in c.functions: for f in c.functions:
if f.contract_declarer != c: if f.contract_declarer != c:

Loading…
Cancel
Save