Incorrect missing zero address validation issue.
- Dominant language
- Python
- Stars
- 6.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
running `slither --exclude-informational --filter-paths node_modules .` on the following piece of solidity code raises a missing zero address validation error from slither.
Solidity code:
```
function transferOwnership(address _newOwner) external onlyOwner {
require(_newOwner != address(0), "ERC20: transfer to the zero address");
emit OwnershipTransfered(owner, _newOwner);
owner = _newOwner;
}
```
Slither output:
```INFO:Detectors:
Curve.transferOwnership(address)._newOwner (contracts/DFX.sol#184) lacks a zero-check on :
- owner = _newOwner (contracts/DFX.sol#185)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#missing-zero-address-validation```
Contributor guide
Assessment
This issue has not been assessed yet.