Consensys / pythx

A Python library for the MythX smart contract security analysis platform
MIT License
32 stars 8 forks source link

`pythx truffle` failed to display the result #77

Closed shayanb closed 5 years ago

shayanb commented 5 years ago

Description

Ran pythx truffle on a truffle package, everything seems to be done and I can see the analysis result on Mythx dashboard, but pythx is failing to show the report. The same happens if I run pythx report *UUID*.

What I Did

🍺  pythx report 8646092c****

Traceback (most recent call last):
  File ".pyenv/versions/3.7.0/bin/pythx", line 10, in <module>
    sys.exit(cli())
  File ".pyenv/versions/3.7.0/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File ".pyenv/versions/3.7.0/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File ".pyenv/versions/3.7.0/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File ".pyenv/versions/3.7.0/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File ".pyenv/versions/3.7.0/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File ".pyenv/versions/3.7.0/lib/python3.7/site-packages/pythx/cli/main.py", line 369, in truffle
    utils.echo_report_as_table(c.report(uuid))
  File ".pyenv/versions/3.7.0/lib/python3.7/site-packages/pythx/cli/utils.py", line 206, in echo_report_as_table
    source_locs = [loc.source_map.split(":") for loc in issue.locations]
  File ".pyenv/versions/3.7.0/lib/python3.7/site-packages/pythx/cli/utils.py", line 206, in <listcomp>
    source_locs = [loc.source_map.split(":") for loc in issue.locations]
AttributeError: 'SourceMap' object has no attribute 'split'
dmuhs commented 5 years ago

:wave: Hey Shayan! The PythX CLI is outdated. It was initially meant as a PoC to display how PythX could be used in a CLI setting. I have gotten quite a bit of feedback and built a CLI version that goes beyong a PoC: https://github.com/dmuhs/mythx-cli/

The PythX CLI will be removed in future versions to avoid confusion. :slightly_smiling_face:

shayanb commented 5 years ago

@dmuhs Please update the documentation then. That was the pointer that led me to Pythx.

https://docs.mythx.io/en/latest/tools/index.html#current-tools