I am setting up a burnable, ennumerable, metadata ERC721 token with ERC2981 support. I've flattened it all into one file. My contract has the following deviations from the OpenZeppelin wizard output:
- I've hardcoded the contract and symbol names and made them constants.
- I've removed renounceOwnership().
- ERC2981 support from https://github.com/dievardump/EIP2981-implementation
I decided to run the OpenZeppelin tests on my contract and they have produced a few issues:
- I originally just had this for minting:
function uriMint(address to, uint256 tokenId, string calldata tokenURI_) public onlyOwner {
_safeMint(to, tokenId);
_setTokenURI(tokenId, tokenURI_);
}
The tests forced me to add mint() and two versions of safeMint(), which I copied from the OpenZeppelin mocks.
I think this is okay, but I'd appreciate a second opinion.
- The only errors I'm getting are incorrect reason strings. Do they have any significance? Could this indicate a deeper issue?
1) Contract: ERC721
_burn
reverts when burning a non-existent token id:
Wrong kind of exception received
+ expected - actual
-VM Exception while processing transaction: reverted with reason string 'ERC721: operator query for nonexistent token'
+ERC721: owner query for nonexistent token
2) Contract: ERC721
_burn
with minted tokens
with burnt token
reverts when burning a token id that has been deleted:
Wrong kind of exception received
+ expected - actual
-VM Exception while processing transaction: reverted with reason string 'ERC721: operator query for nonexistent token'
+ERC721: owner query for nonexistent token
3) Contract: ERC721
metadata
token URI
reverts when queried for non existent token id:
Wrong kind of exception received
+ expected - actual
-VM Exception while processing transaction: reverted with reason string 'ERC721URIStorage: URI query for nonexistent token'
+ERC721Metadata: URI query for nonexistent token