-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Check that destination of token transfers is not 0x #400
Comments
Why? You can have use cases that need to send funds to a non-accessible address. |
What does it mean to check for validity? In general we add checks for the null address because uninitialized values in the EVM are zero values. It helps prevent errors. A use-case where it's needed to make tokens inaccessible would be better served by a custom (non-ERC20) function that removes the tokens from circulation. |
What I mean by invalidity is non-redeemable address like 0xdead, 0xwhatever etc. I agree, but a user can't make that error (only a dev) by forgetting a parameter, the function takes 2, so you must provide 0x0 manually or the EVM will throw because of the invalid number of arguments. Removing the tokens from circulation doesn't mean necessarily destroying them. What if you want to transfer them to 0x0 until X and make them redeemable at that point? |
The thing is there is no way to identify that an address is non-redeemable. Any address is potentially non-redeemable if no user has a private key for it (and it's not a contract address). |
Do we want to add
require(_to != address(0))
totransfer
andtransferFrom
?The text was updated successfully, but these errors were encountered: