Skip to content

Commit

Permalink
add events
Browse files Browse the repository at this point in the history
  • Loading branch information
dhvanipa committed May 14, 2024
1 parent 638f715 commit c835863
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/hardhat/contracts/Game.sol
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ contract Game is IOptionalSystemHook {
getEntityFromPlayer(msgSender) != bytes32(0),
"You Must First Spawn An Avatar In Biome-1 To Play The Game."
);
emit GameNotif(string.concat(Strings.toHexString(msgSender), " has joined the game"));
}

function onAfterCallSystem(
Expand All @@ -77,6 +78,8 @@ contract Game is IOptionalSystemHook {
(bool sent, ) = msgSender.call{ value: address(this).balance }("");
require(sent, "Failed to send Ether");

emit GameNotif(string.concat(Strings.toHexString(winner), " won the game!"));

return;
}

Expand Down

0 comments on commit c835863

Please sign in to comment.