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

Asks me to upgrade to solc 0.6.0 version when I already have it #1578

Closed
NoroMeb opened this issue Jan 10, 2023 · 5 comments
Closed

Asks me to upgrade to solc 0.6.0 version when I already have it #1578

NoroMeb opened this issue Jan 10, 2023 · 5 comments

Comments

@NoroMeb
Copy link

NoroMeb commented Jan 10, 2023

This following error drops when runninng slither . in my brownie project .

Traceback (most recent call last):
  File "C:\Users\Dell\AppData\Local\Programs\Python\Python310\lib\site-packages\slither\__main__.py", line 834, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
  File "C:\Users\Dell\AppData\Local\Programs\Python\Python310\lib\site-packages\slither\__main__.py", line 98, in process_all
    ) = process_single(compilation, args, detector_classes, printer_classes)
  File "C:\Users\Dell\AppData\Local\Programs\Python\Python310\lib\site-packages\slither\__main__.py", line 76, in process_single
    slither = Slither(target, ast_format=ast, **vars(args))
  File "C:\Users\Dell\AppData\Local\Programs\Python\Python310\lib\site-packages\slither\slither.py", line 112, in __init__
    parser.parse_top_level_from_loaded_json(ast, path)
  File "C:\Users\Dell\AppData\Local\Programs\Python\Python310\lib\site-packages\slither\solc_parsing\slither_compilation_unit_solc.py", line 263, in parse_top_level_from_loaded_json
    _handle_import_aliases(symbol_aliases, import_directive, scope)
  File "C:\Users\Dell\AppData\Local\Programs\Python\Python310\lib\site-packages\slither\solc_parsing\slither_compilation_unit_solc.py", line 64, in _handle_import_aliases
    raise SlitherException(
slither.exceptions.SlitherException: Cannot resolve local alias for import directive due to malformed AST. Please upgrade to solc 0.6.0 or higher.
Error:
Cannot resolve local alias for import directive due to malformed AST. Please upgrade to solc 0.6.0 or higher.
Please report an issue to https://github.com/crytic/slither/issues

And when i want to install solc '0.6.0' it says that i already have it :

>>> from brownie.project.compiler import install_solc
>>> install_solc("0.6.0")
solc 0.6.0 already installed at: C:\Users\Dell\.solcx\solc-v0.6.0
@0xalpharush
Copy link
Contributor

0xalpharush commented Jan 10, 2023

You may have it installed but what solidity version are you using to compile your project? This is related to #1319 where the compiler does not provide enough info for versions 0.5.12 and needs to be upgraded.

@NoroMeb
Copy link
Author

NoroMeb commented Jan 10, 2023

@0xalpharush im using 0.8.14 version.

@0xalpharush
Copy link
Contributor

What branch did you install slither from?

@NoroMeb
Copy link
Author

NoroMeb commented Jan 10, 2023

I found that i use mutiple .sol files with different compiler versions and one of them was 0.4.11, my bad sorry .

@NoroMeb NoroMeb closed this as completed Jan 10, 2023
@0xalpharush
Copy link
Contributor

0xalpharush commented Jan 10, 2023

If it's difficult to upgrade, you can also try using imports like import {Foo} from "bar.sol"; for the older versions. AFAIK, it will only not work if an alias like import {Foo as Other} from "bar.sol"; is used in these older compiler versions.

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

2 participants