A contract that holds NFTs (escrow, staking, marketplace) does not implement onERC721Received / onERC1155Received. Safe transfers into it revert, or NFTs sent via safeTransfer become stuck if a non-safe path was assumed.
// staking.stake() pulls the NFT via safeTransferFrom // vault has no onERC721Received -> the transfer reverts, staking broken; // or a stuck NFT with no withdraw path.
contract Vault is IERC721Receiver {
function onERC721Received(address,address,uint256,bytes calldata) external pure returns (bytes4) {
return IERC721Receiver.onERC721Received.selector;
}
}
The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0216 among them. Paste an address or the source itself — a small per-scan fee, shown before you sign, or unlimited on any plan.