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

Slither 6.14 assertion error #708

Closed
Ferparishuertas opened this issue Nov 26, 2020 · 3 comments
Closed

Slither 6.14 assertion error #708

Ferparishuertas opened this issue Nov 26, 2020 · 3 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@Ferparishuertas
Copy link

After adding some new functionalities, to the smart contract, the following error raises. previous version with 6.14, works.

It seems to me the problem is the new functionality introduced on solidity 7.4, constants at file level

https://blog.soliditylang.org/2020/10/19/solidity-0.7.4-release-announcement/

Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/slither/main.py", line 693, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
File "/usr/local/lib/python3.9/site-packages/slither/main.py", line 79, in process_all
) = process_single(compilation, args, detector_classes, printer_classes)
File "/usr/local/lib/python3.9/site-packages/slither/main.py", line 62, in process_single
slither = Slither(target, ast_format=ast, **vars(args))
File "/usr/local/lib/python3.9/site-packages/slither/slither.py", line 81, in init
self._parser.parse_contracts_from_loaded_json(ast, path)
File "/usr/local/lib/python3.9/site-packages/slither/solc_parsing/slitherSolc.py", line 132, in parse_contracts_from_loaded_json
assert contract_data[self.get_key()] in [
AssertionError
ERROR:root:None
ERROR:root:Error in .
ERROR:root:Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/slither/main.py", line 693, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
File "/usr/local/lib/python3.9/site-packages/slither/main.py", line 79, in process_all
) = process_single(compilation, args, detector_classes, printer_classes)
File "/usr/local/lib/python3.9/site-packages/slither/main.py", line 62, in process_single
slither = Slither(target, ast_format=ast, **vars(args))
File "/usr/local/lib/python3.9/site-packages/slither/slither.py", line 81, in init
self._parser.parse_contracts_from_loaded_json(ast, path)
File "/usr/local/lib/python3.9/site-packages/slither/solc_parsing/slitherSolc.py", line 132, in parse_contracts_from_loaded_json
assert contract_data[self.get_key()] in [
AssertionError

@elenadimitrova
Copy link

I did also get this error once when troubleshooting a problem with slither recently. You can reproduce on the https://github.com/argentlabs/argent-contracts/tree/experiment/migrate-to-truffle branch unless argentlabs/argent-contracts#146 is merged into develop meanwhile.

npm run compile:infrastructure
slither . --ignore-compile

produces

ERROR:ContractSolcParsing:Missing inheritance <slither.solc_parsing.declarations.contract.ContractSolc object at 0x110e7e940>
ERROR:root:Error:
ERROR:root:Type not found struct IAugustusSwapper.Path

then I compile the missing contract and run slither again

npx truffle compile --contracts_directory=./lib/paraswap/IAugustusSwapper*.sol
slither . --ignore-compile

produces

ERROR:ContractSolcParsing:Missing inheritance <slither.solc_parsing.declarations.contract.ContractSolc object at 0x10bbdcf10>
ERROR:root:Error:
ERROR:root:Type not found contract BaseWallet

then I compile the next missing contract and run slither again

npx truffle compile --contracts_directory=./contracts/wallet/BaseWallet*.sol
slither . --ignore-compile

and get the exact error reported above.

@montyly montyly added bug Something isn't working enhancement New feature or request labels Dec 4, 2020
@montyly
Copy link
Member

montyly commented Dec 4, 2020

Hi @Ferparishuertas , @elenadimitrova . Thank you for reporting this. Slither does not support yet most of the top-level elements, but we are working on it.

Related: #619

@0xalpharush
Copy link
Contributor

Fixed by #1032

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants