diff --git a/slither/solc_parsing/expressions/expression_parsing.py b/slither/solc_parsing/expressions/expression_parsing.py index c0ac0a1e2..1f79e8e75 100644 --- a/slither/solc_parsing/expressions/expression_parsing.py +++ b/slither/solc_parsing/expressions/expression_parsing.py @@ -240,30 +240,31 @@ def filter_name(value): def convert_subdenomination(value, sub): if sub is None: return value - value = int(value) + # to allow 0.1 ether conversion + value = float(value) if sub == 'wei': - return value + return int(value) if sub == 'szabo': - return value * int(1e12) + return int(value * int(1e12)) if sub == 'finney': - return value * int(1e15) + return int(value * int(1e15)) if sub == 'ether': - return value * int(1e18) + return int(value * int(1e18)) if sub == 'seconds': - return value + return int(value) if sub == 'minutes': - return value * 60 + return int(value * 60) if sub == 'hours': - return value * 60 * 60 + return int(value * 60 * 60) if sub == 'days': - return value * 60 * 60 * 24 + return int(value * 60 * 60 * 24) if sub == 'weeks': - return value * 60 * 60 * 24 * 7 + return int(value * 60 * 60 * 24 * 7) if sub == 'years': - return value * 60 * 60 * 24 * 7 * 365 + return int(value * 60 * 60 * 24 * 7 * 365) logger.error('Subdemoniation not found {}'.format(sub)) - return value + return int(value) def parse_expression(expression, caller_context): """