sender). Tern sends the refund and pays its gas. Only the gas the user spent on the deposit itself isn’t returned.
Same-chain and private swaps never need a refund. If they can’t meet the minimum, the transaction reverts and nothing moves.
When a cross-chain swap refunds
When a swap is
refunded, its status includes source.refundTxHash: the transaction that returned the deposit.
Deposit addresses
A deposit address accepts any transfer, so it can receive the wrong amount, the wrong token, or a late payment. None of it can be lost: funds at a deposit address can only go into the swap or back to the user.
Tern watches each deposit address for several hours after its deadline. After that, anyone can return late funds to the user by calling
sweep on the contract. See Deposit addresses in the specification.