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

Running evm printer results in "AttributeError: 'Contract' object has no attribute 'scope'" #1668

Closed
S3v3ru5 opened this issue Feb 17, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@S3v3ru5
Copy link

S3v3ru5 commented Feb 17, 2023

Describe the issue:

Slither fails with AttributeError when the evm printer is used.

Additional: Running evm printer requires evm-cfg-builder. evm-cfg-builder is not listed as a dependency in setup.py. Maybe we can include it as a dependency or as an optional "printer" dependency.

Code example to reproduce the issue:

// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.8.17;

contract Storage {

    function check(address a, address b, uint256 c) public view returns (address, address, uint256) {
        return (a, b, c);
    }

    fallback() external {

    }
}

Version:

0.9.2

Relevant log output:

File "/Users/vara/tob/Slither/venv/lib/python3.9/site-packages/slither/__main__.py", line 834, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
  File "/Users/vara/tob/Slither/venv/lib/python3.9/site-packages/slither/__main__.py", line 98, in process_all
    ) = process_single(compilation, args, detector_classes, printer_classes)
  File "/Users/vara/tob/Slither/venv/lib/python3.9/site-packages/slither/__main__.py", line 78, in process_single
    return _process(slither, detector_classes, printer_classes)
  File "/Users/vara/tob/Slither/venv/lib/python3.9/site-packages/slither/__main__.py", line 134, in _process
    printer_results = slither.run_printers()
  File "/Users/vara/tob/Slither/venv/lib/python3.9/site-packages/slither/slither.py", line 214, in run_printers
    return [p.output(self._crytic_compile.target).data for p in self._printers]
  File "/Users/vara/tob/Slither/venv/lib/python3.9/site-packages/slither/slither.py", line 214, in <listcomp>
    return [p.output(self._crytic_compile.target).data for p in self._printers]
  File "/Users/vara/tob/Slither/venv/lib/python3.9/site-packages/slither/printers/summary/evm.py", line 70, in output
    evm_info = _extract_evm_info(self.slither)
  File "/Users/vara/tob/Slither/venv/lib/python3.9/site-packages/slither/printers/summary/evm.py", line 24, in _extract_evm_info
    contract_bytecode_runtime = contract.scope.bytecode_runtime(contract.name)
AttributeError: 'Contract' object has no attribute 'scope'
@S3v3ru5 S3v3ru5 added the bug-candidate Bugs reports that are not yet confirmed label Feb 17, 2023
@0xalpharush 0xalpharush added bug Something isn't working and removed bug-candidate Bugs reports that are not yet confirmed labels Feb 24, 2023
@0xalpharush
Copy link
Contributor

Closed by #1765

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

2 participants