Skip to content

Commit

Permalink
Merge pull request #569 from crytic/dev-type
Browse files Browse the repository at this point in the history
Improve support for type()
  • Loading branch information
montyly authored Aug 5, 2020
2 parents 97b775e + c70f202 commit f90eb65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions slither/core/declarations/solidity_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}


Expand Down
2 changes: 1 addition & 1 deletion slither/slithir/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f90eb65

Please sign in to comment.