Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:crytic/slither into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
montyly committed Apr 24, 2020
2 parents e24624f + 9be9ad8 commit 03713a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion slither/detectors/shadowing/builtin_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class BuiltinSymbolShadowing(AbstractDetector):
BUILTIN_SYMBOLS = ["assert", "require", "revert", "block", "blockhash",
"gasleft", "msg", "now", "tx", "this", "addmod", "mulmod",
"keccak256", "sha256", "sha3", "ripemd160", "ecrecover",
"selfdestruct", "suicide", "abi"]
"selfdestruct", "suicide", "abi", "fallback", "receive"]

# https://solidity.readthedocs.io/en/v0.5.2/miscellaneous.html#reserved-keywords
RESERVED_KEYWORDS = ['abstract', 'after', 'alias', 'apply', 'auto', 'case', 'catch', 'copyof',
Expand Down Expand Up @@ -92,6 +92,8 @@ def detect_builtin_shadowing_definitions(self, contract):
# Loop through all functions, modifiers, variables (state and local) to detect any built-in symbol keywords.
for function in contract.functions_declared:
if self.is_builtin_symbol(function.name):
if function.is_fallback or function.is_receive:
continue
result.append((self.SHADOWING_FUNCTION, function))
result += self.detect_builtin_shadowing_locals(function)
for modifier in contract.modifiers_declared:
Expand Down

0 comments on commit 03713a5

Please sign in to comment.