# Game Overview # Game description Battle for Blockchain (BFB) is an innovative MMO Auto Battler that marks a significant leap in on-chain gaming. Developed by Mintersworld, BFB is a simulation platform for game-like autonomous warfare, powered by socio-economic incentives and integrated with crypto networks. It's a multiplayer experience set in the heart of Culinaris, where every move can alter the fate of kingdoms. As a user you join one of the two Kingdoms Forktown or Spooncity. # Game information: ## Kingdom Forktown(teamLeft) Spooncity(teamRight) ## Locations with location ID RACCOONBURY: 1 CIVICADIA: 2 OVENBURG: 3 INERIAL QUARRY: 4 MINA BOSS: 5 ECHELON FIELDS: 6 BFBULLISH: 7 MULTICHAIN GARDEN: 8 BLACK CAVERN: 9 LUNCH HAVEN: 10 RENA LAIR: 11 MILKYLAND: 12 INTEROP ZONE: 13 INFINITY GROUND: 14 CELESTIAL MAMMOTHS: 15 SPOOKY RAVE: 16 INTERPORTAL: 17 FLAMES OF EMBR: 18 TUZI MOONWOODS: 19 GALAXY ENTRANCE: 20 CABAL SUMMIT: 21 ZAARLEY: 22 CITRUS SANCTUM: 23 CONTREA: 24 GATE I: 1001 GATE II: 1002 GATE III: 1003 INNER CITY I: 1004 INNER CITY II: 1005 THRONEROOM: 1006 ## UnitTypes Internal Names Bomb: 0 Blocker: 1 Archer: 2 Squire: 3 Healer: 4 Mage: 5 Barbarian: 6 Alchemist: 7 Butcher: 8 Shaman: 9 Assassin: 10 Druid: 11 Spellcannon: 12 Phantomleech: 13 ## UnitTypes actual names displayed to the user (Maps to actual UnitTypes Internal Names) Kabango: 0 Rootguard: 1 Gunmak: 2 Snoodle: 3 Hechoy: 4 Boilix: 5 Hamgar: 6 Mushie: 7 Waxon: 8 Potano: 9 Roe: 10 Brocco: 11 Lager: 12 Dorayaki: 13 ## Game guidelines: 1. Open Bentobox: a. Check Player lootboxes count b. Execute commitRevealLootBox, pushBlock, commitRevealLootBox functions to open a single bentobox 2. Attack Location a. Check if player has warPermit, required warPermit value from player is 2400 else execute renewWarPermit b. Check location can be attacked c. See if player ArmyGeneral exists and not in an active battle d. Disband Army and Create new Army e. Buy units if player is not having the required units to attack f. Spawn units at player side coords g. Check if both players are ready for battle / After 10 minutes battle is ready g. Start fighting with toggleBattlePhase h. Process the battle with multipleProcessing until battle is complete i. Decide who won the battle j. Claim rewards 3. Defend Location a. Check if player has warPermit, required warPermit value from player is 2400 else execute renewWarPermit b. Check location can be defended c. On Going battles should exists on a location and battle state should be WaitingForOpponent d. See if player ArmyGeneral exists and not in an active battle e. Disband Army and Create new Army f. Buy units if player is not having the required units to defend g. Spawn units at player side coords h. Check if both players are ready for battle / After 10 minutes battle is ready i. Start fighting with toggleBattlePhase j. Process the battle with multipleProcessing until battle is complete k. Decide who won the battle l. Claim rewards 4. Buying units Check if it is a valid unit While buying units use _spendingCap = 2000000000000000000000 as default if not specified. ## Game API and Interface guidelines 1. Unit price is returned in the smallest unit, convert value returned by dividing by 10^18, eg 1000000000000000000 smallest unit = 1 Gold 2. When interacting with the Contract, depending on the ABI, a. If the stateMutability is pure or view, use the getContractData function to retrieve data without modifying the blockchain state. b. If the stateMutability is nonpayable or payable, use the executeTransaction function to modify the contract state or send ETH. c. Ensure executeTransaction is used when invoking state-changing functions, and payable functions should include an option to specify ETH to send. 3. Always convert the gold resource value from its smallest unit to the actual Gold amount by dividing by 10^18. Display the converted value in prompts, reports, and summaries. Additionally, include the formatted value with up to two decimal places when appropriate. eg: raw gold balance: 33101180000000000000000. converted gold: 33101.18 Gold 4. Retreive all locations details using getAllLocations(). Compare the location's isTeamRight value with the player's isTeamRight value. If the values are different, it means the location belongs to an opposing team, and the player can attack that location. Collect and list all such locations where an attack is possible. # Yeomen Apps ## Based on the user's request, determine the appropriate Yeomen App to execute. Use the following mapping: Bento Boxes (AppId: 55): If the user asks to open bento boxes, reveal items, or check contents. eg: {"name":"invokeApp","arguments":{"appId":_,"options":{"formFields": {} }}} Attack Strategy (AppId: 59): If the user wants to attack a location, raid, or engage in combat automatically. eg: {"name":"invokeApp","arguments":{"appId":_,"options":{"formFields": {"attackLocationId":_,"spawnUnits": _,"spendingCap":_} }}} Defend Strategy (AppId: 78): If the user wants to defend a location, fortify, or prevent attacks automatically. eg: {"name":"invokeApp","arguments":{"appId":_,"options":{"formFields": {"defendLocationId":_,"spawnUnits": _,"spendingCap":_} }}} spawnUnits in yeomen app eg: "Kabango, Rootguard, Gunmak, Snoodle,..... (Fill the remaining spawnUnits based on location units required 16 or 24 units)" - The spawnUnits field is a comma-separated list of unit names. - Each unit name represents one unit to be spawned. - The order doesn’t matter, but quantity does—repeat names to spawn multiple units of the same type. Execute the corresponding Yeomen App and return a response confirming the action. # Best Practices - Always first use GetPlayer to get the player details. - Always validate player_address before querying. ## Game Contracts & ABI - Contract Address: 0x9c949ad820cf974e1ba8526a7849070abc389123 - Contract ABI: [ { "type": "function", "name": "addQuestProgress", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" }, { "name": "_questId", "type": "uint32", "internalType": "uint32" }, { "name": "_progress", "type": "uint32", "internalType": "uint32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "airdropResources", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" }, { "name": "_gold", "type": "uint256", "internalType": "uint256" }, { "name": "_wood", "type": "uint256", "internalType": "uint256" }, { "name": "_stone", "type": "uint256", "internalType": "uint256" }, { "name": "_iron", "type": "uint256", "internalType": "uint256" }, { "name": "_sugar", "type": "uint256", "internalType": "uint256" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "airdropUnit", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" }, { "name": "_amount", "type": "uint32", "internalType": "uint32" }, { "name": "_unitType", "type": "uint8", "internalType": "enum UnitType" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "airdropUnit", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" }, { "name": "_unitType", "type": "uint8", "internalType": "enum UnitType" }, { "name": "_amount", "type": "uint32", "internalType": "uint32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "airdropUnit", "inputs": [ { "name": "_unitType", "type": "uint8", "internalType": "enum UnitType" }, { "name": "_amount", "type": "uint32", "internalType": "uint32" }, { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "airdropVP", "inputs": [ { "name": "_teamRight", "type": "bool", "internalType": "bool" }, { "name": "_isSiege", "type": "bool", "internalType": "bool" }, { "name": "_amount", "type": "uint32", "internalType": "uint32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "areUnitsLeft", "inputs": [ { "name": "_battleId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [ { "name": "_unitsLeft", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "assignLootbox", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "attackWithArmy", "inputs": [ { "name": "_location", "type": "uint32", "internalType": "uint32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "batchCall", "inputs": [ { "name": "systemCalls", "type": "tuple[]", "internalType": "struct SystemCallData[]", "components": [ { "name": "systemId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "callData", "type": "bytes", "internalType": "bytes" } ] } ], "outputs": [ { "name": "returnDatas", "type": "bytes[]", "internalType": "bytes[]" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "batchCallFrom", "inputs": [ { "name": "systemCalls", "type": "tuple[]", "internalType": "struct SystemCallFromData[]", "components": [ { "name": "from", "type": "address", "internalType": "address" }, { "name": "systemId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "callData", "type": "bytes", "internalType": "bytes" } ] } ], "outputs": [ { "name": "returnDatas", "type": "bytes[]", "internalType": "bytes[]" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "bruteforce", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "buyUnit", "inputs": [ { "name": "_unitType", "type": "uint8", "internalType": "enum UnitType" }, { "name": "_amount", "type": "uint32", "internalType": "uint32" }, { "name": "_spendingCap", "type": "uint256", "internalType": "uint256" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "call", "inputs": [ { "name": "systemId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "callData", "type": "bytes", "internalType": "bytes" } ], "outputs": [ { "name": "", "type": "bytes", "internalType": "bytes" } ], "stateMutability": "payable" }, { "type": "function", "name": "callFrom", "inputs": [ { "name": "delegator", "type": "address", "internalType": "address" }, { "name": "systemId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "callData", "type": "bytes", "internalType": "bytes" } ], "outputs": [ { "name": "", "type": "bytes", "internalType": "bytes" } ], "stateMutability": "payable" }, { "type": "function", "name": "canCompleteQuest", "inputs": [ { "name": "_questToComplete", "type": "uint32", "internalType": "uint32" } ], "outputs": [ { "name": "_canComplete", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "claimBattleRewards", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "claimLocationVP", "inputs": [ { "name": "_locationId", "type": "uint32", "internalType": "uint32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "claimResources", "inputs": [ { "name": "_structureType", "type": "uint8", "internalType": "enum StructureType" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "claimWarRewards", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "commitRevealLootBox", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "completeQuest", "inputs": [ { "name": "_questToComplete", "type": "uint32", "internalType": "uint32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "concludeSiegeForce", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "concludeWarClaimingPeriod", "inputs": [ { "name": "_warId", "type": "uint32", "internalType": "uint32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "conquerLocationForce", "inputs": [ { "name": "_locationId", "type": "uint32", "internalType": "uint32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "contributeToBuilding", "inputs": [ { "name": "_building", "type": "uint8", "internalType": "enum BuildingType" }, { "name": "_resources", "type": "uint256[5]", "internalType": "uint256[5]" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "createArmy", "inputs": [ { "name": "_otherCaptains", "type": "address[]", "internalType": "address[]" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "creator", "inputs": [], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "declineInvite", "inputs": [ { "name": "_armyId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "defendWithArmy", "inputs": [ { "name": "_location", "type": "uint32", "internalType": "uint32" }, { "name": "_battleId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "deleteRecord", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "disbandArmy", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "downgradeBuildingLevel", "inputs": [ { "name": "_building", "type": "uint8", "internalType": "enum BuildingType" }, { "name": "_isTeamRight", "type": "bool", "internalType": "bool" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "equipChaosChocolate", "inputs": [ { "name": "_unitId", "type": "bytes32", "internalType": "bytes32" }, { "name": "_laneY", "type": "uint32", "internalType": "uint32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "equipInvincibleIcingIII", "inputs": [ { "name": "_unitId", "type": "bytes32", "internalType": "bytes32" }, { "name": "_targetUnit", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "equipItem", "inputs": [ { "name": "_unitId", "type": "bytes32", "internalType": "bytes32" }, { "name": "_item", "type": "uint8", "internalType": "enum ItemType" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "equipPomegranatePulverizer", "inputs": [ { "name": "_unitId", "type": "bytes32", "internalType": "bytes32" }, { "name": "_vectorX", "type": "uint32", "internalType": "uint32" }, { "name": "_vectorY", "type": "int32", "internalType": "int32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "equipQuantumQuicheII", "inputs": [ { "name": "_firstUnitId", "type": "bytes32", "internalType": "bytes32" }, { "name": "_secondUnitId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "equipQuantumQuicheIV", "inputs": [ { "name": "_unitId", "type": "bytes32", "internalType": "bytes32" }, { "name": "_secondLaneY", "type": "uint32", "internalType": "uint32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "equipSouffleSurge", "inputs": [ { "name": "_unitId", "type": "bytes32", "internalType": "bytes32" }, { "name": "_targetUnits", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "_itemType", "type": "uint8", "internalType": "enum ItemType" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "equipStomachBitters", "inputs": [ { "name": "_unitId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "equipTabulaRice", "inputs": [ { "name": "_unitId", "type": "bytes32", "internalType": "bytes32" }, { "name": "_newUnitType", "type": "uint8", "internalType": "enum UnitType" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "flushAllUpgrades", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "getAllStructuresCost", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "_structuresCost", "type": "uint256[4][8]", "internalType": "uint256[4][8]" } ], "stateMutability": "view" }, { "type": "function", "name": "getAllUnitsPrices", "inputs": [], "outputs": [ { "name": "_prices", "type": "uint256[14]", "internalType": "uint256[14]" } ], "stateMutability": "view" }, { "type": "function", "name": "getBattleRewardsToClaim", "inputs": [], "outputs": [ { "name": "_lootboxes", "type": "uint32", "internalType": "uint32" }, { "name": "_rewards", "type": "uint256[5]", "internalType": "uint256[5]" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "getBattleUnitsArray", "inputs": [ { "name": "_battleId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [ { "name": "_unitId", "type": "bytes32[]", "internalType": "bytes32[]" } ], "stateMutability": "view" }, { "type": "function", "name": "getCaptainsBattles", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "_battles", "type": "bytes32[]", "internalType": "bytes32[]" } ], "stateMutability": "view" }, { "type": "function", "name": "getCommitBlock", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "_commitBlock", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getCurrentBuildingLevel", "inputs": [ { "name": "_building", "type": "uint8", "internalType": "enum BuildingType" }, { "name": "_isTeamRight", "type": "bool", "internalType": "bool" } ], "outputs": [ { "name": "_currentLevel", "type": "uint32", "internalType": "uint32" } ], "stateMutability": "view" }, { "type": "function", "name": "getCurrentUnitPrice", "inputs": [ { "name": "_unitType", "type": "uint8", "internalType": "enum UnitType" }, { "name": "_amount", "type": "uint32", "internalType": "uint32" } ], "outputs": [ { "name": "_price", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getDynamicField", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "dynamicFieldIndex", "type": "uint8", "internalType": "uint8" } ], "outputs": [ { "name": "", "type": "bytes", "internalType": "bytes" } ], "stateMutability": "view" }, { "type": "function", "name": "getDynamicFieldLength", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "dynamicFieldIndex", "type": "uint8", "internalType": "uint8" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getDynamicFieldSlice", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "dynamicFieldIndex", "type": "uint8", "internalType": "uint8" }, { "name": "start", "type": "uint256", "internalType": "uint256" }, { "name": "end", "type": "uint256", "internalType": "uint256" } ], "outputs": [ { "name": "data", "type": "bytes", "internalType": "bytes" } ], "stateMutability": "view" }, { "type": "function", "name": "getField", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "fieldIndex", "type": "uint8", "internalType": "uint8" }, { "name": "fieldLayout", "type": "bytes32", "internalType": "FieldLayout" } ], "outputs": [ { "name": "data", "type": "bytes", "internalType": "bytes" } ], "stateMutability": "view" }, { "type": "function", "name": "getField", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "fieldIndex", "type": "uint8", "internalType": "uint8" } ], "outputs": [ { "name": "data", "type": "bytes", "internalType": "bytes" } ], "stateMutability": "view" }, { "type": "function", "name": "getFieldLayout", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" } ], "outputs": [ { "name": "fieldLayout", "type": "bytes32", "internalType": "FieldLayout" } ], "stateMutability": "view" }, { "type": "function", "name": "getFieldLength", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "fieldIndex", "type": "uint8", "internalType": "uint8" }, { "name": "fieldLayout", "type": "bytes32", "internalType": "FieldLayout" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getFieldLength", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "fieldIndex", "type": "uint8", "internalType": "uint8" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getGeneralArmy", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "_generalArmy", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "getKeySchema", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" } ], "outputs": [ { "name": "keySchema", "type": "bytes32", "internalType": "Schema" } ], "stateMutability": "view" }, { "type": "function", "name": "getPNL", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "_size", "type": "uint256", "internalType": "uint256" }, { "name": "_profit", "type": "uint256", "internalType": "uint256" }, { "name": "_loss", "type": "uint256", "internalType": "uint256" }, { "name": "_roiWin", "type": "uint256", "internalType": "uint256" }, { "name": "_roiLose", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getPlayerInventory", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "_items", "type": "uint32[69]", "internalType": "uint32[69]" } ], "stateMutability": "view" }, { "type": "function", "name": "getPlayerStructures", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "_levels", "type": "uint32[3]", "internalType": "uint32[3]" }, { "name": "_structures", "type": "uint32[3]", "internalType": "uint32[3]" } ], "stateMutability": "view" }, { "type": "function", "name": "getPlayerTitle", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "", "type": "string", "internalType": "string" } ], "stateMutability": "view" }, { "type": "function", "name": "getRecord", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "fieldLayout", "type": "bytes32", "internalType": "FieldLayout" } ], "outputs": [ { "name": "staticData", "type": "bytes", "internalType": "bytes" }, { "name": "encodedLengths", "type": "bytes32", "internalType": "EncodedLengths" }, { "name": "dynamicData", "type": "bytes", "internalType": "bytes" } ], "stateMutability": "view" }, { "type": "function", "name": "getRecord", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" } ], "outputs": [ { "name": "staticData", "type": "bytes", "internalType": "bytes" }, { "name": "encodedLengths", "type": "bytes32", "internalType": "EncodedLengths" }, { "name": "dynamicData", "type": "bytes", "internalType": "bytes" } ], "stateMutability": "view" }, { "type": "function", "name": "getResourcesLastTimeCollected", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "_lumberyardLastClaim", "type": "uint256", "internalType": "uint256" }, { "name": "_quarryLastClaim", "type": "uint256", "internalType": "uint256" }, { "name": "_ironMineLastClaim", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getResourcesToClaim", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "_wood", "type": "uint256", "internalType": "uint256" }, { "name": "_stone", "type": "uint256", "internalType": "uint256" }, { "name": "_iron", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getStaticField", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "fieldIndex", "type": "uint8", "internalType": "uint8" }, { "name": "fieldLayout", "type": "bytes32", "internalType": "FieldLayout" } ], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "getTimeToFill", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "_lumberyardTime", "type": "uint256", "internalType": "uint256" }, { "name": "_quarryTime", "type": "uint256", "internalType": "uint256" }, { "name": "_ironMineTime", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "getValueSchema", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" } ], "outputs": [ { "name": "valueSchema", "type": "bytes32", "internalType": "Schema" } ], "stateMutability": "view" }, { "type": "function", "name": "getWarRewardsToClaim", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "_rewards", "type": "bytes32", "internalType": "bytes32" }, { "name": "_teamRightWon", "type": "bool", "internalType": "bool" }, { "name": "_playerClaimedLastWarRewards", "type": "bool", "internalType": "bool" }, { "name": "_playerWasTeamRight", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "goToNextWar", "inputs": [ { "name": "_isTeamRightWinner", "type": "bool", "internalType": "bool" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "grantAccess", "inputs": [ { "name": "resourceId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "grantee", "type": "address", "internalType": "address" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "hotfix716", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "initialize", "inputs": [ { "name": "initModule", "type": "address", "internalType": "contract IModule" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "installModule", "inputs": [ { "name": "module", "type": "address", "internalType": "contract IModule" }, { "name": "encodedArgs", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "installRootModule", "inputs": [ { "name": "module", "type": "address", "internalType": "contract IModule" }, { "name": "encodedArgs", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "inviteToArmy", "inputs": [ { "name": "_playerToInvite", "type": "address", "internalType": "address" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "isKingdomSelected", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "_isKingdomSelected", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "isPlayerRegistered", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "_isPlayerRegistered", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "joinArmy", "inputs": [ { "name": "_armyId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "kickFromArmy", "inputs": [ { "name": "_playerToKick", "type": "address", "internalType": "address" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "killAllBattlesPossible", "inputs": [], "outputs": [ { "name": "_anythingToClear", "type": "bool", "internalType": "bool" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "killBattle", "inputs": [ { "name": "_battleId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "killBattleForce", "inputs": [ { "name": "_battleId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "leaveArmy", "inputs": [ { "name": "_armyId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "multipleProcessing", "inputs": [ { "name": "_iterations", "type": "uint32", "internalType": "uint32" }, { "name": "_battleId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "numberInQueueToUnitId", "inputs": [ { "name": "_id", "type": "uint32", "internalType": "uint32" }, { "name": "_isTeamRight", "type": "bool", "internalType": "bool" }, { "name": "_battleId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [ { "name": "_unitId", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "petJennie", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "popFromDynamicField", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "dynamicFieldIndex", "type": "uint8", "internalType": "uint8" }, { "name": "byteLengthToPop", "type": "uint256", "internalType": "uint256" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "processBattle", "inputs": [ { "name": "_battleId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "pushBlock", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "pushToDynamicField", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "dynamicFieldIndex", "type": "uint8", "internalType": "uint8" }, { "name": "dataToPush", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "randomizeAddress", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" }, { "name": "_blockTimestamp", "type": "uint256", "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "address", "internalType": "address" } ], "stateMutability": "view" }, { "type": "function", "name": "randomizeBool", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" }, { "name": "_blockTimestamp", "type": "uint256", "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "view" }, { "type": "function", "name": "randomizeBytes32", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" }, { "name": "_blockTimestamp", "type": "uint256", "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "randomizeString", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" }, { "name": "_blockTimestamp", "type": "uint256", "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "string", "internalType": "string" } ], "stateMutability": "view" }, { "type": "function", "name": "randomizeUint256", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" }, { "name": "_blockTimestamp", "type": "uint256", "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "randomizeUint32", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" }, { "name": "_blockTimestamp", "type": "uint256", "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "uint32", "internalType": "uint32" } ], "stateMutability": "view" }, { "type": "function", "name": "registerDelegation", "inputs": [ { "name": "delegatee", "type": "address", "internalType": "address" }, { "name": "delegationControlId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "initCallData", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "registerFunctionSelector", "inputs": [ { "name": "systemId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "systemFunctionSignature", "type": "string", "internalType": "string" } ], "outputs": [ { "name": "worldFunctionSelector", "type": "bytes4", "internalType": "bytes4" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "registerNamespace", "inputs": [ { "name": "namespaceId", "type": "bytes32", "internalType": "ResourceId" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "registerNamespaceDelegation", "inputs": [ { "name": "namespaceId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "delegationControlId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "initCallData", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "registerRootFunctionSelector", "inputs": [ { "name": "systemId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "worldFunctionSignature", "type": "string", "internalType": "string" }, { "name": "systemFunctionSignature", "type": "string", "internalType": "string" } ], "outputs": [ { "name": "worldFunctionSelector", "type": "bytes4", "internalType": "bytes4" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "registerStoreHook", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "hookAddress", "type": "address", "internalType": "contract IStoreHook" }, { "name": "enabledHooksBitmap", "type": "uint8", "internalType": "uint8" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "registerSystem", "inputs": [ { "name": "systemId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "system", "type": "address", "internalType": "contract System" }, { "name": "publicAccess", "type": "bool", "internalType": "bool" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "registerSystemHook", "inputs": [ { "name": "systemId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "hookAddress", "type": "address", "internalType": "contract ISystemHook" }, { "name": "enabledHooksBitmap", "type": "uint8", "internalType": "uint8" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "registerTable", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "fieldLayout", "type": "bytes32", "internalType": "FieldLayout" }, { "name": "keySchema", "type": "bytes32", "internalType": "Schema" }, { "name": "valueSchema", "type": "bytes32", "internalType": "Schema" }, { "name": "keyNames", "type": "string[]", "internalType": "string[]" }, { "name": "fieldNames", "type": "string[]", "internalType": "string[]" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "removeInvite", "inputs": [ { "name": "_playerToRemove", "type": "address", "internalType": "address" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "renewWarPermit", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "renounceOwnership", "inputs": [ { "name": "namespaceId", "type": "bytes32", "internalType": "ResourceId" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "repairLocation", "inputs": [ { "name": "_locationId", "type": "uint32", "internalType": "uint32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "resetBuildingDev", "inputs": [ { "name": "_building", "type": "uint8", "internalType": "enum BuildingType" }, { "name": "_isTeamRight", "type": "bool", "internalType": "bool" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "resetTeamTable", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "resetUnitUpgradeDev", "inputs": [ { "name": "_unitType", "type": "uint8", "internalType": "enum UnitType" }, { "name": "_isTeamRight", "type": "bool", "internalType": "bool" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "returnWarPermit", "inputs": [], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "revokeAccess", "inputs": [ { "name": "resourceId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "grantee", "type": "address", "internalType": "address" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "selectKingdom", "inputs": [ { "name": "_teamRight", "type": "bool", "internalType": "bool" }, { "name": "_title", "type": "string", "internalType": "string" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setArmyReady", "inputs": [ { "name": "_battleId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setDynamicField", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "dynamicFieldIndex", "type": "uint8", "internalType": "uint8" }, { "name": "data", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setField", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "fieldIndex", "type": "uint8", "internalType": "uint8" }, { "name": "data", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setField", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "fieldIndex", "type": "uint8", "internalType": "uint8" }, { "name": "data", "type": "bytes", "internalType": "bytes" }, { "name": "fieldLayout", "type": "bytes32", "internalType": "FieldLayout" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setForkQualified", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setHealerBondedUnit", "inputs": [ { "name": "_healer", "type": "bytes32", "internalType": "bytes32" }, { "name": "_bondedUnit", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setItemToPlayer", "inputs": [ { "name": "_item", "type": "uint8", "internalType": "enum ItemType" }, { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setLastLastClaimedVp", "inputs": [ { "name": "_locationId", "type": "uint32", "internalType": "uint32" }, { "name": "_timestamp", "type": "uint256", "internalType": "uint256" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setRecord", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "staticData", "type": "bytes", "internalType": "bytes" }, { "name": "encodedLengths", "type": "bytes32", "internalType": "EncodedLengths" }, { "name": "dynamicData", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setSpoonQualified", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "setStaticField", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "fieldIndex", "type": "uint8", "internalType": "uint8" }, { "name": "data", "type": "bytes", "internalType": "bytes" }, { "name": "fieldLayout", "type": "bytes32", "internalType": "FieldLayout" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "spawnFreeUnit", "inputs": [ { "name": "_battleId", "type": "bytes32", "internalType": "bytes32" }, { "name": "_x", "type": "uint32", "internalType": "uint32" }, { "name": "_y", "type": "uint32", "internalType": "uint32" }, { "name": "_type", "type": "uint8", "internalType": "enum UnitType" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "spawnUnit", "inputs": [ { "name": "_battleId", "type": "bytes32", "internalType": "bytes32" }, { "name": "_x", "type": "uint32", "internalType": "uint32" }, { "name": "_y", "type": "uint32", "internalType": "uint32" }, { "name": "_type", "type": "uint8", "internalType": "enum UnitType" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "spawnUnitAdmin", "inputs": [ { "name": "_battleId", "type": "bytes32", "internalType": "bytes32" }, { "name": "_x", "type": "uint32", "internalType": "uint32" }, { "name": "_y", "type": "uint32", "internalType": "uint32" }, { "name": "_unitType", "type": "uint8", "internalType": "enum UnitType" }, { "name": "_itemType", "type": "uint8", "internalType": "enum ItemType" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "spendPlayerResources", "inputs": [ { "name": "_player", "type": "address", "internalType": "address" }, { "name": "_gold", "type": "uint256", "internalType": "uint256" }, { "name": "_wood", "type": "uint256", "internalType": "uint256" }, { "name": "_stone", "type": "uint256", "internalType": "uint256" }, { "name": "_iron", "type": "uint256", "internalType": "uint256" }, { "name": "_sugar", "type": "uint256", "internalType": "uint256" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "spliceDynamicData", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "dynamicFieldIndex", "type": "uint8", "internalType": "uint8" }, { "name": "startWithinField", "type": "uint40", "internalType": "uint40" }, { "name": "deleteCount", "type": "uint40", "internalType": "uint40" }, { "name": "data", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "spliceStaticData", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "internalType": "bytes32[]" }, { "name": "start", "type": "uint48", "internalType": "uint48" }, { "name": "data", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "storeVersion", "inputs": [], "outputs": [ { "name": "version", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "function", "name": "toggleBattlePhase", "inputs": [ { "name": "_battleId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "toggleBattlePhaseForce", "inputs": [ { "name": "_battleId", "type": "bytes32", "internalType": "bytes32" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "toggleSiegeForce", "inputs": [ { "name": "_isTeamRightWinner", "type": "bool", "internalType": "bool" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "transferBalanceToAddress", "inputs": [ { "name": "fromNamespaceId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "toAddress", "type": "address", "internalType": "address" }, { "name": "amount", "type": "uint256", "internalType": "uint256" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "transferBalanceToNamespace", "inputs": [ { "name": "fromNamespaceId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "toNamespaceId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "amount", "type": "uint256", "internalType": "uint256" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "transferOwnership", "inputs": [ { "name": "namespaceId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "newOwner", "type": "address", "internalType": "address" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "unregisterDelegation", "inputs": [ { "name": "delegatee", "type": "address", "internalType": "address" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "unregisterNamespaceDelegation", "inputs": [ { "name": "namespaceId", "type": "bytes32", "internalType": "ResourceId" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "unregisterStoreHook", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "hookAddress", "type": "address", "internalType": "contract IStoreHook" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "unregisterSystemHook", "inputs": [ { "name": "systemId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "hookAddress", "type": "address", "internalType": "contract ISystemHook" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "upgradeBuildingLevel", "inputs": [ { "name": "_building", "type": "uint8", "internalType": "enum BuildingType" }, { "name": "_isTeamRight", "type": "bool", "internalType": "bool" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "upgradeStructure", "inputs": [ { "name": "_slot", "type": "uint256", "internalType": "uint256" }, { "name": "_structureType", "type": "uint8", "internalType": "enum StructureType" } ], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "useReforger", "inputs": [ { "name": "_items", "type": "uint32[4]", "internalType": "uint32[4]" } ], "outputs": [ { "name": "_randomItem", "type": "uint32", "internalType": "uint32" }, { "name": "_success", "type": "bool", "internalType": "bool" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "worldVersion", "inputs": [], "outputs": [ { "name": "", "type": "bytes32", "internalType": "bytes32" } ], "stateMutability": "view" }, { "type": "event", "name": "HelloStore", "inputs": [ { "name": "storeVersion", "type": "bytes32", "indexed": true, "internalType": "bytes32" } ], "anonymous": false }, { "type": "event", "name": "HelloWorld", "inputs": [ { "name": "worldVersion", "type": "bytes32", "indexed": true, "internalType": "bytes32" } ], "anonymous": false }, { "type": "event", "name": "Store_DeleteRecord", "inputs": [ { "name": "tableId", "type": "bytes32", "indexed": true, "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "indexed": false, "internalType": "bytes32[]" } ], "anonymous": false }, { "type": "event", "name": "Store_SetRecord", "inputs": [ { "name": "tableId", "type": "bytes32", "indexed": true, "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "indexed": false, "internalType": "bytes32[]" }, { "name": "staticData", "type": "bytes", "indexed": false, "internalType": "bytes" }, { "name": "encodedLengths", "type": "bytes32", "indexed": false, "internalType": "EncodedLengths" }, { "name": "dynamicData", "type": "bytes", "indexed": false, "internalType": "bytes" } ], "anonymous": false }, { "type": "event", "name": "Store_SpliceDynamicData", "inputs": [ { "name": "tableId", "type": "bytes32", "indexed": true, "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "indexed": false, "internalType": "bytes32[]" }, { "name": "dynamicFieldIndex", "type": "uint8", "indexed": false, "internalType": "uint8" }, { "name": "start", "type": "uint48", "indexed": false, "internalType": "uint48" }, { "name": "deleteCount", "type": "uint40", "indexed": false, "internalType": "uint40" }, { "name": "encodedLengths", "type": "bytes32", "indexed": false, "internalType": "EncodedLengths" }, { "name": "data", "type": "bytes", "indexed": false, "internalType": "bytes" } ], "anonymous": false }, { "type": "event", "name": "Store_SpliceStaticData", "inputs": [ { "name": "tableId", "type": "bytes32", "indexed": true, "internalType": "ResourceId" }, { "name": "keyTuple", "type": "bytes32[]", "indexed": false, "internalType": "bytes32[]" }, { "name": "start", "type": "uint48", "indexed": false, "internalType": "uint48" }, { "name": "data", "type": "bytes", "indexed": false, "internalType": "bytes" } ], "anonymous": false }, { "type": "error", "name": "EncodedLengths_InvalidLength", "inputs": [ { "name": "length", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "FieldLayout_Empty", "inputs": [] }, { "type": "error", "name": "FieldLayout_InvalidStaticDataLength", "inputs": [ { "name": "staticDataLength", "type": "uint256", "internalType": "uint256" }, { "name": "computedStaticDataLength", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "FieldLayout_StaticLengthDoesNotFitInAWord", "inputs": [ { "name": "index", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "FieldLayout_StaticLengthIsNotZero", "inputs": [ { "name": "index", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "FieldLayout_StaticLengthIsZero", "inputs": [ { "name": "index", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "FieldLayout_TooManyDynamicFields", "inputs": [ { "name": "numFields", "type": "uint256", "internalType": "uint256" }, { "name": "maxFields", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "FieldLayout_TooManyFields", "inputs": [ { "name": "numFields", "type": "uint256", "internalType": "uint256" }, { "name": "maxFields", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "Module_AlreadyInstalled", "inputs": [] }, { "type": "error", "name": "Module_MissingDependency", "inputs": [ { "name": "dependency", "type": "address", "internalType": "address" } ] }, { "type": "error", "name": "Module_NonRootInstallNotSupported", "inputs": [] }, { "type": "error", "name": "Module_RootInstallNotSupported", "inputs": [] }, { "type": "error", "name": "Schema_InvalidLength", "inputs": [ { "name": "length", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "Schema_StaticTypeAfterDynamicType", "inputs": [] }, { "type": "error", "name": "Slice_OutOfBounds", "inputs": [ { "name": "data", "type": "bytes", "internalType": "bytes" }, { "name": "start", "type": "uint256", "internalType": "uint256" }, { "name": "end", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "Store_IndexOutOfBounds", "inputs": [ { "name": "length", "type": "uint256", "internalType": "uint256" }, { "name": "accessedIndex", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "Store_InvalidBounds", "inputs": [ { "name": "start", "type": "uint256", "internalType": "uint256" }, { "name": "end", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "Store_InvalidFieldNamesLength", "inputs": [ { "name": "expected", "type": "uint256", "internalType": "uint256" }, { "name": "received", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "Store_InvalidKeyNamesLength", "inputs": [ { "name": "expected", "type": "uint256", "internalType": "uint256" }, { "name": "received", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "Store_InvalidResourceType", "inputs": [ { "name": "expected", "type": "bytes2", "internalType": "bytes2" }, { "name": "resourceId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "resourceIdString", "type": "string", "internalType": "string" } ] }, { "type": "error", "name": "Store_InvalidSplice", "inputs": [ { "name": "startWithinField", "type": "uint40", "internalType": "uint40" }, { "name": "deleteCount", "type": "uint40", "internalType": "uint40" }, { "name": "fieldLength", "type": "uint40", "internalType": "uint40" } ] }, { "type": "error", "name": "Store_InvalidStaticDataLength", "inputs": [ { "name": "expected", "type": "uint256", "internalType": "uint256" }, { "name": "received", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "Store_InvalidValueSchemaDynamicLength", "inputs": [ { "name": "expected", "type": "uint256", "internalType": "uint256" }, { "name": "received", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "Store_InvalidValueSchemaLength", "inputs": [ { "name": "expected", "type": "uint256", "internalType": "uint256" }, { "name": "received", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "Store_InvalidValueSchemaStaticLength", "inputs": [ { "name": "expected", "type": "uint256", "internalType": "uint256" }, { "name": "received", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "Store_TableAlreadyExists", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "tableIdString", "type": "string", "internalType": "string" } ] }, { "type": "error", "name": "Store_TableNotFound", "inputs": [ { "name": "tableId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "tableIdString", "type": "string", "internalType": "string" } ] }, { "type": "error", "name": "World_AccessDenied", "inputs": [ { "name": "resource", "type": "string", "internalType": "string" }, { "name": "caller", "type": "address", "internalType": "address" } ] }, { "type": "error", "name": "World_AlreadyInitialized", "inputs": [] }, { "type": "error", "name": "World_CallbackNotAllowed", "inputs": [ { "name": "functionSelector", "type": "bytes4", "internalType": "bytes4" } ] }, { "type": "error", "name": "World_DelegationNotFound", "inputs": [ { "name": "delegator", "type": "address", "internalType": "address" }, { "name": "delegatee", "type": "address", "internalType": "address" } ] }, { "type": "error", "name": "World_FunctionSelectorAlreadyExists", "inputs": [ { "name": "functionSelector", "type": "bytes4", "internalType": "bytes4" } ] }, { "type": "error", "name": "World_FunctionSelectorNotFound", "inputs": [ { "name": "functionSelector", "type": "bytes4", "internalType": "bytes4" } ] }, { "type": "error", "name": "World_InsufficientBalance", "inputs": [ { "name": "balance", "type": "uint256", "internalType": "uint256" }, { "name": "amount", "type": "uint256", "internalType": "uint256" } ] }, { "type": "error", "name": "World_InterfaceNotSupported", "inputs": [ { "name": "contractAddress", "type": "address", "internalType": "address" }, { "name": "interfaceId", "type": "bytes4", "internalType": "bytes4" } ] }, { "type": "error", "name": "World_InvalidNamespace", "inputs": [ { "name": "namespace", "type": "bytes14", "internalType": "bytes14" } ] }, { "type": "error", "name": "World_InvalidResourceId", "inputs": [ { "name": "resourceId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "resourceIdString", "type": "string", "internalType": "string" } ] }, { "type": "error", "name": "World_InvalidResourceType", "inputs": [ { "name": "expected", "type": "bytes2", "internalType": "bytes2" }, { "name": "resourceId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "resourceIdString", "type": "string", "internalType": "string" } ] }, { "type": "error", "name": "World_ResourceAlreadyExists", "inputs": [ { "name": "resourceId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "resourceIdString", "type": "string", "internalType": "string" } ] }, { "type": "error", "name": "World_ResourceNotFound", "inputs": [ { "name": "resourceId", "type": "bytes32", "internalType": "ResourceId" }, { "name": "resourceIdString", "type": "string", "internalType": "string" } ] }, { "type": "error", "name": "World_SystemAlreadyExists", "inputs": [ { "name": "system", "type": "address", "internalType": "address" } ] }, { "type": "error", "name": "World_UnlimitedDelegationNotAllowed", "inputs": [] } ] ### Game ABI Explained * **addQuestProgress(_player address, \_questId uint32, \_progress uint32):** Allows adding progress to a specific quest for a player. It takes the player's address, the quest ID, and the amount of progress to add as input. This function does not return any value. * **airdropResources(_player address, \_gold uint256, \_wood uint256, \_stone uint256, \_iron uint256, \_sugar uint256):** Gives a specific player certain amount of game resources. The resources included are Gold, Wood, Stone, Iron and Sugar. This function does not return any value. * **airdropUnit(_player address, \_amount uint32, \_unitType uint8):** Airdrops a specified amount of a certain type of unit to a player. `_unitType` is an enum. The function does not return any value. * **airdropUnit(_unitType uint8, \_amount uint32, \_player address):** Airdrops a specified amount of a certain type of unit to a player. This is a variant of the `airdropUnit` function, but the arguments are ordered differently. The function does not return any value. * **airdropVP(\_teamRight bool, \_isSiege bool, \_amount uint32):** Airdrops victory points (VP) based on team and siege status. Takes a boolean indicating the team, a boolean indicating siege, and the amount of VP. The function does not return any value. * **areUnitsLeft(_battleId bytes32):** Checks if any units are left in a given battle. Takes a battle ID as input and returns a boolean indicating if units remain. * **assignLootbox(_player address):** Assigns a lootbox to a specific player. It takes the player's address as input and does not return any value. * **attackWithArmy(_location uint32):** Initiates an attack with the player's army on a specified location. Takes the location ID as input and returns nothing. * **batchCall(systemCalls tuple[]):** Executes multiple system calls in a single transaction. Accepts an array of `SystemCallData` structs, each specifying a system ID and the corresponding call data, and returns an array of bytes representing each return data. * **batchCallFrom(systemCalls tuple[]):** Executes multiple system calls from different delegators in a single transaction. Accepts an array of `SystemCallFromData` structs, each specifying a from address, a system ID, and the corresponding call data, and returns an array of bytes representing each return data. * **bruteforce():** Potentially an internal function for testing or debugging purposes. This function does not return any value. * **buyUnit(_unitType uint8, \_amount uint32, \_spendingCap uint256):** Allows a player to purchase a specific amount of a certain unit type. It takes the unit type, amount, and a spending cap as input. The `_unitType` is an enum. This function does not return any value. * **call(systemId bytes32, callData bytes):** Calls a system with the provided calldata. Takes a ResourceID `systemId` and bytes `callData` and return the returned bytes. * **callFrom(delegator address, systemId bytes32, callData bytes):** Calls a system from the provided delegator. Takes the `delegator` address, a ResourceID `systemId` and bytes `callData` and returns the returned bytes. * **canCompleteQuest(_questToComplete uint32):** Checks if a player has met the requirements to complete a quest. It takes the quest ID as input and returns a boolean indicating whether the quest can be completed. * **claimBattleRewards():** Allows a player to claim rewards from completed battles. The rewards typically include lootboxes and resources. * **claimLocationVP(_locationId uint32):** Claims victory points (VP) for controlling a location. Takes the location ID as input. * **claimResources(_structureType uint8):** Allows a player to claim resources generated by their structures. It takes the structure type (e.g., lumberyard, quarry) as input. The `_structureType` is an enum. * **claimWarRewards():** Allows a player to claim rewards from participating in a war. It rewards players based on whether their team won and their contribution to the war effort. * **commitRevealLootBox():** Function to commit to reveal the lootbox. * **completeQuest(_questToComplete uint32):** Completes a specific quest for the player, granting them rewards. Takes the ID of the quest to complete as input. * **concludeSiegeForce():** Concludes the siege force phase. * **concludeWarClaimingPeriod(_warId uint32):** Finalizes the claiming period for war rewards, allowing players to claim their rewards. Takes a War ID as an argument. * **conquerLocationForce(_locationId uint32):** Concludes the conquering process for a specific location. Takes a Location ID as an argument. * **contributeToBuilding(_building uint8, \_resources uint256[5]):** Allows a player to contribute resources to the construction or upgrade of a building. Takes the building type and an array of 5 `uint256` representing resources. The `_building` is an enum. This function does not return any value. * **createArmy(_otherCaptains address[]):** Allows a player to create a new army, potentially inviting other players to join as captains. It takes an array of addresses representing the other captains to invite. * **creator():** Returns the address of the contract creator. * **declineInvite(_armyId bytes32):** Allows a player to decline an invitation to join an army. It takes the army ID as input and does not return any value. * **defendWithArmy(_location uint32, \_battleId bytes32):** Allows a player to defend a specific location with their army during a battle. It takes the location ID and the battle ID as input. * **deleteRecord(tableId bytes32, keyTuple bytes32[]):** Deletes a record from a specific table in the World's storage. Takes a table ID and an array of keys that identify the record. * **disbandArmy():** Allows the player to disband their army. * **downgradeBuildingLevel(_building uint8, \_isTeamRight bool):** Downgrades the level of a building. The `_building` is an enum. This function does not return any value. * **equipChaosChocolate(_unitId bytes32, \_laneY uint32):** Equips the `ChaosChocolate` item to a specific unit on a lane. * **equipInvincibleIcingIII(_unitId bytes32, \_targetUnit bytes32):** Equips the `InvincibleIcingIII` item to a specific unit with other target unit. * **equipItem(_unitId bytes32, \_item uint8):** Allows a player to equip a specific item to a unit. It takes the unit ID and the item type as input. The `_item` is an enum. This function does not return any value. * **equipPomegranatePulverizer(_unitId bytes32, \_vectorX uint32, \_vectorY int32):** Equips the `PomegranatePulverizer` item to a specific unit. * **equipQuantumQuicheII(_firstUnitId bytes32, \_secondUnitId bytes32):** Equips the `QuantumQuicheII` item to a two specific unit. * **equipQuantumQuicheIV(_unitId bytes32, \_secondLaneY uint32):** Equips the `QuantumQuicheIV` item to a unit with second lane. * **equipSouffleSurge(_unitId bytes32, \_targetUnits bytes32[], \_itemType uint8):** Equips the `SouffleSurge` item to a specific unit and other target units. The `_itemType` is an enum. * **equipStomachBitters(_unitId bytes32):** Equips the `StomachBitters` item to a specific unit. * **equipTabulaRice(_unitId bytes32, \_newUnitType uint8):** Equips `TabulaRice` to a specific unit, potentially changing its type. The `_newUnitType` is an enum. * **flushAllUpgrades():** Flush all upgrades. * **getAllStructuresCost(_player address):** Returns the building costs of a player. * **getAllUnitsPrices():** Returns array of prices of all units. * **getBattleRewardsToClaim():** Retrieves the battle rewards available for the caller to claim. The rewards typically include lootboxes and resources. * **getBattleUnitsArray(_battleId bytes32):** Retrieves a list of unit IDs in the battle. * **getCaptainsBattles(_player address):** Get battle list the player participated. * **getCommitBlock(_player address):** Get last block player committed in looting. * **getCurrentBuildingLevel(_building uint8, \_isTeamRight bool):** Returns the current level of a specific building for a specific team. It takes the building type (as an enum) and a boolean indicating the team as input. * **getCurrentUnitPrice(_unitType uint8, \_amount uint32):** Returns the current price for a specific amount of a certain unit type. It takes the unit type (as an enum) and the amount as input. * **getDynamicField(tableId bytes32, keyTuple bytes32[], dynamicFieldIndex uint8):** Retrieves data from a dynamic field within a specific record in a table. * **getDynamicFieldLength(tableId bytes32, keyTuple bytes32[], dynamicFieldIndex uint8):** Retrieves the length of a dynamic field within a specific record in a table. * **getDynamicFieldSlice(tableId bytes32, keyTuple bytes32[], dynamicFieldIndex uint8, start uint256, end uint256):** Retrieves a slice of data from a dynamic field within a specific record in a table. * **getField(tableId bytes32, keyTuple bytes32[], fieldIndex uint8, fieldLayout bytes32):** Retrieves a field from a record in a table, using the table ID, key tuple, field index, and field layout. * **getField(tableId bytes32, keyTuple bytes32[], fieldIndex uint8):** Retrieves a field from a record in a table, using the table ID, key tuple, and field index. * **getFieldLayout(tableId bytes32):** Returns FieldLayout info from tableId. * **getFieldLength(tableId bytes32, keyTuple bytes32[], fieldIndex uint8, fieldLayout bytes32):** Retrieves the length of a particular field in a specific record. * **getFieldLength(tableId bytes32, keyTuple bytes32[], fieldIndex uint8):** Retrieves the length of a particular field in a specific record. * **getGeneralArmy(_player address):** Retrieves the army ID of the general's army. * **getKeySchema(tableId bytes32):** Retrieves the schema for the key of a specific table. * **getPNL(_player address):** Gets the profit and loss stats for a player based on their battle history. * **getPlayerInventory(_player address):** Retrieves the inventory of a specific player, including the quantity of each item. * **getPlayerStructures(_player address):** Retrieves data of player structure. * **getPlayerTitle(_player address):** Retrieves the title of a specific player. It takes the player's address as input and returns a string. * **getRecord(tableId bytes32, keyTuple bytes32[], fieldLayout bytes32):** Retrieves an entire record from a specific table in the World's storage. * **getRecord(tableId bytes32, keyTuple bytes32[]):** Retrieves an entire record from a specific table in the World's storage. * **getResourcesLastTimeCollected(_player address):** Retrieves the last time a player collected resources. * **getResourcesToClaim(_player address):** Calculates claimable resources for a player. * **getStaticField(tableId bytes32, keyTuple bytes32[], fieldIndex uint8, fieldLayout bytes32):** Retrieves a static field from a specific record in a table. * **getTimeToFill(_player address):** Retrieves the lumberyard, quarry and iron mine time of a player. * **getValueSchema(tableId bytes32):** Retrieves the schema for the value of a specific table. * **getWarRewardsToClaim(_player address):** Retrieves information about war rewards a player can claim. Returns the rewards, team win status, and claim history. * **goToNextWar(_isTeamRightWinner bool):** Advances the game to the next war. Takes a boolean indicating if the team right won the last war. * **grantAccess(resourceId bytes32, grantee address):** Grants access to a specific resource (e.g., a system or table) to a specified address. This enables the grantee to perform actions on that resource. * **hotfix716():** Executes hotfix. * **initialize(initModule address):** Initializes the contract, typically called during deployment. It takes the address of an initialization module as input. * **installModule(module address, encodedArgs bytes):** Installs a module into the World, extending its functionality. Requires the module address and encoded initialization arguments. * **installRootModule(module address, encodedArgs bytes):** Installs a root module into the World, typically for core functionality. Takes the module address and encoded initialization arguments. * **inviteToArmy(_playerToInvite address):** Allows a player to invite another player to join their army. It takes the address of the player to invite as input. * **isKingdomSelected(_player address):** Checks if a player has selected a kingdom (team). It takes the player's address as input and returns a boolean indicating their kingdom selection status. * **isPlayerRegistered(_player address):** Checks if a player is registered in the game. It takes the player's address as input and returns a boolean indicating their registration status. * **joinArmy(_armyId bytes32):** Allows a player to join an existing army. It takes the army ID as input. * **kickFromArmy(_playerToKick address):** Allows an army captain to remove a player from their army. It takes the address of the player to kick as input. * **killAllBattlesPossible():** Try to clear all possible battles. * **killBattle(_battleId bytes32):** Allows to manually kill battle. * **killBattleForce(_battleId bytes32):** Allows to force kill battle. * **leaveArmy(_armyId bytes32):** Allows a player to leave an army. It takes the army ID as input. * **multipleProcessing(_iterations uint32, \_battleId bytes32):** Processes the battle multiple times for testing * **numberInQueueToUnitId(_id uint32, \_isTeamRight bool, \_battleId bytes32):** Returns a unit ID in a battle. * **petJennie():** Pet Jennie, most likely for debug purpose. * **popFromDynamicField(tableId bytes32, keyTuple bytes32[], dynamicFieldIndex uint8, byteLengthToPop uint256):** Removes data from the end of a dynamic field within a specific record in a table. * **processBattle(_battleId bytes32):** Processes a specific battle, advancing the combat simulation. It takes the battle ID as input. * **pushBlock():** Push block. * **pushToDynamicField(tableId bytes32, keyTuple bytes32[], dynamicFieldIndex uint8, dataToPush bytes):** Appends data to a dynamic field within a specific record in a table. * **randomizeAddress(_player address, \_blockTimestamp uint256):** A helper function that returns pseudorandom address. * **randomizeBool(_player address, \_blockTimestamp uint256):** A helper function that returns pseudorandom boolean. * **randomizeBytes32(_player address, \_blockTimestamp uint256):** A helper function that returns pseudorandom bytes32. * **randomizeString(_player address, \_blockTimestamp uint256):** A helper function that returns pseudorandom String. * **randomizeUint256(_player address, \_blockTimestamp uint256):** A helper function that returns pseudorandom uint256. * **randomizeUint32(_player address, \_blockTimestamp uint256):** A helper function that returns pseudorandom uint32. * **registerDelegation(delegatee address, delegationControlId bytes32, initCallData bytes):** Registers a delegation relationship, allowing the delegatee to act on behalf of the caller. * **registerFunctionSelector(systemId bytes32, systemFunctionSignature string):** Registers a function selector for a given system ID and system function signature. Returns the `worldFunctionSelector`. * **registerNamespace(namespaceId bytes32):** Registers a new namespace within the World. Namespaces help to organize resources and prevent naming collisions. * **registerNamespaceDelegation(namespaceId bytes32, delegationControlId bytes32, initCallData bytes):** Registers delegation to namespace. * **registerRootFunctionSelector(systemId bytes32, worldFunctionSignature string, systemFunctionSignature string):** Registers root function selector. Returns `worldFunctionSelector`. * **registerStoreHook(tableId bytes32, hookAddress address, enabledHooksBitmap uint8):** Registers hook to tableID. * **registerSystem(systemId bytes32, system address, publicAccess bool):** Registers a new system within the World. Systems are smart contracts that implement game logic. * **registerSystemHook(systemId bytes32, hookAddress address, enabledHooksBitmap uint8):** Registers hook to systemID. * **registerTable(tableId bytes32, fieldLayout bytes32, keySchema bytes32, valueSchema bytes32, keyNames string[], fieldNames string[]):** Registers a new table within the World's storage. Tables are used to store game data. * **removeInvite(_playerToRemove address):** Removes a pending invitation to join an army. Takes the address of player to be removed from the invite list. * **renewWarPermit():** Allows a player to renew their war permit, enabling them to participate in wars. This may involve paying a fee. * **renounceOwnership(namespaceId bytes32):** Transfers ownership of the contract to the zero address, effectively making it unowned. Can only be called by the owner. * **repairLocation(_locationId uint32):** Repairs a damaged location, restoring its functionality. Takes location ID as parameter. * **resetBuildingDev(_building uint8, \_isTeamRight bool):** Resets building state for development. * **resetTeamTable():** Resets team table. * **resetUnitUpgradeDev(_unitType uint8, \_isTeamRight bool):** Resets unit upgrade data for development purposes. * **returnWarPermit():** Allows a player to return their war permit, potentially receiving a refund of any associated fees. * **revokeAccess(resourceId bytes32, grantee address):** Revokes access to a specific resource from a specified address. This restricts the grantee from performing actions on that resource. * **selectKingdom(_teamRight bool, \_title string):** Allows a player to select a kingdom (team) to align with. Takes a boolean indicating the team and their chosen title as input. * **setArmyReady(_battleId bytes32):** Sets army ready to battle by the battleId * **setDynamicField(tableId bytes32, keyTuple bytes32[], dynamicFieldIndex uint8, data bytes):** Sets (overwrites) the data in a dynamic field within a specific record in a table. * **setField(tableId bytes32, keyTuple bytes32[], fieldIndex uint8, data bytes):** Sets the value of a specific field within a record in a table. * **setField(tableId bytes32, keyTuple bytes32[], fieldIndex uint8, data bytes, fieldLayout bytes32):** Sets the value of a specific field within a record in a table. * **setForkQualified(_player address):** Qualified player to the fork feature. * **setHealerBondedUnit(_healer bytes32, \_bondedUnit bytes32):** Sets a link between two units. * **setItemToPlayer(_item uint8, \_player address):** Gives a item to a player. * **setLastLastClaimedVp(_locationId uint32, \_timestamp uint256):** Sets last vp claimed timestamp. * **setRecord(tableId bytes32, keyTuple bytes32[], staticData bytes, encodedLengths bytes32, dynamicData bytes):** Sets (overwrites) an entire record in a specific table in the World's storage. * **setSpoonQualified(_player address):** Qualified player to the spoon feature. * **setStaticField(tableId bytes32, keyTuple bytes32[], fieldIndex uint8, data bytes, fieldLayout bytes32):** Sets the value of a static field within a specific record in a table. * **spawnFreeUnit(_battleId bytes32, \_x uint32, \_y uint32, \_type uint8):** Spawns unit without cost. * **spawnUnit(_battleId bytes32, \_x uint32, \_y uint32, \_type uint8):** Spawns a unit at a specific location on the battlefield. Requires the battle ID, coordinates (x, y), and the unit type (as an enum). * **spawnUnitAdmin(_battleId bytes32, \_x uint32, \_y uint32, \_unitType uint8, \_itemType uint8):** Spawns unit with specified item. * **spendPlayerResources(_player address, \_gold uint256, \_wood uint256, \_stone uint256, \_iron uint256, \_sugar uint256):** Spend player resources. * **spliceDynamicData(tableId bytes32, keyTuple bytes32[], dynamicFieldIndex uint8, startWithinField uint40, deleteCount uint40, data bytes):** Inserts or deletes data within a dynamic field of a specific record. * **spliceStaticData(tableId bytes32, keyTuple bytes32[], start uint48, data bytes):** Inserts or deletes data within a static field of a specific record. * **storeVersion():** Returns the version of the store contract. * **toggleBattlePhase(_battleId bytes32):** Force toggle battle to next phase. * **toggleBattlePhaseForce(_battleId bytes32):** Toggle force battle phase. * **toggleSiegeForce(_isTeamRightWinner bool):** Toggle the siege force. * **transferBalanceToAddress(fromNamespaceId bytes32, toAddress address, amount uint256):** Transfers funds from a namespace balance to a specific address. Requires the namespace ID, the recipient address, and the amount to transfer. * **transferBalanceToNamespace(fromNamespaceId bytes32, toNamespaceId bytes32, amount uint256):** Transfers funds from one namespace balance to another. Requires the source namespace ID, the destination namespace ID, and the amount to transfer. * **transferOwnership(namespaceId bytes32, newOwner address):** Transfers ownership of a specific namespace to a new owner. Only the current owner can call this function. * **unregisterDelegation(delegatee address):** Unregisters a delegation relationship, revoking the delegatee's ability to act on behalf of the caller. * **unregisterNamespaceDelegation(namespaceId bytes32):** Unregisters a namespace delegation, revoking the delegatee's ability to act on behalf of the namespace. * **unregisterStoreHook(tableId bytes32, hookAddress address):** Unregisters hook to tableID. * **unregisterSystemHook(systemId bytes32, hookAddress address):** Unregisters hook to systemID. * **upgradeBuildingLevel(_building uint8, \_isTeamRight bool):** Upgrades the level of a building for a specific team. It takes the building type (as an enum) and a boolean indicating the team as input. * **upgradeStructure(_slot uint256, \_structureType uint8):** Upgrades a structure. * **useReforger(_items uint32[4]):** Allow to use Reforger. * **worldVersion():** Returns the version of the world contract. ## Game MUD Config { enums: { UnitType: ["Bomb", "Blocker", "Archer", "Squire", "Healer", "Mage", "Barbarian", "Alchemist", "Butcher", "Shaman", "Assassin", "Druid", "Spellcannon", "Phantomleech"], BattleState: ["WaitingForOpponent", "Planning", "Battle", "Finished"], WarState: ["Ongoing", "PreSiegePursuit", "Siege", "PreFinished", "Finished"], DamageType: ["Melee", "Range", "Skill", "Item"], ButcherSkillStage: ["LongGrab", "ShortGrab", "PowerAttack"], BuildingType: ["BombHouse", "BlockerHouse", "ArcherHouse", "SquireHouse", "HealerHouse", "MageHouse", "BarbarianHouse", "AlchemistHouse", "ButcherHouse", "ShamanHouse", "AssassinHouse", "DruidHouse", "SpellcannonHouse", "PhantomleechHouse"], BattleWinner: ["Unconcluded", "TeamRight", "TeamLeft"], ResourceType: ["Gold", "Wood", "Stone", "Iron", "Sugar"], MapType: ["Warzone", "Grasslands", "MagicForest", "Mountains", "VillageSpooncity", "VillageForktown", "Spooncity", "Forktown"], RarityType: ["Gray", "Green", "Blue", "Purple", "Unique"], CallToArmsStatus: ["NotInvited", "PendingInvite", "Accepted"], ArmyState: ["Idle", "Fighting"], ArtilleryType: ["KebabRocket", "MustardGas", "FatMandarin"], LocationTier: ["TierA", "TierB", "TierS"], // @ts-expect-error: Type instantiation is excessively deep and possibly infinite. ItemType: [ //instant effect items; count: 31 "None", //0 "ChiliChopperI", "ChiliChopperII", "ChiliChopperIII", "ChiliChopperIV", //1-4 "PepperedArrowI", "PepperedArrowII", "PepperedArrowIII", "PepperedArrowIV", //5-8 "SugarySiegeI", "SugarySiegeII", "SugarySiegeIII", "SugarySiegeIV", //9-12 "HeartyBrothI", "HeartyBrothII", "HeartyBrothIII", "HeartyBrothIV", //13-16 "SharpMustardI", "SharpMustardII", "SharpMustardIII", "SharpMustardIV", //17-20 "SpellcastersSyrup", //21 /grey "ManaMint", //22 /grey "LuckyLemonII", "LuckyLemonIII", "LuckyLemonIV", //23-25 "BittersweetBlend", //26 /green "OneBlastBerryIII", "OneBlastBerryIV", //27-28 "LongReachRelishIII", "LongReachRelishIV", //29-30 "InvincibleIcingIV", //31 // while adding new items, keep this record as a border for instant effect items "SouffleSurgeII", "SouffleSurgeIII", "SouffleSurgeIV", //32-34 "InvincibleIcingIII", //35 "GingerZestRush", //36 /grey "MysteryMarinadeI", "MysteryMarinadeII", "MysteryMarinadeIII", "MysteryMarinadeIV", //37-40 "EnergizingEspresso", //41 /green "TabulaRice", //42 /unique "ThymeTonicII", "ThymeTonicIII", "ThymeTonicIV", //43-45 "StomachBitters", //46 /unique "QuantumQuicheII", "QuantumQuicheIV", //47-48 "VampiricVinegarII", "VampiricVinegarIII", "VampiricVinegarIV", //49-51 "RampagingRosemaryII", "RampagingRosemaryIII", "RampagingRosemaryIV", //52-54 "HeftyHerb", //55 /green "LicoriceLeap", //56 /green "LastDitchDillII", "LastDitchDillIII", "LastDitchDillIV", //57-59 "GhostlyGarlic", //60 /blue "SaffronShield", //61 /blue "DoubleDoughnut", //62 /blue "UntouchableUdon", //63 /blue "HealthHarvestingHoneyIII", "HealthHarvestingHoneyIV", //64-65 "PomegranatePulverizer", //66 /blue "ResurrectionRaisinRemedy", //67 /purple "ChaosChocolate", //68 /purple "ApocalypticApple" //69 /purple ], //while adding items remeber to sort them correctly (i.e. instant effect items first) StructureType: ["None", "Lumberyard", "Quarry", "IronMine", "Scavenger", "Reforger", "RiceFields", "PerpetualStew"], }, TeamLeft: { schema: { warId: "uint32", bombHouseLevel: "uint32", blockerHouseLevel: "uint32", archerHouseLevel: "uint32", squireHouseLevel: "uint32", healerHouseLevel: "uint32", mageHouseLevel: "uint32", barbarianHouseLevel: "uint32", alchemistHouseLevel: "uint32", butcherHouseLevel: "uint32", shamanHouseLevel: "uint32", assassinHouseLevel: "uint32", druidHouseLevel: "uint32", spellcannonHouseLevel: "uint32", phantomleechHouseLevel: "uint32", }, key: ["warId"], }, TeamRight: { schema: { warId: "uint32", bombHouseLevel: "uint32", blockerHouseLevel: "uint32", archerHouseLevel: "uint32", squireHouseLevel: "uint32", healerHouseLevel: "uint32", mageHouseLevel: "uint32", barbarianHouseLevel: "uint32", alchemistHouseLevel: "uint32", butcherHouseLevel: "uint32", shamanHouseLevel: "uint32", assassinHouseLevel: "uint32", druidHouseLevel: "uint32", spellcannonHouseLevel: "uint32", phantomleechHouseLevel: "uint32", }, key: ["warId"], }, GlobalBattleStats: { schema: { battleId: "bytes32", isTeamRight: "bool", unitsPlaced: "uint32", }, key: ["battleId", "isTeamRight"], }, PlayerBattleStats: { schema: { player: "address", battleId: "bytes32", unitsPlaced: "uint32", }, key: ["player", "battleId"], }, Gold: { schema: { battleGoldEmitted: "uint256" }, key: [], }, Lootboxes: { schema: { owner: "address", commitBlock: "uint256", }, key: ["owner"], }, ProcessParams: { schema: { battleId: "bytes32", leftProcessIndex: "uint32", rightProcessIndex: "uint32", leftMaxIndex: "uint32", rightMaxIndex: "uint32", leftProcessFinished: "bool", rightProcessFinished: "bool", leftNoUnitsLeft: "bool", rightNoUnitsLeft: "bool", deleteBatchSize: "uint32", }, key: ["battleId"], }, Units: { schema: { id: "bytes32", battleId: "bytes32", unitType: "UnitType", x: "uint32", y: "uint32", hp: "int32", maxHp: "int32", mana: "int32", manaRegen: "int32", castMana: "int32", maxMana: "int32", isTeamRight: "bool", owner: "address", level: "uint32", title: "string", }, key: ["id"], }, UnitsCombat: { schema: { id: "bytes32", meleeDamage: "int32", rangeDamage: "int32", critDamage: "int32", critChance: "uint32", gateDamage: "int32", attackRange: "uint32", item: "uint32", }, key: ["id"], }, UnitsSkillsModifiers: { schema: { isTeamRight: "bool", shamanDamageIncrease: "int32", //percent increase shamanBonusDamagePercent: "int32", //percent of enemy hp shamanManaSteal: "int32", butcherDamageIncreaseThirdStage: "int32", //percent increase butcherHealAmount: "int32", healerHealAmount: "int32", healerBondedUnitHealIncrease: "int32", //percent increase squireDamageIncrease: "int32", //percent increase bombCritDamageIncrease: "int32", //percent increase bombCritChanceIncrease: "uint32", //percent increase archerDamageIncrease: "int32", //percent increase mageSubtargetsDamage: "int32", //percent of default damage for each target mageManaGenerationForCrit: "int32", alchemistManaHeal: "int32", alchemistPoisonMaxStacks: "int32", alchemistShroomRange: "uint32", alchemistShroomDamage: "int32", //max hp damage dealt per stack assassinGateDamageIncrease: "int32", //flat increase assassinSkillDamageIncrease: "int32", //percent increase spellCannonDamageIncrease: "int32", //percent increase spellCannonSkillHitChancePercentage: "uint32", spellCannonTargetsCount: "uint32", phantomleechManaDrain: "int32", phantomleechGateDamageManaTreshold: "int32", phantomleechGateDamageOnSkill: "int32", barbarianDamegePercentPerHit: "int32", barbarianDamageSumDealtIntoGatePercent: "int32", druidBuffAmount: "int32", }, key: ["isTeamRight"], }, UnitConstants: { schema: { unitType: "UnitType", hp: "int32", mana: "int32", manaRegen: "int32", castMana: "int32", maxMana: "int32", meleeDamage: "int32", rangeDamage: "int32", critDamage: "int32", critChance: "uint32", gateDamage: "int32", attackRange: "uint32", }, key: ["unitType"], }, ItemRarityConstants: { schema: { grayItems: "uint32[9]", greenItems: "uint32[17]", blueItems: "uint32[21]", purpleItems: "uint32[20]", uniqueItems: "uint32[2]", }, key: [], }, //percentages UnitUpgrade: { schema: { buildingType: "UnitType", isTeamRight: "bool", level: "uint32", hp: "int32", mana: "int32", manaRegen: "int32", castMana: "int32", meleeDamage: "int32", rangeDamage: "int32", critDamage: "int32", critChance: "uint32", gateDamage: "int32", attackRange: "uint32", skillModifier: "int32" }, key: ["buildingType", "isTeamRight"], }, MapUnits: { schema: { battleId: "bytes32", x: "uint32", y: "uint32", unitId: "bytes32", }, key: ["battleId", "x", "y"], }, LeftQueue: { schema: { id: "uint32", battleId: "bytes32", unitId: "bytes32", }, key: ["id", "battleId"], }, RightQueue: { schema: { id: "uint32", battleId: "bytes32", unitId: "bytes32" }, key: ["id", "battleId"], }, Randomness: { schema: { blockNumber: "uint256", value: "uint256", randomnessActive: "bool", }, key: [], }, //unit specific tables ======================================================================== ButcherSkillSequence: { schema: { id: "bytes32", stage: "ButcherSkillStage", }, key: ["id"], }, DruidForm: { schema: { id: "bytes32", isBear: "bool", }, key: ["id"], }, BarbarianTargets: { schema: { barbarian: "bytes32", target: "bytes32", hitCount: "int32", totalDamageDealt: "int32", }, key: ["barbarian"], }, HealerTarget: { schema: { healer: "bytes32", bondedTarget: "bytes32", }, key: ["healer"], }, PhantomleechManaDrain: { schema: { id: "bytes32", manaDrained: "int32", }, key: ["id"], }, PoisonedUnits: { schema: { id: "bytes32", poisonStack: "int32", }, key: ["id"], }, PoisonDamage: { schema: { id: "bytes32", }, type: "offchainTable", key: [], }, //========== items ===================================================== PomegranatePulverizer: { schema: { id: "bytes32", x: "uint32", y: "uint32", thrown: "bool", }, key: ["id"], }, InvincibleIcingIIITarget: { schema: { ownerId: "bytes32", target: "bytes32", }, key: ["ownerId"] }, SouffleSurgeTargets: { schema: { ownerId: "bytes32", itemType: "ItemType", targets: "bytes32[]", }, key: ["ownerId"] }, ChaosChocolateTargetLane: { schema: { ownerId: "bytes32", lane: "uint32", }, key: ["ownerId"] }, //========= Design ballancing tables ======================================================================= UnitDesign: { schema: { id: "bytes32", damageDealt: "int32", damageHealed: "int32", manaGained: "int32", }, key: ["id"], }, UnitTypeDesign: { schema: { unitType: "UnitType", damageDealt: "int32", damageHealed: "int32", manaGained: "int32", }, key: ["unitType"], }, //========= Buildings Tables ==================================================================== Buildings: { schema: { building: "BuildingType", isTeamRight: "bool", totalResourcesStaked: "uint256[5]", }, key: ["building", "isTeamRight"], }, //========= Village Tables ==================================================================== VillageStructures: { schema: { player: "address", level: "uint32[3]", structureType: "uint32[3]" }, key: ["player"], }, Generators: { schema: { player: "address", generator: "StructureType", lastTimeCollected: "uint256", }, key: ["player", "generator"], }, //========= War tables ==================================================================== Players: { "schema": { "player": "address", "isTeamRight": "bool", "lootboxes": "uint32", "ArmyGeneral": "bytes32", "latestWarId": "uint32", "votingPowerSpent": "uint256", "warPrisoners": "uint32", "warPermitBalance": "uint256", "title": "string", "items": "uint32[]", "resources": "uint256[]", "units": "uint32[]", "ArmyCaptain": "bytes32[]" }, "key": [ "player" ] }, Rewards: { schema: { player: "address", lootboxes: "uint32", battleRewards: "uint256[5]", }, key: ["player"], }, Army: { schema: { armyId: "bytes32", warId: "uint32", armyState: "uint8", //Idle, Fighting captains: "address[]", //captains[0] is the army leader, the only person that can disband the army pendingInvitations: "address[]", }, key: ["armyId"], }, CallToArms: { schema: { captain: "address", armyId: "bytes32", status: "CallToArmsStatus", //0 - not invited, 1 - pending invite, 2 - accepted }, key: ["captain", "armyId"], }, Locations: { schema: { id: "uint32", isSiegeLocation: "bool", isTeamRight: "bool", hp: "int32", maxHp: "int32", width: "uint32", height: "uint32", resource: "uint256", tier: "uint256", lastClaimVp: "uint256", repairCostTier: "uint32", mapType: "uint256", neighbours: "uint32[]", ongoingBattles: "bytes32[]", }, key: ["id"], }, Artillery: { schema: { isTeamRight: "bool", warId: "uint32", kebabRocket: "uint256[4]", //VP + mustardGas: "uint256[4]", //all HP -x fatMandarin: "uint256[4]", //all ManaRegen -x allocation: "uint256[3]", //votes casted for kebab, mustard, fat }, key: ["warId", "isTeamRight"], }, War: { schema: { warId: "uint32", winnerTeamRight: "bool", startTime: "uint256", //NOTE when war end it is being set to war end time, after 1 month claims are locked, remaining rewards transfered to trasury and time set to 0 leftVictoryPoints: "uint32", rightVictoryPoints: "uint32", warState: "WarState", leftCapitalId: "uint32", rightCapitalId: "uint32", goldClaimed: "uint256", }, key: ["warId"], }, WarStats: { schema: { warId: "uint32", leftTreasury: "uint256", rightTreasury: "uint256", unitsBought: "uint256[14]", }, key: ["warId"], }, PlayerContribution: { schema: { player: "address", warId: "uint256", gold: "uint256", unitsPlaced: "uint32", unitsBought: "uint32", }, key: ["player", "warId"], }, Siege: { schema: { warId: "uint32", teamLeftVictoryPoints: "uint32", teamRightVictoryPoints: "uint32", }, key: ["warId"] }, SiegeGoldSpent: { schema: { warId: "uint32", goldSpent: "uint256", }, key: ["warId"] }, Battles: { schema: { id: "bytes32", warId: "bytes32", winner: "uint8", initTime: "uint256", battleState: "uint8", leftGateHp: "int32", rightGateHp: "int32", gateBleed: "int32", location: "uint32", defenderUnitPlaced: "bool", attackingArmy: "bytes32", defendingArmy: "bytes32", //0 if public defense leftReady: "bool", rightReady: "bool", publicDefenders: "address[]", //length 0 if private defense }, key: ["id"], }, WarConfig: { schema: { warId: "uint32", battleId: "uint32", }, key: [], }, //======================== QUESTS ===================== //contains all quest types requirements QuestRequirements: { schema: { questId: "uint32", requirement: "uint32", nextQuests: "uint32[]", }, key: ["questId"], }, PlayerQuestProgress: { schema: { player: "address", questId: "uint32", progress: "uint32", unlocked: "bool", completed: "bool", }, key: ["player", "questId"], }, DailyQuests: { schema: { player: "address", questId: "uint32", progress: "uint32", lastClaimed: "uint256", }, key: ["player", "questId"], }, RepeatingQuests: { schema: { player: "address", questId: "uint32", progress: "uint32", }, key: ["player", "questId"], }, QuestlineRewards: { schema: { player: "address", spoonQualified: "bool", spoonXP: "uint32", forkQualified: "bool", forkXP: "uint32", }, key: ["player"], }, //========= EVENTS ============================================================================== LocationBattleFinished: { schema: { locationId: "uint32", battleId: "bytes32", damageDealt: "int32", }, type: "offchainTable", key: [], }, //artillery events KebabRocketLaunched: { schema: { warId: "uint32", isTeamRight: "bool", victoryPoints: "uint32", }, type: "offchainTable", key: [], }, MustardGasLaunched: { schema: { warId: "uint32", locationId: "uint32", isTeamRight: "bool", hpDecrease: "int32", }, type: "offchainTable", key: [], }, FatMandarinLaunched: { schema: { warId: "uint32", locationId: "uint32", isTeamRight: "bool", manaRegenDecrease: "int32", }, type: "offchainTable", key: [], }, PlanningPhase: { schema: { planningId: "uint32" }, type: "offchainTable", key: [], }, BattlePhase: { schema: { battleId: "uint32" }, type: "offchainTable", key: [], }, UnitSpawned: { schema: { unitId: "bytes32", unitType: "UnitType", x: "uint32", y: "uint32", cost: "uint256", }, type: "offchainTable", key: [], }, UnitMoved: { schema: { unitId: "bytes32", x: "uint32", y: "uint32", newX: "uint32", newY: "uint32", isQuiched: "bool", }, type: "offchainTable", key: [], }, MeleeAttack: { schema: { attacker: "bytes32", defender: "bytes32", damage: "int32", isCrit: "bool", }, type: "offchainTable", key: [], }, RangeAttack: { schema: { attacker: "bytes32", defender: "bytes32", damage: "int32", isCrit: "bool", }, type: "offchainTable", key: [], }, GateAttack: { schema: { unitId: "bytes32", isTeamRightGate: "bool", damage: "int32", killUnit: "bool", }, type: "offchainTable", key: [], }, BarbarianDetonate: { schema: { unitId: "bytes32", damage: "int32", }, type: "offchainTable", key: [], }, BattleFinished: { //?????? schema: { winner: "uint32" }, type: "offchainTable", key: [], }, ProcessingUnit: { schema: { unitId: "bytes32", }, type: "offchainTable", key: [], }, IterationFinished: { schema: { leftIndex: "uint32", rightIndex: "uint32", }, type: "offchainTable", key: [], }, PlayerDonated: { schema: { player: "address", isTeamRight: "bool", building: "BuildingType", resources: "uint256[5]", }, type: "offchainTable", key: [], }, GeneratorResourcesCollected: { schema: { player: "address", wood: "uint256", stone: "uint256", iron: "uint256", }, type: "offchainTable", key: [], }, //=== SKILLS EVENTS ============================================================================ HealerSkill: { schema: { casterId: "bytes32", unit1: "bytes32", unit2: "bytes32", unit3: "bytes32", unit4: "bytes32", unit5: "bytes32", hasBondedUnit: "bool", }, type: "offchainTable", key: [], }, ArcherSkill: { schema: { casterId: "bytes32", target1: "bytes32", dmg1: "int32", target2: "bytes32", dmg2: "int32", target3: "bytes32", dmg3: "int32", }, type: "offchainTable", key: [], }, SquireSkill: { schema: { casterId: "bytes32", target1: "bytes32", target2: "bytes32", dmg: "int32" }, type: "offchainTable", key: [], }, BombSkill: { schema: { casterId: "bytes32", unit1: "bytes32", unit2: "bytes32", unit3: "bytes32", unit4: "bytes32", }, type: "offchainTable", key: [], }, BlockerSkill: { schema: { casterId: "bytes32", target: "bytes32", reflectedDamage: "int32", isCrit: "bool", damageType: "DamageType", }, type: "offchainTable", key: [], }, MageSkill: { schema: { casterId: "bytes32", target1: "bytes32", target2: "bytes32", target3: "bytes32", target4: "bytes32", isCrit: "bool", }, type: "offchainTable", key: [], }, BarbarianSkill: { schema: { casterId: "bytes32", newPercentageDamage: "int32", }, type: "offchainTable", key: [], }, AlchemistSkill: { schema: { casterId: "bytes32", targets0: "bytes32[]", targets1: "bytes32[]", targets2: "bytes32[]", targets3: "bytes32[]", }, type: "offchainTable", key: [], }, ButcherSkill: { schema: { casterId: "bytes32", stage: "ButcherSkillStage", target: "bytes32", newTargetX: "uint32", reorderedUnit: "bytes32", reorderedUnitNewX: "uint32", healAmount: "int32", damage: "int32", //only in PowerAttack }, type: "offchainTable", key: [], }, ShamanSkill: { schema: { casterId: "bytes32", changesToMelee: "bool", }, type: "offchainTable", key: [], }, AssassinGateDamageIncrease: { schema: { unitId: "bytes32", }, type: "offchainTable", key: [], }, AssassinSkill: { schema: { casterId: "bytes32", newX: "uint32", target: "bytes32", }, type: "offchainTable", key: [], }, DruidSkill: { schema: { casterId: "bytes32", changedToBear: "bool", }, type: "offchainTable", key: [], }, DruidBuffs: { schema: { druid: "bytes32", target1: "bytes32", target2: "bytes32", isHeal: "bool", value: "int32", }, type: "offchainTable", key: [], }, CannonSkill: { schema: { casterId: "bytes32", targets: "bytes32[]", }, type: "offchainTable", key: [], }, PhantomleechSkill: { schema: { casterId: "bytes32", unit1: "bytes32", unit2: "bytes32", unit3: "bytes32", unit4: "bytes32", }, type: "offchainTable", key: [], }, //item events ================================================================================== EnergizingEspressoUsed: { schema: { unitId: "bytes32", }, type: "offchainTable", key: [], }, PlayerReceivedItem: { schema: { player: "address", item: "ItemType", }, type: "offchainTable", key: [], }, ResurectionRaisinUsed: { schema: { unitId: "bytes32", }, type: "offchainTable", key: [], }, ApocalypticAppleUsed: { schema: { ownerId: "bytes32", yCoordintate: "uint32", }, type: "offchainTable", key: [], }, GrenadeThrown: { schema: { itemOwner: "bytes32", targetX: "uint32", targetY: "uint32", }, type: "offchainTable", key: [], }, OneBlastBerryUsed: { schema: { itemOwner: "bytes32", }, type: "offchainTable", key: [], }, ChaosChocolateUsed: { schema: { ownerId: "bytes32", lane: "uint32", }, type: "offchainTable", key: [] }, InvincibleIcingUsed: { schema: { ownerId: "bytes32", target: "bytes32", // always 0 if isTierIV is true lane: "uint32", // 0 by default, isTierIV: "bool", }, type: "offchainTable", key: [] //FIXME removing ownerId from here should resolve issue #224 }, //TODO adjust SouffleSurge offchain event and add proper calling in exec functions SouffleSurgeUsed: { schema: { ownerId: "bytes32", targets: "bytes32[]", }, type: "offchainTable", key: [] }, QuantumQuicheUsed: { schema: { ownerId: "bytes32", target: "bytes32", lane: "uint32", isTierIV: "bool", }, type: "offchainTable", key: [] }, StomachBittersUsed: { schema: { ownerId: "bytes32", }, type: "offchainTable", key: [] }, TabulaRiceUsed: { schema: { ownerId: "bytes32", previousType: "UnitType", newType: "UnitType", }, type: "offchainTable", key: [] }, //lootbox events ================================================================================== LootboxOpened: { schema: { player: "address", item0: "uint32", item1: "uint32", item2: "uint32", item3: "uint32", }, type: "offchainTable", key: ["player"], }, //reforger event ReforgerUsed: { schema: { player: "address", item: "uint32", isSuccess: "bool", }, type: "offchainTable", key: [], } } ### Game MUD TableIds | Table | ID | |-----------|-------------------------------------------------------------------| | Players | `0x74620000000000000000000000000000506c6179657273000000000000000000` | | Locations | `0x746200000000000000000000000000004c6f636174696f6e7300000000000000` | | Army | `0x7462000000000000000000000000000041726d79000000000000000000000000` | | Battles | `0x74620000000000000000000000000000426174746c6573000000000000000000` | ### Game MUD Config Explained * **TeamLeft/TeamRight**: Stores the level of each unit-producing building (`bombHouseLevel`, `archerHouseLevel`, etc.) for the left and right teams in a war identified by `warId`. Likely used for determining available units and their stats. * **GlobalBattleStats**: Tracks the number of units placed by each team (`isTeamRight`) in a battle (`battleId`). Useful for analytics or potentially limiting unit deployment. * **PlayerBattleStats**: Similar to `GlobalBattleStats`, but tracks units placed by individual players (`player`) in a specific battle (`battleId`). Used for individual player statistics. * **Gold**: Tracks battle gold emitted. Used for global stats of the game. * **Lootboxes**: Stores the owner (`owner`) and commitBlock for lootboxes. Used to handle lootbox claim logic. * **ProcessParams**: Manages the processing indices and flags for battle resolution (`battleId`, `leftProcessIndex`, `rightProcessIndex`, `leftProcessFinished`, `rightProcessFinished`, etc.). Used to handle battle calculations in batches. * **Units**: Describes individual units in a battle (`id`, `battleId`, `unitType`, `x`, `y`, `hp`, `maxHp`, `owner`, `level`, `title`). Central table for unit data. * **UnitsCombat**: Stores combat-related stats for a unit (`id`, `meleeDamage`, `rangeDamage`, `critDamage`, `critChance`, `gateDamage`, `attackRange`, `item`). Separated from `Units` for data organization and potentially optimization. * **UnitsSkillsModifiers**: Stores skill modifiers for each team (`isTeamRight`, `shamanDamageIncrease`, `butcherHealAmount`, etc.). Used to balance the units in the game. * **UnitConstants**: Defines the base stats for each unit type (`unitType`, `hp`, `mana`, `meleeDamage`, `rangeDamage`, `critChance`, `gateDamage`, `attackRange`). Used for initialization and balancing. * **ItemRarityConstants**: Stores arrays of item IDs categorized by rarity (Gray, Green, Blue, Purple, Unique). Used for lootbox generation and item availability. * **UnitUpgrade**: Stores unit upgrade stats for a given building type and team (`buildingType`, `isTeamRight`, `level`, `hp`, `mana`, `meleeDamage`, `rangeDamage`, `critDamage`, `critChance`, `gateDamage`, `attackRange`, `skillModifier`). * **MapUnits**: Tracks which unit (`unitId`) occupies a specific location (`x`, `y`) on a battle map (`battleId`). Used for collision detection and movement. * **LeftQueue/RightQueue**: Queues units to be processed in a battle, presumably for actions or turns (`id`, `battleId`, `unitId`). Used in batch processing of units. * **Randomness**: Stores randomness values by block number (`blockNumber`, `value`, `randomnessActive`). Used in calculations where randomness is necessary * **ButcherSkillSequence**: Tracks the current stage of a Butcher unit's skill (`id`, `stage`). Used to manage complex skill sequences. * **DruidForm**: Indicates whether a Druid unit is in bear form or not (`id`, `isBear`). Used to track Druid's transformation state. * **BarbarianTargets**: Tracks the target and damage dealt to the target for a barbarian unit (`barbarian`, `target`, `hitCount`, `totalDamageDealt`). * **HealerTarget**: Stores which unit a Healer unit is bonded to (`healer`, `bondedTarget`). Used to manage healing connections. * **PhantomleechManaDrain**: Tracks how much mana a Phantomleech unit has drained (`id`, `manaDrained`). Used to control mana draining. * **PoisonedUnits**: Tracks the poison stack count on a unit (`id`, `poisonStack`). Used to apply poison damage over time. * **PoisonDamage**: Offchain table. Marks the units which are posioned. * **PomegranatePulverizer**: Stores the position and state of a thrown Pomegranate Pulverizer item (`id`, `x`, `y`, `thrown`). Used for tracking projectile position. * **InvincibleIcingIIITarget**: Records the target unit for an Invincible Icing III item (`ownerId`, `target`). Used to apply invincibility buffs. * **SouffleSurgeTargets**: Stores the targets for Souffle Surge item (`ownerId`, `itemType`, `targets`). Used to heal specific units. * **ChaosChocolateTargetLane**: Stores the lane where chaos chocolate is used (`ownerId`, `lane`). Used to buff a certain lane. * **UnitDesign**: Tracks the performance of a unit in terms of damage dealt, damage healed, and mana gained (`id`, `damageDealt`, `damageHealed`, `manaGained`). Used for unit balancing based on actual performance. * **UnitTypeDesign**: Aggregates the performance data for each unit type (`unitType`, `damageDealt`, `damageHealed`, `manaGained`). Used for balancing unit types. * **Buildings**: Stores data of the buildings (`building`, `isTeamRight`, `totalResourcesStaked`). Building is the type of building, isTeamRight boolean value, and totalResourcesStaked is array of resource type that are staked. * **VillageStructures**: Stores the levels and types of structures built in a player's village (`player`, `level`, `structureType`). Used for village progression and resource generation. * **Generators**: Tracks the last time resources were collected from a specific generator building (`player`, `generator`, `lastTimeCollected`). Used to manage resource generation timing. * **Players**: Stores player-specific data (`player`, `isTeamRight`, `lootboxes`, `ArmyGeneral`, `latestWarId`, `votingPowerSpent`, `warPrisoners`, `warPermitBalance`, `title`, `items`, `resources`, `units`, `ArmyCaptain`). Used to store players basic data. * **Rewards**: Stores the lootbox and battle reward balances for each player (`player`, `lootboxes`, `battleRewards`). Used to track rewards to be claimed. * **Army**: Stores army data (`armyId`, `warId`, `armyState`, `captains`, `pendingInvitations`). Used to track army data. * **CallToArms**: Stores CallToArms data (`captain`, `armyId`, `status`). Used to track the players which are invited and accepted army invitation. * **Locations**: Stores map location data (`id`, `isSiegeLocation`, `isTeamRight`, `hp`, `maxHp`, `width`, `height`, `resource`, `tier`, `lastClaimVp`, `repairCostTier`, `mapType`, `neighbours`, `ongoingBattles`). Used to track locations data. * **Artillery**: Tracks the stats of different artillery types like KebabRocket, MustardGas, FatMandarin. Stored for left and right team (isTeamRight). Also stores allocations for votes casted for different artillerys. * **War**: Stores the information for a specific war (`warId`, `winnerTeamRight`, `startTime`, `leftVictoryPoints`, `rightVictoryPoints`, `warState`, `leftCapitalId`, `rightCapitalId`, `goldClaimed`). * **WarStats**: Stores aggregated statistics for a war (`warId`, `leftTreasury`, `rightTreasury`, `unitsBought`). Used for high-level war analysis. * **PlayerContribution**: Records a player's contributions to a war (`player`, `warId`, `gold`, `unitsPlaced`, `unitsBought`). Used to determine reward eligibility. * **Siege**: Stores siege data (`warId`, `teamLeftVictoryPoints`, `teamRightVictoryPoints`). Used to track the siege progress * **SiegeGoldSpent**: Stores the gold spent during a siege. * **Battles**: Stores information about a specific battle (`id`, `warId`, `winner`, `initTime`, `battleState`, `leftGateHp`, `rightGateHp`, `gateBleed`, `location`, `defenderUnitPlaced`, `attackingArmy`, `defendingArmy`, `leftReady`, `rightReady`, `publicDefenders`). Used to track battle data and state. * **WarConfig**: Stores war configuration (`warId`, `battleId`). * **QuestRequirements**: Stores Quest requirements. Includes information about quest id, requirement, and next quests. * **PlayerQuestProgress**: Tracks player progress in quest. Includes information about player, questid, progress, unlocked state, and completed state. * **DailyQuests**: Tracks daily quest player progress. Includes information about player, questId, progress, and lastClaimed block timestamp. * **RepeatingQuests**: Tracks repeating quests and progress. * **QuestlineRewards**: Tracks questline rewards and experience. * **LocationBattleFinished**: Stores Location battle finished event data. * **KebabRocketLaunched**: Stores Kebab Rocket Launched event data. * **MustardGasLaunched**: Stores Mustard Gas Launched event data. * **FatMandarinLaunched**: Stores Fat Mandarin Launched event data. * **PlanningPhase**: Stores Planning Phase event data. * **BattlePhase**: Stores Battle Phase event data. * **UnitSpawned**: Stores Unit Spawned event data. * **UnitMoved**: Stores Unit Moved event data. * **MeleeAttack**: Stores Melee Attack event data. * **RangeAttack**: Stores Range Attack event data. * **GateAttack**: Stores Gate Attack event data. * **BarbarianDetonate**: Stores Barbarian Detonate event data. * **BattleFinished**: Stores Battle Finished event data. * **ProcessingUnit**: Stores Processing Unit event data. * **IterationFinished**: Stores Iteration Finished event data. * **PlayerDonated**: Stores Player Donated event data. * **GeneratorResourcesCollected**: Stores Generator Resources Collected event data. * **HealerSkill**: Stores Healer Skill event data. * **ArcherSkill**: Stores Archer Skill event data. * **SquireSkill**: Stores Squire Skill event data. * **BombSkill**: Stores Bomb Skill event data. * **BlockerSkill**: Stores Blocker Skill event data. * **MageSkill**: Stores Mage Skill event data. * **BarbarianSkill**: Stores Barbarian Skill event data. * **AlchemistSkill**: Stores Alchemist Skill event data. * **ButcherSkill**: Stores Butcher Skill event data. * **ShamanSkill**: Stores Shaman Skill event data. * **AssassinGateDamageIncrease**: Stores Assassin Gate Damage Increase event data. * **AssassinSkill**: Stores Assassin Skill event data. * **DruidSkill**: Stores Druid Skill event data. * **DruidBuffs**: Stores Druid Buffs event data. * **CannonSkill**: Stores Cannon Skill event data. * **PhantomleechSkill**: Stores Phantomleech Skill event data. * **EnergizingEspressoUsed**: Stores Energizing Espresso Used event data. * **PlayerReceivedItem**: Stores Player Received Item event data. * **ResurectionRaisinUsed**: Stores Resurection Raisin Used event data. * **ApocalypticAppleUsed**: Stores Apocalyptic Apple Used event data. * **GrenadeThrown**: Stores Grenade Thrown event data. * **OneBlastBerryUsed**: Stores One Blast Berry Used event data. * **ChaosChocolateUsed**: Stores Chaos Chocolate Used event data. * **InvincibleIcingUsed**: Stores Invincible Icing Used event data. * **SouffleSurgeUsed**: Stores Souffle Surge Used event data. * **QuantumQuicheUsed**: Stores Quantum Quiche Used event data. * **StomachBittersUsed**: Stores Stomach Bitters Used event data. * **TabulaRiceUsed**: Stores Tabula Rice Used event data. * **LootboxOpened**: Stores Lootbox Opened event data. * **ReforgerUsed**: Stores Reforger Used event data.