From 019d3da211c371d97f185f4d6b1c01abd5b3f252 Mon Sep 17 00:00:00 2001 From: David Pokora Date: Wed, 6 Feb 2019 13:19:57 -0500 Subject: [PATCH] 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. --- slither/utils/inheritance_analysis.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/slither/utils/inheritance_analysis.py b/slither/utils/inheritance_analysis.py index 1173dbe53..95d15879f 100644 --- a/slither/utils/inheritance_analysis.py +++ b/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