Title: Proof_of_concept__minting_2__256__1_ERC721_with_IE
Category: ERCs

Author: sciNFTist.eth
Date: 2023-01-06T17:44:14.872Z

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:
115792089237316195423570985008687907853269984665640564039457584007913129639935
In my Implementation proposal I’ve talked about how this can be reached:
see the implementation here
See the project in Action:
I’ve deployed a contract on goerli for proof of concept.
goerli Limits of NFT: 0x6d04C3F8e618a2404803Ca72f5dF93f4F50CaD45
tokenTracker878×390 21.9 KB
this token is Fully IERC721 and IERC721Enumerable compatible.
I highly recommend you try it for yourself.
ERC721interface_showdown1098×698 31.5 KB
from blanceOf() to ownerOf()
ownerOf649×896 53.5 KB
even tokenOfOwnerbyIndex().
tokenOfOwnerbyIndex1290×568 28.7 KB
try it for yourself
All of these tokens are minted to “giver” contract that you can grab one for yourself.
giver898×650 21.1 KB


by calling the getToken() you will get a token from index of 0 of the preOwner(giver address).


by calling the getTokenInd(Index) you will get a token from index of Index of the preOwner(giver address).


giver goerli : 0x65c94c08Dd504a199fE61C3D29ca01784C7081aF
URI:
for proof of concept this contract have an SVG Image with tokenId on it.
tokenURI881×684 35 KB
the Image:
Image892×595 2.24 KB
conclusion:
this project shows:


limit of uint256 for totalSupply for ERC721 can be reached.


zero transaction minting is possible.


batch minting via EIP-2309 and IERC721Enumerable is possible.


please join the disscussion:
Ethereum magician: Use zero gas(0 gwei) for minting any number of NFT

Author: abcoathup
Date: 2023-01-06T22:57:23.628Z

OpenSea appears to stop indexing at 5000.

OpenSea



4999 - Limits of NFT | OpenSea
get one from [this-contract](https://goerli.etherscan.io/address/0x65c94c08dd504a199fe61c3d29ca01784c7081af#writeContract) by calling getToken() function.
see the...





https://testnets.opensea.io/assets/goerli/0x6d04c3f8e618a2404803ca72f5df93f4f50cad45/5000
OpenZeppelin use a 5000 maximum limit for this purpose:

github.com


OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/extensions/ERC721Consecutive.sol#L48

      
          
          
/**
           * @dev Maximum size of a batch of consecutive tokens. This is designed to limit stress on off-chain indexing
           * services that have to record one entry per token, and have protections against "unreasonably large" batches of
           * tokens.
           *
           * NOTE: Overriding the default value of 5000 will not cause on-chain issues, but may result in the asset not being
           * correctly supported by off-chain indexing services (including marketplaces).
           */
          function _maxBatchSize() internal view virtual returns (uint96) {
              return 5000;
          }
          
          
/**
           * @dev See {ERC721-_ownerOf}. Override that checks the sequential ownership structure for tokens that have
           * been minted as part of a batch, and not yet transferred.
           */
          function _ownerOf(uint256 tokenId) internal view virtual override returns (address) {
              address owner = super._ownerOf(tokenId);
          
          
    // If token is owned by the core, or beyond consecutive range, return base value

Author: sciNFTist.eth
Date: 2023-01-06T23:45:45.347Z

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.
 *