abstract contract ERC721OptOwnersExplicit is ERC721Opt {
    uint256 public nextOwnerToExplicitlySet = 1;

    /**
     * @dev Explicitly set `owners` to eliminate loops in future calls of ownerOf().
     */
    function _setOwnersExplicit(uint256 quantity) internal {
        if (quantity == 0) revert QuantityMustBeNonZero();
        if (_nextTokenId == 1) revert NoTokensMintedYet();
        uint256 _nextOwnerToExplicitlySet = nextOwnerToExplicitlySet;
        if (_nextOwnerToExplicitlySet >= _nextTokenId) revert AllOwnersHaveBeenSet();

        // Index underflow is impossible.
        // Counter or index overflow is incredibly unrealistic.
        unchecked {
            uint256 endIndex = _nextOwnerToExplicitlySet + quantity - 1;

            // Set the end index to be the last token index
            if (endIndex + 1 > _nextTokenId) {
                endIndex = _nextTokenId - 1;
            }

            for (uint256 i = _nextOwnerToExplicitlySet; i <= endIndex; i++) {
                if (_owners[i] == address(0) && _owners[i] != DEAD_ADDR) {
                    address ownership = ownerOf(i);
                    _owners[i] = ownership;
                }
            }

            nextOwnerToExplicitlySet = endIndex + 1;
        }
    }
}
function _setOwnersExplicit(uint256 quantity) internal {
    if (quantity == 0) revert QuantityMustBeNonZero();
    if (_nextTokenId == 1) revert NoTokensMintedYet();
    uint256 _nextOwnerToExplicitlySet = nextOwnerToExplicitlySet;
    if (_nextOwnerToExplicitlySet >= _nextTokenId) revert AllOwnersHaveBeenSet();

    // Index underflow is impossible.
    // Counter or index overflow is incredibly unrealistic.
    unchecked {
        uint256 endIndex = _nextOwnerToExplicitlySet + quantity - 1;

        // Set the end index to be the last token index
        if (endIndex + 1 > _nextTokenId) {
            endIndex = _nextTokenId - 1;
        }

        for (uint256 i = _nextOwnerToExplicitlySet; i <= endIndex; i++) {
            if (_owners[i] == address(0) && _owners[i] != DEAD_ADDR) {
                address ownership = ownerOf(i);
                _owners[i] = ownership;
            }
        }

        nextOwnerToExplicitlySet = endIndex + 1;
    }
}

/**
 * @dev Explicitly set `owners` to eliminate loops in future calls of ownerOf().
 */