def _detect(self):
        """ Detect shadowing of built-in symbols

        Recursively visit the calls
        Returns:
            list: {'vuln', 'filename,'contract','func', 'shadow'}

        """

        results = []
        for contract in self.contracts:
            shadows = self.detect_builtin_shadowing_definitions(contract)
            if shadows:
                for shadow in shadows:
                    # Obtain components
                    shadow_type = shadow[0]
                    shadow_object = shadow[1]
                    local_variable_parent = shadow[2]

                    # Build the path for our info string
                    local_variable_path = contract.name + "."
                    if local_variable_parent is not None:
                        local_variable_path += local_variable_parent.name + "."
                    local_variable_path += shadow_object.name

                    info = '{} ({} @ {}) shadows built-in symbol \"{}"\n'.format(local_variable_path,
                                                                                 shadow_type,
                                                                                 shadow_object.source_mapping_str,
                                                                                 shadow_object.name)

                    # Generate relevant JSON data for this shadowing definition.
                    json = self.generate_json_result(info)
                    if shadow_type in [self.SHADOWING_FUNCTION, self.SHADOWING_MODIFIER, self.SHADOWING_EVENT]:
                        self.add_function_to_json(shadow_object, json)
                    elif shadow_type in [self.SHADOWING_STATE_VARIABLE, self.SHADOWING_LOCAL_VARIABLE]:
                        self.add_variable_to_json(shadow_object, json)
                    results.append(json)

        return results
def _detect ( self ) : results = [ ] for contract in self . contracts : shadows = self . detect_builtin_shadowing_definitions ( contract ) if shadows : for shadow in shadows : shadow_type = shadow [ 0 ] shadow_object = shadow [ 1 ] local_variable_parent = shadow [ 2 ] local_variable_path = contract . name + "." if local_variable_parent is not None : local_variable_path += local_variable_parent . name + "." local_variable_path += shadow_object . name info = '{} ({} @ {}) shadows built-in symbol \"{}"\n' . format ( local_variable_path , shadow_type , shadow_object . source_mapping_str , shadow_object . name ) json = self . generate_json_result ( info ) if shadow_type in [ self . SHADOWING_FUNCTION , self . SHADOWING_MODIFIER , self . SHADOWING_EVENT ] : self . add_function_to_json ( shadow_object , json ) elif shadow_type in [ self . SHADOWING_STATE_VARIABLE , self . SHADOWING_LOCAL_VARIABLE ] : self . add_variable_to_json ( shadow_object , json ) results . append ( json ) return results
Detect shadowing of built-in symbols

        Recursively visit the calls
        Returns:
            list: {'vuln', 'filename,'contract','func', 'shadow'}