From c70f202138da0b889efba2f19e87e019c98ecebd Mon Sep 17 00:00:00 2001 From: Josselin Date: Wed, 5 Aug 2020 14:42:51 +0200 Subject: [PATCH] Improve support for type() (fix #547) --- slither/core/declarations/solidity_variables.py | 1 + slither/slithir/convert.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/slither/core/declarations/solidity_variables.py b/slither/core/declarations/solidity_variables.py index 3f493147df..7a645f5d3a 100644 --- a/slither/core/declarations/solidity_variables.py +++ b/slither/core/declarations/solidity_variables.py @@ -66,6 +66,7 @@ # abi.decode returns an a list arbitrary types "abi.decode()": [], "type(address)": [], + "type()": [], # 0.6.8 changed type(address) to type() } diff --git a/slither/slithir/convert.py b/slither/slithir/convert.py index e625a10b25..97c8171e75 100644 --- a/slither/slithir/convert.py +++ b/slither/slithir/convert.py @@ -581,7 +581,7 @@ def propagate_types(ir, node): elif isinstance(ir, Send): ir.lvalue.set_type(ElementaryType('bool')) elif isinstance(ir, SolidityCall): - if ir.function.name == 'type(address)': + if ir.function.name in ['type(address)', 'type()']: ir.function.return_type = [TypeInformation(ir.arguments[0])] return_type = ir.function.return_type if len(return_type) == 1: