|
|
|
@ -1500,10 +1500,13 @@ class Function(SourceMapping, metaclass=ABCMeta): # pylint: disable=too-many-pu |
|
|
|
|
""" |
|
|
|
|
Determine if the function can be re-entered |
|
|
|
|
""" |
|
|
|
|
reentrancy_modifier = "nonReentrant" |
|
|
|
|
|
|
|
|
|
if self.function_language == FunctionLanguage.Vyper: |
|
|
|
|
reentrancy_modifier = "nonreentrant(lock)" |
|
|
|
|
|
|
|
|
|
# TODO: compare with hash of known nonReentrant modifier instead of the name |
|
|
|
|
if "nonReentrant" in [m.name for m in self.modifiers] or "nonreentrant(lock)" in [ |
|
|
|
|
m.name for m in self.modifiers |
|
|
|
|
]: |
|
|
|
|
if reentrancy_modifier in [m.name for m in self.modifiers]: |
|
|
|
|
return False |
|
|
|
|
|
|
|
|
|
if self.visibility in ["public", "external"]: |
|
|
|
@ -1515,7 +1518,9 @@ class Function(SourceMapping, metaclass=ABCMeta): # pylint: disable=too-many-pu |
|
|
|
|
] |
|
|
|
|
if not all_entry_points: |
|
|
|
|
return True |
|
|
|
|
return not all(("nonReentrant" in [m.name for m in f.modifiers] for f in all_entry_points)) |
|
|
|
|
return not all( |
|
|
|
|
(reentrancy_modifier in [m.name for m in f.modifiers] for f in all_entry_points) |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
# endregion |
|
|
|
|
################################################################################### |
|
|
|
|