Updates to inheritance_analysis.py's detect_function_shadowing to not include c3 collisions which end up neutralized by later inheriting contracts in a multi-inheritance scheme.

pull/166/head
David Pokora 6 years ago
parent 1f81f820a8
commit 019d3da211
No known key found for this signature in database
GPG Key ID: 3CED48D1BB21BDD7
  1. 5
      slither/utils/inheritance_analysis.py

@ -102,7 +102,8 @@ class InheritanceAnalysis:
shadows = InheritanceAnalysis.detect_c3_function_shadowing(contract)
for colliding_functions in shadows:
for i in range(0, len(colliding_functions) - 1):
results.add((colliding_functions[i + 1][0], colliding_functions[i + 1][1],
colliding_functions[i][0], colliding_functions[i][1]))
if colliding_functions[i][1] != colliding_functions[-1][1]:
results.add((colliding_functions[-1][0], colliding_functions[-1][1],
colliding_functions[i][0], colliding_functions[i][1]))
return results

Loading…
Cancel
Save