contract ERC721Holder is IERC721Receiver {

    // Equal to: bytes4(keccak256("onERC721Received(address,address,uint256,bytes)")).
    bytes4 internal constant NEW_ERC721_RECEIVED = 0x150b7a02;

    // Equal to: bytes4(keccak256("onERC721Received(address,uint256,bytes)"));
    bytes4 internal constant OLD_ERC721_RECEIVED = 0xf0b9e5ba;

    /**
     * @dev implements old onERC721Received interface
     */
    function onERC721Received(address, uint256, bytes memory) public pure returns (bytes4) {
        return OLD_ERC721_RECEIVED;
    }

    /**
     * @dev The ERC721 smart contract calls this function on the recipient
     *  after a {IERC721-safeTransferFrom}.
     */
    function onERC721Received(
        address,
        address,
        uint256,
        bytes memory
    )
        public virtual override returns (bytes4)
    {
        return NEW_ERC721_RECEIVED;
    }
}
function onERC721Received(address, uint256, bytes memory) public pure returns (bytes4) {
    return OLD_ERC721_RECEIVED;
}

/**
 * @dev implements old onERC721Received interface
 */