|
|
@ -362,17 +362,20 @@ def convert_type_of_high_level_call(ir, contract): |
|
|
|
return_type = return_type[0] |
|
|
|
return_type = return_type[0] |
|
|
|
else: |
|
|
|
else: |
|
|
|
# otherwise its a variable (getter) |
|
|
|
# otherwise its a variable (getter) |
|
|
|
if isinstance(func.type, MappingType): |
|
|
|
# If its a mapping or a array |
|
|
|
# iterate over the lenght of arguments |
|
|
|
# we iterate until we find the final type |
|
|
|
|
|
|
|
# mapping and array can be mixed together |
|
|
|
# ex: |
|
|
|
# ex: |
|
|
|
# mapping ( uint => mapping ( uint => uint)) my_var |
|
|
|
# mapping ( uint => mapping ( uint => uint)) my_var |
|
|
|
# is accessed through contract.my_var(0,0) |
|
|
|
# mapping(uint => uint)[] test;p |
|
|
|
|
|
|
|
if isinstance(func.type, (MappingType, ArrayType)): |
|
|
|
tmp = func.type |
|
|
|
tmp = func.type |
|
|
|
for _ in range(len(ir.arguments)): |
|
|
|
while isinstance(tmp, (MappingType, ArrayType)): |
|
|
|
|
|
|
|
if isinstance(tmp, MappingType): |
|
|
|
tmp = tmp.type_to |
|
|
|
tmp = tmp.type_to |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
tmp = tmp.type |
|
|
|
return_type = tmp |
|
|
|
return_type = tmp |
|
|
|
elif isinstance(func.type, ArrayType): |
|
|
|
|
|
|
|
return_type = func.type.type |
|
|
|
|
|
|
|
else: |
|
|
|
else: |
|
|
|
return_type = func.type |
|
|
|
return_type = func.type |
|
|
|
if return_type: |
|
|
|
if return_type: |
|
|
|