From ec309343a5e9c7dbf3ca5d4cc1dfb12b080da049 Mon Sep 17 00:00:00 2001 From: Simone Date: Mon, 17 Jul 2023 15:42:10 +0200 Subject: [PATCH] Fix abi.decode tuple result with udt --- slither/slithir/convert.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/slither/slithir/convert.py b/slither/slithir/convert.py index d40715c4f3..df9400c6a0 100644 --- a/slither/slithir/convert.py +++ b/slither/slithir/convert.py @@ -1210,7 +1210,12 @@ def convert_to_solidity_func( and len(new_ir.arguments) == 2 and isinstance(new_ir.arguments[1], list) ): - types = list(new_ir.arguments[1]) + types = [] + for arg_type in new_ir.arguments[1]: + decode_type = arg_type + if isinstance(decode_type, (Structure, Enum, Contract)): + decode_type = UserDefinedType(decode_type) + types.append(decode_type) new_ir.lvalue.set_type(types) # abi.decode where the type to decode is a singleton # abi.decode(a, (uint))