Add temporary support for abi.decode on complex type (temporary solution

until #566 is fixed)
pull/567/head
Josselin 4 years ago
parent 6aab6bd951
commit d791d105ec
  1. 5
      slither/slithir/convert.py

@ -812,7 +812,10 @@ def convert_to_solidity_func(ir):
# 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])
# 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])
else:
new_ir.lvalue.set_type(call.return_type)
return new_ir

Loading…
Cancel
Save