Is it possible to use ERC721Consecutive.sol & ERC721Enumerable at the same time

benefit of each

  • ERC721Consecutive.sol provides batch minting.
  • ERC721Enumerable provides Enumerability of owner tokens.

my guess is it's not possible because of this:

quote from ERC721Consecutive.sol

 * IMPORTANT: This extension bypasses the hooks {_beforeTokenTransfer} and {_afterTokenTransfer} for tokens minted in
 * batch. When using this extension, you should consider the {_beforeConsecutiveTokenTransfer} and
 * {_afterConsecutiveTokenTransfer} hooks in addition to {_beforeTokenTransfer} and {_afterTokenTransfer}.
 * IMPORTANT: When overriding {_afterTokenTransfer}, be careful about call ordering. {ownerOf} may return invalid
 * values during the {_afterTokenTransfer} execution if the super call is not called first. To be safe, execute the
 * super call before your custom logic.

but I need a second opinion.

It isn't possible. If you try to combine them, it will revert when you attempt to mint a batch:

1 Like

thank you @frangio ,
also i was wondering what is the purpose of ERC721ConsecutiveEnumerableMock.sol ?

since it's like this.

contract ERC721ConsecutiveEnumerableMock is ERC721Consecutive, ERC721Enumerable

Mock contracts are for testing only.

Thanks again,
also I made some tweaks on top of ERC721 openZepplin v4.7.0 and enabled batch minting at the construction time, and single mint after construction, with IERC721Enumarable extension available.

If you have the time to check my implementation, I'll be glad if you could provide me feedback and insights.

PS: most of the code is base on ERC721 openZepplin v4.7.0 + plus some complementary function for {_beforeTokenTransfer} hook in ERC721FancyMintEnumerable