A half-sold himself a 100 dollar cup for 30 to his friend B, B went home and found the cup could not be sealed, and then wanted to ask

This is a gift contract with an obligation, but the obligation is not equivalent to the gift, and selling a 100 mug for 30 is already a clearly unreasonably low price. Therefore, it is still a gift contract.

Obligatory gift contract, the gift of property is defective, the donor in the limit of the obligation attached to the same responsibility as the seller.

Cups are used for what, can not seal whether the cup seriously affect the performance of the cup. The size of that defect affects the size of its grantor's warranty liability.

If B feels that his friendship with A is worth the $30 price tag, go to A and hold him liable for the defective warranty.

If the friendship between the two is something that money can't measure, then B can use the cup as a vase.