[Bug-Candidate]: I'm not able to run slither. -- Error in . Traceback
- Dominant language
- Python
- Stars
- 6.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the issue:
When I run "slither ." or "yarn slither" I've always gotten this error and I don't know what to do anymore. I cleaned the cache and articules, still nothing. Any good solution?
### Code example to reproduce the issue:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// One shouldn't use any values from inside the blockchain as randomness
// Use something like Chainlink VRF for verifiable randomness
// https://docs.chain.link/docs/get-a-random-number/
contract BadRNG {
address payable[] private s_players;
function enterRaffle() external payable {
require(msg.value >= 10000000000000000000);
s_players.push(payable(msg.sender));
}
function pickWinner() external {
uint256 randomWinnerIndex = uint256(
keccak256(abi.encodePacked(block.difficulty, msg.sender))
);
address winner = s_players[randomWinnerIndex % s_players.length];
(bool success, ) = winner.call{value: address(this).balance}("");
require(success, "Transfer failed");
}
}
// Just an example. I had tried with several contracts and nothing...
### Version:
0.8.3
### Relevant log output:
```shell
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/__main__.py", line 744, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/__main__.py", line 76, in process_all
compilations = compile_all(target, **vars(args))
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 658, in compile_all
compilations.append(CryticCompile(filename, **kwargs))
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 117, in __init__
self._compile(**kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 548, in _compile
self._platform.compile(self, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/crytic_compile/platform/solc.py", line 154, in compile
targets_json = _get_targets_json(compilation_unit, self._target, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/crytic_compile/platform/solc.py", line 276, in _get_targets_json
return _run_solc(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/crytic_compile/platform/solc.py", line 474, in _run_solc
compiler="solc", version=get_version(solc, env), optimized=is_optimized(solc_arguments)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/crytic_compile/platform/solc.py", line 381, in get_version
raise InvalidCompilation(f"Solidity version not found: {stdout}")
crytic_compile.platform.exceptions.InvalidCompilation: Solidity version not found: No solc version set. Run `solc-select use VERSION` or set SOLC_VERSION environment variable.
None
Error in .
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/__main__.py", line 744, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/slither/__main__.py", line 76, in process_all
compilations = compile_all(target, **vars(args))
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 658, in compile_all
compilations.append(CryticCompile(filename, **kwargs))
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 117, in __init__
self._compile(**kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 548, in _compile
self._platform.compile(self, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/crytic_compile/platform/solc.py", line 154, in compile
targets_json = _get_targets_json(compilation_unit, self._target, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/crytic_compile/platform/solc.py", line 276, in _get_targets_json
return _run_solc(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/crytic_compile/platform/solc.py", line 474, in _run_solc
compiler="solc", version=get_version(solc, env), optimized=is_optimized(solc_arguments)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/crytic_compile/platform/solc.py", line 381, in get_version
raise InvalidCompilation(f"Solidity version not found: {stdout}")
crytic_compile.platform.exceptions.InvalidCompilation: Solidity version not found: No solc version set. Run `solc-select use VERSION` or set SOLC_VERSION environment variable.
```
Contributor guide
Assessment
This issue has not been assessed yet.