We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a989df7 commit 786fb78Copy full SHA for 786fb78
contracts/yakuSwap.sol
@@ -24,6 +24,8 @@ contract yakuSwap is Ownable {
24
mapping (bytes32 => Swap) public swaps;
25
uint public totalFees = 0;
26
27
+ event SwapCompleted(bytes32 indexed _swapId, string _secret);
28
+
29
function getSwapId(bytes32 secretHash, address fromAddress) public pure returns (bytes32) {
30
return keccak256(abi.encodePacked(
31
secretHash,
@@ -62,6 +64,7 @@ contract yakuSwap is Ownable {
62
64
require(swap.secretHash == sha256(abi.encodePacked(_secret)));
63
65
66
swap.status = SwapStatus.Completed;
67
+ emit SwapCompleted(_swapId, _secret);
68
(bool success,) = swap.toAddress.call{value: swap.amount}("");
69
70
require(success);
0 commit comments