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

--print variable-order throws error ('Slither' object has no attribute 'storage_layout_of') #915

Closed
transmissions11 opened this issue Aug 15, 2021 · 3 comments

Comments

@transmissions11
Copy link

Seeing this error ('Slither' object has no attribute 'storage_layout_of') when trying to print variable-order in a hardhat project:

❯ TS_NODE_TRANSPILE_ONLY=1 slither . --print variable-order
'npx hardhat compile --force' running
Compiling 22 files with 0.7.6
Generating typings for: 27 artifacts in dir: typechain for target: ethers-v5
Successfully generated 41 typings!
Compilation finished successfully

@openzeppelin/contracts/token/ERC20/ERC20.sol:55:5: Warning: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
    constructor (string memory name_, string memory symbol_) public {
    ^ (Relevant source part starts here and spans across multiple lines).


Traceback (most recent call last):
  File "/Library/Python/3.8/site-packages/slither/__main__.py", line 723, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
  File "/Library/Python/3.8/site-packages/slither/__main__.py", line 82, in process_all
    ) = process_single(compilation, args, detector_classes, printer_classes)
  File "/Library/Python/3.8/site-packages/slither/__main__.py", line 67, in process_single
    return _process(slither, detector_classes, printer_classes)
  File "/Library/Python/3.8/site-packages/slither/__main__.py", line 114, in _process
    printer_results = slither.run_printers()
  File "/Library/Python/3.8/site-packages/slither/slither.py", line 195, in run_printers
    return [p.output(self._crytic_compile.target).data for p in self._printers]
  File "/Library/Python/3.8/site-packages/slither/slither.py", line 195, in <listcomp>
    return [p.output(self._crytic_compile.target).data for p in self._printers]
  File "/Library/Python/3.8/site-packages/slither/printers/summary/variable_order.py", line 32, in output
    slot, offset = self.slither.storage_layout_of(contract, variable)
AttributeError: 'Slither' object has no attribute 'storage_layout_of'
ERROR:root:None
ERROR:root:Error in .
ERROR:root:Traceback (most recent call last):
  File "/Library/Python/3.8/site-packages/slither/__main__.py", line 723, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
  File "/Library/Python/3.8/site-packages/slither/__main__.py", line 82, in process_all
    ) = process_single(compilation, args, detector_classes, printer_classes)
  File "/Library/Python/3.8/site-packages/slither/__main__.py", line 67, in process_single
    return _process(slither, detector_classes, printer_classes)
  File "/Library/Python/3.8/site-packages/slither/__main__.py", line 114, in _process
    printer_results = slither.run_printers()
  File "/Library/Python/3.8/site-packages/slither/slither.py", line 195, in run_printers
    return [p.output(self._crytic_compile.target).data for p in self._printers]
  File "/Library/Python/3.8/site-packages/slither/slither.py", line 195, in <listcomp>
    return [p.output(self._crytic_compile.target).data for p in self._printers]
  File "/Library/Python/3.8/site-packages/slither/printers/summary/variable_order.py", line 32, in output
    slot, offset = self.slither.storage_layout_of(contract, variable)
AttributeError: 'Slither' object has no attribute 'storage_layout_of'
@transmissions11
Copy link
Author

transmissions11 commented Aug 15, 2021

this is on slither v0.8 btw

@montyly
Copy link
Member

montyly commented Aug 18, 2021

Hi @TransmissionsDev .

Thanks for reporting this. Can you try with slither 0.8.1? We released it yesterday, and I believe that we fixed this issue with #849

@transmissions11
Copy link
Author

yup fixed, thanks!

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