Hi all,
Concerning the ERC721.sol safeTransferFrom function, I propose to move the code line and invert the require by the call to transferFrom:
Current code:
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public {
transferFrom(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, data), “ERC721: transfer to non ERC721Receiver implementer”);
}
I propose:
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public {
require(_checkOnERC721Received(from, to, tokenId, data), “ERC721: transfer to non ERC721Receiver implementer”);
transferFrom(from, to, tokenId);**
}
In my point of view, the require must be always before the call to any function that should be called if the require is confirmed.
Thanks!
Sergio