-
Notifications
You must be signed in to change notification settings - Fork 951
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
Failed to generate IR #2354
Comments
The However, if you're using a recent version of slither, they way |
It says solc-select-1.0.4.
The install dependencies and building contracts worked fine. |
If it works without |
if you want to use ignore-compile and build manually, you can add the
That way test & script won't get built and Slither will then not process that code. |
reason i want to use --ignore-compile. |
if you want to use ignore-compile and build manually, you can add the --skip argument to your forge build invocation to achieve the same Slither does internally: forge build --build-info --skip '/test/**' '/script/**' That way test & script won't get built and Slither will then not process that code.
|
This is exactly what I tried and the error above occurs |
I tried forge build --build-info --skip '/test/**' '/script/**' as below Have I done something wrong? |
slither version is 0.10.0 |
please try again, removing |
I appreciate your help!
I attempted to follow your instructions as provided, yet the error persists as indicated below. Could you please elucidate why this error arises specifically in the presence of the "--ignore-compile" option, whereas it does not manifest in its absence? --ignore-compile used, if something goes wrong, consider removing the ignore compile flag |
this is the log for Build the contracts Run cd packages/tokamak/contracts-bedrock |
Hi! It looks like you're still missing the asterisks at the beginning, please have another look at my message here: #2354 (comment) |
Wow it works now!! By the way can you tell me the reason why the [Failed to generate IR] error occurs? I don't really want to except any of the contracts. Thanks again |
I don't know what's causing the underlying issue with IR generation here. If your repository is public and you can share a link with us, that might help triage this bug further. |
Here are the smart contract links that's having this issue. Thank you for helping me solve this issue! |
I am pretty sure that the The need to support this is tracked in #1452 |
Hello I'm having the same issue and I don't have import aliases on Unfortunately, the repo is closed source, so I'll keep trying some alternatives until I find more information to share here. |
Ok, after some trial and error, I think I understand what is causing the IR generation failure. I am using an library Errors {
error NULL_AMOUNT();
error NULL_ADDRESS();
} Then, whenever I use
Idk why, since this wasn't happening before. I'll try to create a MWE |
@aviggiano Would you open a new issue with the full stack trace and show the output of adding |
--ignore-compile used, if something goes wrong, consider removing the ignore compile flag
ERROR:ContractSolcParsing:Impossible to generate IR for LibSort._toInts (scripts/libraries/LibSort.sol#469-474):
'str' object has no attribute 'type'
ERROR:SlitherSolcParsing:
Failed to generate IR for LivenessGuard_TestInit._initializeSafeTools. Please open an issue https://github.com/crytic/slither/issues.
LivenessGuard_TestInit._initializeSafeTools (test/safe-tools/SafeTestTools.sol#509-513):
singleton = new GnosisSafe()
proxyFactory = new GnosisSafeProxyFactory()
handler = new CompatibilityFallbackHandler()
Traceback (most recent call last):
File "/opt/slither/bin/slither", line 8, in
sys.exit(main())
File "/opt/slither/lib/python3.9/site-packages/slither/main.py", line 735, in main
main_impl(all_detector_classes=detectors, all_printer_classes=printers)
File "/opt/slither/lib/python3.9/site-packages/slither/main.py", line 841, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
File "/opt/slither/lib/python3.9/site-packages/slither/main.py", line 107, in process_all
) = process_single(compilation, args, detector_classes, printer_classes)
File "/opt/slither/lib/python3.9/site-packages/slither/main.py", line 80, in process_single
slither = Slither(target, ast_format=ast, **vars(args))
File "/opt/slither/lib/python3.9/site-packages/slither/slither.py", line 146, in init
self._init_parsing_and_analyses(kwargs.get("skip_analyze", False))
File "/opt/slither/lib/python3.9/site-packages/slither/slither.py", line 166, in _init_parsing_and_analyses
raise e
File "/opt/slither/lib/python3.9/site-packages/slither/slither.py", line 162, in _init_parsing_and_analyses
parser.analyze_contracts()
File "/opt/slither/lib/python3.9/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 539, in analyze_contracts
self._convert_to_slithir()
File "/opt/slither/lib/python3.9/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 765, in _convert_to_slithir
raise e
File "/opt/slither/lib/python3.9/site-packages/slither/solc_parsing/slither_compilation_unit_solc.py", line 750, in _convert_to_slithir
func.generate_slithir_and_analyze()
File "/opt/slither/lib/python3.9/site-packages/slither/core/declarations/function.py", line 1772, in generate_slithir_and_analyze
node.slithir_generation()
File "/opt/slither/lib/python3.9/site-packages/slither/core/cfg/node.py", line 716, in slithir_generation
self._irs = convert_expression(expression, self) # type:ignore
File "/opt/slither/lib/python3.9/site-packages/slither/slithir/convert.py", line 118, in convert_expression
result = apply_ir_heuristics(result, node, is_solidity)
File "/opt/slither/lib/python3.9/site-packages/slither/slithir/convert.py", line 2033, in apply_ir_heuristics
irs = propagate_type_and_convert_call(irs, node)
File "/opt/slither/lib/python3.9/site-packages/slither/slithir/convert.py", line 529, in propagate_type_and_convert_call
new_ins = propagate_types(ins, node)
File "/opt/slither/lib/python3.9/site-packages/slither/slithir/convert.py", line 875, in propagate_types
assert contract
AssertionError
This error continues to occur despite having applied filter_path for both LibSort.sol and SafeTestTools.sol.
{
"detectors_to_exclude": "arbitrary-send-eth,incorrect-equality,naming-convention,solc-version",
"exclude_dependencies": true,
"exclude_informational": true,
"exclude_low": true,
"exclude_optimization": true,
"fail_on": "none",
"filter_paths": "(src/vendor|src/cannon/MIPS.sol|src/EAS/EAS.sol|test/safe-tools/SafeTestTools.sol|scripts/libraries/LibSort.sol)",
"foundry_out_directory": "artifacts"
}
The text was updated successfully, but these errors were encountered: