Skip to content

Commit

Permalink
Merge pull request #598 from crytic/dev-abidecode
Browse files Browse the repository at this point in the history
Improve abi-decode support on user type
  • Loading branch information
montyly authored Aug 22, 2020
2 parents 4793cb1 + ee1d9ce commit 8133041
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion slither/slithir/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,10 @@ def convert_to_solidity_func(ir):
# If the variable is a referenceVariable, we are lost
# See https://github.com/crytic/slither/issues/566 for potential solutions
if not isinstance(new_ir.arguments[1], ReferenceVariable):
new_ir.lvalue.set_type(new_ir.arguments[1])
decode_type = new_ir.arguments[1]
if isinstance(decode_type, (Structure, Enum, Contract)):
decode_type = UserDefinedType(decode_type)
new_ir.lvalue.set_type(decode_type)
else:
new_ir.lvalue.set_type(call.return_type)
return new_ir
Expand Down

0 comments on commit 8133041

Please sign in to comment.