From 26f80cfcf03c6a2f371d06e6cf178e04bfbf7691 Mon Sep 17 00:00:00 2001 From: webthethird Date: Fri, 17 Mar 2023 09:53:50 -0500 Subject: [PATCH] Use `Contract.fallback_function` --- slither/utils/upgradeability.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/slither/utils/upgradeability.py b/slither/utils/upgradeability.py index f94813876..cefc0868c 100644 --- a/slither/utils/upgradeability.py +++ b/slither/utils/upgradeability.py @@ -350,8 +350,7 @@ def get_proxy_implementation_var(proxy: Contract) -> Optional[Variable]: Returns: (`Variable`) | None : The variable, ideally a StateVariable, which stores the proxy's implementation address. """ - available_functions = proxy.available_functions_as_dict() - if not proxy.is_upgradeable_proxy or not available_functions["fallback()"]: + if not proxy.is_upgradeable_proxy or not proxy.fallback_function: return None delegate = find_delegate_in_fallback(proxy) @@ -375,7 +374,7 @@ def find_delegate_in_fallback(proxy: Contract) -> Optional[Variable]: (`Variable`) | None : The variable being passed as the destination argument in a delegatecall in the fallback. """ delegate: Optional[Variable] = None - fallback = proxy.available_functions_as_dict()["fallback()"] + fallback = proxy.fallback_function for node in fallback.all_nodes(): for ir in node.irs: if isinstance(ir, LowLevelCall) and ir.function_name == "delegatecall":