ERC721 has both safeTransferFrom
and transferFrom
, where safeTransferFrom
throws if the receiving contract's onERC721Received
method doesn't return a specific magic number. This is to ensure a receiving contract is capable of receiving the token, so it isn't permanently lost.
But why would transferFrom
exist too when it doesn't have this check? My only guess it to make ERC721 compatible with ERC20, which has a transferFrom
method with the same signature. However the semantics of the method in each standard are different (the uint256
in ERC20 refers to the value, whereas in ERC721 it refers to the tokenID) so compatibility there seems misleading.
What am I missing?
Best Answer
There is an explanation in the original Github ERC721 thread about keeping the "unsafe" transfer function (comment from Dieter Shirley, alias "dete", one of the authors of EIP-721) :
This functionality has therefore been retained for greater flexibility and to keep the standard as simple as possible.