1

Can you highlight the core difference between two functions: mint and safeMint? Why its called "safe"? and when both of them should use? cause, for me, functions' syntax is pretty similar.

turboza
  • 340
  • 1
  • 12
Decode_me
  • 47
  • 1
  • 4

1 Answers1

2

There was the answer here: _mint vs _safeMint, which is best for ERC721?


To summarize, safeMint is there to prevent someone minting ERC721 to a contract which does not support ERC721 transfer. So the ERC721 token is stuck there forever. If you are sure this won't happen, you can directly use _mint to save the gas cost.

See more: ERC721.sol#L262

turboza
  • 340
  • 1
  • 12