Open palango opened 2 years ago
Based off the error log, this may be an error with crytic-compile or compilation. Can you try crytic-compile .
and report back? Prior to doing that, make sure it compiles with brownie compile
please.
@0xalpharush That works fine:
➜ contracts git:(brownie-update) ✗ crytic-compile .
INFO:CryticCompile:Brownie v1.18.1 - Python development framework for Ethereum
Project has been compiled. Build artifacts saved at /Users/paul/Projects/contracts/build/contracts
➜ contracts git:(brownie-update) ✗ brownie compile
Brownie v1.18.1 - Python development framework for Ethereum
Project has been compiled. Build artifacts saved at /Users/paul/Projects/contracts/build/contracts
Could you please confirm which version of crytic-compile you have installed? You can check it by running crytic-compile --version
If it's not the latest (0.2.2
) can you please upgrade it (pip3 install --upgrade crytic-compile
) and let us know if that fixes the issue?
@elopez It's already installed:
$ contracts ✗ crytic-compile --version
0.2.2
$ contracts ✗ pip3 install --upgrade crytic-compile
Requirement already satisfied: crytic-compile in /Users/paul/Library/Caches/pypoetry/virtualenvs/test/lib/python3.9/site-packages (0.2.2)
Requirement already satisfied: pysha3>=1.0.2 in /Users/paul/Library/Caches/pypoetry/virtualenvs/test/lib/python3.9/site-packages (from crytic-compile) (1.0.2)
Having the same issues here.
➜ slither .
Brownie v1.17.2 - Python development framework for Ethereum
Project has been compiled. Build artifacts saved at /home/vader/Code/labs/furia/px-nft/build/contracts
Missing inheritance <slither.solc_parsing.declarations.contract.ContractSolc object at 0x7f2902fb2040>
Missing inheritance <slither.solc_parsing.declarations.contract.ContractSolc object at 0x7f29028f4f10>
Missing inheritance <slither.solc_parsing.declarations.contract.ContractSolc object at 0x7f2902536ac0>
Missing inheritance <slither.solc_parsing.declarations.contract.ContractSolc object at 0x7f2901fee790>
Traceback (most recent call last):
[ . . . ]
File "/home/---/.local/lib/python3.8/site-packages/crytic_compile/crytic_compile.py", line 291, in get_line_from_offset
return lines_delimiters[offset]
KeyError: 3118
Evidences:
➜ crytic-compile --version
0.2.2
➜ crytic-compile .
INFO:CryticCompile:Brownie v1.17.2 - Python development framework for Ethereum
Project has been compiled.
➜ brownie compile
Brownie v1.17.2 - Python development framework for Ethereum
Project has been compiled.
It did ran once and I was able to view some warnings and address a couple of them. When I tried running again, I received this error.
Can you provide an example of a codebase that causes this error? (Duplicate of https://github.com/crytic/slither/issues/1066)
Can you provide an example of a codebase that causes this error? (Duplicate of crytic/slither#1066)
Not currently, but next week I'll be able to share to code.
@0xalpharush Here's the way to reproduce the following problem:
Error in .
Traceback (most recent call last):
File "/Users/paul/Library/Caches/pypoetry/virtualenvs/beamer-1vah2Hfk-py3.9/lib/python3.9/site-packages/slither/__main__.py", line 743, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
File "/Users/paul/Library/Caches/pypoetry/virtualenvs/beamer-1vah2Hfk-py3.9/lib/python3.9/site-packages/slither/__main__.py", line 84, in process_all
) = process_single(compilation, args, detector_classes, printer_classes)
File "/Users/paul/Library/Caches/pypoetry/virtualenvs/beamer-1vah2Hfk-py3.9/lib/python3.9/site-packages/slither/__main__.py", line 67, in process_single
slither = Slither(target, ast_format=ast, **vars(args))
File "/Users/paul/Library/Caches/pypoetry/virtualenvs/beamer-1vah2Hfk-py3.9/lib/python3.9/site-packages/slither/slither.py", line 97, in __init__
parser.parse_top_level_from_loaded_json(ast, path)
File "/Users/paul/Library/Caches/pypoetry/virtualenvs/beamer-1vah2Hfk-py3.9/lib/python3.9/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 182, in parse_top_level_from_loaded_json
contract.set_offset(top_level_data["src"], self._compilation_unit)
File "/Users/paul/Library/Caches/pypoetry/virtualenvs/beamer-1vah2Hfk-py3.9/lib/python3.9/site-packages/slither/core/source_mapping/source_mapping.py", line 124, in set_offset
self._source_mapping = self._convert_source_mapping(offset, compilation_unit)
File "/Users/paul/Library/Caches/pypoetry/virtualenvs/beamer-1vah2Hfk-py3.9/lib/python3.9/site-packages/slither/core/source_mapping/source_mapping.py", line 101, in _convert_source_mapping
(lines, starting_column, ending_column) = self._compute_line(
File "/Users/paul/Library/Caches/pypoetry/virtualenvs/beamer-1vah2Hfk-py3.9/lib/python3.9/site-packages/slither/core/source_mapping/source_mapping.py", line 43, in _compute_line
end_line, ending_column = compilation_unit.core.crytic_compile.get_line_from_offset(
File "/Users/paul/Library/Caches/pypoetry/virtualenvs/beamer-1vah2Hfk-py3.9/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 291, in get_line_from_offset
return lines_delimiters[offset]
KeyError: 2783
git clone https://github.com/beamer-bridge/beamer.git
cd beamer
poetry add -D slither-analyzer
poetry install
poetry shell
slither .
Any updates on this?
Any updates on this?
I fixed the problem by removing the build
folder created by brownie
What happened?
When running slither on a brownie based project I see the following error output:
Can you share code with us to reproduce this bug?
unfortunately not right now
Version
0.8.2
Relevant log output
No response