Skip to content

Commit 6cbec05

Browse files
committed
Fixes
1 parent 898940c commit 6cbec05

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

contracts/ERC721A.sol

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -380,17 +380,15 @@ contract ERC721A is IERC721A {
380380
*/
381381
function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) {
382382
if (_startTokenId() <= tokenId) {
383-
// Workflow if spot-minting is enabled.
383+
packed = _packedOwnerships[tokenId];
384+
384385
if (_sequentialUpTo() != type(uint256).max) {
385-
// If the `tokenId` is above the sequential range.
386386
if (tokenId > _sequentialUpTo()) {
387-
packed = _packedOwnerships[tokenId];
388-
if (packed & _BITMASK_BURNED == 0) _revert(OwnerQueryForNonexistentToken.selector);
389-
return packed;
387+
if (_packedOwnershipExists(packed)) return packed;
388+
_revert(OwnerQueryForNonexistentToken.selector);
390389
}
391390
}
392391

393-
packed = _packedOwnerships[tokenId];
394392
// If the data at the starting slot does not exist, start the scan.
395393
if (packed == 0) {
396394
if (tokenId >= _currentIndex) _revert(OwnerQueryForNonexistentToken.selector);
@@ -519,9 +517,8 @@ contract ERC721A is IERC721A {
519517
*/
520518
function _exists(uint256 tokenId) internal view virtual returns (bool result) {
521519
if (_startTokenId() <= tokenId) {
522-
// Workflow if spot-minting is enabled.
520+
523521
if (_sequentialUpTo() != type(uint256).max) {
524-
// If the `tokenId` is above the sequential range.
525522
if (tokenId > _sequentialUpTo())
526523
return _packedOwnershipExists(_packedOwnerships[tokenId]);
527524
}

0 commit comments

Comments
 (0)