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]: EVM printer fails for Abstract Contracts #2430

Closed
DarkaMaul opened this issue Apr 17, 2024 · 0 comments
Closed

[Bug]: EVM printer fails for Abstract Contracts #2430

DarkaMaul opened this issue Apr 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@DarkaMaul
Copy link
Contributor

Describe the issue:

If slither is runned with slither --print evm contract.sol where contract.sol is an abstract contract, it will fail with the following error:

➜ slither --print evm contract.sol


  File "/Users/dm/Projects/slither/slither/__main__.py", line 143, in _process
    printer_results = slither.run_printers()
                      ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dm/Projects/slither/slither/slither.py", line 300, in run_printers
    return [p.output(self._crytic_compile.target).data for p in self._printers]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dm/Projects/slither/slither/printers/summary/evm.py", line 78, in output
    evm_info = _extract_evm_info(self.slither)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dm/Projects/slither/slither/printers/summary/evm.py", line 30, in _extract_evm_info
    cfg = CFG(contract_bytecode_runtime)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dm/Projects/slither/env/lib/python3.12/site-packages/evm_cfg_builder/cfg/__init__.py", line 96, in __init__
    self.create_functions()
  File "/Users/dm/Projects/slither/env/lib/python3.12/site-packages/evm_cfg_builder/cfg/__init__.py", line 183, in create_functions
    self.compute_functions(self._basic_blocks[0], True)
                           ~~~~~~~~~~~~~~~~~~^^^

Code example to reproduce the issue:

abstract contract Ownable {}

Version:

0.10.2

Relevant log output:

No response

@DarkaMaul DarkaMaul added the bug-candidate Bugs reports that are not yet confirmed label Apr 17, 2024
DarkaMaul added a commit that referenced this issue Apr 18, 2024
EVM printer now correctly detects missing bytecode in contract and don't try to analyze them.
@0xalpharush 0xalpharush added bug Something isn't working and removed bug-candidate Bugs reports that are not yet confirmed labels Apr 18, 2024
@0xalpharush 0xalpharush changed the title [Bug-Candidate]: EVM printer fails for Abstract Contracts [Bug]: EVM printer fails for Abstract Contracts Apr 18, 2024
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