Skip to content
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

Consider removing address != 0x0 checks from OpenZeppelin Contracts #2734

Closed
gentasumantri opened this issue Jun 21, 2021 · 3 comments
Closed

Comments

@gentasumantri
Copy link

Like the previously disscused at OpenZeppelin Forum. i am agreed that zero address checks in OpenZeppelin Contracts it's not that important. since people can burn through other address like 0x0dEad and many more ways.

maybe we can consider to remove zero address checks so the contracts more flexible as a module. and maybe it can saving some gas. so any update of this issue?

@Amxx
Copy link
Collaborator

Amxx commented Jun 22, 2021

Hello @gentasumantri, and thank you for raising this issue.

Can you give us more specific details about which check you have issues with? Are you talking about Ownable? ERC20/721 transfers? Depending on the contract, we might have good reasons to do these checks. I'd love to know more about your usecase.

@fulldecent
Copy link
Contributor

If I was going to write a token standard again, I would exclude to != 0x0 checks in the code, and then make up for it with Clients MUST produce a warning before attempting to send to the 0x0 address if the user intention is to transfer.

But as long as we have the current standards that are widely supported and there are no glaring errors with them, we should prefer consistency over minor innovations.

@frangio
Copy link
Contributor

frangio commented Dec 2, 2022

I don't really see reasons to allow use of 0x0 like any other address (in transfers or elsewhere), and I do see some reasons to disallow it, namely that it can show up accidentally in a few places: read from an uninitialized variable or in the return value of ecrecover. They are not particularly strong reasons but I think the net result is that we should treat the zero address specially and disallow its use in most places.

@frangio frangio closed this as completed Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants