Skip to content

Commit

Permalink
fix: add existence check before the _beforeTokenTransfer hook (#844)
Browse files Browse the repository at this point in the history
Co-authored-by: Jean Cvllr <31145285+CJ42@users.noreply.github.com>
  • Loading branch information
2 people authored and richtera committed Mar 6, 2024
1 parent b6de951 commit cb696c9
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,11 @@ abstract contract LSP8IdentifiableDigitalAssetCore is
revert LSP8CannotSendToAddressZero();
}

// Check that `tokenId` is not already minted
if (_exists(tokenId)) {
revert LSP8TokenIdAlreadyMinted(tokenId);
}

_beforeTokenTransfer(address(0), to, tokenId, data);

// Check that `tokenId` was not minted inside the `_beforeTokenTransfer` hook
Expand Down

0 comments on commit cb696c9

Please sign in to comment.