Zellic / solidity-parser

Solp is a Python library used for reading, parsing and analysis of Solidity source projects and contracts without a dependency on the solc compiler.
https://solp.zellic.io
GNU Affero General Public License v3.0
53 stars 2 forks source link

parsing issue with Exactly Protocol #1

Closed stong closed 1 year ago

stong commented 1 year ago
Traceback (most recent call last):
  File "/home/website/verafi/audit-drift/src/drifter.py", line 372, in <module>

    Drifter(json_content, args.nodelete, args.outdir, args.safe).run()
  File "/home/website/verafi/audit-drift/src/drifter.py", line 161, in init
    self.parse_projects()
  File "/home/website/verafi/audit-drift/src/drifter.py", line 244, in parse_projects
    address.diff = Differ(
  File "/home/website/verafi/audit-drift/src/main.py", line 420, in init

    self.contract_objects = ContractObjects(contract, project, repo_dir, no_delete, rerun)
  File "/home/website/verafi/audit-drift/src/main.py", line 233, in init

    self.collect_off_chain_objects()
  File "/home/website/verafi/audit-drift/src/main.py", line 263, in collect_off_chain_objects

    for obj in collect_top_level_objects(content, vers):
  File "/home/website/verafi/audit-drift/venv/lib/python3.10/site-packages/solidity_parser/collectors/collector.py", line 33, in collect_top_level_objects

    return TopLevelObjectCollectorV080().collect(stream)
  File "/home/website/verafi/audit-drift/venv/lib/python3.10/site-packages/solidity_parser/collectors/v080.py", line 64, in collect

    result.append(TopLevelObject(str(su.identifier().Identifier()), self.collect_lines(),
AttributeError: 
'list' object has no attribute 'Identifier'

Looks like we dont handle cases where there are more than one identifiers in the source unit