Skip to content

Commit

Permalink
refactor: 💡 handle burn and re-mint
Browse files Browse the repository at this point in the history
  • Loading branch information
MASDXI committed Feb 26, 2025
1 parent 914d534 commit 4944ab0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions contracts/tokens/ERC721/extensions/ERC721EpochBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,15 @@ abstract contract ERC721EpochBase is Context, ERC165, IERC721, IERC721Errors, IE
uint256 tokenPointer = _tokenPointers[tokenId];
address from = _ownerOf(tokenId);
// if the tokenId is not exist before minting it
if (tokenPointer == 0) {
tokenPointer = pointer;
_tokenPointers[tokenId] = pointer;
if (to == address(0)) {
_tokenPointers[tokenId] = 0;
} else {
pointer = tokenPointer;
if (tokenPointer == 0) {
tokenPointer = pointer;
_tokenPointers[tokenId] = pointer;
} else {
pointer = tokenPointer;
}
}
uint256 epoch = _getEpoch(pointer);

Expand Down

0 comments on commit 4944ab0

Please sign in to comment.