Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse_standard_json_output shall skip filename verification #495

Open
shouc opened this issue Sep 2, 2023 · 0 comments
Open

parse_standard_json_output shall skip filename verification #495

shouc opened this issue Sep 2, 2023 · 0 comments

Comments

@shouc
Copy link

shouc commented Sep 2, 2023

When trying to compile a solc JSON input, crytic-compile tries to verify all filename inside JSON. However, most of the time, when we use parse_standard_json_output, the file does not really exist. Is it possible to skip filename verification?

from crytic_compile.platform.solc_standard_json import SolcStandardJson
a = SolcStandardJson("slither/compiler.json")
from crytic_compile import CryticCompile
CryticCompile(a)

=>

Traceback (most recent call last):
  File "/Users/shou/PycharmProjects/slither/venv/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 554, in _compile
    self._platform.compile(self, **kwargs)
  File "/Users/shou/PycharmProjects/slither/venv/lib/python3.9/site-packages/crytic_compile/platform/solc_standard_json.py", line 469, in compile
    parse_standard_json_output(
  File "/Users/shou/PycharmProjects/slither/venv/lib/python3.9/site-packages/crytic_compile/platform/solc_standard_json.py", line 309, in parse_standard_json_output
    path = convert_filename(
  File "/Users/shou/PycharmProjects/slither/venv/lib/python3.9/site-packages/crytic_compile/utils/naming.py", line 169, in convert_filename
    filename = _verify_filename_existence(filename, cwd)
  File "/Users/shou/PycharmProjects/slither/venv/lib/python3.9/site-packages/crytic_compile/utils/naming.py", line 119, in _verify_filename_existence
    raise InvalidCompilation(f"Unknown file: {filename}")
crytic_compile.platform.exceptions.InvalidCompilation: Unknown file: main.sol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant