-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Hint for Zero Address Allocation #592
Comments
hello @rajosch to understand:
please put examples... thanks |
Hi @dbale-altoros,
function transferOwnership(address newOwner) public {
require(newOwner != address(0), "New owner cannot be the zero address");
owner = newOwner;
} My question is if there should be a hint to check for a zero address allocation if the require statement is not present. |
sorry @rajosch I'm kind of swamp... I WILL take a look and get back to you as soon as i can |
@rajosch as juan capurro mentioned this is very hard to implement. |
Context:
Solidity developers often make the mistake of assigning or comparing addresses to the zero address (
0x0000000000000000000000000000000000000000
). This can lead to vulnerabilities and bugs in smart contracts.Suggestion:
Implement a new rule in Solhint to check for:
Rationale:
This check will help developers avoid common pitfalls and ensure better security and reliability in their smart contracts.
References:
The text was updated successfully, but these errors were encountered: