Skip to content

Commit

Permalink
Merge pull request #551 from crytic/dev-abi-decode-one-type
Browse files Browse the repository at this point in the history
Improve abi.decode support in case of single type to convert
  • Loading branch information
montyly authored Jul 22, 2020
2 parents 8ee5614 + 650e3ae commit 0b2b2f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions slither/slithir/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,10 @@ def convert_to_solidity_func(ir):
isinstance(new_ir.arguments[1], list)):
types = [x for x in new_ir.arguments[1]]
new_ir.lvalue.set_type(types)
# abi.decode where the type to decode is a singleton
# abi.decode(a, (uint))
elif call == SolidityFunction("abi.decode()") and len(new_ir.arguments) == 2:
new_ir.lvalue.set_type(new_ir.arguments[1])
else:
new_ir.lvalue.set_type(call.return_type)
return new_ir
Expand Down

0 comments on commit 0b2b2f6

Please sign in to comment.