Skip to content


add SwapCompleted event
Browse files Browse the repository at this point in the history
  • Loading branch information
yakuhito committed Sep 2, 2021
1 parent a989df7 commit 786fb78
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contracts/yakuSwap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ contract yakuSwap is Ownable {
mapping (bytes32 => Swap) public swaps;
uint public totalFees = 0;

event SwapCompleted(bytes32 indexed _swapId, string _secret);

function getSwapId(bytes32 secretHash, address fromAddress) public pure returns (bytes32) {
return keccak256(abi.encodePacked(
Expand Down Expand Up @@ -62,6 +64,7 @@ contract yakuSwap is Ownable {
require(swap.secretHash == sha256(abi.encodePacked(_secret)));

swap.status = SwapStatus.Completed;
emit SwapCompleted(_swapId, _secret);
(bool success,) ={value: swap.amount}("");

Expand Down

0 comments on commit 786fb78

Please sign in to comment.