File tree Expand file tree Collapse file tree
contracts/atomic_swap/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -303,6 +303,13 @@ impl AtomicSwap {
303303 . persistent ( )
304304 . extend_ttl ( & DataKey :: Swap ( swap_id) , 50000 , 50000 ) ;
305305
306+ // Transfer escrowed payment to seller (Issue #34)
307+ token:: Client :: new ( & env, & swap. token ) . transfer (
308+ & env. current_contract_address ( ) ,
309+ & swap. seller ,
310+ & swap. price ,
311+ ) ;
312+
306313 env. events ( ) . publish (
307314 ( soroban_sdk:: symbol_short!( "key_rev" ) , ) ,
308315 KeyRevealedEvent {
@@ -427,6 +434,13 @@ impl AtomicSwap {
427434 env. storage ( )
428435 . persistent ( )
429436 . remove ( & DataKey :: ActiveSwap ( swap. ip_id ) ) ;
437+
438+ // Refund buyer's escrowed payment (Issue #35)
439+ token:: Client :: new ( & env, & swap. token ) . transfer (
440+ & env. current_contract_address ( ) ,
441+ & swap. buyer ,
442+ & swap. price ,
443+ ) ;
430444 }
431445
432446 /// Read a swap record. Returns `None` if the swap_id does not exist.
You can’t perform that action at this time.
0 commit comments