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

[Bug-Candidate]: ParsingError: Type not found struct Checkpoints.Trace208 in Slither Analysis #2504

Closed
roisindowling opened this issue Jul 10, 2024 · 2 comments
Labels
bug-candidate Bugs reports that are not yet confirmed

Comments

@roisindowling
Copy link

Describe the issue:

When running Slither on our smart contracts, we encounter a ParsingError indicating that the type Checkpoints.Trace208 cannot be found. This prevents Slither from running as expected. Checkpoints.Trace208 is defined in the code and slither was working fine on smart contracts that were Checkpoints.Trace208 until we added some new smart contracts and increases the size of our repo.

Code example to reproduce the issue:

https://github.com/vechain/vebetterdao-contracts

Version:

0.10.0

Relevant log output:

roisindowling@Roisins-MacBook-Pro vebetterdao-contracts % slither .                                        
'npx hardhat clean' running (wd: /Users/roisindowling/Desktop/Code/vebetterdao-contracts)
'npx hardhat clean --global' running (wd: /Users/roisindowling/Desktop/Code/vebetterdao-contracts)
Problem executing hardhat: WARNING: You are currently using Node.js v21.1.0, which is not supported by Hardhat. This can lead to unexpected behavior. See https://hardhat.org/nodejs-versions

'npx hardhat compile --force' running (wd: /Users/roisindowling/Desktop/Code/vebetterdao-contracts)
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/slither/__main__.py", line 833, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/slither/__main__.py", line 107, in process_all
    ) = process_single(compilation, args, detector_classes, printer_classes)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/slither/__main__.py", line 80, in process_single
    slither = Slither(target, ast_format=ast, **vars(args))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/slither/slither.py", line 144, in __init__
    self._init_parsing_and_analyses(kwargs.get("skip_analyze", False))
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/slither/slither.py", line 154, in _init_parsing_and_analyses
    raise e
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/slither/slither.py", line 150, in _init_parsing_and_analyses
    parser.parse_contracts()
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 525, in parse_contracts
    self._analyze_second_part(contracts_to_be_analyzed, libraries)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 612, in _analyze_second_part
    self._analyze_struct_events(contract)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 685, in _analyze_struct_events
    contract.analyze_structs()
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/slither/solc_parsing/declarations/contract.py", line 736, in analyze_structs
    self._analyze_struct(struct)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/slither/solc_parsing/declarations/contract.py", line 731, in _analyze_struct
    struct.analyze()
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/slither/solc_parsing/declarations/structure_contract.py", line 55, in analyze
    elem_parser.analyze(self._contract_parser)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/slither/solc_parsing/variables/variable_declaration.py", line 212, in analyze
    self._variable.type = parse_type(self._elem_to_parse, caller_context)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/slither/solc_parsing/solidity_types/type_parsing.py", line 444, in parse_type
    mappingTo = parse_type(t["valueType"], next_context)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/slither/solc_parsing/solidity_types/type_parsing.py", line 371, in parse_type
    type_found = _find_from_type_name(
                 ^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/slither/solc_parsing/solidity_types/type_parsing.py", line 194, in _find_from_type_name
    raise ParsingError("Type not found " + str(name))
slither.solc_parsing.exceptions.ParsingError: Type not found struct Checkpoints.Trace208
ERROR:root:Error:
ERROR:root:Type not found struct Checkpoints.Trace208
ERROR:root:Please report an issue to https://github.com/crytic/slither/issues
@roisindowling roisindowling added the bug-candidate Bugs reports that are not yet confirmed label Jul 10, 2024
@0xalpharush
Copy link
Contributor

Can you confirm this is still an issue on the latest version please?

@roisindowling
Copy link
Author

Just checked with latest version not an issue. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-candidate Bugs reports that are not yet confirmed
Projects
None yet
Development

No branches or pull requests

2 participants