Limits of NFT(ERC721Enumerable) or Minting 2^256 - 1 NFT
warning:
these contract have been altered for proof of concept and they are different than the proposed Implementation. please see this link to learn more about mechanism and rationale
Abstract
The upper limit of totalSupply of any ERC721 contract or how many NFT can be minted, is determined by the EIP-721 is uint256 number.
so the upper limit for totalSupply is this number:
yeah, I know about this limit
so I’ve wrote this function
uint256 private emitCounter = 1;
// in case the marketplace need this
function emitHandlerSingle() public {
emit ConsecutiveTransfer(
emitCounter * 5000,
emitCounter * 5000 + 4999,
address(0),
preOwner_
);
emitCounter++;
}
PS: I made a typo on the contract in the contract this is the what I think solves the problem
the problem will be solved with this function.
I know it’s not it’s not feasible to call it 2*256/5000 times but I’ve tried it in bundle of 100 consecutiveTransfer event with gas around 500k another TX and looksrare kept resolving them till 530K Item then they stopped it.
I think marketplace indexer should propose another limit like a daily limit or something else 5000 is a bit small I think.
@abcoathup
also, a really important question, is it possible to use ERC721Consecutive.sol and ERC721Enumerable.sol at the same time?
my guess is no because of this part from ERC721Consecutive:
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.
*