Merge pull request #1040 from crytic/issue-929

fix issue-929, FP in dead-code detector
pull/1049/head
Feist Josselin 3 years ago committed by GitHub
commit 2b48b7b806
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      slither/detectors/functions/dead_code.py
  2. 4
      tests/detectors/dead-code/0.8.0/dead-code.sol

@ -68,6 +68,9 @@ contract Contract{
function.contract_declarer.is_from_dependency() function.contract_declarer.is_from_dependency()
): ):
continue continue
# Continue if the functon is not implemented because it means the contract is abstract
if not function.is_implemented:
continue
info = [function, " is never used and should be removed\n"] info = [function, " is never used and should be removed\n"]
res = self.generate_result(info) res = self.generate_result(info)
results.append(res) results.append(res)

@ -27,3 +27,7 @@ contract Test4 is Test2{
} }
} }
abstract contract Test5 {
function unused_but_abstract() internal virtual;
}

Loading…
Cancel
Save