From 90b2f6ed8d9f2fc5c47bf7cc32cc3a053c866864 Mon Sep 17 00:00:00 2001 From: Josselin Date: Wed, 24 Oct 2018 19:50:24 +0100 Subject: [PATCH] Compact AST: Better support for state mutability --- slither/solc_parsing/declarations/function.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/slither/solc_parsing/declarations/function.py b/slither/solc_parsing/declarations/function.py index cf3fed8f0..e8e7f4ba4 100644 --- a/slither/solc_parsing/declarations/function.py +++ b/slither/solc_parsing/declarations/function.py @@ -61,12 +61,14 @@ class FunctionSolc(Function): if 'payable' in attributes: self._payable = attributes['payable'] - elif 'stateMutability' in attributes: + if 'stateMutability' in attributes: if attributes['stateMutability'] == 'payable': self._payable = True elif attributes['stateMutability'] == 'pure': self._pure = True self._view = True + elif attributes['stateMutability'] == 'view': + self._view = True if 'constant' in attributes: self._view = attributes['constant']