Solidity – Conformance Test Suite for ERC-721 Smart Contracts

erc-721soliditytesting

Entities like Open Zeppelin offer "well tested and audited" (I'm paraphrasing) open source Solidity code for common patterns such as ownership, ERC20 tokens, etc.

Are there any such entities (or just normal developers) who are, in the same vein as Open Zeppelin, open sourcing rigorous tests for code that is supposed to comply with the popular ERC standards?

Specifically, I've written some ERC721 compliant code, and I'm wondering if there are really good truffle test modules for this code. Would probably be more rigorous than what I'd write, and would definitely save me a lot of time and effort.

Best Answer

I'm currently developing my own implementation of an ERC721 compliant token.

I wrote a number of tests for it, which I have added to my Github so that you may use if you wish.

The test file was written in NodeJS, using Ganache-cli, Web3 and Mocha for tests. Contracts were compiled using Solc.

You will need to create and compile a valid and invalid "token receiver" contract for testing the "safeTransferFrom" methods.

Note, this is just a file I wrote for my own personal use, so it's not extremely polished or anything. But if you aren't an absolute beginner you shouldn't have any trouble.

Related Topic