File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,8 @@ contract yakuSwap is Ownable {
6262 require (swap.secretHash == sha256 (abi.encodePacked (_secret)));
6363
6464 swap.status = SwapStatus.Completed;
65- if (! payable (swap.toAddress).send (swap.amount)) {
65+ (bool success ,) = swap.toAddress.call {value: swap.amount}("" );
66+ if (! success) {
6667 swap.status = SwapStatus.Created;
6768 }
6869 }
@@ -74,15 +75,17 @@ contract yakuSwap is Ownable {
7475 require (block .number >= swap.startBlock + swap.maxBlockHeight);
7576
7677 swap.status = SwapStatus.Cancelled;
77- if (! payable (swap.fromAddress).send (swap.amount)) {
78+ (bool success ,) = swap.fromAddress.call {value: swap.amount}("" );
79+ if (! success) {
7880 swap.status = SwapStatus.Created;
7981 }
8082 }
8183
8284 function getFees () public onlyOwner {
8385 uint oldTotalFees = totalFees;
8486 totalFees = 0 ;
85- if (! payable (owner ()).send (totalFees)) {
87+ (bool success ,) = owner ().call {value: totalFees}("" );
88+ if (! success) {
8689 totalFees = oldTotalFees;
8790 }
8891 }
You can’t perform that action at this time.
0 commit comments