Merge pull request #2048 from crytic/dev-abidecode-tuple-udt

Fix abi.decode tuple result with udt
pull/2170/head
Feist Josselin 1 year ago committed by GitHub
commit 7bddbb60f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      slither/slithir/convert.py

@ -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))

Loading…
Cancel
Save