[Bug-Candidate]: Different pragma directives are used
- Dominant language
- Python
- Stars
- 6.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the issue:
Executed command: `slither . --truffle-ignore-compile --exclude-dependencies --filter-paths test`
Although I use the flag `--exclude-dependencies` the detector `Different pragma directives are used` is triggered. If I understand this flag correctly, then the OpenZeppelin dependencies should be ignored for all detectors.
### Code example to reproduce the issue:
```
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/token/ERC777/ERC777.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract TestContract is ERC777, Ownable {
constructor(uint256 amount) ERC777("TestContracts", "TC", new address[](0)) {
_mint(msg.sender, amount, "", "");
}
function mint(
address account,
uint256 amount,
bytes memory userData,
bytes memory operatorData
) external onlyOwner {
_mint(account, amount, userData, operatorData);
}
}
```
### Version:
0.8.3
### Relevant log output:
```shell
Different versions of Solidity are used:
- Version used: ['^0.8.0', '^0.8.1', '^0.8.7']
- ^0.8.0 (@openzeppelin/contracts/token/ERC20/IERC20.sol#4)
- ^0.8.0 (@openzeppelin/contracts/access/Ownable.sol#4)
- ^0.8.1 (@openzeppelin/contracts/utils/Address.sol#4)
- ^0.8.7 (Migrations.sol#2)
- ^0.8.0 (@openzeppelin/contracts/token/ERC777/IERC777Recipient.sol#4)
- ^0.8.0 (@openzeppelin/contracts/token/ERC777/ERC777.sol#4)
- ^0.8.0 (@openzeppelin/contracts/token/ERC777/IERC777Sender.sol#4)
- ^0.8.0 (@openzeppelin/contracts/utils/introspection/IERC1820Registry.sol#4)
- ^0.8.7 (TestContract.sol#2)
- ^0.8.0 (@openzeppelin/contracts/token/ERC777/IERC777.sol#4)
- ^0.8.0 (@openzeppelin/contracts/utils/Context.sol#4)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#different-pragma-directives-are-used
```
Contributor guide
Assessment
This issue has not been assessed yet.