Incorrect ERC detectors: iterate over contracts_derived to avoid dupplicate

pull/231/head
Josselin 6 years ago
parent 0424889d0a
commit 024ddef7f2
  1. 5
      slither/detectors/erc/incorrect_erc20_interface.py
  2. 5
      slither/detectors/erc/incorrect_erc721_interface.py

@ -70,7 +70,8 @@ contract Token{
if contract.is_possible_erc721():
return []
functions = [f for f in contract.functions if IncorrectERC20InterfaceDetection.incorrect_erc20_interface(f.signature)]
funcs = contract.functions
functions = [f for f in funcs if IncorrectERC20InterfaceDetection.incorrect_erc20_interface(f.signature)]
return functions
def _detect(self):
@ -80,7 +81,7 @@ contract Token{
dict: [contract name] = set(str) events
"""
results = []
for c in self.contracts:
for c in self.slither.contracts_derived:
functions = IncorrectERC20InterfaceDetection.detect_incorrect_erc20_interface(c)
if functions:
info = "{} ({}) has incorrect ERC20 function interface(s):\n"

@ -71,7 +71,8 @@ contract Token{
if not contract.is_possible_erc721() or not contract.is_possible_erc20():
return []
functions = [f for f in contract.functions if IncorrectERC721InterfaceDetection.incorrect_erc721_interface(f.signature)]
funcs = contract.functions
functions = [f for f in funcs if IncorrectERC721InterfaceDetection.incorrect_erc721_interface(f.signature)]
return functions
def _detect(self):
@ -81,7 +82,7 @@ contract Token{
dict: [contract name] = set(str) events
"""
results = []
for c in self.contracts:
for c in self.slither.contracts_derived:
functions = IncorrectERC721InterfaceDetection.detect_incorrect_erc721_interface(c)
if functions:
info = "{} ({}) has incorrect ERC721 function interface(s):\n"

Loading…
Cancel
Save