[False-Positive]: Undetected Error Declaration
- Dominant language
- Python
- Stars
- 6.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the false alarm that Slither raise and how you know it's inaccurate:
When an `error` is declared outside of the contract scope, Slither is unable to find it, thus creating a false positive. Note that the contract compiles without errors.
### Frequency
Very Frequently
### Code example to reproduce the issue:
```
error MyError();
contract A {
function X() public pure {
require(1 == 1, MyError());
}
}
```
### Version:
0.11.3
### Relevant log output:
```shell
'forge clean' running (wd: /Users/ferit/IdeaProjects/octant-v2-core)
'forge config --json' running
'forge build --build-info --skip */test/** */script/** --force' running (wd: /Users/ferit/IdeaProjects/octant-v2-core)
ERROR:ContractSolcParsing:Missing function Variable not found: NotWhitelisted(IWhitelist,address) (context RegenStaker src/regen/RegenStaker.sol#49-191 (1 - 2))
INFO:Printers:
Compiled with Foundry
Total number of contracts in source files: 79
Number of contracts in dependencies: 63
Source lines of code (SLOC) in source files: 3649
Source lines of code (SLOC) in dependencies: 4488
Number of assembly lines: 0
Number of optimization issues: 9
Number of informational issues: 0
Number of low issues: 0
Number of medium issues: 45
Number of high issues: 5
ERCs: ERC4626, ERC20, ERC165, ERC2612
```
Contributor guide
Assessment
This issue has not been assessed yet.