Handle custom upgradeability comments

for contract definition
pull/1517/head
webthethird 2 years ago
parent 5314d7653a
commit 2cbbb706ac
  1. 10
      slither/solc_parsing/declarations/contract.py

@ -699,6 +699,16 @@ class ContractSolc(CallerContextExpression):
self._usingForNotParsed = [] self._usingForNotParsed = []
self._customErrorParsed = [] self._customErrorParsed = []
def _handle_comment(self, attributes: Dict):
if "documentation" in attributes and "text" in attributes["documentation"]:
candidates = attributes["documentation"]["text"].replace("\n", ",").split(",")
for candidate in candidates:
if "@custom:security isProxy" in candidate:
self._contract._is_upgradeable_proxy = True
if "@custom:security isUpgradeable" in candidate:
self._contract._is_upgradeable = True
# endregion # endregion
################################################################################### ###################################################################################
################################################################################### ###################################################################################

Loading…
Cancel
Save