From 786148bdfc3f0c3a90a8c0d120e6c5a6b0470957 Mon Sep 17 00:00:00 2001 From: William E Bodell III Date: Thu, 15 Dec 2022 15:39:26 -0600 Subject: [PATCH] Fix `ExtraVariablesProxy` and by inheritance, also fix `ExtraVariablesNewContract`. This check was reporting too many variables, because it was starting at `idx = len(order2) - len(order1)`. So, if the new contract (or proxy) had 12 variables, and the original contract had 10, it was reporting every variable starting at `idx = 2`, whereas it should have only been reporting those starting at `idx = len(order1)`. --- slither/tools/upgradeability/checks/variables_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slither/tools/upgradeability/checks/variables_order.py b/slither/tools/upgradeability/checks/variables_order.py index 8e30d3c3f1..8404f1d251 100644 --- a/slither/tools/upgradeability/checks/variables_order.py +++ b/slither/tools/upgradeability/checks/variables_order.py @@ -236,7 +236,7 @@ def _check(self): if len(order2) <= len(order1): return [] - idx = len(order2) - len(order1) + idx = len(order1) while idx < len(order2): variable2 = order2[idx]