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]: Slither crashes running slither . --print variable-order in solmate #1182

Closed
transmissions11 opened this issue Apr 21, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@transmissions11
Copy link

Describe the issue:

Running slither . --print variable-order in Solmate (a foundry project) crashes with an error about "KeyError: 'ERC20.decimals'"

https://github.com/rari-Capital/solmate

Code example to reproduce the issue:

slither . --print variable-order  

Version:

λ slither --version
0.8.3

Relevant log output:

λ slither . --print variable-order
'forge build --extra-output abi --extra-output userdoc --extra-output devdoc --extra-output evm.methodIdentifiers --force' running
Compiling 53 files with 0.8.10
Compiler run successful (with warnings)

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/__main__.py", line 744, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/__main__.py", line 87, in process_all
    ) = process_single(compilation, args, detector_classes, printer_classes)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/__main__.py", line 72, in process_single
    return _process(slither, detector_classes, printer_classes)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/__main__.py", line 119, in _process
    printer_results = slither.run_printers()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/slither.py", line 211, in run_printers
    return [p.output(self._crytic_compile.target).data for p in self._printers]
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/slither.py", line 211, in <listcomp>
    return [p.output(self._crytic_compile.target).data for p in self._printers]
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/printers/summary/variable_order.py", line 32, in output
    slot, offset = contract.compilation_unit.storage_layout_of(contract, variable)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/core/compilation_unit.py", line 277, in storage_layout_of
    return self._storage_layouts[contract.name][var.canonical_name]
KeyError: 'ERC20.decimals'
None
Error in .
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/__main__.py", line 744, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/__main__.py", line 87, in process_all
    ) = process_single(compilation, args, detector_classes, printer_classes)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/__main__.py", line 72, in process_single
    return _process(slither, detector_classes, printer_classes)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/__main__.py", line 119, in _process
    printer_results = slither.run_printers()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/slither.py", line 211, in run_printers
    return [p.output(self._crytic_compile.target).data for p in self._printers]
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/slither.py", line 211, in <listcomp>
    return [p.output(self._crytic_compile.target).data for p in self._printers]
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/printers/summary/variable_order.py", line 32, in output
    slot, offset = contract.compilation_unit.storage_layout_of(contract, variable)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/core/compilation_unit.py", line 277, in storage_layout_of
    return self._storage_layouts[contract.name][var.canonical_name]
KeyError: 'ERC20.decimals'
@transmissions11 transmissions11 added the bug-candidate Bugs reports that are not yet confirmed label Apr 21, 2022
@brockelmore
Copy link

Doesn't seem to be foundry specific as a slither . --print variable-order --compile-force-framework dapp also fails in a same manner

@0xalpharush 0xalpharush changed the title [Bug-Candidate]: Slither crashes running slither . --print variable-order in solmate [Bug]: Slither crashes running slither . --print variable-order in solmate Apr 21, 2022
@0xalpharush 0xalpharush added bug Something isn't working and removed bug-candidate Bugs reports that are not yet confirmed labels Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants