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']