File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
slither/core/declarations Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1405,7 +1405,11 @@ def is_protected(self) -> bool:
1405
1405
"""
1406
1406
Determine if the function is protected using a check on msg.sender
1407
1407
1408
- Only detects if msg.sender is directly used in a condition
1408
+ Consider onlyOwner as a safe modifier.
1409
+ If the owner functionality is incorrectly implemented, this will lead to incorrectly
1410
+ classify the function as protected
1411
+
1412
+ Otherwise only detects if msg.sender is directly used in a condition
1409
1413
For example, it wont work for:
1410
1414
address a = msg.sender
1411
1415
require(a == owner)
@@ -1417,6 +1421,9 @@ def is_protected(self) -> bool:
1417
1421
if self .is_constructor :
1418
1422
self ._is_protected = True
1419
1423
return True
1424
+ if "onlyOwner" in [m .name for m in self .modifiers ]:
1425
+ self ._is_protected = True
1426
+ return True
1420
1427
conditional_vars = self .all_conditional_solidity_variables_read (include_loop = False )
1421
1428
args_vars = self .all_solidity_variables_used_as_args ()
1422
1429
self ._is_protected = (
You can’t perform that action at this time.
0 commit comments