This contract allows the owner of the contract to set an escrow address and deposit funds in the contract. The funds can then be refunded or released to the buyer, but only by the escrow address. The contract also emits events for deposit, refund, and release of funds.
Please note that this is just an example and you should test it thoroughly before deployment.