ethereum / ethereum-org

[ARCHIVED] ethereum.org website from 2016-2019. See https://github.com/ethereum/ethereum-org-website for current version.
GNU Lesser General Public License v3.0
410 stars 1.39k forks source link

Transfer of zero ERC20 Token must success #796

Closed slesolliec closed 6 years ago

slesolliec commented 6 years ago

Hi, as an exercice to learn how to use Truffle, I'm developping an ERC20 token test suite. I realised that the ERC20 token on ethereum.org does not comply with the ERC20 token standard <:o) !!!

If you look at the ERC20 token standard, here: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md#transfer You can read that: Transfers of 0 values MUST be treated as normal transfers and fire the Transfer event.

But in the example, you are too strict when checking for overflows. A 0 token transaction will revert. I think we need to change the > into >= to allow successful transfers of 0 token as required by the standard.

alexvandesande commented 6 years ago

Thanks! I did not realize this. Not sure what's the usefulness.

slesolliec commented 6 years ago

I'm not sure either ;-) Probably just the possibility to test that "it works!!!" before proceeding with sending real non-zero tokens.