Skip to content

Commit

Permalink
Merge pull request #2048 from crytic/dev-abidecode-tuple-udt
Browse files Browse the repository at this point in the history
Fix abi.decode tuple result with udt
montyly authored Oct 12, 2023
2 parents bc79bee + ec30934 commit 7bddbb6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion slither/slithir/convert.py
Original file line number Diff line number Diff line change
@@ -1294,7 +1294,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))

0 comments on commit 7bddbb6

Please sign in to comment.