crytic / crytic/slither

Incorrect missing zero address validation issue.

Open
#787 2 comments 0 reactions 0 assignees View on GitHub
false-positive
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.