Skip to content

Instantly share code, notes, and snippets.

@kaymomin
Created July 12, 2022 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaymomin/7daf2175496bdaefcd3924c3d7657e14 to your computer and use it in GitHub Desktop.
Save kaymomin/7daf2175496bdaefcd3924c3d7657e14 to your computer and use it in GitHub Desktop.
Code Snippet to make NFTs Soulbound aka Non-transferable
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal override virtual {
require(from == address(0), "Err: token transfer is BLOCKED");
super._beforeTokenTransfer(from, to, tokenId);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment