From 5eaf23727591575962d7afb3cf215cdb94a5f40b Mon Sep 17 00:00:00 2001 From: Dhvani Patel Date: Tue, 14 May 2024 12:34:52 +0100 Subject: [PATCH] getters --- packages/hardhat/contracts/Game.sol | 64 +- packages/nextjs/app/page.tsx | 3 +- .../nextjs/contracts/deployedContracts.ts | 1501 +---------------- 3 files changed, 130 insertions(+), 1438 deletions(-) diff --git a/packages/hardhat/contracts/Game.sol b/packages/hardhat/contracts/Game.sol index 9a51b2d3..eb39ed59 100644 --- a/packages/hardhat/contracts/Game.sol +++ b/packages/hardhat/contracts/Game.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.8.24; +import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol"; import { ResourceId, WorldResourceIdLib, WorldResourceIdInstance } from "@latticexyz/world/src/WorldResourceId.sol"; import { Hook } from "@latticexyz/store/src/Hook.sol"; @@ -14,6 +15,8 @@ import { hasBeforeAndAfterSystemHook, getEntityAtCoord, getEntityFromPlayer, get import { IWorld } from "@biomesaw/world/src/codegen/world/IWorld.sol"; import { VoxelCoord } from "@biomesaw/utils/src/Types.sol"; +import { decodeCallData } from "../utils/HookUtils.sol"; +import { weiToString } from "../utils/GameUtils.sol"; struct LeaderboardEntry { address player; @@ -177,8 +180,8 @@ contract Game is IOptionalSystemHook { lastHitter[msgSender] = address(0); } } else if (ResourceId.unwrap(systemId) == ResourceId.unwrap(HitSystemId)) { - Slice callDataArgs = SliceLib.getSubslice(callData, 4); - address hitPlayer = abi.decode(callDataArgs.toBytes(), (address)); + (, bytes memory callDataArgs) = decodeCallData(callData); + address hitPlayer = abi.decode(callDataArgs, (address)); if (isPlayerRegistered(hitPlayer)) { lastHitter[hitPlayer] = msgSender; @@ -236,7 +239,6 @@ contract Game is IOptionalSystemHook { } } - //UNUSED: function onRegisterHook( address msgSender, ResourceId systemId, @@ -254,4 +256,60 @@ contract Game is IOptionalSystemHook { ResourceId systemId, bytes memory callData ) external override onlyBiomeWorld {} + + function getDisplayName() external view returns (string memory) { + return "Bounty Hunter"; + } + + function getAvatars() external view returns (bytes32[] memory) { + bytes32[] memory avatars = new bytes32[](players.length); + for (uint i = 0; i < players.length; i++) { + avatars[i] = getEntityFromPlayer(players[i]); + } + return avatars; + } + + function getStatus() external view returns (string memory) { + if (!isPlayerRegistered(msg.sender)) { + return "You are not registered yet."; + } + + uint256 playerBalanceWei = balance[msg.sender]; + address recipient = lastHitter[msg.sender]; + bool canWithdraw = lastWithdrawal[msg.sender] + 2 hours < block.timestamp; + + return + string.concat( + "Your balance is ", + weiToString(playerBalanceWei), + " ether and your last hitter is ", + recipient != address(0) ? Strings.toHexString(recipient) : "no one", + canWithdraw ? ". You may withdraw!" : ". See countdown for next withdrawal." + ); + } + + function getUnregisterMessage() external view returns (string memory) { + if (!isPlayerRegistered(msg.sender)) { + return ""; + } + + uint256 playerBalance = balance[msg.sender]; + address recipient = lastHitter[msg.sender]; + + if (playerBalance > 0) { + if (recipient == address(0)) { + return "You have unclaimed balance. You will be unregistered and the balance will be sent to you."; + } else { + return "You have unclaimed balance. You will be unregistered and the balance will be sent to your last hitter."; + } + } + } + + function getCountdownEndTimestamp() external view returns (uint256) { + if (!isPlayerRegistered(msg.sender)) { + return 0; + } + + return lastWithdrawal[msg.sender] + 2 hours; + } } diff --git a/packages/nextjs/app/page.tsx b/packages/nextjs/app/page.tsx index d24f87f5..b6ad148d 100644 --- a/packages/nextjs/app/page.tsx +++ b/packages/nextjs/app/page.tsx @@ -17,7 +17,8 @@ const Home: NextPage = () => { const isBiomesRegistered = useGlobalState(({ isBiomesRegistered }) => isBiomesRegistered); const isGameRegistered = useGlobalState(({ isGameRegistered }) => isGameRegistered); - const isBiomesClientSetup = useGlobalState(({ isBiomesClientSetup }) => isBiomesClientSetup); + // const isBiomesClientSetup = useGlobalState(({ isBiomesClientSetup }) => isBiomesClientSetup); + const isBiomesClientSetup = true; useEffect(() => { if (connectedAddress) { diff --git a/packages/nextjs/contracts/deployedContracts.ts b/packages/nextjs/contracts/deployedContracts.ts index 7bb3b7a0..4baef59e 100644 --- a/packages/nextjs/contracts/deployedContracts.ts +++ b/packages/nextjs/contracts/deployedContracts.ts @@ -5,9 +5,9 @@ import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract"; const deployedContracts = { - 690: { + 31337: { Game: { - address: "0xDaeAeb19d2b2fde49b613e687F9794544A2FBb6c", + address: "0xeF31027350Be2c7439C1b0BE022d49421488b72C", abi: [ { inputs: [ @@ -148,6 +148,19 @@ const deployedContracts = { stateMutability: "view", type: "function", }, + { + inputs: [], + name: "getAvatars", + outputs: [ + { + internalType: "bytes32[]", + name: "", + type: "bytes32[]", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [], name: "getBalancesLeaderboard", @@ -173,6 +186,32 @@ const deployedContracts = { stateMutability: "view", type: "function", }, + { + inputs: [], + name: "getCountdownEndTimestamp", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getDisplayName", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [], name: "getRegisteredPlayerEntityIds", @@ -199,6 +238,32 @@ const deployedContracts = { stateMutability: "view", type: "function", }, + { + inputs: [], + name: "getStatus", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getUnregisterMessage", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [ { @@ -420,1438 +485,6 @@ const deployedContracts = { }, }, }, - 17069: { - Game: { - address: "0xae60eCEFf66A56771965817456190AF11D89357f", - abi: [ - { - inputs: [ - { - internalType: "address", - name: "_biomeWorldAddress", - type: "address", - }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - inputs: [ - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "uint256", - name: "start", - type: "uint256", - }, - { - internalType: "uint256", - name: "end", - type: "uint256", - }, - ], - name: "Slice_OutOfBounds", - type: "error", - }, - { - inputs: [], - name: "biomeWorldAddress", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "buildCount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "buildingId", - type: "uint256", - }, - { - internalType: "uint256", - name: "n", - type: "uint256", - }, - ], - name: "challengeBuilding", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - name: "coordHashToBuilder", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint8[]", - name: "objectTypeIds", - type: "uint8[]", - }, - { - components: [ - { - internalType: "int16", - name: "x", - type: "int16", - }, - { - internalType: "int16", - name: "y", - type: "int16", - }, - { - internalType: "int16", - name: "z", - type: "int16", - }, - ], - internalType: "struct VoxelCoord[]", - name: "relativePositions", - type: "tuple[]", - }, - { - internalType: "uint256", - name: "submissionPrice", - type: "uint256", - }, - { - internalType: "string", - name: "name", - type: "string", - }, - ], - name: "create", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "getAllBlueprints", - outputs: [ - { - components: [ - { - internalType: "uint256", - name: "id", - type: "uint256", - }, - { - components: [ - { - internalType: "uint8[]", - name: "objectTypeIds", - type: "uint8[]", - }, - { - components: [ - { - internalType: "int16", - name: "x", - type: "int16", - }, - { - internalType: "int16", - name: "y", - type: "int16", - }, - { - internalType: "int16", - name: "z", - type: "int16", - }, - ], - internalType: "struct VoxelCoord[]", - name: "relativePositions", - type: "tuple[]", - }, - ], - internalType: "struct Build", - name: "blueprint", - type: "tuple", - }, - ], - internalType: "struct BlueprintPair[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getAllBuilders", - outputs: [ - { - components: [ - { - internalType: "uint256", - name: "id", - type: "uint256", - }, - { - internalType: "address[]", - name: "builderAddresses", - type: "address[]", - }, - ], - internalType: "struct BuilderList[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getAllLocations", - outputs: [ - { - components: [ - { - internalType: "uint256", - name: "id", - type: "uint256", - }, - { - components: [ - { - internalType: "int16", - name: "x", - type: "int16", - }, - { - internalType: "int16", - name: "y", - type: "int16", - }, - { - internalType: "int16", - name: "z", - type: "int16", - }, - ], - internalType: "struct VoxelCoord[]", - name: "location", - type: "tuple[]", - }, - ], - internalType: "struct LocationPair[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getAllNames", - outputs: [ - { - components: [ - { - internalType: "uint256", - name: "id", - type: "uint256", - }, - { - internalType: "string", - name: "name", - type: "string", - }, - ], - internalType: "struct NamePair[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getAllSubmissionPrices", - outputs: [ - { - components: [ - { - internalType: "uint256", - name: "id", - type: "uint256", - }, - { - internalType: "uint256", - name: "price", - type: "uint256", - }, - ], - internalType: "struct SubmissionPricePair[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getEarned", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getList", - outputs: [ - { - components: [ - { - internalType: "uint256", - name: "id", - type: "uint256", - }, - { - internalType: "string", - name: "name", - type: "string", - }, - { - internalType: "uint256", - name: "price", - type: "uint256", - }, - { - internalType: "address[]", - name: "builders", - type: "address[]", - }, - { - components: [ - { - internalType: "uint8[]", - name: "objectTypeIds", - type: "uint8[]", - }, - { - components: [ - { - internalType: "int16", - name: "x", - type: "int16", - }, - { - internalType: "int16", - name: "y", - type: "int16", - }, - { - internalType: "int16", - name: "z", - type: "int16", - }, - ], - internalType: "struct VoxelCoord[]", - name: "relativePositions", - type: "tuple[]", - }, - ], - internalType: "struct Build", - name: "blueprint", - type: "tuple", - }, - { - components: [ - { - internalType: "int16", - name: "x", - type: "int16", - }, - { - internalType: "int16", - name: "y", - type: "int16", - }, - { - internalType: "int16", - name: "z", - type: "int16", - }, - ], - internalType: "struct VoxelCoord[]", - name: "locations", - type: "tuple[]", - }, - ], - internalType: "struct ListEntry[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "msgSender", - type: "address", - }, - { - internalType: "ResourceId", - name: "systemId", - type: "bytes32", - }, - { - internalType: "bytes", - name: "callData", - type: "bytes", - }, - ], - name: "onAfterCallSystem", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "msgSender", - type: "address", - }, - { - internalType: "ResourceId", - name: "systemId", - type: "bytes32", - }, - { - internalType: "bytes", - name: "callData", - type: "bytes", - }, - ], - name: "onBeforeCallSystem", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "msgSender", - type: "address", - }, - { - internalType: "ResourceId", - name: "systemId", - type: "bytes32", - }, - { - internalType: "uint8", - name: "enabledHooksBitmap", - type: "uint8", - }, - { - internalType: "bytes32", - name: "callDataHash", - type: "bytes32", - }, - ], - name: "onRegisterHook", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "msgSender", - type: "address", - }, - { - internalType: "ResourceId", - name: "systemId", - type: "bytes32", - }, - { - internalType: "uint8", - name: "enabledHooksBitmap", - type: "uint8", - }, - { - internalType: "bytes32", - name: "callDataHash", - type: "bytes32", - }, - ], - name: "onUnregisterHook", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "buildingId", - type: "uint256", - }, - { - components: [ - { - internalType: "int16", - name: "x", - type: "int16", - }, - { - internalType: "int16", - name: "y", - type: "int16", - }, - { - internalType: "int16", - name: "z", - type: "int16", - }, - ], - internalType: "struct VoxelCoord", - name: "baseWorldCoord", - type: "tuple", - }, - ], - name: "submitBuilding", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes4", - name: "interfaceId", - type: "bytes4", - }, - ], - name: "supportsInterface", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - ], - inheritedFunctions: { - onAfterCallSystem: "@latticexyz/world/src/IOptionalSystemHook.sol", - onBeforeCallSystem: "@latticexyz/world/src/IOptionalSystemHook.sol", - onRegisterHook: "@latticexyz/world/src/IOptionalSystemHook.sol", - onUnregisterHook: "@latticexyz/world/src/IOptionalSystemHook.sol", - supportsInterface: "@latticexyz/world/src/IOptionalSystemHook.sol", - }, - }, - }, - 17069: { - Game: { - address: "0xB1f332427AdE17d97686395cB109B216A2B51F03", - abi: [ - { - inputs: [ - { - internalType: "address", - name: "_biomeWorldAddress", - type: "address", - }, - { - internalType: "address", - name: "_delegatorAddress", - type: "address", - }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - inputs: [], - name: "basicGetter", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "biomeWorldAddress", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "delegator", - type: "address", - }, - ], - name: "canUnregister", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "delegatorAddress", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getRegisteredPlayers", - outputs: [ - { - internalType: "address[]", - name: "", - type: "address[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "msgSender", - type: "address", - }, - { - internalType: "ResourceId", - name: "systemId", - type: "bytes32", - }, - { - internalType: "bytes", - name: "callData", - type: "bytes", - }, - ], - name: "onAfterCallSystem", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "msgSender", - type: "address", - }, - { - internalType: "ResourceId", - name: "systemId", - type: "bytes32", - }, - { - internalType: "bytes", - name: "callData", - type: "bytes", - }, - ], - name: "onBeforeCallSystem", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "msgSender", - type: "address", - }, - { - internalType: "ResourceId", - name: "systemId", - type: "bytes32", - }, - { - internalType: "uint8", - name: "enabledHooksBitmap", - type: "uint8", - }, - { - internalType: "bytes32", - name: "callDataHash", - type: "bytes32", - }, - ], - name: "onRegisterHook", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "msgSender", - type: "address", - }, - { - internalType: "ResourceId", - name: "systemId", - type: "bytes32", - }, - { - internalType: "uint8", - name: "enabledHooksBitmap", - type: "uint8", - }, - { - internalType: "bytes32", - name: "callDataHash", - type: "bytes32", - }, - ], - name: "onUnregisterHook", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes4", - name: "interfaceId", - type: "bytes4", - }, - ], - name: "supportsInterface", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - ], - inheritedFunctions: { - canUnregister: "@latticexyz/world/src/ICustomUnregisterDelegation.sol", - supportsInterface: "@latticexyz/world/src/IOptionalSystemHook.sol", - onAfterCallSystem: "@latticexyz/world/src/IOptionalSystemHook.sol", - onBeforeCallSystem: "@latticexyz/world/src/IOptionalSystemHook.sol", - onRegisterHook: "@latticexyz/world/src/IOptionalSystemHook.sol", - onUnregisterHook: "@latticexyz/world/src/IOptionalSystemHook.sol", - }, - }, - }, - 31337: { - Game: { - address: "0x12Bcb546bC60fF39F1Adfc7cE4605d5Bd6a6A876", - abi: [ - { - inputs: [ - { - internalType: "address", - name: "_biomeWorldAddress", - type: "address", - }, - { - components: [ - { - internalType: "int16", - name: "x", - type: "int16", - }, - { - internalType: "int16", - name: "y", - type: "int16", - }, - { - internalType: "int16", - name: "z", - type: "int16", - }, - ], - internalType: "struct VoxelCoord", - name: "lowerSouthwestCorner", - type: "tuple", - }, - { - components: [ - { - internalType: "int16", - name: "x", - type: "int16", - }, - { - internalType: "int16", - name: "y", - type: "int16", - }, - { - internalType: "int16", - name: "z", - type: "int16", - }, - ], - internalType: "struct VoxelCoord", - name: "size", - type: "tuple", - }, - { - internalType: "address", - name: "_gameStarter", - type: "address", - }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - inputs: [ - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - { - internalType: "uint256", - name: "start", - type: "uint256", - }, - { - internalType: "uint256", - name: "end", - type: "uint256", - }, - ], - name: "Slice_OutOfBounds", - type: "error", - }, - { - inputs: [], - name: "biomeWorldAddress", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "claimRewardPool", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "gameEndBlock", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "gameStarter", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getAlivePlayers", - outputs: [ - { - internalType: "address[]", - name: "", - type: "address[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getAreas", - outputs: [ - { - components: [ - { - internalType: "string", - name: "name", - type: "string", - }, - { - components: [ - { - components: [ - { - internalType: "int16", - name: "x", - type: "int16", - }, - { - internalType: "int16", - name: "y", - type: "int16", - }, - { - internalType: "int16", - name: "z", - type: "int16", - }, - ], - internalType: "struct VoxelCoord", - name: "lowerSouthwestCorner", - type: "tuple", - }, - { - components: [ - { - internalType: "int16", - name: "x", - type: "int16", - }, - { - internalType: "int16", - name: "y", - type: "int16", - }, - { - internalType: "int16", - name: "z", - type: "int16", - }, - ], - internalType: "struct VoxelCoord", - name: "size", - type: "tuple", - }, - ], - internalType: "struct Area", - name: "area", - type: "tuple", - }, - ], - internalType: "struct NamedArea[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getAvatars", - outputs: [ - { - internalType: "bytes32[]", - name: "", - type: "bytes32[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getCountdownEndBlock", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getDeadPlayers", - outputs: [ - { - internalType: "address[]", - name: "", - type: "address[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getDisplayName", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getDisqualifiedPlayers", - outputs: [ - { - internalType: "address[]", - name: "", - type: "address[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getKillsLeaderboard", - outputs: [ - { - components: [ - { - internalType: "address", - name: "player", - type: "address", - }, - { - internalType: "bool", - name: "isAlive", - type: "bool", - }, - { - internalType: "uint256", - name: "kills", - type: "uint256", - }, - ], - internalType: "struct LeaderboardEntry[]", - name: "", - type: "tuple[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getMatchArea", - outputs: [ - { - components: [ - { - components: [ - { - internalType: "int16", - name: "x", - type: "int16", - }, - { - internalType: "int16", - name: "y", - type: "int16", - }, - { - internalType: "int16", - name: "z", - type: "int16", - }, - ], - internalType: "struct VoxelCoord", - name: "lowerSouthwestCorner", - type: "tuple", - }, - { - components: [ - { - internalType: "int16", - name: "x", - type: "int16", - }, - { - internalType: "int16", - name: "y", - type: "int16", - }, - { - internalType: "int16", - name: "z", - type: "int16", - }, - ], - internalType: "struct VoxelCoord", - name: "size", - type: "tuple", - }, - ], - internalType: "struct Area", - name: "", - type: "tuple", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getRewardPool", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getStatus", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "getUnregisterMessage", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "isGameStarted", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "msgSender", - type: "address", - }, - { - internalType: "ResourceId", - name: "systemId", - type: "bytes32", - }, - { - internalType: "bytes", - name: "callData", - type: "bytes", - }, - ], - name: "onAfterCallSystem", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "msgSender", - type: "address", - }, - { - internalType: "ResourceId", - name: "systemId", - type: "bytes32", - }, - { - internalType: "bytes", - name: "callData", - type: "bytes", - }, - ], - name: "onBeforeCallSystem", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "msgSender", - type: "address", - }, - { - internalType: "ResourceId", - name: "systemId", - type: "bytes32", - }, - { - internalType: "uint8", - name: "enabledHooksBitmap", - type: "uint8", - }, - { - internalType: "bytes32", - name: "callDataHash", - type: "bytes32", - }, - ], - name: "onRegisterHook", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "msgSender", - type: "address", - }, - { - internalType: "ResourceId", - name: "systemId", - type: "bytes32", - }, - { - internalType: "uint8", - name: "enabledHooksBitmap", - type: "uint8", - }, - { - internalType: "bytes32", - name: "callDataHash", - type: "bytes32", - }, - ], - name: "onUnregisterHook", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "registerPlayer", - outputs: [], - stateMutability: "payable", - type: "function", - }, - { - inputs: [ - { - components: [ - { - internalType: "int16", - name: "x", - type: "int16", - }, - { - internalType: "int16", - name: "y", - type: "int16", - }, - { - internalType: "int16", - name: "z", - type: "int16", - }, - ], - internalType: "struct VoxelCoord", - name: "lowerSouthwestCorner", - type: "tuple", - }, - { - components: [ - { - internalType: "int16", - name: "x", - type: "int16", - }, - { - internalType: "int16", - name: "y", - type: "int16", - }, - { - internalType: "int16", - name: "z", - type: "int16", - }, - ], - internalType: "struct VoxelCoord", - name: "size", - type: "tuple", - }, - ], - name: "setMatchArea", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "numBlocksToEnd", - type: "uint256", - }, - ], - name: "startGame", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "bytes4", - name: "interfaceId", - type: "bytes4", - }, - ], - name: "supportsInterface", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - ], - inheritedFunctions: { - onAfterCallSystem: "@latticexyz/world/src/IOptionalSystemHook.sol", - onBeforeCallSystem: "@latticexyz/world/src/IOptionalSystemHook.sol", - onRegisterHook: "@latticexyz/world/src/IOptionalSystemHook.sol", - onUnregisterHook: "@latticexyz/world/src/IOptionalSystemHook.sol", - supportsInterface: "@latticexyz/world/src/IOptionalSystemHook.sol", - }, - }, - }, } as const; export default deployedContracts satisfies GenericContractsDeclaration;