I have a custom ERC20 token project and I would like to cover the token behaviour with tests. As the ERC20 interface is standardized I wonder whether there are some libraries to test ERC20 functionality or to help me with it?

I use truffle in my project so I prefer tests specifically for this framework but it is not required.


I haven't found out nothing similar to what I was looking for. Hence I have came up with the custom package:


With this package all the tests are already written. Just configure and run the test suite contained!

  • This is great, but I have a few issues using it 1) the import statement no longer works, and 2) I am not sure how I'm supposed to be getting those test addresses – Serj Sagan Feb 12 '18 at 8:56
  • 1
    Wow, so somebody is actually trying to use it? That's great. Feel free to open up an issue on github and let's discuss it there. – mancze Feb 15 '18 at 8:50
  • You have done great job! However it does not work with truffle 5.0 and web3 1.0 anymore. I have updated it to support new truffle: github.com/dukei/token-test-suite – Dmitry Kochin Mar 17 '19 at 20:03

Take a look at the heavily audited ERC20 token contracts found on github.com/ConsenSys/Tokens and github.com/OpenZeppelin/zeppelin-solidity. You'll find extensive tests using truffle.

  • Thanks, I have seen those. The major problem with them they are not designed for code reuse (the tests). So the only way to use them is to copy&paste (and customize). That's not good. – mancze Nov 20 '17 at 13:33
  • @mancze oh gotcha. I haven't seen anything out there like you described. However, it should be pretty simple to take those tests and turn it into a library. – Miguel Mota Nov 20 '17 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.