From 5af174946a65e90397c877fbba14c71834bee0cb Mon Sep 17 00:00:00 2001 From: Josselin Date: Wed, 12 Aug 2020 13:24:09 +0200 Subject: [PATCH] Fix incorrect types to list conversion --- slither/slithir/convert.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/slither/slithir/convert.py b/slither/slithir/convert.py index 97c8171e7..d9ebb07fc 100644 --- a/slither/slithir/convert.py +++ b/slither/slithir/convert.py @@ -1040,6 +1040,29 @@ def _convert_to_structure_to_list(return_type: Type) -> List[Type]: for v in return_type.type.elems_ordered: ret += _convert_to_structure_to_list(v.type) return ret + # Mapping and arrays are not included in external call + # + # contract A{ + # + # struct St{ + # uint a; + # uint b; + # mapping(uint => uint) map; + # uint[] array; + # } + # + # mapping (uint => St) public st; + # + # } + # + # contract B{ + # + # function f(A a) public{ + # (uint a, uint b) = a.st(0); + # } + # } + if isinstance(return_type, (MappingType, ArrayType)): + return [] return [return_type.type]