prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Bug in function-id printer
  Hi there! There is an issue connected to `function-id` printer that I faced:
  
  when you create a dynamic array with `public` visibility modifier compiler automatically generates a getter-function with `uint256` input parameter. However, Slither thinks that the getter has no input parameters. Thus, the wrong function signature is printed in the output.
  
  Here is a small example.
  
  ```
  pragma solidity 0.5.7;
  
  contract Example {
      uint256[] public example;
  }
  ```
  
  Slither outputs the following table: 
  
  ```
  +-----------+------------+
  |    Name   |     ID     |
  +-----------+------------+
  | example() | 0x54353f2f |
  +-----------+------------+
  ```
  
  However, the real `example()` function's signature is `0x477e4a02` in the example.
  
  </issue>
  <code>
  [start of slither/printers/summary/function_ids.py]
  1 """
  2     Module printing summary of the contract
  3 """
  4 import collections
  5 from prettytable import PrettyTable
  6 from slither.printers.abstract_printer import AbstractPrinter
  7 from slither.utils.colors import blue, green, magenta
  8 from slither.utils.function import get_function_id
  9 
  10 class FunctionIds(AbstractPrinter):
  11 
  12     ARGUMENT = 'function-id'
  13     HELP = 'Print the keccack256 signature of the functions'
  14 
  15     WIKI = 'https://github.com/trailofbits/slither/wiki/Printer-documentation#function-id'
  16 
  17     def output(self, _filename):
  18         """
  19             _filename is not used
  20             Args:
  21                 _filename(string)
  22         """
  23 
  24         txt = ''
  25         for contract in self.slither.contracts_derived:
  26             txt += '\n{}:\n'.format(contract.name)
  27             table = PrettyTable(['Name', 'ID'])
  28             for function in contract.functions:
  29                 if function.visibility in ['public', 'external']:
  30                     table.add_row([function.full_name, hex(get_function_id(function.full_name))])
  31             for variable in contract.state_variables:
  32                 if variable.visibility in ['public']:
  33                     table.add_row([variable.name+'()', hex(get_function_id(variable.name+'()'))])
  34             txt += str(table) + '\n'
  35 
  36         self.info(txt)
  37
  [end of slither/printers/summary/function_ids.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/slither/printers/summary/function_ids.py b/slither/printers/summary/function_ids.py
  --- a/slither/printers/summary/function_ids.py
  +++ b/slither/printers/summary/function_ids.py
  @@ -3,6 +3,8 @@
   """
   import collections
   from prettytable import PrettyTable
  +
  +from slither.core.solidity_types import ArrayType, MappingType
   from slither.printers.abstract_printer import AbstractPrinter
   from slither.utils.colors import blue, green, magenta
   from slither.utils.function import get_function_id
  @@ -30,7 +32,18 @@
                       table.add_row([function.full_name, hex(get_function_id(function.full_name))])
               for variable in contract.state_variables:
                   if variable.visibility in ['public']:
  -                    table.add_row([variable.name+'()', hex(get_function_id(variable.name+'()'))])
  +                    variable_getter_args = ""
  +                    if type(variable.type) is ArrayType:
  +                        length = 0
  +                        v = variable
  +                        while type(v.type) is ArrayType:
  +                            length += 1
  +                            v = v.type
  +                        variable_getter_args = ','.join(["uint256"]*length)
  +                    elif type(variable.type) is MappingType:
  +                        variable_getter_args = variable.type.type_from
  +
  +                    table.add_row([f"{variable.name}({variable_getter_args})", hex(get_function_id(f"{variable.name}({variable_getter_args})"))])
               txt += str(table) + '\n'
   
           self.info(txt)
  
verification_info: {"golden_diff": "diff --git a/slither/printers/summary/function_ids.py b/slither/printers/summary/function_ids.py\n--- a/slither/printers/summary/function_ids.py\n+++ b/slither/printers/summary/function_ids.py\n@@ -3,6 +3,8 @@\n \"\"\"\n import collections\n from prettytable import PrettyTable\n+\n+from slither.core.solidity_types import ArrayType, MappingType\n from slither.printers.abstract_printer import AbstractPrinter\n from slither.utils.colors import blue, green, magenta\n from slither.utils.function import get_function_id\n@@ -30,7 +32,18 @@\n                     table.add_row([function.full_name, hex(get_function_id(function.full_name))])\n             for variable in contract.state_variables:\n                 if variable.visibility in ['public']:\n-                    table.add_row([variable.name+'()', hex(get_function_id(variable.name+'()'))])\n+                    variable_getter_args = \"\"\n+                    if type(variable.type) is ArrayType:\n+                        length = 0\n+                        v = variable\n+                        while type(v.type) is ArrayType:\n+                            length += 1\n+                            v = v.type\n+                        variable_getter_args = ','.join([\"uint256\"]*length)\n+                    elif type(variable.type) is MappingType:\n+                        variable_getter_args = variable.type.type_from\n+\n+                    table.add_row([f\"{variable.name}({variable_getter_args})\", hex(get_function_id(f\"{variable.name}({variable_getter_args})\"))])\n             txt += str(table) + '\\n'\n \n         self.info(txt)\n", "issue": "Bug in function-id printer\nHi there! There is an issue connected to `function-id` printer that I faced:\r\n\r\nwhen you create a dynamic array with `public` visibility modifier compiler automatically generates a getter-function with `uint256` input parameter. However, Slither thinks that the getter has no input parameters. Thus, the wrong function signature is printed in the output.\r\n\r\nHere is a small example.\r\n\r\n```\r\npragma solidity 0.5.7;\r\n\r\ncontract Example {\r\n    uint256[] public example;\r\n}\r\n```\r\n\r\nSlither outputs the following table: \r\n\r\n```\r\n+-----------+------------+\r\n|    Name   |     ID     |\r\n+-----------+------------+\r\n| example() | 0x54353f2f |\r\n+-----------+------------+\r\n```\r\n\r\nHowever, the real `example()` function's signature is `0x477e4a02` in the example.\n", "before_files": [{"content": "\"\"\"\n    Module printing summary of the contract\n\"\"\"\nimport collections\nfrom prettytable import PrettyTable\nfrom slither.printers.abstract_printer import AbstractPrinter\nfrom slither.utils.colors import blue, green, magenta\nfrom slither.utils.function import get_function_id\n\nclass FunctionIds(AbstractPrinter):\n\n    ARGUMENT = 'function-id'\n    HELP = 'Print the keccack256 signature of the functions'\n\n    WIKI = 'https://github.com/trailofbits/slither/wiki/Printer-documentation#function-id'\n\n    def output(self, _filename):\n        \"\"\"\n            _filename is not used\n            Args:\n                _filename(string)\n        \"\"\"\n\n        txt = ''\n        for contract in self.slither.contracts_derived:\n            txt += '\\n{}:\\n'.format(contract.name)\n            table = PrettyTable(['Name', 'ID'])\n            for function in contract.functions:\n                if function.visibility in ['public', 'external']:\n                    table.add_row([function.full_name, hex(get_function_id(function.full_name))])\n            for variable in contract.state_variables:\n                if variable.visibility in ['public']:\n                    table.add_row([variable.name+'()', hex(get_function_id(variable.name+'()'))])\n            txt += str(table) + '\\n'\n\n        self.info(txt)\n", "path": "slither/printers/summary/function_ids.py"}]}