From 8a8424ea63aeba9e71d96aa1cef99ccac5f6e2c1 Mon Sep 17 00:00:00 2001 From: Josselin Date: Wed, 8 May 2019 07:06:04 +0100 Subject: [PATCH] Improve type deduction of Literal (old solc) --- slither/solc_parsing/expressions/expression_parsing.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/slither/solc_parsing/expressions/expression_parsing.py b/slither/solc_parsing/expressions/expression_parsing.py index 968ae446a..1de47a1d0 100644 --- a/slither/solc_parsing/expressions/expression_parsing.py +++ b/slither/solc_parsing/expressions/expression_parsing.py @@ -497,7 +497,12 @@ def parse_expression(expression, caller_context): value = '0x'+expression['attributes']['hexvalue'] type = expression['attributes']['type'] - if type.startswith('int_const '): + if type is None: + if value.isdecimal(): + type = ElementaryType('uint256') + else: + type = ElementaryType('string') + elif type.startswith('int_const '): type = ElementaryType('uint256') elif type.startswith('bool'): type = ElementaryType('bool')