Skip to content

Commit

Permalink
add events
Browse files Browse the repository at this point in the history
  • Loading branch information
dhvanipa committed May 16, 2024
1 parent 8bf30d6 commit 9b3bdf8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 655 deletions.
3 changes: 3 additions & 0 deletions packages/hardhat/contracts/Game.sol
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ contract Game is IOptionalSystemHook {

submissionPrices[buildCount] = submissionPrice;
names[buildCount] = name;

emit GameNotif(address(0), "A new build has been added to the game.");
}

function submitBuilding(uint256 buildingId, VoxelCoord memory baseWorldCoord) external payable {
Expand Down Expand Up @@ -162,6 +164,7 @@ contract Game is IOptionalSystemHook {
earned[buildersAtId[i]] += splitAmount;
(bool sent, ) = buildersAtId[i].call{ value: splitAmount }("");
require(sent, "Failed to send submission price to builder");
emit GameNotif(buildersAtId[i], "You've earned some ether for your contribution to a build.");
}

if (remainder > 0) {
Expand Down
Loading

0 comments on commit 9b3bdf8

Please sign in to comment.