File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,9 +63,8 @@ contract yakuSwap is Ownable {
6363
6464 swap.status = SwapStatus.Completed;
6565 (bool success ,) = swap.toAddress.call {value: swap.amount}("" );
66- if (! success) {
67- swap.status = SwapStatus.Created;
68- }
66+
67+ require (success);
6968 }
7069
7170 function cancelSwap (bytes32 _swapId ) public {
@@ -76,17 +75,14 @@ contract yakuSwap is Ownable {
7675
7776 swap.status = SwapStatus.Cancelled;
7877 (bool success ,) = swap.fromAddress.call {value: swap.amount}("" );
79- if (! success) {
80- swap.status = SwapStatus.Created;
81- }
78+
79+ require (success);
8280 }
8381
8482 function getFees () public onlyOwner {
85- uint oldTotalFees = totalFees;
8683 totalFees = 0 ;
8784 (bool success ,) = owner ().call {value: totalFees}("" );
88- if (! success) {
89- totalFees = oldTotalFees;
90- }
85+
86+ require (success);
9187 }
9288}
You can’t perform that action at this time.
0 commit comments