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

Add tests for ERC20 #686

Closed
mancze opened this issue Jan 17, 2018 · 1 comment
Closed

Add tests for ERC20 #686

mancze opened this issue Jan 17, 2018 · 1 comment
Assignees

Comments

@mancze
Copy link

mancze commented Jan 17, 2018

The tests for ERC-20 token contracts does not cover all the behavior described by the actual standard. Some issues are already described in #616, but there are more. For example:

  • Testing the return values of certain functions.
  • Testing the triggered events.

Testing all the defined behavior requires lots of tests. In addition I believe having ERC-20 token thoroughly and pessimistically tested is in place. This includes testing functions with different marginal inputs and their combination (like mentioned 0x0 addresses, 0 values and like) even this leads to test duplication.

I tried to find ERC-20 testing library (and also asked). Like package with tests written to test ERC-20 compliance. Since it is a standard with defined behavior those compliance tests can be written generally for any implementation. Yet I have found nothing.

Thus I started such a package. It's aim is to test compliance with the ERC-20 token standard. Reusable tests. Even when one's token smart contract is based on some well-tested library it is beneficial to recheck. Especially when overriding functions to ensure nothing got broken.

But I think zeppelin-solidity can also benefit from it. It is easy to integrate and I have already prepared a branch mancze:test/erc20-testing for it (its a draft, not PR). Check and see. Run with:

npm test ./test/StandardToken.erc20.test.js

The token test suite still needs improvements and has some gaps. But if it makes sense it can be completed. Integrating with zeppelin-solidity would fix #616 and provide the missing tests for ERC-20 standard compliance.

@frangio
Copy link
Contributor

frangio commented Jan 19, 2018

Thanks @mancze! I agree with your thoughts.

There is a comprehensive test suite for ERC20 in IC3Hydra/Hydra.

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

3 participants