diff --git a/frontend/src/components/tankGame/Tank.tsx b/frontend/src/components/tankGame/Tank.tsx index 007ea24..cf85a64 100644 --- a/frontend/src/components/tankGame/Tank.tsx +++ b/frontend/src/components/tankGame/Tank.tsx @@ -2,7 +2,7 @@ import { Droplet, Heart, Target, User, Zap } from "lucide-react"; import { ITank } from "./ITank"; import { useTankGameGetEpoch, useTankGameLastDripEpoch } from "@/src/generated"; import { DropdownMenu, DropdownMenuContent } from "../ui/dropdown-menu"; -import { Address} from "viem"; +import { Address } from "viem"; import { useTankNameFromId } from "./EventsStream"; interface TankProps { @@ -13,17 +13,29 @@ interface TankProps { left: number; } | null; onChange: () => void; - address: Address + address: Address; } -export function Tank({ tankObj, open, position, onChange, address }: TankProps) { +export function Tank({ + tankObj, + open, + position, + onChange, + address, +}: TankProps) { const { tank, tankId } = tankObj; const tankName = useTankNameFromId(address, tankId); let lastDripEpoch = useTankGameLastDripEpoch({ args: [tankId], enabled: !!tankId, watch: true, + // @ts-ignore + address: address, + }); + let currentEpoch = useTankGameGetEpoch({ + watch: true, + // @ts-ignore + address: address, }); - let currentEpoch = useTankGameGetEpoch({ watch: true }); return (
@@ -48,9 +60,7 @@ export function Tank({ tankObj, open, position, onChange, address }: TankProps)
- - Owner name: {tankName} - + Owner name: {tankName}
{" "} diff --git a/frontend/src/components/treaties/Bounty.tsx b/frontend/src/components/treaties/Bounty.tsx index 5ecfd98..fea17dd 100644 --- a/frontend/src/components/treaties/Bounty.tsx +++ b/frontend/src/components/treaties/Bounty.tsx @@ -8,7 +8,11 @@ import { } from "@/src/generated"; import { useState, useEffect } from "react"; import { Address, BaseError, formatEther } from "viem"; -import { useAccount, useBlockNumber, useWaitForTransaction } from "wagmi"; +import { + useAccount, + useBlockNumber, + useWaitForTransaction, +} from "wagmi"; import { getPublicClient } from "wagmi/actions"; import { getTankNameFromJoinIndex, @@ -69,9 +73,9 @@ export default function Bounty({ } else { return acc.map((item: any) => item.address === current.address && - item.args.tankId === current.args.tankId && - item.args.target === current.args.target && - item.args.amount > current.args.amount + item.args.tankId === current.args.tankId && + item.args.target === current.args.target && + item.args.amount > current.args.amount ? current : item ); @@ -92,8 +96,11 @@ export default function Bounty({ }, [hookAddress, blockNumber]); const { config: addHooksConfig } = usePrepareTankGameAddHooks({ args: [ownerTank.data!, hookAddress], - enabled: !!ownerTank, + // @ts-ignore + address: gameAddress, + enabled: !!ownerTank.data, }); + // console.log(addHooksConfig); const { write: addHook, data: addHookData } = useTankGameAddHooks(addHooksConfig); useWaitForTransaction({ @@ -264,7 +271,9 @@ function BountyCard({ diff --git a/frontend/src/generated.ts b/frontend/src/generated.ts index 35333d4..5d95bb0 100644 --- a/frontend/src/generated.ts +++ b/frontend/src/generated.ts @@ -1326,21 +1326,21 @@ export const gameViewABI = [ { stateMutability: 'view', type: 'function', - inputs: [{ name: 'game', internalType: 'address', type: 'address' }], + inputs: [{ name: 'gameAddress', internalType: 'address', type: 'address' }], name: 'getBoard', outputs: [{ name: '', internalType: 'contract Board', type: 'address' }], }, { stateMutability: 'view', type: 'function', - inputs: [{ name: 'game', internalType: 'address', type: 'address' }], + inputs: [{ name: 'gameAddress', internalType: 'address', type: 'address' }], name: 'getEpoch', outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], }, { stateMutability: 'view', type: 'function', - inputs: [{ name: 'game', internalType: 'address', type: 'address' }], + inputs: [{ name: 'gameAddress', internalType: 'address', type: 'address' }], name: 'getGameEpoch', outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], }, @@ -1348,7 +1348,7 @@ export const gameViewABI = [ stateMutability: 'view', type: 'function', inputs: [ - { name: 'game', internalType: 'address', type: 'address' }, + { name: 'gameAddress', internalType: 'address', type: 'address' }, { name: 'tankId', internalType: 'uint256', type: 'uint256' }, ], name: 'getLastDrip', @@ -1357,14 +1357,14 @@ export const gameViewABI = [ { stateMutability: 'view', type: 'function', - inputs: [{ name: 'game', internalType: 'address', type: 'address' }], + inputs: [{ name: 'gameAddress', internalType: 'address', type: 'address' }], name: 'getPlayerCount', outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], }, { stateMutability: 'view', type: 'function', - inputs: [{ name: 'game', internalType: 'address', type: 'address' }], + inputs: [{ name: 'gameAddress', internalType: 'address', type: 'address' }], name: 'getSettings', outputs: [ { @@ -1393,7 +1393,7 @@ export const gameViewABI = [ { stateMutability: 'view', type: 'function', - inputs: [{ name: 'game', internalType: 'address', type: 'address' }], + inputs: [{ name: 'gameAddress', internalType: 'address', type: 'address' }], name: 'getState', outputs: [ { name: '', internalType: 'enum ITankGame.GameState', type: 'uint8' }, @@ -1403,7 +1403,7 @@ export const gameViewABI = [ stateMutability: 'view', type: 'function', inputs: [ - { name: 'game', internalType: 'address', type: 'address' }, + { name: 'gameAddress', internalType: 'address', type: 'address' }, { name: 'tankId', internalType: 'uint256', type: 'uint256' }, ], name: 'getTank', @@ -1425,7 +1425,7 @@ export const gameViewABI = [ stateMutability: 'view', type: 'function', inputs: [ - { name: 'game', internalType: 'address', type: 'address' }, + { name: 'gameAddress', internalType: 'address', type: 'address' }, { name: 'tankId', internalType: 'uint256', type: 'uint256' }, ], name: 'getUpgradeCost', @@ -1435,7 +1435,7 @@ export const gameViewABI = [ stateMutability: 'view', type: 'function', inputs: [ - { name: 'game', internalType: 'address', type: 'address' }, + { name: 'gameAddress', internalType: 'address', type: 'address' }, { name: 'tankId', internalType: 'uint256', type: 'uint256' }, { name: '_owner', internalType: 'address', type: 'address' }, ], @@ -1822,23 +1822,6 @@ export const hookFactoryConfig = { abi: hookFactoryABI, } as const -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// IAcceptable -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const iAcceptableABI = [ - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'from', internalType: 'address', type: 'address' }, - { name: 'hook', internalType: 'address', type: 'address' }, - ], - name: 'accept', - outputs: [], - }, -] as const - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // IGameView ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -4032,27 +4015,66 @@ export const nonAggressionABI = [ ] as const ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// NonAggressionHook +// Strings +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const stringsABI = [ + { + type: 'error', + inputs: [ + { name: 'value', internalType: 'uint256', type: 'uint256' }, + { name: 'length', internalType: 'uint256', type: 'uint256' }, + ], + name: 'StringsInsufficientHexLength', + }, +] as const + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// TankGame ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -export const nonAggressionHookABI = [ +/** + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - + */ +export const tankGameABI = [ + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: '_getEpoch', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, { stateMutability: 'nonpayable', type: 'function', inputs: [ - { name: 'from', internalType: 'address', type: 'address' }, - { name: 'hook', internalType: 'address', type: 'address' }, + { name: 'tankId', internalType: 'uint256', type: 'uint256' }, + { name: 'hooks', internalType: 'contract IHooks', type: 'address' }, ], - name: 'accept', + name: 'addHooks', outputs: [], }, { - stateMutability: 'pure', + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'aliveTanksIdSum', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'board', + outputs: [{ name: '', internalType: 'contract Board', type: 'address' }], + }, + { + stateMutability: 'nonpayable', type: 'function', inputs: [ - { name: '', internalType: 'address', type: 'address' }, { - name: '', + name: 'params', internalType: 'struct ITankGame.ClaimParams', type: 'tuple', components: [ @@ -4060,18 +4082,30 @@ export const nonAggressionHookABI = [ { name: 'claimer', internalType: 'address', type: 'address' }, ], }, - { name: '', internalType: 'bytes', type: 'bytes' }, ], - name: 'afterClaim', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], + name: 'claim', + outputs: [], }, { - stateMutability: 'pure', + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], + name: 'claimed', + outputs: [{ name: 'claimed', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'deadTanks', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'nonpayable', type: 'function', inputs: [ - { name: '', internalType: 'address', type: 'address' }, { - name: '', + name: 'params', internalType: 'struct ITankGame.DelegateParams', type: 'tuple', components: [ @@ -4079,36 +4113,87 @@ export const nonAggressionHookABI = [ { name: 'delegatee', internalType: 'address', type: 'address' }, ], }, - { name: '', internalType: 'bytes', type: 'bytes' }, ], - name: 'afterDelegate', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], + name: 'delegate', + outputs: [], }, { - stateMutability: 'pure', + stateMutability: 'view', + type: 'function', + inputs: [ + { name: 'tankId', internalType: 'uint256', type: 'uint256' }, + { name: 'delegate', internalType: 'address', type: 'address' }, + ], + name: 'delegates', + outputs: [{ name: 'isDelegate', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'payable', + type: 'function', + inputs: [], + name: 'donate', + outputs: [], + }, + { + stateMutability: 'nonpayable', type: 'function', inputs: [ - { name: '', internalType: 'address', type: 'address' }, { - name: '', + name: 'params', internalType: 'struct ITankGame.DripParams', type: 'tuple', components: [ { name: 'tankId', internalType: 'uint256', type: 'uint256' }, ], }, - { name: '', internalType: 'bytes', type: 'bytes' }, ], - name: 'afterDrip', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], + name: 'drip', + outputs: [], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'epochStart', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'factory', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [ + { name: 'tankId', internalType: 'uint256', type: 'uint256' }, + { name: 'hooks', internalType: 'contract IHooks', type: 'address' }, + ], + name: 'forceAddDefaultHook', + outputs: [], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], + name: 'getLastDrip', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], + name: 'getUpgradeCost', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], }, { stateMutability: 'nonpayable', type: 'function', inputs: [ - { name: '', internalType: 'address', type: 'address' }, { - name: '', + name: 'params', internalType: 'struct ITankGame.GiveParams', type: 'tuple', components: [ @@ -4118,18 +4203,56 @@ export const nonAggressionHookABI = [ { name: 'aps', internalType: 'uint256', type: 'uint256' }, ], }, - { name: '', internalType: 'bytes', type: 'bytes' }, ], - name: 'afterGive', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], + name: 'give', + outputs: [], }, { - stateMutability: 'pure', + stateMutability: 'payable', type: 'function', inputs: [ - { name: '', internalType: 'address', type: 'address' }, { - name: '', + name: 'gs', + internalType: 'struct ITankGame.GameSettings', + type: 'tuple', + components: [ + { name: 'playerCount', internalType: 'uint256', type: 'uint256' }, + { name: 'boardSize', internalType: 'uint256', type: 'uint256' }, + { name: 'initAPs', internalType: 'uint256', type: 'uint256' }, + { name: 'initHearts', internalType: 'uint256', type: 'uint256' }, + { name: 'initShootRange', internalType: 'uint256', type: 'uint256' }, + { name: 'epochSeconds', internalType: 'uint256', type: 'uint256' }, + { name: 'buyInMinimum', internalType: 'uint256', type: 'uint256' }, + { + name: 'revealWaitBlocks', + internalType: 'uint256', + type: 'uint256', + }, + { name: 'autoStart', internalType: 'bool', type: 'bool' }, + { name: 'root', internalType: 'bytes32', type: 'bytes32' }, + ], + }, + { name: '_owner', internalType: 'address', type: 'address' }, + ], + name: 'initialize', + outputs: [], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [ + { name: 'tankId', internalType: 'uint256', type: 'uint256' }, + { name: '_owner', internalType: 'address', type: 'address' }, + ], + name: 'isAuth', + outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'payable', + type: 'function', + inputs: [ + { + name: 'params', internalType: 'struct ITankGame.JoinParams', type: 'tuple', components: [ @@ -4138,18 +4261,30 @@ export const nonAggressionHookABI = [ { name: 'playerName', internalType: 'string', type: 'string' }, ], }, - { name: '', internalType: 'bytes', type: 'bytes' }, ], - name: 'afterJoin', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], + name: 'join', + outputs: [], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], + name: 'lastDripEpoch', + outputs: [{ name: 'epoch', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'lastRevealBlock', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], }, { stateMutability: 'nonpayable', type: 'function', inputs: [ - { name: '', internalType: 'address', type: 'address' }, { - name: '', + name: 'params', internalType: 'struct ITankGame.MoveParams', type: 'tuple', components: [ @@ -4166,28 +4301,97 @@ export const nonAggressionHookABI = [ }, ], }, - { name: '', internalType: 'bytes', type: 'bytes' }, ], - name: 'afterMove', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], + name: 'move', + outputs: [], }, { - stateMutability: 'nonpayable', + stateMutability: 'view', type: 'function', - inputs: [ - { name: '', internalType: 'address', type: 'address' }, - { name: '', internalType: 'bytes', type: 'bytes' }, - ], - name: 'afterReveal', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], + inputs: [], + name: 'numTanksAlive', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'owner', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'player', internalType: 'address', type: 'address' }], + name: 'players', + outputs: [{ name: 'tank', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'playersCount', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'podium', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'prizePool', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [], + name: 'reveal', + outputs: [], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'revealBlock', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'nonpayable', + type: 'function', + inputs: [{ name: '_owner', internalType: 'address', type: 'address' }], + name: 'setOwner', + outputs: [], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'settings', + outputs: [ + { name: 'playerCount', internalType: 'uint256', type: 'uint256' }, + { name: 'boardSize', internalType: 'uint256', type: 'uint256' }, + { name: 'initAPs', internalType: 'uint256', type: 'uint256' }, + { name: 'initHearts', internalType: 'uint256', type: 'uint256' }, + { name: 'initShootRange', internalType: 'uint256', type: 'uint256' }, + { name: 'epochSeconds', internalType: 'uint256', type: 'uint256' }, + { name: 'buyInMinimum', internalType: 'uint256', type: 'uint256' }, + { name: 'revealWaitBlocks', internalType: 'uint256', type: 'uint256' }, + { name: 'autoStart', internalType: 'bool', type: 'bool' }, + { name: 'root', internalType: 'bytes32', type: 'bytes32' }, + ], }, { stateMutability: 'nonpayable', type: 'function', inputs: [ - { name: 'gameId', internalType: 'address', type: 'address' }, { - name: 'shootParams', + name: 'params', internalType: 'struct ITankGame.ShootParams', type: 'tuple', components: [ @@ -4196,602 +4400,858 @@ export const nonAggressionHookABI = [ { name: 'shots', internalType: 'uint256', type: 'uint256' }, ], }, - { name: 'hookData', internalType: 'bytes', type: 'bytes' }, ], - name: 'afterShoot', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], + name: 'shoot', + outputs: [], }, { stateMutability: 'nonpayable', type: 'function', - inputs: [ - { name: '', internalType: 'address', type: 'address' }, - { - name: '', - internalType: 'struct ITankGame.UpgradeParams', - type: 'tuple', - components: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - ], - }, - { name: '', internalType: 'bytes', type: 'bytes' }, + inputs: [], + name: 'start', + outputs: [], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'state', + outputs: [ + { name: '', internalType: 'enum ITankGame.GameState', type: 'uint8' }, ], - name: 'afterUpgrade', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], }, { - stateMutability: 'nonpayable', + stateMutability: 'view', type: 'function', - inputs: [ - { name: '', internalType: 'address', type: 'address' }, - { - name: '', - internalType: 'struct ITankGame.VoteParams', - type: 'tuple', - components: [ - { name: 'voter', internalType: 'uint256', type: 'uint256' }, - { name: 'cursed', internalType: 'uint256', type: 'uint256' }, - ], - }, - { name: '', internalType: 'bytes', type: 'bytes' }, + inputs: [], + name: 'stateData', + outputs: [ + { name: 'playersCount', internalType: 'uint256', type: 'uint256' }, + { name: 'numTanksAlive', internalType: 'uint256', type: 'uint256' }, + { name: 'prizePool', internalType: 'uint256', type: 'uint256' }, + { name: 'epochStart', internalType: 'uint256', type: 'uint256' }, + { name: 'aliveTanksIdSum', internalType: 'uint256', type: 'uint256' }, + { name: 'revealBlock', internalType: 'uint256', type: 'uint256' }, + { name: 'lastRevealBlock', internalType: 'uint256', type: 'uint256' }, + { name: 'owner', internalType: 'address', type: 'address' }, ], - name: 'afterVote', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], }, { - stateMutability: 'pure', + stateMutability: 'view', type: 'function', inputs: [ - { name: '', internalType: 'address', type: 'address' }, - { - name: '', - internalType: 'struct ITankGame.ClaimParams', - type: 'tuple', - components: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { name: 'claimer', internalType: 'address', type: 'address' }, - ], - }, - { name: '', internalType: 'bytes', type: 'bytes' }, + { name: 'tankId', internalType: 'uint256', type: 'uint256' }, + { name: '', internalType: 'uint256', type: 'uint256' }, + ], + name: 'tankHooks', + outputs: [ + { name: 'hooks', internalType: 'contract IHooks', type: 'address' }, ], - name: 'beforeClaim', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], }, { - stateMutability: 'pure', + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], + name: 'tanks', + outputs: [ + { name: 'owner', internalType: 'address', type: 'address' }, + { name: 'hearts', internalType: 'uint256', type: 'uint256' }, + { name: 'aps', internalType: 'uint256', type: 'uint256' }, + { name: 'range', internalType: 'uint256', type: 'uint256' }, + ], + }, + { + stateMutability: 'nonpayable', type: 'function', inputs: [ - { name: '', internalType: 'address', type: 'address' }, { - name: '', - internalType: 'struct ITankGame.DelegateParams', + name: 'params', + internalType: 'struct ITankGame.UpgradeParams', type: 'tuple', components: [ { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { name: 'delegatee', internalType: 'address', type: 'address' }, ], }, - { name: '', internalType: 'bytes', type: 'bytes' }, ], - name: 'beforeDelegate', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], + name: 'upgrade', + outputs: [], }, { - stateMutability: 'pure', + stateMutability: 'nonpayable', type: 'function', inputs: [ - { name: '', internalType: 'address', type: 'address' }, { - name: '', - internalType: 'struct ITankGame.DripParams', + name: 'params', + internalType: 'struct ITankGame.VoteParams', type: 'tuple', components: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, + { name: 'voter', internalType: 'uint256', type: 'uint256' }, + { name: 'cursed', internalType: 'uint256', type: 'uint256' }, ], }, - { name: '', internalType: 'bytes', type: 'bytes' }, ], - name: 'beforeDrip', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], + name: 'vote', + outputs: [], }, { - stateMutability: 'pure', + stateMutability: 'view', type: 'function', inputs: [ - { name: '', internalType: 'address', type: 'address' }, - { - name: '', - internalType: 'struct ITankGame.GiveParams', - type: 'tuple', - components: [ - { name: 'fromId', internalType: 'uint256', type: 'uint256' }, - { name: 'toId', internalType: 'uint256', type: 'uint256' }, - { name: 'hearts', internalType: 'uint256', type: 'uint256' }, - { name: 'aps', internalType: 'uint256', type: 'uint256' }, - ], - }, - { name: '', internalType: 'bytes', type: 'bytes' }, + { name: 'epoch', internalType: 'uint256', type: 'uint256' }, + { name: 'tankId', internalType: 'uint256', type: 'uint256' }, ], - name: 'beforeGive', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], + name: 'votedThisEpoch', + outputs: [{ name: 'voted', internalType: 'bool', type: 'bool' }], }, { - stateMutability: 'pure', + stateMutability: 'view', type: 'function', inputs: [ - { name: '', internalType: 'address', type: 'address' }, - { - name: '', - internalType: 'struct ITankGame.JoinParams', - type: 'tuple', - components: [ - { name: 'joiner', internalType: 'address', type: 'address' }, - { name: 'proof', internalType: 'bytes32[]', type: 'bytes32[]' }, - { name: 'playerName', internalType: 'string', type: 'string' }, - ], - }, - { name: '', internalType: 'bytes', type: 'bytes' }, + { name: 'epoch', internalType: 'uint256', type: 'uint256' }, + { name: 'tankId', internalType: 'uint256', type: 'uint256' }, ], - name: 'beforeJoin', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], + name: 'votesPerEpoch', + outputs: [{ name: 'votes', internalType: 'uint256', type: 'uint256' }], }, { - stateMutability: 'nonpayable', + stateMutability: 'view', type: 'function', + inputs: [{ name: 'epoch', internalType: 'uint256', type: 'uint256' }], + name: 'votingClosed', + outputs: [{ name: 'votingClosed', internalType: 'bool', type: 'bool' }], + }, + { + type: 'event', + anonymous: false, inputs: [ - { name: '', internalType: 'address', type: 'address' }, { - name: '', - internalType: 'struct ITankGame.MoveParams', - type: 'tuple', - components: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { - name: 'to', - internalType: 'struct Board.Point', - type: 'tuple', - components: [ - { name: 'x', internalType: 'uint256', type: 'uint256' }, - { name: 'y', internalType: 'uint256', type: 'uint256' }, - { name: 'z', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], + name: 'hunter', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'victim', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'reward', + internalType: 'uint256', + type: 'uint256', + indexed: false, }, - { name: '', internalType: 'bytes', type: 'bytes' }, ], - name: 'beforeMove', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], + name: 'BountyCompleted', }, { - stateMutability: 'pure', - type: 'function', + type: 'event', + anonymous: false, inputs: [ - { name: '', internalType: 'address', type: 'address' }, - { name: '', internalType: 'bytes', type: 'bytes' }, + { + name: 'reciever', + internalType: 'address', + type: 'address', + indexed: false, + }, + { + name: 'tankId', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'amount', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, ], - name: 'beforeReveal', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], + name: 'Claim', }, { - stateMutability: 'nonpayable', - type: 'function', + type: 'event', + anonymous: false, inputs: [ - { name: '', internalType: 'address', type: 'address' }, { - name: '', - internalType: 'struct ITankGame.ShootParams', - type: 'tuple', - components: [ - { name: 'fromId', internalType: 'uint256', type: 'uint256' }, - { name: 'toId', internalType: 'uint256', type: 'uint256' }, - { name: 'shots', internalType: 'uint256', type: 'uint256' }, - ], + name: 'poker', + internalType: 'address', + type: 'address', + indexed: false, + }, + { + name: 'blocknumber', + internalType: 'uint256', + type: 'uint256', + indexed: false, }, - { name: '', internalType: 'bytes', type: 'bytes' }, ], - name: 'beforeShoot', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], + name: 'Commit', }, { - stateMutability: 'nonpayable', - type: 'function', + type: 'event', + anonymous: false, inputs: [ - { name: '', internalType: 'address', type: 'address' }, { - name: '', - internalType: 'struct ITankGame.UpgradeParams', - type: 'tuple', - components: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - ], + name: 'cursedTank', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'voter', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'epoch', + internalType: 'uint256', + type: 'uint256', + indexed: false, }, - { name: '', internalType: 'bytes', type: 'bytes' }, ], - name: 'beforeUpgrade', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], + name: 'Curse', }, { - stateMutability: 'nonpayable', - type: 'function', + type: 'event', + anonymous: false, inputs: [ - { name: '', internalType: 'address', type: 'address' }, { - name: '', - internalType: 'struct ITankGame.VoteParams', - type: 'tuple', - components: [ - { name: 'voter', internalType: 'uint256', type: 'uint256' }, - { name: 'cursed', internalType: 'uint256', type: 'uint256' }, - ], + name: 'killer', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'killed', + internalType: 'uint256', + type: 'uint256', + indexed: false, }, - { name: '', internalType: 'bytes', type: 'bytes' }, ], - name: 'beforeVote', - outputs: [{ name: '', internalType: 'bytes4', type: 'bytes4' }], + name: 'Death', }, -] as const - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Strings -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const stringsABI = [ { - type: 'error', + type: 'event', + anonymous: false, inputs: [ - { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'length', internalType: 'uint256', type: 'uint256' }, + { + name: 'tank', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'delegate', + internalType: 'address', + type: 'address', + indexed: false, + }, + { + name: 'owner', + internalType: 'address', + type: 'address', + indexed: false, + }, ], - name: 'StringsInsufficientHexLength', - }, -] as const - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// TankGame -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/** - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - - */ -export const tankGameABI = [ - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: '_getEpoch', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'Delegate', }, { - stateMutability: 'nonpayable', - type: 'function', + type: 'event', + anonymous: false, inputs: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { name: 'hooks', internalType: 'contract IHooks', type: 'address' }, + { + name: 'tankId', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'amount', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'epoch', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, ], - name: 'addHooks', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'aliveTanksIdSum', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'board', - outputs: [{ name: '', internalType: 'contract Board', type: 'address' }], + name: 'Drip', }, { - stateMutability: 'nonpayable', - type: 'function', + type: 'event', + anonymous: false, inputs: [ { - name: 'params', - internalType: 'struct ITankGame.ClaimParams', + name: 'settings', + internalType: 'struct ITankGame.GameSettings', type: 'tuple', components: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { name: 'claimer', internalType: 'address', type: 'address' }, + { name: 'playerCount', internalType: 'uint256', type: 'uint256' }, + { name: 'boardSize', internalType: 'uint256', type: 'uint256' }, + { name: 'initAPs', internalType: 'uint256', type: 'uint256' }, + { name: 'initHearts', internalType: 'uint256', type: 'uint256' }, + { name: 'initShootRange', internalType: 'uint256', type: 'uint256' }, + { name: 'epochSeconds', internalType: 'uint256', type: 'uint256' }, + { name: 'buyInMinimum', internalType: 'uint256', type: 'uint256' }, + { + name: 'revealWaitBlocks', + internalType: 'uint256', + type: 'uint256', + }, + { name: 'autoStart', internalType: 'bool', type: 'bool' }, + { name: 'root', internalType: 'bytes32', type: 'bytes32' }, ], + indexed: false, }, ], - name: 'claim', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], - name: 'claimed', - outputs: [{ name: 'claimed', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - name: 'deadTanks', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'GameInit', }, { - stateMutability: 'nonpayable', - type: 'function', + type: 'event', + anonymous: false, inputs: [ { - name: 'params', - internalType: 'struct ITankGame.DelegateParams', - type: 'tuple', - components: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { name: 'delegatee', internalType: 'address', type: 'address' }, - ], + name: 'winner', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'second', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'third', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'prizePool', + internalType: 'uint256', + type: 'uint256', + indexed: false, }, ], - name: 'delegate', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { name: 'delegate', internalType: 'address', type: 'address' }, - ], - name: 'delegates', - outputs: [{ name: 'isDelegate', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'payable', - type: 'function', - inputs: [], - name: 'donate', - outputs: [], + name: 'GameOver', }, + { type: 'event', anonymous: false, inputs: [], name: 'GameStarted' }, { - stateMutability: 'nonpayable', - type: 'function', + type: 'event', + anonymous: false, inputs: [ { - name: 'params', - internalType: 'struct ITankGame.DripParams', - type: 'tuple', - components: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - ], + name: 'fromId', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'toId', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'hearts', + internalType: 'uint256', + type: 'uint256', + indexed: false, }, + { name: 'aps', internalType: 'uint256', type: 'uint256', indexed: false }, ], - name: 'drip', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'epochStart', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'factory', - outputs: [{ name: '', internalType: 'address', type: 'address' }], + name: 'Give', }, { - stateMutability: 'nonpayable', - type: 'function', + type: 'event', + anonymous: false, inputs: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { name: 'hooks', internalType: 'contract IHooks', type: 'address' }, + { + name: 'tankId', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'hook', + internalType: 'address', + type: 'address', + indexed: false, + }, ], - name: 'forceAddDefaultHook', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], - name: 'getLastDrip', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], - name: 'getUpgradeCost', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'HooksAdded', }, { - stateMutability: 'nonpayable', - type: 'function', + type: 'event', + anonymous: false, inputs: [ { - name: 'params', - internalType: 'struct ITankGame.GiveParams', + name: 'tankId', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'position', + internalType: 'struct Board.Point', type: 'tuple', components: [ - { name: 'fromId', internalType: 'uint256', type: 'uint256' }, - { name: 'toId', internalType: 'uint256', type: 'uint256' }, - { name: 'hearts', internalType: 'uint256', type: 'uint256' }, - { name: 'aps', internalType: 'uint256', type: 'uint256' }, + { name: 'x', internalType: 'uint256', type: 'uint256' }, + { name: 'y', internalType: 'uint256', type: 'uint256' }, + { name: 'z', internalType: 'uint256', type: 'uint256' }, ], + indexed: false, }, ], - name: 'give', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'position', internalType: 'uint256', type: 'uint256' }], - name: 'heartsOnBoard', - outputs: [{ name: 'heartCount', internalType: 'uint256', type: 'uint256' }], + name: 'Move', }, { - stateMutability: 'payable', - type: 'function', + type: 'event', + anonymous: false, inputs: [ { - name: 'gs', - internalType: 'struct ITankGame.GameSettings', + name: 'player', + internalType: 'address', + type: 'address', + indexed: false, + }, + { + name: 'tankId', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'position', + internalType: 'struct Board.Point', type: 'tuple', components: [ - { name: 'playerCount', internalType: 'uint256', type: 'uint256' }, - { name: 'boardSize', internalType: 'uint256', type: 'uint256' }, - { name: 'initAPs', internalType: 'uint256', type: 'uint256' }, - { name: 'initHearts', internalType: 'uint256', type: 'uint256' }, - { name: 'initShootRange', internalType: 'uint256', type: 'uint256' }, - { name: 'epochSeconds', internalType: 'uint256', type: 'uint256' }, - { name: 'buyInMinimum', internalType: 'uint256', type: 'uint256' }, - { - name: 'revealWaitBlocks', - internalType: 'uint256', - type: 'uint256', - }, - { name: 'autoStart', internalType: 'bool', type: 'bool' }, - { name: 'root', internalType: 'bytes32', type: 'bytes32' }, + { name: 'x', internalType: 'uint256', type: 'uint256' }, + { name: 'y', internalType: 'uint256', type: 'uint256' }, + { name: 'z', internalType: 'uint256', type: 'uint256' }, ], + indexed: false, }, - { name: '_owner', internalType: 'address', type: 'address' }, + { name: 'name', internalType: 'string', type: 'string', indexed: false }, ], - name: 'initialize', - outputs: [], + name: 'PlayerJoined', }, { - stateMutability: 'view', - type: 'function', + type: 'event', + anonymous: false, inputs: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { name: '_owner', internalType: 'address', type: 'address' }, + { + name: 'donator', + internalType: 'address', + type: 'address', + indexed: false, + }, + { + name: 'amount', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'newTotal', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, ], - name: 'isAuth', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], + name: 'PrizeIncrease', }, { - stateMutability: 'payable', - type: 'function', - inputs: [ + type: 'event', + anonymous: false, + inputs: [ { - name: 'params', - internalType: 'struct ITankGame.JoinParams', - type: 'tuple', - components: [ - { name: 'joiner', internalType: 'address', type: 'address' }, - { name: 'proof', internalType: 'bytes32[]', type: 'bytes32[]' }, - { name: 'playerName', internalType: 'string', type: 'string' }, - ], + name: 'poker', + internalType: 'address', + type: 'address', + indexed: false, + }, + { + name: 'blocknumber', + internalType: 'uint256', + type: 'uint256', + indexed: false, }, ], - name: 'join', - outputs: [], + name: 'Reveal', }, { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], - name: 'lastDripEpoch', - outputs: [{ name: 'epoch', internalType: 'uint256', type: 'uint256' }], + type: 'event', + anonymous: false, + inputs: [ + { + name: 'savior', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'saved', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + ], + name: 'Revive', }, { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'lastRevealBlock', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + type: 'event', + anonymous: false, + inputs: [ + { + name: 'tankId', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'targetId', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + ], + name: 'Shoot', }, { - stateMutability: 'nonpayable', - type: 'function', + type: 'event', + anonymous: false, inputs: [ { - name: 'params', - internalType: 'struct ITankGame.MoveParams', + name: 'poker', + internalType: 'address', + type: 'address', + indexed: false, + }, + { + name: 'position', + internalType: 'struct Board.Point', type: 'tuple', components: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { - name: 'to', - internalType: 'struct Board.Point', - type: 'tuple', - components: [ - { name: 'x', internalType: 'uint256', type: 'uint256' }, - { name: 'y', internalType: 'uint256', type: 'uint256' }, - { name: 'z', internalType: 'uint256', type: 'uint256' }, - ], - }, + { name: 'x', internalType: 'uint256', type: 'uint256' }, + { name: 'y', internalType: 'uint256', type: 'uint256' }, + { name: 'z', internalType: 'uint256', type: 'uint256' }, ], + indexed: false, }, ], - name: 'move', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'numTanksAlive', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'SpawnHeart', }, { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'owner', - outputs: [{ name: '', internalType: 'address', type: 'address' }], + type: 'event', + anonymous: false, + inputs: [ + { + name: 'tankId', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'range', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + ], + name: 'Upgrade', }, { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'player', internalType: 'address', type: 'address' }], - name: 'players', - outputs: [{ name: 'tank', internalType: 'uint256', type: 'uint256' }], + type: 'event', + anonymous: false, + inputs: [ + { + name: 'voter', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'cursed', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + { + name: 'epoch', + internalType: 'uint256', + type: 'uint256', + indexed: false, + }, + ], + name: 'Vote', }, +] as const + +/** + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - + */ +export const tankGameAddress = { + 5: '0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414', + 31337: '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0', +} as const + +/** + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - + */ +export const tankGameConfig = { + address: tankGameAddress, + abi: tankGameABI, +} as const + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// TankGameFactory +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) + * - + */ +export const tankGameFactoryABI = [ { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'playersCount', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + stateMutability: 'nonpayable', + type: 'constructor', + inputs: [ + { name: '_gameView', internalType: 'contract GameView', type: 'address' }, + { + name: '_hookFactory', + internalType: 'contract HookFactory', + type: 'address', + }, + ], }, { - stateMutability: 'view', + stateMutability: 'nonpayable', type: 'function', - inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - name: 'podium', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + inputs: [ + { name: '_implementation', internalType: 'address', type: 'address' }, + { + name: 'settings', + internalType: 'struct ITankGame.GameSettings', + type: 'tuple', + components: [ + { name: 'playerCount', internalType: 'uint256', type: 'uint256' }, + { name: 'boardSize', internalType: 'uint256', type: 'uint256' }, + { name: 'initAPs', internalType: 'uint256', type: 'uint256' }, + { name: 'initHearts', internalType: 'uint256', type: 'uint256' }, + { name: 'initShootRange', internalType: 'uint256', type: 'uint256' }, + { name: 'epochSeconds', internalType: 'uint256', type: 'uint256' }, + { name: 'buyInMinimum', internalType: 'uint256', type: 'uint256' }, + { + name: 'revealWaitBlocks', + internalType: 'uint256', + type: 'uint256', + }, + { name: 'autoStart', internalType: 'bool', type: 'bool' }, + { name: 'root', internalType: 'bytes32', type: 'bytes32' }, + ], + }, + { name: '_owner', internalType: 'address', type: 'address' }, + ], + name: 'createGame', + outputs: [ + { name: 'game', internalType: 'contract ITankGame', type: 'address' }, + ], }, { stateMutability: 'view', type: 'function', inputs: [], - name: 'prizePool', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [], - name: 'reveal', - outputs: [], + name: 'gameView', + outputs: [{ name: '', internalType: 'contract GameView', type: 'address' }], }, { stateMutability: 'view', type: 'function', inputs: [], - name: 'revealBlock', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'hookFactory', + outputs: [ + { name: '', internalType: 'contract HookFactory', type: 'address' }, + ], }, { - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: '_owner', internalType: 'address', type: 'address' }], - name: 'setOwner', - outputs: [], + type: 'event', + anonymous: false, + inputs: [ + { + name: 'game', + internalType: 'address', + type: 'address', + indexed: false, + }, + { + name: 'settings', + internalType: 'struct ITankGame.GameSettings', + type: 'tuple', + components: [ + { name: 'playerCount', internalType: 'uint256', type: 'uint256' }, + { name: 'boardSize', internalType: 'uint256', type: 'uint256' }, + { name: 'initAPs', internalType: 'uint256', type: 'uint256' }, + { name: 'initHearts', internalType: 'uint256', type: 'uint256' }, + { name: 'initShootRange', internalType: 'uint256', type: 'uint256' }, + { name: 'epochSeconds', internalType: 'uint256', type: 'uint256' }, + { name: 'buyInMinimum', internalType: 'uint256', type: 'uint256' }, + { + name: 'revealWaitBlocks', + internalType: 'uint256', + type: 'uint256', + }, + { name: 'autoStart', internalType: 'bool', type: 'bool' }, + { name: 'root', internalType: 'bytes32', type: 'bytes32' }, + ], + indexed: false, + }, + ], + name: 'GameCreated', + }, + { type: 'error', inputs: [], name: 'ERC1167FailedCreateClone' }, +] as const + +/** + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) + * - + */ +export const tankGameFactoryAddress = { + 5: '0x9758ce8FE412C72893b42FFEdAEDff1840e1886f', + 31337: '0x5FC8d32690cc91D4c39d9d3abcBD16989F875707', +} as const + +/** + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) + * - + */ +export const tankGameFactoryConfig = { + address: tankGameFactoryAddress, + abi: tankGameFactoryABI, +} as const + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// TankGameV2Storage +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export const tankGameV2StorageABI = [ + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'aliveTanksIdSum', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'board', + outputs: [{ name: '', internalType: 'contract Board', type: 'address' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], + name: 'claimed', + outputs: [{ name: 'claimed', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'deadTanks', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [ + { name: 'tankId', internalType: 'uint256', type: 'uint256' }, + { name: 'delegate', internalType: 'address', type: 'address' }, + ], + name: 'delegates', + outputs: [{ name: 'isDelegate', internalType: 'bool', type: 'bool' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'epochStart', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], + name: 'lastDripEpoch', + outputs: [{ name: 'epoch', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'lastRevealBlock', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'numTanksAlive', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'owner', + outputs: [{ name: '', internalType: 'address', type: 'address' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'player', internalType: 'address', type: 'address' }], + name: 'players', + outputs: [{ name: 'tank', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'playersCount', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + name: 'podium', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'prizePool', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], + }, + { + stateMutability: 'view', + type: 'function', + inputs: [], + name: 'revealBlock', + outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], }, { stateMutability: 'view', @@ -4811,31 +5271,6 @@ export const tankGameABI = [ { name: 'root', internalType: 'bytes32', type: 'bytes32' }, ], }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { - name: 'params', - internalType: 'struct ITankGame.ShootParams', - type: 'tuple', - components: [ - { name: 'fromId', internalType: 'uint256', type: 'uint256' }, - { name: 'toId', internalType: 'uint256', type: 'uint256' }, - { name: 'shots', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - name: 'shoot', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [], - name: 'start', - outputs: [], - }, { stateMutability: 'view', type: 'function', @@ -4873,17 +5308,6 @@ export const tankGameABI = [ { name: 'hooks', internalType: 'contract IHooks', type: 'address' }, ], }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], - name: 'tankToPosition', - outputs: [ - { name: 'x', internalType: 'uint256', type: 'uint256' }, - { name: 'y', internalType: 'uint256', type: 'uint256' }, - { name: 'z', internalType: 'uint256', type: 'uint256' }, - ], - }, { stateMutability: 'view', type: 'function', @@ -4896,46 +5320,6 @@ export const tankGameABI = [ { name: 'range', internalType: 'uint256', type: 'uint256' }, ], }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'position', internalType: 'uint256', type: 'uint256' }], - name: 'tanksOnBoard', - outputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { - name: 'params', - internalType: 'struct ITankGame.UpgradeParams', - type: 'tuple', - components: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - name: 'upgrade', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { - name: 'params', - internalType: 'struct ITankGame.VoteParams', - type: 'tuple', - components: [ - { name: 'voter', internalType: 'uint256', type: 'uint256' }, - { name: 'cursed', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - name: 'vote', - outputs: [], - }, { stateMutability: 'view', type: 'function', @@ -4963,14494 +5347,9789 @@ export const tankGameABI = [ name: 'votingClosed', outputs: [{ name: 'votingClosed', internalType: 'bool', type: 'bool' }], }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'hunter', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'victim', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'reward', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'BountyCompleted', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'reciever', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'tankId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Claim', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'poker', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'blocknumber', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Commit', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'cursedTank', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'voter', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'epoch', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Curse', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'killer', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'killed', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Death', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'tank', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'delegate', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'owner', - internalType: 'address', - type: 'address', - indexed: false, - }, - ], - name: 'Delegate', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'tankId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'epoch', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Drip', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'settings', - internalType: 'struct ITankGame.GameSettings', - type: 'tuple', - components: [ - { name: 'playerCount', internalType: 'uint256', type: 'uint256' }, - { name: 'boardSize', internalType: 'uint256', type: 'uint256' }, - { name: 'initAPs', internalType: 'uint256', type: 'uint256' }, - { name: 'initHearts', internalType: 'uint256', type: 'uint256' }, - { name: 'initShootRange', internalType: 'uint256', type: 'uint256' }, - { name: 'epochSeconds', internalType: 'uint256', type: 'uint256' }, - { name: 'buyInMinimum', internalType: 'uint256', type: 'uint256' }, - { - name: 'revealWaitBlocks', - internalType: 'uint256', - type: 'uint256', - }, - { name: 'autoStart', internalType: 'bool', type: 'bool' }, - { name: 'root', internalType: 'bytes32', type: 'bytes32' }, - ], - indexed: false, - }, - ], - name: 'GameInit', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'winner', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'second', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'third', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'prizePool', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'GameOver', - }, - { type: 'event', anonymous: false, inputs: [], name: 'GameStarted' }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'fromId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'toId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'hearts', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { name: 'aps', internalType: 'uint256', type: 'uint256', indexed: false }, - ], - name: 'Give', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'tankId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'hook', - internalType: 'address', - type: 'address', - indexed: false, - }, - ], - name: 'HooksAdded', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'tankId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'position', - internalType: 'struct Board.Point', - type: 'tuple', - components: [ - { name: 'x', internalType: 'uint256', type: 'uint256' }, - { name: 'y', internalType: 'uint256', type: 'uint256' }, - { name: 'z', internalType: 'uint256', type: 'uint256' }, - ], - indexed: false, - }, - ], - name: 'Move', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'player', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'tankId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'position', - internalType: 'struct Board.Point', - type: 'tuple', - components: [ - { name: 'x', internalType: 'uint256', type: 'uint256' }, - { name: 'y', internalType: 'uint256', type: 'uint256' }, - { name: 'z', internalType: 'uint256', type: 'uint256' }, - ], - indexed: false, - }, - { name: 'name', internalType: 'string', type: 'string', indexed: false }, - ], - name: 'PlayerJoined', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'donator', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'newTotal', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'PrizeIncrease', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'poker', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'blocknumber', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Reveal', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'savior', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'saved', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Revive', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'tankId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'targetId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Shoot', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'poker', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'position', - internalType: 'struct Board.Point', - type: 'tuple', - components: [ - { name: 'x', internalType: 'uint256', type: 'uint256' }, - { name: 'y', internalType: 'uint256', type: 'uint256' }, - { name: 'z', internalType: 'uint256', type: 'uint256' }, - ], - indexed: false, - }, - ], - name: 'SpawnHeart', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'tankId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'range', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Upgrade', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'voter', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'cursed', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'epoch', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Vote', - }, -] as const - -/** - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - - */ -export const tankGameAddress = { - 5: '0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414', - 31337: '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0', -} as const - -/** - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - - */ -export const tankGameConfig = { - address: tankGameAddress, - abi: tankGameABI, -} as const - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// TankGameFactory -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/** - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) - * - - */ -export const tankGameFactoryABI = [ - { - stateMutability: 'nonpayable', - type: 'constructor', - inputs: [ - { name: '_gameView', internalType: 'contract GameView', type: 'address' }, - { - name: '_hookFactory', - internalType: 'contract HookFactory', - type: 'address', - }, - ], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: '_implementation', internalType: 'address', type: 'address' }, - { - name: 'settings', - internalType: 'struct ITankGame.GameSettings', - type: 'tuple', - components: [ - { name: 'playerCount', internalType: 'uint256', type: 'uint256' }, - { name: 'boardSize', internalType: 'uint256', type: 'uint256' }, - { name: 'initAPs', internalType: 'uint256', type: 'uint256' }, - { name: 'initHearts', internalType: 'uint256', type: 'uint256' }, - { name: 'initShootRange', internalType: 'uint256', type: 'uint256' }, - { name: 'epochSeconds', internalType: 'uint256', type: 'uint256' }, - { name: 'buyInMinimum', internalType: 'uint256', type: 'uint256' }, - { - name: 'revealWaitBlocks', - internalType: 'uint256', - type: 'uint256', - }, - { name: 'autoStart', internalType: 'bool', type: 'bool' }, - { name: 'root', internalType: 'bytes32', type: 'bytes32' }, - ], - }, - { name: '_owner', internalType: 'address', type: 'address' }, - ], - name: 'createGame', - outputs: [ - { name: 'game', internalType: 'contract ITankGame', type: 'address' }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'gameView', - outputs: [{ name: '', internalType: 'contract GameView', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'hookFactory', - outputs: [ - { name: '', internalType: 'contract HookFactory', type: 'address' }, - ], - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'game', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'settings', - internalType: 'struct ITankGame.GameSettings', - type: 'tuple', - components: [ - { name: 'playerCount', internalType: 'uint256', type: 'uint256' }, - { name: 'boardSize', internalType: 'uint256', type: 'uint256' }, - { name: 'initAPs', internalType: 'uint256', type: 'uint256' }, - { name: 'initHearts', internalType: 'uint256', type: 'uint256' }, - { name: 'initShootRange', internalType: 'uint256', type: 'uint256' }, - { name: 'epochSeconds', internalType: 'uint256', type: 'uint256' }, - { name: 'buyInMinimum', internalType: 'uint256', type: 'uint256' }, - { - name: 'revealWaitBlocks', - internalType: 'uint256', - type: 'uint256', - }, - { name: 'autoStart', internalType: 'bool', type: 'bool' }, - { name: 'root', internalType: 'bytes32', type: 'bytes32' }, - ], - indexed: false, - }, - ], - name: 'GameCreated', - }, - { type: 'error', inputs: [], name: 'ERC1167FailedCreateClone' }, -] as const - -/** - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) - * - - */ -export const tankGameFactoryAddress = { - 5: '0x9758ce8FE412C72893b42FFEdAEDff1840e1886f', - 31337: '0x5FC8d32690cc91D4c39d9d3abcBD16989F875707', -} as const - -/** - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) - * - - */ -export const tankGameFactoryConfig = { - address: tankGameFactoryAddress, - abi: tankGameFactoryABI, -} as const - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// TankGameLogic -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const tankGameLogicABI = [ - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'hunter', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'victim', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'reward', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'BountyCompleted', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'reciever', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'tankId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Claim', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'poker', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'blocknumber', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Commit', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'cursedTank', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'voter', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'epoch', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Curse', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'killer', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'killed', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Death', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'tank', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'delegate', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'owner', - internalType: 'address', - type: 'address', - indexed: false, - }, - ], - name: 'Delegate', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'tankId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'epoch', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Drip', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'settings', - internalType: 'struct ITankGame.GameSettings', - type: 'tuple', - components: [ - { name: 'playerCount', internalType: 'uint256', type: 'uint256' }, - { name: 'boardSize', internalType: 'uint256', type: 'uint256' }, - { name: 'initAPs', internalType: 'uint256', type: 'uint256' }, - { name: 'initHearts', internalType: 'uint256', type: 'uint256' }, - { name: 'initShootRange', internalType: 'uint256', type: 'uint256' }, - { name: 'epochSeconds', internalType: 'uint256', type: 'uint256' }, - { name: 'buyInMinimum', internalType: 'uint256', type: 'uint256' }, - { - name: 'revealWaitBlocks', - internalType: 'uint256', - type: 'uint256', - }, - { name: 'root', internalType: 'bytes32', type: 'bytes32' }, - ], - indexed: false, - }, - ], - name: 'GameInit', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'winner', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'second', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'third', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'prizePool', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'GameOver', - }, - { type: 'event', anonymous: false, inputs: [], name: 'GameStarted' }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'fromId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'toId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'hearts', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { name: 'aps', internalType: 'uint256', type: 'uint256', indexed: false }, - ], - name: 'Give', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'tankId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'hook', - internalType: 'address', - type: 'address', - indexed: false, - }, - ], - name: 'HooksAdded', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'tankId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'position', - internalType: 'struct Board.Point', - type: 'tuple', - components: [ - { name: 'x', internalType: 'uint256', type: 'uint256' }, - { name: 'y', internalType: 'uint256', type: 'uint256' }, - { name: 'z', internalType: 'uint256', type: 'uint256' }, - ], - indexed: false, - }, - ], - name: 'Move', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'player', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'tankId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'position', - internalType: 'struct Board.Point', - type: 'tuple', - components: [ - { name: 'x', internalType: 'uint256', type: 'uint256' }, - { name: 'y', internalType: 'uint256', type: 'uint256' }, - { name: 'z', internalType: 'uint256', type: 'uint256' }, - ], - indexed: false, - }, - { name: 'name', internalType: 'string', type: 'string', indexed: false }, - ], - name: 'PlayerJoined', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'donator', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'newTotal', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'PrizeIncrease', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'poker', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'blocknumber', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Reveal', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'savior', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'saved', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Revive', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'tankId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'targetId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Shoot', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'poker', - internalType: 'address', - type: 'address', - indexed: false, - }, - { - name: 'position', - internalType: 'struct Board.Point', - type: 'tuple', - components: [ - { name: 'x', internalType: 'uint256', type: 'uint256' }, - { name: 'y', internalType: 'uint256', type: 'uint256' }, - { name: 'z', internalType: 'uint256', type: 'uint256' }, - ], - indexed: false, - }, - ], - name: 'SpawnHeart', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'tankId', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'range', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Upgrade', - }, - { - type: 'event', - anonymous: false, - inputs: [ - { - name: 'voter', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'cursed', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - { - name: 'epoch', - internalType: 'uint256', - type: 'uint256', - indexed: false, - }, - ], - name: 'Vote', - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { name: 'hooks', internalType: 'contract IHooks', type: 'address' }, - ], - name: 'addHooks', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'aliveTanksIdSum', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'board', - outputs: [{ name: '', internalType: 'contract Board', type: 'address' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { - name: 'params', - internalType: 'struct ITankGame.ClaimParams', - type: 'tuple', - components: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { name: 'claimer', internalType: 'address', type: 'address' }, - ], - }, - ], - name: 'claim', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], - name: 'claimed', - outputs: [{ name: 'claimed', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - name: 'deadTanks', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { - name: 'params', - internalType: 'struct ITankGame.DelegateParams', - type: 'tuple', - components: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { name: 'delegatee', internalType: 'address', type: 'address' }, - ], - }, - ], - name: 'delegate', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { name: 'delegate', internalType: 'address', type: 'address' }, - ], - name: 'delegates', - outputs: [{ name: 'isDelegate', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'payable', - type: 'function', - inputs: [], - name: 'donate', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { - name: 'params', - internalType: 'struct ITankGame.DripParams', - type: 'tuple', - components: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - name: 'drip', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'epochStart', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { name: 'hooks', internalType: 'contract IHooks', type: 'address' }, - ], - name: 'forceAddDefaultHook', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'getBoard', - outputs: [{ name: '', internalType: 'contract Board', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'getEpoch', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], - name: 'getLastDrip', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'getPlayerCount', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'getSettings', - outputs: [ - { - name: '', - internalType: 'struct ITankGame.GameSettings', - type: 'tuple', - components: [ - { name: 'playerCount', internalType: 'uint256', type: 'uint256' }, - { name: 'boardSize', internalType: 'uint256', type: 'uint256' }, - { name: 'initAPs', internalType: 'uint256', type: 'uint256' }, - { name: 'initHearts', internalType: 'uint256', type: 'uint256' }, - { name: 'initShootRange', internalType: 'uint256', type: 'uint256' }, - { name: 'epochSeconds', internalType: 'uint256', type: 'uint256' }, - { name: 'buyInMinimum', internalType: 'uint256', type: 'uint256' }, - { - name: 'revealWaitBlocks', - internalType: 'uint256', - type: 'uint256', - }, - { name: 'root', internalType: 'bytes32', type: 'bytes32' }, - ], - }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'getState', - outputs: [ - { name: '', internalType: 'enum ITankGame.GameState', type: 'uint8' }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], - name: 'getTank', - outputs: [ - { - name: '', - internalType: 'struct ITankGame.Tank', - type: 'tuple', - components: [ - { name: 'owner', internalType: 'address', type: 'address' }, - { name: 'hearts', internalType: 'uint256', type: 'uint256' }, - { name: 'aps', internalType: 'uint256', type: 'uint256' }, - { name: 'range', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], - name: 'getUpgradeCost', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { - name: 'params', - internalType: 'struct ITankGame.GiveParams', - type: 'tuple', - components: [ - { name: 'fromId', internalType: 'uint256', type: 'uint256' }, - { name: 'toId', internalType: 'uint256', type: 'uint256' }, - { name: 'hearts', internalType: 'uint256', type: 'uint256' }, - { name: 'aps', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - name: 'give', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'position', internalType: 'uint256', type: 'uint256' }], - name: 'heartsOnBoard', - outputs: [{ name: 'heartCount', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { name: '_owner', internalType: 'address', type: 'address' }, - ], - name: 'isAuth', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'payable', - type: 'function', - inputs: [ - { - name: 'params', - internalType: 'struct ITankGame.JoinParams', - type: 'tuple', - components: [ - { name: 'joiner', internalType: 'address', type: 'address' }, - { name: 'proof', internalType: 'bytes32[]', type: 'bytes32[]' }, - { name: 'playerName', internalType: 'string', type: 'string' }, - ], - }, - ], - name: 'join', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], - name: 'lastDripEpoch', - outputs: [{ name: 'epoch', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'lastRevealBlock', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { - name: 'params', - internalType: 'struct ITankGame.MoveParams', - type: 'tuple', - components: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { - name: 'to', - internalType: 'struct Board.Point', - type: 'tuple', - components: [ - { name: 'x', internalType: 'uint256', type: 'uint256' }, - { name: 'y', internalType: 'uint256', type: 'uint256' }, - { name: 'z', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - }, - ], - name: 'move', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'numTanksAlive', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'owner', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'player', internalType: 'address', type: 'address' }], - name: 'players', - outputs: [{ name: 'tank', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'playersCount', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - name: 'podium', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'prizePool', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [], - name: 'reveal', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'revealBlock', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [{ name: '_owner', internalType: 'address', type: 'address' }], - name: 'setOwner', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'settings', - outputs: [ - { name: 'playerCount', internalType: 'uint256', type: 'uint256' }, - { name: 'boardSize', internalType: 'uint256', type: 'uint256' }, - { name: 'initAPs', internalType: 'uint256', type: 'uint256' }, - { name: 'initHearts', internalType: 'uint256', type: 'uint256' }, - { name: 'initShootRange', internalType: 'uint256', type: 'uint256' }, - { name: 'epochSeconds', internalType: 'uint256', type: 'uint256' }, - { name: 'buyInMinimum', internalType: 'uint256', type: 'uint256' }, - { name: 'revealWaitBlocks', internalType: 'uint256', type: 'uint256' }, - { name: 'root', internalType: 'bytes32', type: 'bytes32' }, - ], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { - name: 'params', - internalType: 'struct ITankGame.ShootParams', - type: 'tuple', - components: [ - { name: 'fromId', internalType: 'uint256', type: 'uint256' }, - { name: 'toId', internalType: 'uint256', type: 'uint256' }, - { name: 'shots', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - name: 'shoot', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'state', - outputs: [ - { name: '', internalType: 'enum ITankGame.GameState', type: 'uint8' }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'stateData', - outputs: [ - { name: 'playersCount', internalType: 'uint256', type: 'uint256' }, - { name: 'numTanksAlive', internalType: 'uint256', type: 'uint256' }, - { name: 'prizePool', internalType: 'uint256', type: 'uint256' }, - { name: 'epochStart', internalType: 'uint256', type: 'uint256' }, - { name: 'aliveTanksIdSum', internalType: 'uint256', type: 'uint256' }, - { name: 'revealBlock', internalType: 'uint256', type: 'uint256' }, - { name: 'lastRevealBlock', internalType: 'uint256', type: 'uint256' }, - { name: 'owner', internalType: 'address', type: 'address' }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { name: '', internalType: 'uint256', type: 'uint256' }, - ], - name: 'tankHooks', - outputs: [ - { name: 'hooks', internalType: 'contract IHooks', type: 'address' }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], - name: 'tankToPosition', - outputs: [ - { name: 'x', internalType: 'uint256', type: 'uint256' }, - { name: 'y', internalType: 'uint256', type: 'uint256' }, - { name: 'z', internalType: 'uint256', type: 'uint256' }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], - name: 'tanks', - outputs: [ - { name: 'owner', internalType: 'address', type: 'address' }, - { name: 'hearts', internalType: 'uint256', type: 'uint256' }, - { name: 'aps', internalType: 'uint256', type: 'uint256' }, - { name: 'range', internalType: 'uint256', type: 'uint256' }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'position', internalType: 'uint256', type: 'uint256' }], - name: 'tanksOnBoard', - outputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { - name: 'params', - internalType: 'struct ITankGame.UpgradeParams', - type: 'tuple', - components: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - name: 'upgrade', - outputs: [], - }, - { - stateMutability: 'nonpayable', - type: 'function', - inputs: [ - { - name: 'params', - internalType: 'struct ITankGame.VoteParams', - type: 'tuple', - components: [ - { name: 'voter', internalType: 'uint256', type: 'uint256' }, - { name: 'cursed', internalType: 'uint256', type: 'uint256' }, - ], - }, - ], - name: 'vote', - outputs: [], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'epoch', internalType: 'uint256', type: 'uint256' }, - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - ], - name: 'votedThisEpoch', - outputs: [{ name: 'voted', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'epoch', internalType: 'uint256', type: 'uint256' }, - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - ], - name: 'votesPerEpoch', - outputs: [{ name: 'votes', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'epoch', internalType: 'uint256', type: 'uint256' }], - name: 'votingClosed', - outputs: [{ name: 'votingClosed', internalType: 'bool', type: 'bool' }], - }, -] as const - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// TankGameV2Storage -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -export const tankGameV2StorageABI = [ - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'aliveTanksIdSum', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'board', - outputs: [{ name: '', internalType: 'contract Board', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], - name: 'claimed', - outputs: [{ name: 'claimed', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - name: 'deadTanks', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { name: 'delegate', internalType: 'address', type: 'address' }, - ], - name: 'delegates', - outputs: [{ name: 'isDelegate', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'epochStart', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], - name: 'lastDripEpoch', - outputs: [{ name: 'epoch', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'lastRevealBlock', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'numTanksAlive', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'owner', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'player', internalType: 'address', type: 'address' }], - name: 'players', - outputs: [{ name: 'tank', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'playersCount', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - name: 'podium', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'prizePool', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'revealBlock', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'settings', - outputs: [ - { name: 'playerCount', internalType: 'uint256', type: 'uint256' }, - { name: 'boardSize', internalType: 'uint256', type: 'uint256' }, - { name: 'initAPs', internalType: 'uint256', type: 'uint256' }, - { name: 'initHearts', internalType: 'uint256', type: 'uint256' }, - { name: 'initShootRange', internalType: 'uint256', type: 'uint256' }, - { name: 'epochSeconds', internalType: 'uint256', type: 'uint256' }, - { name: 'buyInMinimum', internalType: 'uint256', type: 'uint256' }, - { name: 'revealWaitBlocks', internalType: 'uint256', type: 'uint256' }, - { name: 'autoStart', internalType: 'bool', type: 'bool' }, - { name: 'root', internalType: 'bytes32', type: 'bytes32' }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'state', - outputs: [ - { name: '', internalType: 'enum ITankGame.GameState', type: 'uint8' }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [], - name: 'stateData', - outputs: [ - { name: 'playersCount', internalType: 'uint256', type: 'uint256' }, - { name: 'numTanksAlive', internalType: 'uint256', type: 'uint256' }, - { name: 'prizePool', internalType: 'uint256', type: 'uint256' }, - { name: 'epochStart', internalType: 'uint256', type: 'uint256' }, - { name: 'aliveTanksIdSum', internalType: 'uint256', type: 'uint256' }, - { name: 'revealBlock', internalType: 'uint256', type: 'uint256' }, - { name: 'lastRevealBlock', internalType: 'uint256', type: 'uint256' }, - { name: 'owner', internalType: 'address', type: 'address' }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - { name: '', internalType: 'uint256', type: 'uint256' }, - ], - name: 'tankHooks', - outputs: [ - { name: 'hooks', internalType: 'contract IHooks', type: 'address' }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'tankId', internalType: 'uint256', type: 'uint256' }], - name: 'tanks', - outputs: [ - { name: 'owner', internalType: 'address', type: 'address' }, - { name: 'hearts', internalType: 'uint256', type: 'uint256' }, - { name: 'aps', internalType: 'uint256', type: 'uint256' }, - { name: 'range', internalType: 'uint256', type: 'uint256' }, - ], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'epoch', internalType: 'uint256', type: 'uint256' }, - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - ], - name: 'votedThisEpoch', - outputs: [{ name: 'voted', internalType: 'bool', type: 'bool' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [ - { name: 'epoch', internalType: 'uint256', type: 'uint256' }, - { name: 'tankId', internalType: 'uint256', type: 'uint256' }, - ], - name: 'votesPerEpoch', - outputs: [{ name: 'votes', internalType: 'uint256', type: 'uint256' }], - }, - { - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'epoch', internalType: 'uint256', type: 'uint256' }], - name: 'votingClosed', - outputs: [{ name: 'votingClosed', internalType: 'bool', type: 'bool' }], - }, -] as const - -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// React -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__. - */ -export function useBoardRead< - TFunctionName extends string, - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' - > = {} as any, -) { - return useContractRead({ abi: boardABI, ...config } as UseContractReadConfig< - typeof boardABI, - TFunctionName, - TSelectData - >) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"boardSize"`. - */ -export function useBoardBoardSize< - TFunctionName extends 'boardSize', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: boardABI, - functionName: 'boardSize', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"getDistance"`. - */ -export function useBoardGetDistance< - TFunctionName extends 'getDistance', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: boardABI, - functionName: 'getDistance', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"getDistanceTankToPoint"`. - */ -export function useBoardGetDistanceTankToPoint< - TFunctionName extends 'getDistanceTankToPoint', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: boardABI, - functionName: 'getDistanceTankToPoint', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"getDistanceTanks"`. - */ -export function useBoardGetDistanceTanks< - TFunctionName extends 'getDistanceTanks', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: boardABI, - functionName: 'getDistanceTanks', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"getEmptyTile"`. - */ -export function useBoardGetEmptyTile< - TFunctionName extends 'getEmptyTile', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: boardABI, - functionName: 'getEmptyTile', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"getHeartAtPosition"`. - */ -export function useBoardGetHeartAtPosition< - TFunctionName extends 'getHeartAtPosition', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: boardABI, - functionName: 'getHeartAtPosition', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"getPerimeterForRadius"`. - */ -export function useBoardGetPerimeterForRadius< - TFunctionName extends 'getPerimeterForRadius', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: boardABI, - functionName: 'getPerimeterForRadius', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"getTankPosition"`. - */ -export function useBoardGetTankPosition< - TFunctionName extends 'getTankPosition', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: boardABI, - functionName: 'getTankPosition', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"getTile"`. - */ -export function useBoardGetTile< - TFunctionName extends 'getTile', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: boardABI, - functionName: 'getTile', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"getTotalTiles"`. - */ -export function useBoardGetTotalTiles< - TFunctionName extends 'getTotalTiles', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: boardABI, - functionName: 'getTotalTiles', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"isValidPoint"`. - */ -export function useBoardIsValidPoint< - TFunctionName extends 'isValidPoint', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: boardABI, - functionName: 'isValidPoint', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"pointToIndex"`. - */ -export function useBoardPointToIndex< - TFunctionName extends 'pointToIndex', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: boardABI, - functionName: 'pointToIndex', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"randomPoint"`. - */ -export function useBoardRandomPoint< - TFunctionName extends 'randomPoint', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: boardABI, - functionName: 'randomPoint', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link boardABI}__. - */ -export function useBoardWrite< - TFunctionName extends string, - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult['request']['abi'], - TFunctionName, - TMode - > - : UseContractWriteConfig & { - abi?: never - } = {} as any, -) { - return useContractWrite({ - abi: boardABI, - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"setTile"`. - */ -export function useBoardSetTile( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof boardABI, - 'setTile' - >['request']['abi'], - 'setTile', - TMode - > & { functionName?: 'setTile' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'setTile' - } = {} as any, -) { - return useContractWrite({ - abi: boardABI, - functionName: 'setTile', - ...config, - } as any) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link boardABI}__. - */ -export function usePrepareBoardWrite( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: boardABI, - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"setTile"`. - */ -export function usePrepareBoardSetTile( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: boardABI, - functionName: 'setTile', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__. - */ -export function useBountyRead< - TFunctionName extends string, - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' - > = {} as any, -) { - return useContractRead({ abi: bountyABI, ...config } as UseContractReadConfig< - typeof bountyABI, - TFunctionName, - TSelectData - >) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterClaim"`. - */ -export function useBountyAfterClaim< - TFunctionName extends 'afterClaim', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: bountyABI, - functionName: 'afterClaim', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterDelegate"`. - */ -export function useBountyAfterDelegate< - TFunctionName extends 'afterDelegate', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: bountyABI, - functionName: 'afterDelegate', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterDrip"`. - */ -export function useBountyAfterDrip< - TFunctionName extends 'afterDrip', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: bountyABI, - functionName: 'afterDrip', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterJoin"`. - */ -export function useBountyAfterJoin< - TFunctionName extends 'afterJoin', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: bountyABI, - functionName: 'afterJoin', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeClaim"`. - */ -export function useBountyBeforeClaim< - TFunctionName extends 'beforeClaim', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: bountyABI, - functionName: 'beforeClaim', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeDelegate"`. - */ -export function useBountyBeforeDelegate< - TFunctionName extends 'beforeDelegate', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: bountyABI, - functionName: 'beforeDelegate', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeDrip"`. - */ -export function useBountyBeforeDrip< - TFunctionName extends 'beforeDrip', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: bountyABI, - functionName: 'beforeDrip', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeGive"`. - */ -export function useBountyBeforeGive< - TFunctionName extends 'beforeGive', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: bountyABI, - functionName: 'beforeGive', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeJoin"`. - */ -export function useBountyBeforeJoin< - TFunctionName extends 'beforeJoin', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: bountyABI, - functionName: 'beforeJoin', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeReveal"`. - */ -export function useBountyBeforeReveal< - TFunctionName extends 'beforeReveal', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: bountyABI, - functionName: 'beforeReveal', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"bounties"`. - */ -export function useBountyBounties< - TFunctionName extends 'bounties', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: bountyABI, - functionName: 'bounties', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"bountiesData"`. - */ -export function useBountyBountiesData< - TFunctionName extends 'bountiesData', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: bountyABI, - functionName: 'bountiesData', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"bountyCount"`. - */ -export function useBountyBountyCount< - TFunctionName extends 'bountyCount', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: bountyABI, - functionName: 'bountyCount', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"ownerTank"`. - */ -export function useBountyOwnerTank< - TFunctionName extends 'ownerTank', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: bountyABI, - functionName: 'ownerTank', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"tankGame"`. - */ -export function useBountyTankGame< - TFunctionName extends 'tankGame', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: bountyABI, - functionName: 'tankGame', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"tankGameView"`. - */ -export function useBountyTankGameView< - TFunctionName extends 'tankGameView', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: bountyABI, - functionName: 'tankGameView', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"withdrawals"`. - */ -export function useBountyWithdrawals< - TFunctionName extends 'withdrawals', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: bountyABI, - functionName: 'withdrawals', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__. - */ -export function useBountyWrite< - TFunctionName extends string, - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult['request']['abi'], - TFunctionName, - TMode - > - : UseContractWriteConfig & { - abi?: never - } = {} as any, -) { - return useContractWrite({ - abi: bountyABI, - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterGive"`. - */ -export function useBountyAfterGive( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof bountyABI, - 'afterGive' - >['request']['abi'], - 'afterGive', - TMode - > & { functionName?: 'afterGive' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'afterGive' - } = {} as any, -) { - return useContractWrite({ - abi: bountyABI, - functionName: 'afterGive', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterMove"`. - */ -export function useBountyAfterMove( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof bountyABI, - 'afterMove' - >['request']['abi'], - 'afterMove', - TMode - > & { functionName?: 'afterMove' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'afterMove' - } = {} as any, -) { - return useContractWrite({ - abi: bountyABI, - functionName: 'afterMove', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterReveal"`. - */ -export function useBountyAfterReveal< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof bountyABI, - 'afterReveal' - >['request']['abi'], - 'afterReveal', - TMode - > & { functionName?: 'afterReveal' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'afterReveal' - } = {} as any, -) { - return useContractWrite({ - abi: bountyABI, - functionName: 'afterReveal', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterShoot"`. - */ -export function useBountyAfterShoot< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof bountyABI, - 'afterShoot' - >['request']['abi'], - 'afterShoot', - TMode - > & { functionName?: 'afterShoot' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'afterShoot' - } = {} as any, -) { - return useContractWrite({ - abi: bountyABI, - functionName: 'afterShoot', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterUpgrade"`. - */ -export function useBountyAfterUpgrade< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof bountyABI, - 'afterUpgrade' - >['request']['abi'], - 'afterUpgrade', - TMode - > & { functionName?: 'afterUpgrade' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'afterUpgrade' - } = {} as any, -) { - return useContractWrite({ - abi: bountyABI, - functionName: 'afterUpgrade', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterVote"`. - */ -export function useBountyAfterVote( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof bountyABI, - 'afterVote' - >['request']['abi'], - 'afterVote', - TMode - > & { functionName?: 'afterVote' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'afterVote' - } = {} as any, -) { - return useContractWrite({ - abi: bountyABI, - functionName: 'afterVote', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeMove"`. - */ -export function useBountyBeforeMove< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof bountyABI, - 'beforeMove' - >['request']['abi'], - 'beforeMove', - TMode - > & { functionName?: 'beforeMove' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'beforeMove' - } = {} as any, -) { - return useContractWrite({ - abi: bountyABI, - functionName: 'beforeMove', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeShoot"`. - */ -export function useBountyBeforeShoot< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof bountyABI, - 'beforeShoot' - >['request']['abi'], - 'beforeShoot', - TMode - > & { functionName?: 'beforeShoot' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'beforeShoot' - } = {} as any, -) { - return useContractWrite({ - abi: bountyABI, - functionName: 'beforeShoot', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeUpgrade"`. - */ -export function useBountyBeforeUpgrade< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof bountyABI, - 'beforeUpgrade' - >['request']['abi'], - 'beforeUpgrade', - TMode - > & { functionName?: 'beforeUpgrade' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'beforeUpgrade' - } = {} as any, -) { - return useContractWrite({ - abi: bountyABI, - functionName: 'beforeUpgrade', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeVote"`. - */ -export function useBountyBeforeVote< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof bountyABI, - 'beforeVote' - >['request']['abi'], - 'beforeVote', - TMode - > & { functionName?: 'beforeVote' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'beforeVote' - } = {} as any, -) { - return useContractWrite({ - abi: bountyABI, - functionName: 'beforeVote', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"cancel"`. - */ -export function useBountyCancel( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof bountyABI, - 'cancel' - >['request']['abi'], - 'cancel', - TMode - > & { functionName?: 'cancel' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'cancel' - } = {} as any, -) { - return useContractWrite({ - abi: bountyABI, - functionName: 'cancel', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"create"`. - */ -export function useBountyCreate( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof bountyABI, - 'create' - >['request']['abi'], - 'create', - TMode - > & { functionName?: 'create' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'create' - } = {} as any, -) { - return useContractWrite({ - abi: bountyABI, - functionName: 'create', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"withdraw"`. - */ -export function useBountyWithdraw( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof bountyABI, - 'withdraw' - >['request']['abi'], - 'withdraw', - TMode - > & { functionName?: 'withdraw' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'withdraw' - } = {} as any, -) { - return useContractWrite({ - abi: bountyABI, - functionName: 'withdraw', - ...config, - } as any) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__. - */ -export function usePrepareBountyWrite( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: bountyABI, - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterGive"`. - */ -export function usePrepareBountyAfterGive( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: bountyABI, - functionName: 'afterGive', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterMove"`. - */ -export function usePrepareBountyAfterMove( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: bountyABI, - functionName: 'afterMove', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterReveal"`. - */ -export function usePrepareBountyAfterReveal( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: bountyABI, - functionName: 'afterReveal', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterShoot"`. - */ -export function usePrepareBountyAfterShoot( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: bountyABI, - functionName: 'afterShoot', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterUpgrade"`. - */ -export function usePrepareBountyAfterUpgrade( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: bountyABI, - functionName: 'afterUpgrade', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterVote"`. - */ -export function usePrepareBountyAfterVote( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: bountyABI, - functionName: 'afterVote', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeMove"`. - */ -export function usePrepareBountyBeforeMove( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: bountyABI, - functionName: 'beforeMove', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeShoot"`. - */ -export function usePrepareBountyBeforeShoot( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: bountyABI, - functionName: 'beforeShoot', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeUpgrade"`. - */ -export function usePrepareBountyBeforeUpgrade( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: bountyABI, - functionName: 'beforeUpgrade', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeVote"`. - */ -export function usePrepareBountyBeforeVote( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: bountyABI, - functionName: 'beforeVote', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"cancel"`. - */ -export function usePrepareBountyCancel( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: bountyABI, - functionName: 'cancel', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"create"`. - */ -export function usePrepareBountyCreate( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: bountyABI, - functionName: 'create', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"withdraw"`. - */ -export function usePrepareBountyWithdraw( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: bountyABI, - functionName: 'withdraw', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link bountyABI}__. - */ -export function useBountyEvent( - config: Omit< - UseContractEventConfig, - 'abi' - > = {} as any, -) { - return useContractEvent({ - abi: bountyABI, - ...config, - } as UseContractEventConfig) -} - -/** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link bountyABI}__ and `eventName` set to `"BountyHookCreated"`. - */ -export function useBountyBountyHookCreatedEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, -) { - return useContractEvent({ - abi: bountyABI, - eventName: 'BountyHookCreated', - ...config, - } as UseContractEventConfig) -} - -/** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link bountyABI}__ and `eventName` set to `"BountyPosted"`. - */ -export function useBountyBountyPostedEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, -) { - return useContractEvent({ - abi: bountyABI, - eventName: 'BountyPosted', - ...config, - } as UseContractEventConfig) -} - -/** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link bountyABI}__ and `eventName` set to `"BountyWon"`. - */ -export function useBountyBountyWonEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, -) { - return useContractEvent({ - abi: bountyABI, - eventName: 'BountyWon', - ...config, - } as UseContractEventConfig) -} - -/** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link bountyABI}__ and `eventName` set to `"Withdraw"`. - */ -export function useBountyWithdrawEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, -) { - return useContractEvent({ - abi: bountyABI, - eventName: 'Withdraw', - ...config, - } as UseContractEventConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__. - */ -export function useDefaultEmptyHooksRead< - TFunctionName extends string, - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >, - 'abi' - > = {} as any, -) { - return useContractRead({ - abi: defaultEmptyHooksABI, - ...config, - } as UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterClaim"`. - */ -export function useDefaultEmptyHooksAfterClaim< - TFunctionName extends 'afterClaim', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: defaultEmptyHooksABI, - functionName: 'afterClaim', - ...config, - } as UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterDelegate"`. - */ -export function useDefaultEmptyHooksAfterDelegate< - TFunctionName extends 'afterDelegate', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: defaultEmptyHooksABI, - functionName: 'afterDelegate', - ...config, - } as UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterDrip"`. - */ -export function useDefaultEmptyHooksAfterDrip< - TFunctionName extends 'afterDrip', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: defaultEmptyHooksABI, - functionName: 'afterDrip', - ...config, - } as UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterJoin"`. - */ -export function useDefaultEmptyHooksAfterJoin< - TFunctionName extends 'afterJoin', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: defaultEmptyHooksABI, - functionName: 'afterJoin', - ...config, - } as UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeClaim"`. - */ -export function useDefaultEmptyHooksBeforeClaim< - TFunctionName extends 'beforeClaim', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: defaultEmptyHooksABI, - functionName: 'beforeClaim', - ...config, - } as UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeDelegate"`. - */ -export function useDefaultEmptyHooksBeforeDelegate< - TFunctionName extends 'beforeDelegate', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: defaultEmptyHooksABI, - functionName: 'beforeDelegate', - ...config, - } as UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeDrip"`. - */ -export function useDefaultEmptyHooksBeforeDrip< - TFunctionName extends 'beforeDrip', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: defaultEmptyHooksABI, - functionName: 'beforeDrip', - ...config, - } as UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeGive"`. - */ -export function useDefaultEmptyHooksBeforeGive< - TFunctionName extends 'beforeGive', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: defaultEmptyHooksABI, - functionName: 'beforeGive', - ...config, - } as UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeJoin"`. - */ -export function useDefaultEmptyHooksBeforeJoin< - TFunctionName extends 'beforeJoin', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: defaultEmptyHooksABI, - functionName: 'beforeJoin', - ...config, - } as UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeReveal"`. - */ -export function useDefaultEmptyHooksBeforeReveal< - TFunctionName extends 'beforeReveal', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: defaultEmptyHooksABI, - functionName: 'beforeReveal', - ...config, - } as UseContractReadConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TSelectData - >) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__. - */ -export function useDefaultEmptyHooksWrite< - TFunctionName extends string, - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof defaultEmptyHooksABI, - string - >['request']['abi'], - TFunctionName, - TMode - > - : UseContractWriteConfig< - typeof defaultEmptyHooksABI, - TFunctionName, - TMode - > & { - abi?: never - } = {} as any, -) { - return useContractWrite({ - abi: defaultEmptyHooksABI, - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterGive"`. - */ -export function useDefaultEmptyHooksAfterGive< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof defaultEmptyHooksABI, - 'afterGive' - >['request']['abi'], - 'afterGive', - TMode - > & { functionName?: 'afterGive' } - : UseContractWriteConfig< - typeof defaultEmptyHooksABI, - 'afterGive', - TMode - > & { - abi?: never - functionName?: 'afterGive' - } = {} as any, -) { - return useContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'afterGive', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterMove"`. - */ -export function useDefaultEmptyHooksAfterMove< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof defaultEmptyHooksABI, - 'afterMove' - >['request']['abi'], - 'afterMove', - TMode - > & { functionName?: 'afterMove' } - : UseContractWriteConfig< - typeof defaultEmptyHooksABI, - 'afterMove', - TMode - > & { - abi?: never - functionName?: 'afterMove' - } = {} as any, -) { - return useContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'afterMove', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterReveal"`. - */ -export function useDefaultEmptyHooksAfterReveal< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof defaultEmptyHooksABI, - 'afterReveal' - >['request']['abi'], - 'afterReveal', - TMode - > & { functionName?: 'afterReveal' } - : UseContractWriteConfig< - typeof defaultEmptyHooksABI, - 'afterReveal', - TMode - > & { - abi?: never - functionName?: 'afterReveal' - } = {} as any, -) { - return useContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'afterReveal', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterShoot"`. - */ -export function useDefaultEmptyHooksAfterShoot< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof defaultEmptyHooksABI, - 'afterShoot' - >['request']['abi'], - 'afterShoot', - TMode - > & { functionName?: 'afterShoot' } - : UseContractWriteConfig< - typeof defaultEmptyHooksABI, - 'afterShoot', - TMode - > & { - abi?: never - functionName?: 'afterShoot' - } = {} as any, -) { - return useContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'afterShoot', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterUpgrade"`. - */ -export function useDefaultEmptyHooksAfterUpgrade< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof defaultEmptyHooksABI, - 'afterUpgrade' - >['request']['abi'], - 'afterUpgrade', - TMode - > & { functionName?: 'afterUpgrade' } - : UseContractWriteConfig< - typeof defaultEmptyHooksABI, - 'afterUpgrade', - TMode - > & { - abi?: never - functionName?: 'afterUpgrade' - } = {} as any, -) { - return useContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'afterUpgrade', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterVote"`. - */ -export function useDefaultEmptyHooksAfterVote< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof defaultEmptyHooksABI, - 'afterVote' - >['request']['abi'], - 'afterVote', - TMode - > & { functionName?: 'afterVote' } - : UseContractWriteConfig< - typeof defaultEmptyHooksABI, - 'afterVote', - TMode - > & { - abi?: never - functionName?: 'afterVote' - } = {} as any, -) { - return useContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'afterVote', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeMove"`. - */ -export function useDefaultEmptyHooksBeforeMove< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof defaultEmptyHooksABI, - 'beforeMove' - >['request']['abi'], - 'beforeMove', - TMode - > & { functionName?: 'beforeMove' } - : UseContractWriteConfig< - typeof defaultEmptyHooksABI, - 'beforeMove', - TMode - > & { - abi?: never - functionName?: 'beforeMove' - } = {} as any, -) { - return useContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'beforeMove', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeShoot"`. - */ -export function useDefaultEmptyHooksBeforeShoot< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof defaultEmptyHooksABI, - 'beforeShoot' - >['request']['abi'], - 'beforeShoot', - TMode - > & { functionName?: 'beforeShoot' } - : UseContractWriteConfig< - typeof defaultEmptyHooksABI, - 'beforeShoot', - TMode - > & { - abi?: never - functionName?: 'beforeShoot' - } = {} as any, -) { - return useContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'beforeShoot', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeUpgrade"`. - */ -export function useDefaultEmptyHooksBeforeUpgrade< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof defaultEmptyHooksABI, - 'beforeUpgrade' - >['request']['abi'], - 'beforeUpgrade', - TMode - > & { functionName?: 'beforeUpgrade' } - : UseContractWriteConfig< - typeof defaultEmptyHooksABI, - 'beforeUpgrade', - TMode - > & { - abi?: never - functionName?: 'beforeUpgrade' - } = {} as any, -) { - return useContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'beforeUpgrade', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeVote"`. - */ -export function useDefaultEmptyHooksBeforeVote< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof defaultEmptyHooksABI, - 'beforeVote' - >['request']['abi'], - 'beforeVote', - TMode - > & { functionName?: 'beforeVote' } - : UseContractWriteConfig< - typeof defaultEmptyHooksABI, - 'beforeVote', - TMode - > & { - abi?: never - functionName?: 'beforeVote' - } = {} as any, -) { - return useContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'beforeVote', - ...config, - } as any) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__. - */ -export function usePrepareDefaultEmptyHooksWrite( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: defaultEmptyHooksABI, - ...config, - } as UsePrepareContractWriteConfig< - typeof defaultEmptyHooksABI, - TFunctionName - >) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterGive"`. - */ -export function usePrepareDefaultEmptyHooksAfterGive( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'afterGive', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterMove"`. - */ -export function usePrepareDefaultEmptyHooksAfterMove( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'afterMove', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterReveal"`. - */ -export function usePrepareDefaultEmptyHooksAfterReveal( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'afterReveal', - ...config, - } as UsePrepareContractWriteConfig< - typeof defaultEmptyHooksABI, - 'afterReveal' - >) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterShoot"`. - */ -export function usePrepareDefaultEmptyHooksAfterShoot( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'afterShoot', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterUpgrade"`. - */ -export function usePrepareDefaultEmptyHooksAfterUpgrade( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'afterUpgrade', - ...config, - } as UsePrepareContractWriteConfig< - typeof defaultEmptyHooksABI, - 'afterUpgrade' - >) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterVote"`. - */ -export function usePrepareDefaultEmptyHooksAfterVote( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'afterVote', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeMove"`. - */ -export function usePrepareDefaultEmptyHooksBeforeMove( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'beforeMove', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeShoot"`. - */ -export function usePrepareDefaultEmptyHooksBeforeShoot( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'beforeShoot', - ...config, - } as UsePrepareContractWriteConfig< - typeof defaultEmptyHooksABI, - 'beforeShoot' - >) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeUpgrade"`. - */ -export function usePrepareDefaultEmptyHooksBeforeUpgrade( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'beforeUpgrade', - ...config, - } as UsePrepareContractWriteConfig< - typeof defaultEmptyHooksABI, - 'beforeUpgrade' - >) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeVote"`. - */ -export function usePrepareDefaultEmptyHooksBeforeVote( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: defaultEmptyHooksABI, - functionName: 'beforeVote', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) - * - - */ -export function useGameViewRead< - TFunctionName extends string, - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' - > & { chainId?: keyof typeof gameViewAddress } = {} as any, -) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: gameViewABI, - address: gameViewAddress[chainId as keyof typeof gameViewAddress], - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getAllHearts"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) - * - - */ -export function useGameViewGetAllHearts< - TFunctionName extends 'getAllHearts', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof gameViewAddress } = {} as any, -) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: gameViewABI, - address: gameViewAddress[chainId as keyof typeof gameViewAddress], - functionName: 'getAllHearts', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getAllTanks"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) - * - - */ -export function useGameViewGetAllTanks< - TFunctionName extends 'getAllTanks', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof gameViewAddress } = {} as any, -) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: gameViewABI, - address: gameViewAddress[chainId as keyof typeof gameViewAddress], - functionName: 'getAllTanks', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getBoard"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) - * - - */ -export function useGameViewGetBoard< - TFunctionName extends 'getBoard', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof gameViewAddress } = {} as any, -) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: gameViewABI, - address: gameViewAddress[chainId as keyof typeof gameViewAddress], - functionName: 'getBoard', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getEpoch"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) - * - - */ -export function useGameViewGetEpoch< - TFunctionName extends 'getEpoch', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof gameViewAddress } = {} as any, -) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: gameViewABI, - address: gameViewAddress[chainId as keyof typeof gameViewAddress], - functionName: 'getEpoch', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getGameEpoch"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) - * - - */ -export function useGameViewGetGameEpoch< - TFunctionName extends 'getGameEpoch', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof gameViewAddress } = {} as any, -) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: gameViewABI, - address: gameViewAddress[chainId as keyof typeof gameViewAddress], - functionName: 'getGameEpoch', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getLastDrip"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) - * - - */ -export function useGameViewGetLastDrip< - TFunctionName extends 'getLastDrip', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof gameViewAddress } = {} as any, -) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: gameViewABI, - address: gameViewAddress[chainId as keyof typeof gameViewAddress], - functionName: 'getLastDrip', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getPlayerCount"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) - * - - */ -export function useGameViewGetPlayerCount< - TFunctionName extends 'getPlayerCount', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof gameViewAddress } = {} as any, -) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: gameViewABI, - address: gameViewAddress[chainId as keyof typeof gameViewAddress], - functionName: 'getPlayerCount', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getSettings"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) - * - - */ -export function useGameViewGetSettings< - TFunctionName extends 'getSettings', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof gameViewAddress } = {} as any, -) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: gameViewABI, - address: gameViewAddress[chainId as keyof typeof gameViewAddress], - functionName: 'getSettings', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getState"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) - * - - */ -export function useGameViewGetState< - TFunctionName extends 'getState', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof gameViewAddress } = {} as any, -) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: gameViewABI, - address: gameViewAddress[chainId as keyof typeof gameViewAddress], - functionName: 'getState', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getTank"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) - * - - */ -export function useGameViewGetTank< - TFunctionName extends 'getTank', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof gameViewAddress } = {} as any, -) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: gameViewABI, - address: gameViewAddress[chainId as keyof typeof gameViewAddress], - functionName: 'getTank', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getUpgradeCost"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) - * - - */ -export function useGameViewGetUpgradeCost< - TFunctionName extends 'getUpgradeCost', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof gameViewAddress } = {} as any, -) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: gameViewABI, - address: gameViewAddress[chainId as keyof typeof gameViewAddress], - functionName: 'getUpgradeCost', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"isAuth"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) - * - - */ -export function useGameViewIsAuth< - TFunctionName extends 'isAuth', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof gameViewAddress } = {} as any, -) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: gameViewABI, - address: gameViewAddress[chainId as keyof typeof gameViewAddress], - functionName: 'isAuth', - ...config, - } as UseContractReadConfig) -} +] as const + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// React +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__. */ -export function useHexBoardRead< +export function useBoardRead< TFunctionName extends string, - TSelectData = ReadContractResult, + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' > = {} as any, ) { - return useContractRead({ - abi: hexBoardABI, - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"boardSize"`. - */ -export function useHexBoardBoardSize< - TFunctionName extends 'boardSize', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: hexBoardABI, - functionName: 'boardSize', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"getDistance"`. - */ -export function useHexBoardGetDistance< - TFunctionName extends 'getDistance', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: hexBoardABI, - functionName: 'getDistance', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"getDistanceTankToPoint"`. - */ -export function useHexBoardGetDistanceTankToPoint< - TFunctionName extends 'getDistanceTankToPoint', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: hexBoardABI, - functionName: 'getDistanceTankToPoint', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"getDistanceTanks"`. - */ -export function useHexBoardGetDistanceTanks< - TFunctionName extends 'getDistanceTanks', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: hexBoardABI, - functionName: 'getDistanceTanks', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"getEmptyTile"`. - */ -export function useHexBoardGetEmptyTile< - TFunctionName extends 'getEmptyTile', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: hexBoardABI, - functionName: 'getEmptyTile', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"getHeartAtPosition"`. - */ -export function useHexBoardGetHeartAtPosition< - TFunctionName extends 'getHeartAtPosition', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: hexBoardABI, - functionName: 'getHeartAtPosition', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"getPerimeterForRadius"`. - */ -export function useHexBoardGetPerimeterForRadius< - TFunctionName extends 'getPerimeterForRadius', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: hexBoardABI, - functionName: 'getPerimeterForRadius', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"getTankPosition"`. - */ -export function useHexBoardGetTankPosition< - TFunctionName extends 'getTankPosition', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: hexBoardABI, - functionName: 'getTankPosition', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"getTile"`. - */ -export function useHexBoardGetTile< - TFunctionName extends 'getTile', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: hexBoardABI, - functionName: 'getTile', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"getTotalTiles"`. - */ -export function useHexBoardGetTotalTiles< - TFunctionName extends 'getTotalTiles', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: hexBoardABI, - functionName: 'getTotalTiles', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"heartsOnBoard"`. - */ -export function useHexBoardHeartsOnBoard< - TFunctionName extends 'heartsOnBoard', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: hexBoardABI, - functionName: 'heartsOnBoard', - ...config, - } as UseContractReadConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"isValidPoint"`. - */ -export function useHexBoardIsValidPoint< - TFunctionName extends 'isValidPoint', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return useContractRead({ - abi: hexBoardABI, - functionName: 'isValidPoint', - ...config, - } as UseContractReadConfig) + return useContractRead({ abi: boardABI, ...config } as UseContractReadConfig< + typeof boardABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"pointToIndex"`. - */ -export function useHexBoardPointToIndex< - TFunctionName extends 'pointToIndex', - TSelectData = ReadContractResult, + * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"boardSize"`. + */ +export function useBoardBoardSize< + TFunctionName extends 'boardSize', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: hexBoardABI, - functionName: 'pointToIndex', + abi: boardABI, + functionName: 'boardSize', ...config, - } as UseContractReadConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"randomPoint"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"getDistance"`. */ -export function useHexBoardRandomPoint< - TFunctionName extends 'randomPoint', - TSelectData = ReadContractResult, +export function useBoardGetDistance< + TFunctionName extends 'getDistance', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: hexBoardABI, - functionName: 'randomPoint', + abi: boardABI, + functionName: 'getDistance', ...config, - } as UseContractReadConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"tankToPosition"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"getDistanceTankToPoint"`. */ -export function useHexBoardTankToPosition< - TFunctionName extends 'tankToPosition', - TSelectData = ReadContractResult, +export function useBoardGetDistanceTankToPoint< + TFunctionName extends 'getDistanceTankToPoint', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: hexBoardABI, - functionName: 'tankToPosition', + abi: boardABI, + functionName: 'getDistanceTankToPoint', ...config, - } as UseContractReadConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"tanksOnBoard"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"getDistanceTanks"`. */ -export function useHexBoardTanksOnBoard< - TFunctionName extends 'tanksOnBoard', - TSelectData = ReadContractResult, +export function useBoardGetDistanceTanks< + TFunctionName extends 'getDistanceTanks', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: hexBoardABI, - functionName: 'tanksOnBoard', + abi: boardABI, + functionName: 'getDistanceTanks', ...config, - } as UseContractReadConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link hexBoardABI}__. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"getEmptyTile"`. */ -export function useHexBoardWrite< - TFunctionName extends string, - TMode extends WriteContractMode = undefined, +export function useBoardGetEmptyTile< + TFunctionName extends 'getEmptyTile', + TSelectData = ReadContractResult, >( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof hexBoardABI, - string - >['request']['abi'], - TFunctionName, - TMode - > - : UseContractWriteConfig & { - abi?: never - } = {} as any, -) { - return useContractWrite({ - abi: hexBoardABI, - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"setTile"`. - */ -export function useHexBoardSetTile( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof hexBoardABI, - 'setTile' - >['request']['abi'], - 'setTile', - TMode - > & { functionName?: 'setTile' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'setTile' - } = {} as any, + config: Omit< + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - return useContractWrite({ - abi: hexBoardABI, - functionName: 'setTile', + return useContractRead({ + abi: boardABI, + functionName: 'getEmptyTile', ...config, - } as any) + } as UseContractReadConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link hexBoardABI}__. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"getHeartAtPosition"`. */ -export function usePrepareHexBoardWrite( +export function useBoardGetHeartAtPosition< + TFunctionName extends 'getHeartAtPosition', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' + UseContractReadConfig, + 'abi' | 'functionName' > = {} as any, ) { - return usePrepareContractWrite({ - abi: hexBoardABI, + return useContractRead({ + abi: boardABI, + functionName: 'getHeartAtPosition', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"setTile"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"getPerimeterForRadius"`. */ -export function usePrepareHexBoardSetTile( +export function useBoardGetPerimeterForRadius< + TFunctionName extends 'getPerimeterForRadius', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { - return usePrepareContractWrite({ - abi: hexBoardABI, - functionName: 'setTile', + return useContractRead({ + abi: boardABI, + functionName: 'getPerimeterForRadius', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link hookFactoryABI}__. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2833Ee23DdAFa959D5ca459c6A64df2164B367b3) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"getTankPosition"`. */ -export function useHookFactoryWrite< - TFunctionName extends string, - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof hookFactoryAddress, +export function useBoardGetTankPosition< + TFunctionName extends 'getTankPosition', + TSelectData = ReadContractResult, >( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof hookFactoryABI, - string - >['request']['abi'], - TFunctionName, - TMode - > & { address?: Address; chainId?: TChainId } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - } = {} as any, + config: Omit< + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: hookFactoryABI, - address: hookFactoryAddress[chainId as keyof typeof hookFactoryAddress], + return useContractRead({ + abi: boardABI, + functionName: 'getTankPosition', ...config, - } as any) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link hookFactoryABI}__ and `functionName` set to `"createHook"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2833Ee23DdAFa959D5ca459c6A64df2164B367b3) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"getTile"`. */ -export function useHookFactoryCreateHook< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof hookFactoryAddress, +export function useBoardGetTile< + TFunctionName extends 'getTile', + TSelectData = ReadContractResult, >( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof hookFactoryABI, - 'createHook' - >['request']['abi'], - 'createHook', - TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'createHook' } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'createHook' - } = {} as any, + config: Omit< + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: hookFactoryABI, - address: hookFactoryAddress[chainId as keyof typeof hookFactoryAddress], - functionName: 'createHook', + return useContractRead({ + abi: boardABI, + functionName: 'getTile', ...config, - } as any) + } as UseContractReadConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link hookFactoryABI}__. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2833Ee23DdAFa959D5ca459c6A64df2164B367b3) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"getTotalTiles"`. */ -export function usePrepareHookFactoryWrite( +export function useBoardGetTotalTiles< + TFunctionName extends 'getTotalTiles', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' - > & { chainId?: keyof typeof hookFactoryAddress } = {} as any, -) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: hookFactoryABI, - address: hookFactoryAddress[chainId as keyof typeof hookFactoryAddress], + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, +) { + return useContractRead({ + abi: boardABI, + functionName: 'getTotalTiles', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link hookFactoryABI}__ and `functionName` set to `"createHook"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2833Ee23DdAFa959D5ca459c6A64df2164B367b3) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"isValidPoint"`. */ -export function usePrepareHookFactoryCreateHook( +export function useBoardIsValidPoint< + TFunctionName extends 'isValidPoint', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof hookFactoryAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: hookFactoryABI, - address: hookFactoryAddress[chainId as keyof typeof hookFactoryAddress], - functionName: 'createHook', + return useContractRead({ + abi: boardABI, + functionName: 'isValidPoint', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link hookFactoryABI}__. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2833Ee23DdAFa959D5ca459c6A64df2164B367b3) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"pointToIndex"`. */ -export function useHookFactoryEvent( +export function useBoardPointToIndex< + TFunctionName extends 'pointToIndex', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' - > & { chainId?: keyof typeof hookFactoryAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: hookFactoryABI, - address: hookFactoryAddress[chainId as keyof typeof hookFactoryAddress], + return useContractRead({ + abi: boardABI, + functionName: 'pointToIndex', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link hookFactoryABI}__ and `eventName` set to `"HookCreated"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2833Ee23DdAFa959D5ca459c6A64df2164B367b3) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"randomPoint"`. */ -export function useHookFactoryHookCreatedEvent( +export function useBoardRandomPoint< + TFunctionName extends 'randomPoint', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof hookFactoryAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: hookFactoryABI, - address: hookFactoryAddress[chainId as keyof typeof hookFactoryAddress], - eventName: 'HookCreated', + return useContractRead({ + abi: boardABI, + functionName: 'randomPoint', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iAcceptableABI}__. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link boardABI}__. */ -export function useIAcceptableWrite< +export function useBoardWrite< TFunctionName extends string, TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iAcceptableABI, - string - >['request']['abi'], + PrepareWriteContractResult['request']['abi'], TFunctionName, TMode > - : UseContractWriteConfig & { + : UseContractWriteConfig & { abi?: never } = {} as any, ) { - return useContractWrite({ - abi: iAcceptableABI, + return useContractWrite({ + abi: boardABI, ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iAcceptableABI}__ and `functionName` set to `"accept"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"setTile"`. */ -export function useIAcceptableAccept< - TMode extends WriteContractMode = undefined, ->( +export function useBoardSetTile( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iAcceptableABI, - 'accept' + typeof boardABI, + 'setTile' >['request']['abi'], - 'accept', + 'setTile', TMode - > & { functionName?: 'accept' } - : UseContractWriteConfig & { + > & { functionName?: 'setTile' } + : UseContractWriteConfig & { abi?: never - functionName?: 'accept' + functionName?: 'setTile' } = {} as any, ) { - return useContractWrite({ - abi: iAcceptableABI, - functionName: 'accept', + return useContractWrite({ + abi: boardABI, + functionName: 'setTile', ...config, } as any) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iAcceptableABI}__. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link boardABI}__. */ -export function usePrepareIAcceptableWrite( +export function usePrepareBoardWrite( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' > = {} as any, ) { return usePrepareContractWrite({ - abi: iAcceptableABI, + abi: boardABI, ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iAcceptableABI}__ and `functionName` set to `"accept"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link boardABI}__ and `functionName` set to `"setTile"`. */ -export function usePrepareIAcceptableAccept( +export function usePrepareBoardSetTile( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: iAcceptableABI, - functionName: 'accept', + abi: boardABI, + functionName: 'setTile', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__. */ -export function useIGameViewRead< +export function useBountyRead< TFunctionName extends string, - TSelectData = ReadContractResult, + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' > = {} as any, +) { + return useContractRead({ abi: bountyABI, ...config } as UseContractReadConfig< + typeof bountyABI, + TFunctionName, + TSelectData + >) +} + +/** + * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterClaim"`. + */ +export function useBountyAfterClaim< + TFunctionName extends 'afterClaim', + TSelectData = ReadContractResult, +>( + config: Omit< + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { return useContractRead({ - abi: iGameViewABI, + abi: bountyABI, + functionName: 'afterClaim', ...config, - } as UseContractReadConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getAllHearts"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterDelegate"`. */ -export function useIGameViewGetAllHearts< - TFunctionName extends 'getAllHearts', - TSelectData = ReadContractResult, +export function useBountyAfterDelegate< + TFunctionName extends 'afterDelegate', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: iGameViewABI, - functionName: 'getAllHearts', + abi: bountyABI, + functionName: 'afterDelegate', ...config, - } as UseContractReadConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getAllTanks"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterDrip"`. */ -export function useIGameViewGetAllTanks< - TFunctionName extends 'getAllTanks', - TSelectData = ReadContractResult, +export function useBountyAfterDrip< + TFunctionName extends 'afterDrip', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: iGameViewABI, - functionName: 'getAllTanks', + abi: bountyABI, + functionName: 'afterDrip', ...config, - } as UseContractReadConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getBoard"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterJoin"`. */ -export function useIGameViewGetBoard< - TFunctionName extends 'getBoard', - TSelectData = ReadContractResult, +export function useBountyAfterJoin< + TFunctionName extends 'afterJoin', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: iGameViewABI, - functionName: 'getBoard', + abi: bountyABI, + functionName: 'afterJoin', ...config, - } as UseContractReadConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getEpoch"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeClaim"`. */ -export function useIGameViewGetEpoch< - TFunctionName extends 'getEpoch', - TSelectData = ReadContractResult, +export function useBountyBeforeClaim< + TFunctionName extends 'beforeClaim', + TSelectData = ReadContractResult, +>( + config: Omit< + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, +) { + return useContractRead({ + abi: bountyABI, + functionName: 'beforeClaim', + ...config, + } as UseContractReadConfig) +} + +/** + * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeDelegate"`. + */ +export function useBountyBeforeDelegate< + TFunctionName extends 'beforeDelegate', + TSelectData = ReadContractResult, +>( + config: Omit< + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, +) { + return useContractRead({ + abi: bountyABI, + functionName: 'beforeDelegate', + ...config, + } as UseContractReadConfig) +} + +/** + * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeDrip"`. + */ +export function useBountyBeforeDrip< + TFunctionName extends 'beforeDrip', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: iGameViewABI, - functionName: 'getEpoch', + abi: bountyABI, + functionName: 'beforeDrip', ...config, - } as UseContractReadConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getGameEpoch"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeGive"`. */ -export function useIGameViewGetGameEpoch< - TFunctionName extends 'getGameEpoch', - TSelectData = ReadContractResult, +export function useBountyBeforeGive< + TFunctionName extends 'beforeGive', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: iGameViewABI, - functionName: 'getGameEpoch', + abi: bountyABI, + functionName: 'beforeGive', ...config, - } as UseContractReadConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getLastDrip"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeJoin"`. */ -export function useIGameViewGetLastDrip< - TFunctionName extends 'getLastDrip', - TSelectData = ReadContractResult, +export function useBountyBeforeJoin< + TFunctionName extends 'beforeJoin', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: iGameViewABI, - functionName: 'getLastDrip', + abi: bountyABI, + functionName: 'beforeJoin', ...config, - } as UseContractReadConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getPlayerCount"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeReveal"`. */ -export function useIGameViewGetPlayerCount< - TFunctionName extends 'getPlayerCount', - TSelectData = ReadContractResult, +export function useBountyBeforeReveal< + TFunctionName extends 'beforeReveal', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: iGameViewABI, - functionName: 'getPlayerCount', + abi: bountyABI, + functionName: 'beforeReveal', ...config, - } as UseContractReadConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getSettings"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"bounties"`. */ -export function useIGameViewGetSettings< - TFunctionName extends 'getSettings', - TSelectData = ReadContractResult, +export function useBountyBounties< + TFunctionName extends 'bounties', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: iGameViewABI, - functionName: 'getSettings', + abi: bountyABI, + functionName: 'bounties', ...config, - } as UseContractReadConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getState"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"bountiesData"`. */ -export function useIGameViewGetState< - TFunctionName extends 'getState', - TSelectData = ReadContractResult, +export function useBountyBountiesData< + TFunctionName extends 'bountiesData', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: iGameViewABI, - functionName: 'getState', + abi: bountyABI, + functionName: 'bountiesData', ...config, - } as UseContractReadConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getTank"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"bountyCount"`. */ -export function useIGameViewGetTank< - TFunctionName extends 'getTank', - TSelectData = ReadContractResult, +export function useBountyBountyCount< + TFunctionName extends 'bountyCount', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: iGameViewABI, - functionName: 'getTank', + abi: bountyABI, + functionName: 'bountyCount', ...config, - } as UseContractReadConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"isAuth"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"ownerTank"`. */ -export function useIGameViewIsAuth< - TFunctionName extends 'isAuth', - TSelectData = ReadContractResult, +export function useBountyOwnerTank< + TFunctionName extends 'ownerTank', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: iGameViewABI, - functionName: 'isAuth', + abi: bountyABI, + functionName: 'ownerTank', ...config, - } as UseContractReadConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"tankGame"`. */ -export function useIHooksWrite< - TFunctionName extends string, - TMode extends WriteContractMode = undefined, +export function useBountyTankGame< + TFunctionName extends 'tankGame', + TSelectData = ReadContractResult, >( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult['request']['abi'], - TFunctionName, - TMode - > - : UseContractWriteConfig & { - abi?: never - } = {} as any, + config: Omit< + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - return useContractWrite({ - abi: iHooksABI, + return useContractRead({ + abi: bountyABI, + functionName: 'tankGame', ...config, - } as any) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterClaim"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"tankGameView"`. */ -export function useIHooksAfterClaim< - TMode extends WriteContractMode = undefined, +export function useBountyTankGameView< + TFunctionName extends 'tankGameView', + TSelectData = ReadContractResult, >( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iHooksABI, - 'afterClaim' - >['request']['abi'], - 'afterClaim', - TMode - > & { functionName?: 'afterClaim' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'afterClaim' - } = {} as any, + config: Omit< + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - return useContractWrite({ - abi: iHooksABI, - functionName: 'afterClaim', + return useContractRead({ + abi: bountyABI, + functionName: 'tankGameView', ...config, - } as any) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterDelegate"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"withdrawals"`. */ -export function useIHooksAfterDelegate< - TMode extends WriteContractMode = undefined, +export function useBountyWithdrawals< + TFunctionName extends 'withdrawals', + TSelectData = ReadContractResult, >( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iHooksABI, - 'afterDelegate' - >['request']['abi'], - 'afterDelegate', - TMode - > & { functionName?: 'afterDelegate' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'afterDelegate' - } = {} as any, -) { - return useContractWrite({ - abi: iHooksABI, - functionName: 'afterDelegate', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterDrip"`. - */ -export function useIHooksAfterDrip( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iHooksABI, - 'afterDrip' - >['request']['abi'], - 'afterDrip', - TMode - > & { functionName?: 'afterDrip' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'afterDrip' - } = {} as any, + config: Omit< + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - return useContractWrite({ - abi: iHooksABI, - functionName: 'afterDrip', + return useContractRead({ + abi: bountyABI, + functionName: 'withdrawals', ...config, - } as any) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterGive"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__. */ -export function useIHooksAfterGive( +export function useBountyWrite< + TFunctionName extends string, + TMode extends WriteContractMode = undefined, +>( config: TMode extends 'prepared' ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iHooksABI, - 'afterGive' - >['request']['abi'], - 'afterGive', + PrepareWriteContractResult['request']['abi'], + TFunctionName, TMode - > & { functionName?: 'afterGive' } - : UseContractWriteConfig & { + > + : UseContractWriteConfig & { abi?: never - functionName?: 'afterGive' } = {} as any, ) { - return useContractWrite({ - abi: iHooksABI, - functionName: 'afterGive', + return useContractWrite({ + abi: bountyABI, ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterJoin"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterGive"`. */ -export function useIHooksAfterJoin( +export function useBountyAfterGive( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iHooksABI, - 'afterJoin' + typeof bountyABI, + 'afterGive' >['request']['abi'], - 'afterJoin', + 'afterGive', TMode - > & { functionName?: 'afterJoin' } - : UseContractWriteConfig & { + > & { functionName?: 'afterGive' } + : UseContractWriteConfig & { abi?: never - functionName?: 'afterJoin' + functionName?: 'afterGive' } = {} as any, ) { - return useContractWrite({ - abi: iHooksABI, - functionName: 'afterJoin', + return useContractWrite({ + abi: bountyABI, + functionName: 'afterGive', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterMove"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterMove"`. */ -export function useIHooksAfterMove( +export function useBountyAfterMove( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iHooksABI, + typeof bountyABI, 'afterMove' >['request']['abi'], 'afterMove', TMode > & { functionName?: 'afterMove' } - : UseContractWriteConfig & { + : UseContractWriteConfig & { abi?: never functionName?: 'afterMove' } = {} as any, ) { - return useContractWrite({ - abi: iHooksABI, + return useContractWrite({ + abi: bountyABI, functionName: 'afterMove', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterReveal"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterReveal"`. */ -export function useIHooksAfterReveal< +export function useBountyAfterReveal< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iHooksABI, + typeof bountyABI, 'afterReveal' >['request']['abi'], 'afterReveal', TMode > & { functionName?: 'afterReveal' } - : UseContractWriteConfig & { + : UseContractWriteConfig & { abi?: never functionName?: 'afterReveal' } = {} as any, ) { - return useContractWrite({ - abi: iHooksABI, + return useContractWrite({ + abi: bountyABI, functionName: 'afterReveal', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterShoot"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterShoot"`. */ -export function useIHooksAfterShoot< +export function useBountyAfterShoot< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iHooksABI, + typeof bountyABI, 'afterShoot' >['request']['abi'], 'afterShoot', TMode > & { functionName?: 'afterShoot' } - : UseContractWriteConfig & { + : UseContractWriteConfig & { abi?: never functionName?: 'afterShoot' } = {} as any, ) { - return useContractWrite({ - abi: iHooksABI, + return useContractWrite({ + abi: bountyABI, functionName: 'afterShoot', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterUpgrade"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterUpgrade"`. */ -export function useIHooksAfterUpgrade< +export function useBountyAfterUpgrade< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iHooksABI, + typeof bountyABI, 'afterUpgrade' >['request']['abi'], 'afterUpgrade', TMode > & { functionName?: 'afterUpgrade' } - : UseContractWriteConfig & { + : UseContractWriteConfig & { abi?: never functionName?: 'afterUpgrade' } = {} as any, ) { - return useContractWrite({ - abi: iHooksABI, + return useContractWrite({ + abi: bountyABI, functionName: 'afterUpgrade', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterVote"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterVote"`. */ -export function useIHooksAfterVote( +export function useBountyAfterVote( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iHooksABI, + typeof bountyABI, 'afterVote' >['request']['abi'], 'afterVote', TMode > & { functionName?: 'afterVote' } - : UseContractWriteConfig & { + : UseContractWriteConfig & { abi?: never functionName?: 'afterVote' } = {} as any, ) { - return useContractWrite({ - abi: iHooksABI, + return useContractWrite({ + abi: bountyABI, functionName: 'afterVote', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeClaim"`. - */ -export function useIHooksBeforeClaim< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iHooksABI, - 'beforeClaim' - >['request']['abi'], - 'beforeClaim', - TMode - > & { functionName?: 'beforeClaim' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'beforeClaim' - } = {} as any, -) { - return useContractWrite({ - abi: iHooksABI, - functionName: 'beforeClaim', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeDelegate"`. - */ -export function useIHooksBeforeDelegate< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iHooksABI, - 'beforeDelegate' - >['request']['abi'], - 'beforeDelegate', - TMode - > & { functionName?: 'beforeDelegate' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'beforeDelegate' - } = {} as any, -) { - return useContractWrite({ - abi: iHooksABI, - functionName: 'beforeDelegate', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeDrip"`. - */ -export function useIHooksBeforeDrip< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iHooksABI, - 'beforeDrip' - >['request']['abi'], - 'beforeDrip', - TMode - > & { functionName?: 'beforeDrip' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'beforeDrip' - } = {} as any, -) { - return useContractWrite({ - abi: iHooksABI, - functionName: 'beforeDrip', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeGive"`. - */ -export function useIHooksBeforeGive< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iHooksABI, - 'beforeGive' - >['request']['abi'], - 'beforeGive', - TMode - > & { functionName?: 'beforeGive' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'beforeGive' - } = {} as any, -) { - return useContractWrite({ - abi: iHooksABI, - functionName: 'beforeGive', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeJoin"`. - */ -export function useIHooksBeforeJoin< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iHooksABI, - 'beforeJoin' - >['request']['abi'], - 'beforeJoin', - TMode - > & { functionName?: 'beforeJoin' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'beforeJoin' - } = {} as any, -) { - return useContractWrite({ - abi: iHooksABI, - functionName: 'beforeJoin', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeMove"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeMove"`. */ -export function useIHooksBeforeMove< +export function useBountyBeforeMove< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iHooksABI, + typeof bountyABI, 'beforeMove' >['request']['abi'], - 'beforeMove', - TMode - > & { functionName?: 'beforeMove' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'beforeMove' - } = {} as any, -) { - return useContractWrite({ - abi: iHooksABI, - functionName: 'beforeMove', - ...config, - } as any) -} - -/** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeReveal"`. - */ -export function useIHooksBeforeReveal< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iHooksABI, - 'beforeReveal' - >['request']['abi'], - 'beforeReveal', + 'beforeMove', TMode - > & { functionName?: 'beforeReveal' } - : UseContractWriteConfig & { + > & { functionName?: 'beforeMove' } + : UseContractWriteConfig & { abi?: never - functionName?: 'beforeReveal' + functionName?: 'beforeMove' } = {} as any, ) { - return useContractWrite({ - abi: iHooksABI, - functionName: 'beforeReveal', + return useContractWrite({ + abi: bountyABI, + functionName: 'beforeMove', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeShoot"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeShoot"`. */ -export function useIHooksBeforeShoot< +export function useBountyBeforeShoot< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iHooksABI, + typeof bountyABI, 'beforeShoot' >['request']['abi'], 'beforeShoot', TMode > & { functionName?: 'beforeShoot' } - : UseContractWriteConfig & { + : UseContractWriteConfig & { abi?: never functionName?: 'beforeShoot' } = {} as any, ) { - return useContractWrite({ - abi: iHooksABI, + return useContractWrite({ + abi: bountyABI, functionName: 'beforeShoot', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeUpgrade"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeUpgrade"`. */ -export function useIHooksBeforeUpgrade< +export function useBountyBeforeUpgrade< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iHooksABI, + typeof bountyABI, 'beforeUpgrade' >['request']['abi'], 'beforeUpgrade', TMode > & { functionName?: 'beforeUpgrade' } - : UseContractWriteConfig & { + : UseContractWriteConfig & { abi?: never functionName?: 'beforeUpgrade' } = {} as any, ) { - return useContractWrite({ - abi: iHooksABI, + return useContractWrite({ + abi: bountyABI, functionName: 'beforeUpgrade', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeVote"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeVote"`. */ -export function useIHooksBeforeVote< +export function useBountyBeforeVote< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iHooksABI, + typeof bountyABI, 'beforeVote' >['request']['abi'], 'beforeVote', TMode > & { functionName?: 'beforeVote' } - : UseContractWriteConfig & { + : UseContractWriteConfig & { abi?: never functionName?: 'beforeVote' } = {} as any, -) { - return useContractWrite({ - abi: iHooksABI, - functionName: 'beforeVote', - ...config, - } as any) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__. - */ -export function usePrepareIHooksWrite( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: iHooksABI, - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterClaim"`. - */ -export function usePrepareIHooksAfterClaim( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'afterClaim', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterDelegate"`. - */ -export function usePrepareIHooksAfterDelegate( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'afterDelegate', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterDrip"`. - */ -export function usePrepareIHooksAfterDrip( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'afterDrip', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterGive"`. - */ -export function usePrepareIHooksAfterGive( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'afterGive', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterJoin"`. - */ -export function usePrepareIHooksAfterJoin( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'afterJoin', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterMove"`. - */ -export function usePrepareIHooksAfterMove( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'afterMove', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterReveal"`. - */ -export function usePrepareIHooksAfterReveal( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'afterReveal', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterShoot"`. - */ -export function usePrepareIHooksAfterShoot( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'afterShoot', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterUpgrade"`. - */ -export function usePrepareIHooksAfterUpgrade( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'afterUpgrade', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterVote"`. - */ -export function usePrepareIHooksAfterVote( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'afterVote', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeClaim"`. - */ -export function usePrepareIHooksBeforeClaim( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'beforeClaim', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeDelegate"`. - */ -export function usePrepareIHooksBeforeDelegate( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'beforeDelegate', +) { + return useContractWrite({ + abi: bountyABI, + functionName: 'beforeVote', ...config, - } as UsePrepareContractWriteConfig) + } as any) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeDrip"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"cancel"`. */ -export function usePrepareIHooksBeforeDrip( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, +export function useBountyCancel( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof bountyABI, + 'cancel' + >['request']['abi'], + 'cancel', + TMode + > & { functionName?: 'cancel' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'cancel' + } = {} as any, ) { - return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'beforeDrip', + return useContractWrite({ + abi: bountyABI, + functionName: 'cancel', ...config, - } as UsePrepareContractWriteConfig) + } as any) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeGive"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"create"`. */ -export function usePrepareIHooksBeforeGive( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, +export function useBountyCreate( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof bountyABI, + 'create' + >['request']['abi'], + 'create', + TMode + > & { functionName?: 'create' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'create' + } = {} as any, ) { - return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'beforeGive', + return useContractWrite({ + abi: bountyABI, + functionName: 'create', ...config, - } as UsePrepareContractWriteConfig) + } as any) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeJoin"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"withdraw"`. */ -export function usePrepareIHooksBeforeJoin( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, +export function useBountyWithdraw( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof bountyABI, + 'withdraw' + >['request']['abi'], + 'withdraw', + TMode + > & { functionName?: 'withdraw' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'withdraw' + } = {} as any, ) { - return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'beforeJoin', + return useContractWrite({ + abi: bountyABI, + functionName: 'withdraw', ...config, - } as UsePrepareContractWriteConfig) + } as any) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeMove"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__. */ -export function usePrepareIHooksBeforeMove( +export function usePrepareBountyWrite( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' + UsePrepareContractWriteConfig, + 'abi' > = {} as any, ) { return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'beforeMove', + abi: bountyABI, ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeReveal"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterGive"`. */ -export function usePrepareIHooksBeforeReveal( +export function usePrepareBountyAfterGive( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'beforeReveal', + abi: bountyABI, + functionName: 'afterGive', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeShoot"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterMove"`. */ -export function usePrepareIHooksBeforeShoot( +export function usePrepareBountyAfterMove( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'beforeShoot', + abi: bountyABI, + functionName: 'afterMove', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeUpgrade"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterReveal"`. */ -export function usePrepareIHooksBeforeUpgrade( +export function usePrepareBountyAfterReveal( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'beforeUpgrade', + abi: bountyABI, + functionName: 'afterReveal', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeVote"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterShoot"`. */ -export function usePrepareIHooksBeforeVote( +export function usePrepareBountyAfterShoot( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: iHooksABI, - functionName: 'beforeVote', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__. - */ -export function useIMulticall3Read< - TFunctionName extends string, - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' - > = {} as any, -) { - return useContractRead({ - abi: iMulticall3ABI, + abi: bountyABI, + functionName: 'afterShoot', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getBasefee"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterUpgrade"`. */ -export function useIMulticall3GetBasefee< - TFunctionName extends 'getBasefee', - TSelectData = ReadContractResult, ->( +export function usePrepareBountyAfterUpgrade( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { - return useContractRead({ - abi: iMulticall3ABI, - functionName: 'getBasefee', + return usePrepareContractWrite({ + abi: bountyABI, + functionName: 'afterUpgrade', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getBlockHash"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"afterVote"`. */ -export function useIMulticall3GetBlockHash< - TFunctionName extends 'getBlockHash', - TSelectData = ReadContractResult, ->( +export function usePrepareBountyAfterVote( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { - return useContractRead({ - abi: iMulticall3ABI, - functionName: 'getBlockHash', + return usePrepareContractWrite({ + abi: bountyABI, + functionName: 'afterVote', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getBlockNumber"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeMove"`. */ -export function useIMulticall3GetBlockNumber< - TFunctionName extends 'getBlockNumber', - TSelectData = ReadContractResult, ->( +export function usePrepareBountyBeforeMove( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { - return useContractRead({ - abi: iMulticall3ABI, - functionName: 'getBlockNumber', + return usePrepareContractWrite({ + abi: bountyABI, + functionName: 'beforeMove', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getChainId"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeShoot"`. */ -export function useIMulticall3GetChainId< - TFunctionName extends 'getChainId', - TSelectData = ReadContractResult, ->( +export function usePrepareBountyBeforeShoot( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { - return useContractRead({ - abi: iMulticall3ABI, - functionName: 'getChainId', + return usePrepareContractWrite({ + abi: bountyABI, + functionName: 'beforeShoot', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getCurrentBlockCoinbase"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeUpgrade"`. */ -export function useIMulticall3GetCurrentBlockCoinbase< - TFunctionName extends 'getCurrentBlockCoinbase', - TSelectData = ReadContractResult, ->( +export function usePrepareBountyBeforeUpgrade( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { - return useContractRead({ - abi: iMulticall3ABI, - functionName: 'getCurrentBlockCoinbase', + return usePrepareContractWrite({ + abi: bountyABI, + functionName: 'beforeUpgrade', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getCurrentBlockDifficulty"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"beforeVote"`. */ -export function useIMulticall3GetCurrentBlockDifficulty< - TFunctionName extends 'getCurrentBlockDifficulty', - TSelectData = ReadContractResult, ->( +export function usePrepareBountyBeforeVote( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { - return useContractRead({ - abi: iMulticall3ABI, - functionName: 'getCurrentBlockDifficulty', + return usePrepareContractWrite({ + abi: bountyABI, + functionName: 'beforeVote', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getCurrentBlockGasLimit"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"cancel"`. */ -export function useIMulticall3GetCurrentBlockGasLimit< - TFunctionName extends 'getCurrentBlockGasLimit', - TSelectData = ReadContractResult, ->( +export function usePrepareBountyCancel( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { - return useContractRead({ - abi: iMulticall3ABI, - functionName: 'getCurrentBlockGasLimit', + return usePrepareContractWrite({ + abi: bountyABI, + functionName: 'cancel', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getCurrentBlockTimestamp"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"create"`. */ -export function useIMulticall3GetCurrentBlockTimestamp< - TFunctionName extends 'getCurrentBlockTimestamp', - TSelectData = ReadContractResult, ->( +export function usePrepareBountyCreate( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { - return useContractRead({ - abi: iMulticall3ABI, - functionName: 'getCurrentBlockTimestamp', + return usePrepareContractWrite({ + abi: bountyABI, + functionName: 'create', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getEthBalance"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link bountyABI}__ and `functionName` set to `"withdraw"`. */ -export function useIMulticall3GetEthBalance< - TFunctionName extends 'getEthBalance', - TSelectData = ReadContractResult, ->( +export function usePrepareBountyWithdraw( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { - return useContractRead({ - abi: iMulticall3ABI, - functionName: 'getEthBalance', + return usePrepareContractWrite({ + abi: bountyABI, + functionName: 'withdraw', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getLastBlockHash"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link bountyABI}__. */ -export function useIMulticall3GetLastBlockHash< - TFunctionName extends 'getLastBlockHash', - TSelectData = ReadContractResult, ->( +export function useBountyEvent( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' + UseContractEventConfig, + 'abi' > = {} as any, ) { - return useContractRead({ - abi: iMulticall3ABI, - functionName: 'getLastBlockHash', + return useContractEvent({ + abi: bountyABI, ...config, - } as UseContractReadConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link bountyABI}__ and `eventName` set to `"BountyHookCreated"`. */ -export function useIMulticall3Write< - TFunctionName extends string, - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iMulticall3ABI, - string - >['request']['abi'], - TFunctionName, - TMode - > - : UseContractWriteConfig & { - abi?: never - } = {} as any, +export function useBountyBountyHookCreatedEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'eventName' + > = {} as any, ) { - return useContractWrite({ - abi: iMulticall3ABI, + return useContractEvent({ + abi: bountyABI, + eventName: 'BountyHookCreated', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"aggregate"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link bountyABI}__ and `eventName` set to `"BountyPosted"`. */ -export function useIMulticall3Aggregate< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iMulticall3ABI, - 'aggregate' - >['request']['abi'], - 'aggregate', - TMode - > & { functionName?: 'aggregate' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'aggregate' - } = {} as any, +export function useBountyBountyPostedEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'eventName' + > = {} as any, ) { - return useContractWrite({ - abi: iMulticall3ABI, - functionName: 'aggregate', + return useContractEvent({ + abi: bountyABI, + eventName: 'BountyPosted', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"aggregate3"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link bountyABI}__ and `eventName` set to `"BountyWon"`. */ -export function useIMulticall3Aggregate3< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iMulticall3ABI, - 'aggregate3' - >['request']['abi'], - 'aggregate3', - TMode - > & { functionName?: 'aggregate3' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'aggregate3' - } = {} as any, +export function useBountyBountyWonEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'eventName' + > = {} as any, ) { - return useContractWrite({ - abi: iMulticall3ABI, - functionName: 'aggregate3', + return useContractEvent({ + abi: bountyABI, + eventName: 'BountyWon', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"aggregate3Value"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link bountyABI}__ and `eventName` set to `"Withdraw"`. */ -export function useIMulticall3Aggregate3Value< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iMulticall3ABI, - 'aggregate3Value' - >['request']['abi'], - 'aggregate3Value', - TMode - > & { functionName?: 'aggregate3Value' } - : UseContractWriteConfig< - typeof iMulticall3ABI, - 'aggregate3Value', - TMode - > & { - abi?: never - functionName?: 'aggregate3Value' - } = {} as any, +export function useBountyWithdrawEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'eventName' + > = {} as any, ) { - return useContractWrite({ - abi: iMulticall3ABI, - functionName: 'aggregate3Value', + return useContractEvent({ + abi: bountyABI, + eventName: 'Withdraw', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"blockAndAggregate"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__. */ -export function useIMulticall3BlockAndAggregate< - TMode extends WriteContractMode = undefined, +export function useDefaultEmptyHooksRead< + TFunctionName extends string, + TSelectData = ReadContractResult, >( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iMulticall3ABI, - 'blockAndAggregate' - >['request']['abi'], - 'blockAndAggregate', - TMode - > & { functionName?: 'blockAndAggregate' } - : UseContractWriteConfig< - typeof iMulticall3ABI, - 'blockAndAggregate', - TMode - > & { - abi?: never - functionName?: 'blockAndAggregate' - } = {} as any, + config: Omit< + UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >, + 'abi' + > = {} as any, +) { + return useContractRead({ + abi: defaultEmptyHooksABI, + ...config, + } as UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >) +} + +/** + * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterClaim"`. + */ +export function useDefaultEmptyHooksAfterClaim< + TFunctionName extends 'afterClaim', + TSelectData = ReadContractResult, +>( + config: Omit< + UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >, + 'abi' | 'functionName' + > = {} as any, ) { - return useContractWrite({ - abi: iMulticall3ABI, - functionName: 'blockAndAggregate', + return useContractRead({ + abi: defaultEmptyHooksABI, + functionName: 'afterClaim', ...config, - } as any) + } as UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"tryAggregate"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterDelegate"`. */ -export function useIMulticall3TryAggregate< - TMode extends WriteContractMode = undefined, +export function useDefaultEmptyHooksAfterDelegate< + TFunctionName extends 'afterDelegate', + TSelectData = ReadContractResult, >( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iMulticall3ABI, - 'tryAggregate' - >['request']['abi'], - 'tryAggregate', - TMode - > & { functionName?: 'tryAggregate' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'tryAggregate' - } = {} as any, + config: Omit< + UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >, + 'abi' | 'functionName' + > = {} as any, ) { - return useContractWrite({ - abi: iMulticall3ABI, - functionName: 'tryAggregate', + return useContractRead({ + abi: defaultEmptyHooksABI, + functionName: 'afterDelegate', ...config, - } as any) + } as UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"tryBlockAndAggregate"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterDrip"`. */ -export function useIMulticall3TryBlockAndAggregate< - TMode extends WriteContractMode = undefined, +export function useDefaultEmptyHooksAfterDrip< + TFunctionName extends 'afterDrip', + TSelectData = ReadContractResult, >( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iMulticall3ABI, - 'tryBlockAndAggregate' - >['request']['abi'], - 'tryBlockAndAggregate', - TMode - > & { functionName?: 'tryBlockAndAggregate' } - : UseContractWriteConfig< - typeof iMulticall3ABI, - 'tryBlockAndAggregate', - TMode - > & { - abi?: never - functionName?: 'tryBlockAndAggregate' - } = {} as any, + config: Omit< + UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >, + 'abi' | 'functionName' + > = {} as any, ) { - return useContractWrite( - { - abi: iMulticall3ABI, - functionName: 'tryBlockAndAggregate', - ...config, - } as any, - ) + return useContractRead({ + abi: defaultEmptyHooksABI, + functionName: 'afterDrip', + ...config, + } as UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterJoin"`. */ -export function usePrepareIMulticall3Write( +export function useDefaultEmptyHooksAfterJoin< + TFunctionName extends 'afterJoin', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' + UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >, + 'abi' | 'functionName' > = {} as any, ) { - return usePrepareContractWrite({ - abi: iMulticall3ABI, + return useContractRead({ + abi: defaultEmptyHooksABI, + functionName: 'afterJoin', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"aggregate"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeClaim"`. */ -export function usePrepareIMulticall3Aggregate( +export function useDefaultEmptyHooksBeforeClaim< + TFunctionName extends 'beforeClaim', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, + UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >, 'abi' | 'functionName' > = {} as any, ) { - return usePrepareContractWrite({ - abi: iMulticall3ABI, - functionName: 'aggregate', + return useContractRead({ + abi: defaultEmptyHooksABI, + functionName: 'beforeClaim', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"aggregate3"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeDelegate"`. */ -export function usePrepareIMulticall3Aggregate3( +export function useDefaultEmptyHooksBeforeDelegate< + TFunctionName extends 'beforeDelegate', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, + UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >, 'abi' | 'functionName' > = {} as any, ) { - return usePrepareContractWrite({ - abi: iMulticall3ABI, - functionName: 'aggregate3', + return useContractRead({ + abi: defaultEmptyHooksABI, + functionName: 'beforeDelegate', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"aggregate3Value"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeDrip"`. */ -export function usePrepareIMulticall3Aggregate3Value( +export function useDefaultEmptyHooksBeforeDrip< + TFunctionName extends 'beforeDrip', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, + UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >, 'abi' | 'functionName' > = {} as any, ) { - return usePrepareContractWrite({ - abi: iMulticall3ABI, - functionName: 'aggregate3Value', + return useContractRead({ + abi: defaultEmptyHooksABI, + functionName: 'beforeDrip', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"blockAndAggregate"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeGive"`. */ -export function usePrepareIMulticall3BlockAndAggregate( +export function useDefaultEmptyHooksBeforeGive< + TFunctionName extends 'beforeGive', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, + UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >, 'abi' | 'functionName' > = {} as any, ) { - return usePrepareContractWrite({ - abi: iMulticall3ABI, - functionName: 'blockAndAggregate', + return useContractRead({ + abi: defaultEmptyHooksABI, + functionName: 'beforeGive', ...config, - } as UsePrepareContractWriteConfig< - typeof iMulticall3ABI, - 'blockAndAggregate' + } as UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"tryAggregate"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeJoin"`. */ -export function usePrepareIMulticall3TryAggregate( +export function useDefaultEmptyHooksBeforeJoin< + TFunctionName extends 'beforeJoin', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, + UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >, 'abi' | 'functionName' > = {} as any, ) { - return usePrepareContractWrite({ - abi: iMulticall3ABI, - functionName: 'tryAggregate', + return useContractRead({ + abi: defaultEmptyHooksABI, + functionName: 'beforeJoin', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"tryBlockAndAggregate"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeReveal"`. */ -export function usePrepareIMulticall3TryBlockAndAggregate( +export function useDefaultEmptyHooksBeforeReveal< + TFunctionName extends 'beforeReveal', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig< - typeof iMulticall3ABI, - 'tryBlockAndAggregate' + UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData >, 'abi' | 'functionName' > = {} as any, ) { - return usePrepareContractWrite({ - abi: iMulticall3ABI, - functionName: 'tryBlockAndAggregate', + return useContractRead({ + abi: defaultEmptyHooksABI, + functionName: 'beforeReveal', ...config, - } as UsePrepareContractWriteConfig< - typeof iMulticall3ABI, - 'tryBlockAndAggregate' + } as UseContractReadConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TSelectData >) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__. */ -export function useITankGameWrite< +export function useDefaultEmptyHooksWrite< TFunctionName extends string, TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof iTankGameAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iTankGameABI, + typeof defaultEmptyHooksABI, string >['request']['abi'], TFunctionName, TMode - > & { address?: Address; chainId?: TChainId } - : UseContractWriteConfig & { + > + : UseContractWriteConfig< + typeof defaultEmptyHooksABI, + TFunctionName, + TMode + > & { abi?: never - address?: never - chainId?: TChainId } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + return useContractWrite({ + abi: defaultEmptyHooksABI, ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"addHooks"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterGive"`. */ -export function useITankGameAddHooks< +export function useDefaultEmptyHooksAfterGive< TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof iTankGameAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iTankGameABI, - 'addHooks' + typeof defaultEmptyHooksABI, + 'afterGive' >['request']['abi'], - 'addHooks', + 'afterGive', TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'addHooks' } - : UseContractWriteConfig & { + > & { functionName?: 'afterGive' } + : UseContractWriteConfig< + typeof defaultEmptyHooksABI, + 'afterGive', + TMode + > & { abi?: never - address?: never - chainId?: TChainId - functionName?: 'addHooks' + functionName?: 'afterGive' } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'addHooks', + return useContractWrite({ + abi: defaultEmptyHooksABI, + functionName: 'afterGive', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"claim"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterMove"`. */ -export function useITankGameClaim< +export function useDefaultEmptyHooksAfterMove< TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof iTankGameAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iTankGameABI, - 'claim' + typeof defaultEmptyHooksABI, + 'afterMove' >['request']['abi'], - 'claim', + 'afterMove', TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'claim' } - : UseContractWriteConfig & { + > & { functionName?: 'afterMove' } + : UseContractWriteConfig< + typeof defaultEmptyHooksABI, + 'afterMove', + TMode + > & { abi?: never - address?: never - chainId?: TChainId - functionName?: 'claim' + functionName?: 'afterMove' } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'claim', + return useContractWrite({ + abi: defaultEmptyHooksABI, + functionName: 'afterMove', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"delegate"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterReveal"`. */ -export function useITankGameDelegate< +export function useDefaultEmptyHooksAfterReveal< TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof iTankGameAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iTankGameABI, - 'delegate' + typeof defaultEmptyHooksABI, + 'afterReveal' >['request']['abi'], - 'delegate', + 'afterReveal', TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'delegate' } - : UseContractWriteConfig & { + > & { functionName?: 'afterReveal' } + : UseContractWriteConfig< + typeof defaultEmptyHooksABI, + 'afterReveal', + TMode + > & { abi?: never - address?: never - chainId?: TChainId - functionName?: 'delegate' + functionName?: 'afterReveal' } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'delegate', + return useContractWrite({ + abi: defaultEmptyHooksABI, + functionName: 'afterReveal', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"drip"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterShoot"`. */ -export function useITankGameDrip< +export function useDefaultEmptyHooksAfterShoot< TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof iTankGameAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iTankGameABI, - 'drip' + typeof defaultEmptyHooksABI, + 'afterShoot' >['request']['abi'], - 'drip', + 'afterShoot', TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'drip' } - : UseContractWriteConfig & { + > & { functionName?: 'afterShoot' } + : UseContractWriteConfig< + typeof defaultEmptyHooksABI, + 'afterShoot', + TMode + > & { abi?: never - address?: never - chainId?: TChainId - functionName?: 'drip' + functionName?: 'afterShoot' } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'drip', + return useContractWrite({ + abi: defaultEmptyHooksABI, + functionName: 'afterShoot', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"forceAddDefaultHook"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterUpgrade"`. */ -export function useITankGameForceAddDefaultHook< +export function useDefaultEmptyHooksAfterUpgrade< TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof iTankGameAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iTankGameABI, - 'forceAddDefaultHook' + typeof defaultEmptyHooksABI, + 'afterUpgrade' >['request']['abi'], - 'forceAddDefaultHook', + 'afterUpgrade', + TMode + > & { functionName?: 'afterUpgrade' } + : UseContractWriteConfig< + typeof defaultEmptyHooksABI, + 'afterUpgrade', TMode > & { - address?: Address - chainId?: TChainId - functionName?: 'forceAddDefaultHook' - } + abi?: never + functionName?: 'afterUpgrade' + } = {} as any, +) { + return useContractWrite({ + abi: defaultEmptyHooksABI, + functionName: 'afterUpgrade', + ...config, + } as any) +} + +/** + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterVote"`. + */ +export function useDefaultEmptyHooksAfterVote< + TMode extends WriteContractMode = undefined, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof defaultEmptyHooksABI, + 'afterVote' + >['request']['abi'], + 'afterVote', + TMode + > & { functionName?: 'afterVote' } : UseContractWriteConfig< - typeof iTankGameABI, - 'forceAddDefaultHook', + typeof defaultEmptyHooksABI, + 'afterVote', TMode > & { abi?: never - address?: never - chainId?: TChainId - functionName?: 'forceAddDefaultHook' + functionName?: 'afterVote' } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'forceAddDefaultHook', + return useContractWrite({ + abi: defaultEmptyHooksABI, + functionName: 'afterVote', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"give"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeMove"`. */ -export function useITankGameGive< +export function useDefaultEmptyHooksBeforeMove< TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof iTankGameAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iTankGameABI, - 'give' + typeof defaultEmptyHooksABI, + 'beforeMove' >['request']['abi'], - 'give', + 'beforeMove', TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'give' } - : UseContractWriteConfig & { + > & { functionName?: 'beforeMove' } + : UseContractWriteConfig< + typeof defaultEmptyHooksABI, + 'beforeMove', + TMode + > & { abi?: never - address?: never - chainId?: TChainId - functionName?: 'give' + functionName?: 'beforeMove' } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'give', + return useContractWrite({ + abi: defaultEmptyHooksABI, + functionName: 'beforeMove', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"initialize"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeShoot"`. */ -export function useITankGameInitialize< +export function useDefaultEmptyHooksBeforeShoot< TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof iTankGameAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iTankGameABI, - 'initialize' + typeof defaultEmptyHooksABI, + 'beforeShoot' >['request']['abi'], - 'initialize', + 'beforeShoot', TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'initialize' } - : UseContractWriteConfig & { + > & { functionName?: 'beforeShoot' } + : UseContractWriteConfig< + typeof defaultEmptyHooksABI, + 'beforeShoot', + TMode + > & { abi?: never - address?: never - chainId?: TChainId - functionName?: 'initialize' + functionName?: 'beforeShoot' } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'initialize', + return useContractWrite({ + abi: defaultEmptyHooksABI, + functionName: 'beforeShoot', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"join"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeUpgrade"`. */ -export function useITankGameJoin< +export function useDefaultEmptyHooksBeforeUpgrade< TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof iTankGameAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iTankGameABI, - 'join' + typeof defaultEmptyHooksABI, + 'beforeUpgrade' >['request']['abi'], - 'join', + 'beforeUpgrade', TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'join' } - : UseContractWriteConfig & { + > & { functionName?: 'beforeUpgrade' } + : UseContractWriteConfig< + typeof defaultEmptyHooksABI, + 'beforeUpgrade', + TMode + > & { abi?: never - address?: never - chainId?: TChainId - functionName?: 'join' + functionName?: 'beforeUpgrade' } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'join', + return useContractWrite({ + abi: defaultEmptyHooksABI, + functionName: 'beforeUpgrade', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"move"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeVote"`. */ -export function useITankGameMove< +export function useDefaultEmptyHooksBeforeVote< TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof iTankGameAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iTankGameABI, - 'move' + typeof defaultEmptyHooksABI, + 'beforeVote' >['request']['abi'], - 'move', + 'beforeVote', TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'move' } - : UseContractWriteConfig & { + > & { functionName?: 'beforeVote' } + : UseContractWriteConfig< + typeof defaultEmptyHooksABI, + 'beforeVote', + TMode + > & { abi?: never - address?: never - chainId?: TChainId - functionName?: 'move' + functionName?: 'beforeVote' } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'move', + return useContractWrite({ + abi: defaultEmptyHooksABI, + functionName: 'beforeVote', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"reveal"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__. + */ +export function usePrepareDefaultEmptyHooksWrite( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' + > = {} as any, +) { + return usePrepareContractWrite({ + abi: defaultEmptyHooksABI, + ...config, + } as UsePrepareContractWriteConfig< + typeof defaultEmptyHooksABI, + TFunctionName + >) +} + +/** + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterGive"`. + */ +export function usePrepareDefaultEmptyHooksAfterGive( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, +) { + return usePrepareContractWrite({ + abi: defaultEmptyHooksABI, + functionName: 'afterGive', + ...config, + } as UsePrepareContractWriteConfig) +} + +/** + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterMove"`. + */ +export function usePrepareDefaultEmptyHooksAfterMove( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, +) { + return usePrepareContractWrite({ + abi: defaultEmptyHooksABI, + functionName: 'afterMove', + ...config, + } as UsePrepareContractWriteConfig) +} + +/** + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterReveal"`. + */ +export function usePrepareDefaultEmptyHooksAfterReveal( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, +) { + return usePrepareContractWrite({ + abi: defaultEmptyHooksABI, + functionName: 'afterReveal', + ...config, + } as UsePrepareContractWriteConfig< + typeof defaultEmptyHooksABI, + 'afterReveal' + >) +} + +/** + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterShoot"`. + */ +export function usePrepareDefaultEmptyHooksAfterShoot( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, +) { + return usePrepareContractWrite({ + abi: defaultEmptyHooksABI, + functionName: 'afterShoot', + ...config, + } as UsePrepareContractWriteConfig) +} + +/** + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterUpgrade"`. */ -export function useITankGameReveal< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof iTankGameAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iTankGameABI, - 'reveal' - >['request']['abi'], - 'reveal', - TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'reveal' } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'reveal' - } = {} as any, +export function usePrepareDefaultEmptyHooksAfterUpgrade( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'reveal', + return usePrepareContractWrite({ + abi: defaultEmptyHooksABI, + functionName: 'afterUpgrade', ...config, - } as any) + } as UsePrepareContractWriteConfig< + typeof defaultEmptyHooksABI, + 'afterUpgrade' + >) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"shoot"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"afterVote"`. */ -export function useITankGameShoot< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof iTankGameAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iTankGameABI, - 'shoot' - >['request']['abi'], - 'shoot', - TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'shoot' } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'shoot' - } = {} as any, +export function usePrepareDefaultEmptyHooksAfterVote( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'shoot', + return usePrepareContractWrite({ + abi: defaultEmptyHooksABI, + functionName: 'afterVote', ...config, - } as any) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"upgrade"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeMove"`. */ -export function useITankGameUpgrade< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof iTankGameAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iTankGameABI, - 'upgrade' - >['request']['abi'], - 'upgrade', - TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'upgrade' } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'upgrade' - } = {} as any, +export function usePrepareDefaultEmptyHooksBeforeMove( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'upgrade', + return usePrepareContractWrite({ + abi: defaultEmptyHooksABI, + functionName: 'beforeMove', ...config, - } as any) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"vote"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeShoot"`. */ -export function useITankGameVote< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof iTankGameAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iTankGameABI, - 'vote' - >['request']['abi'], - 'vote', - TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'vote' } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'vote' - } = {} as any, +export function usePrepareDefaultEmptyHooksBeforeShoot( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'vote', + return usePrepareContractWrite({ + abi: defaultEmptyHooksABI, + functionName: 'beforeShoot', ...config, - } as any) + } as UsePrepareContractWriteConfig< + typeof defaultEmptyHooksABI, + 'beforeShoot' + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeUpgrade"`. */ -export function usePrepareITankGameWrite( +export function usePrepareDefaultEmptyHooksBeforeUpgrade( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId return usePrepareContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + abi: defaultEmptyHooksABI, + functionName: 'beforeUpgrade', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig< + typeof defaultEmptyHooksABI, + 'beforeUpgrade' + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"addHooks"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link defaultEmptyHooksABI}__ and `functionName` set to `"beforeVote"`. */ -export function usePrepareITankGameAddHooks( +export function usePrepareDefaultEmptyHooksBeforeVote( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId return usePrepareContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'addHooks', + abi: defaultEmptyHooksABI, + functionName: 'beforeVote', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"claim"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__. * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) * - */ -export function usePrepareITankGameClaim( +export function useGameViewRead< + TFunctionName extends string, + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'address' + > & { chainId?: keyof typeof gameViewAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'claim', + return useContractRead({ + abi: gameViewABI, + address: gameViewAddress[chainId as keyof typeof gameViewAddress], ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"delegate"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getAllHearts"`. * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) * - */ -export function usePrepareITankGameDelegate( +export function useGameViewGetAllHearts< + TFunctionName extends 'getAllHearts', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, + UseContractReadConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + > & { chainId?: keyof typeof gameViewAddress } = {} as any, ) { const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'delegate', + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractRead({ + abi: gameViewABI, + address: gameViewAddress[chainId as keyof typeof gameViewAddress], + functionName: 'getAllHearts', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"drip"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getAllTanks"`. * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) * - */ -export function usePrepareITankGameDrip( +export function useGameViewGetAllTanks< + TFunctionName extends 'getAllTanks', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, + UseContractReadConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + > & { chainId?: keyof typeof gameViewAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'drip', + return useContractRead({ + abi: gameViewABI, + address: gameViewAddress[chainId as keyof typeof gameViewAddress], + functionName: 'getAllTanks', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"forceAddDefaultHook"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getBoard"`. * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) * - */ -export function usePrepareITankGameForceAddDefaultHook( +export function useGameViewGetBoard< + TFunctionName extends 'getBoard', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, + UseContractReadConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + > & { chainId?: keyof typeof gameViewAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'forceAddDefaultHook', + return useContractRead({ + abi: gameViewABI, + address: gameViewAddress[chainId as keyof typeof gameViewAddress], + functionName: 'getBoard', ...config, - } as UsePrepareContractWriteConfig< - typeof iTankGameABI, - 'forceAddDefaultHook' - >) + } as UseContractReadConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"give"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getEpoch"`. * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) * - */ -export function usePrepareITankGameGive( +export function useGameViewGetEpoch< + TFunctionName extends 'getEpoch', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, + UseContractReadConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + > & { chainId?: keyof typeof gameViewAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'give', + return useContractRead({ + abi: gameViewABI, + address: gameViewAddress[chainId as keyof typeof gameViewAddress], + functionName: 'getEpoch', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"initialize"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getGameEpoch"`. * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) * - */ -export function usePrepareITankGameInitialize( +export function useGameViewGetGameEpoch< + TFunctionName extends 'getGameEpoch', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, + UseContractReadConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + > & { chainId?: keyof typeof gameViewAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'initialize', + return useContractRead({ + abi: gameViewABI, + address: gameViewAddress[chainId as keyof typeof gameViewAddress], + functionName: 'getGameEpoch', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"join"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getLastDrip"`. * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) * - */ -export function usePrepareITankGameJoin( +export function useGameViewGetLastDrip< + TFunctionName extends 'getLastDrip', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, + UseContractReadConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + > & { chainId?: keyof typeof gameViewAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'join', + return useContractRead({ + abi: gameViewABI, + address: gameViewAddress[chainId as keyof typeof gameViewAddress], + functionName: 'getLastDrip', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"move"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getPlayerCount"`. * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) * - */ -export function usePrepareITankGameMove( +export function useGameViewGetPlayerCount< + TFunctionName extends 'getPlayerCount', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, + UseContractReadConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + > & { chainId?: keyof typeof gameViewAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'move', + return useContractRead({ + abi: gameViewABI, + address: gameViewAddress[chainId as keyof typeof gameViewAddress], + functionName: 'getPlayerCount', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"reveal"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getSettings"`. * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) * - */ -export function usePrepareITankGameReveal( +export function useGameViewGetSettings< + TFunctionName extends 'getSettings', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, + UseContractReadConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + > & { chainId?: keyof typeof gameViewAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'reveal', + return useContractRead({ + abi: gameViewABI, + address: gameViewAddress[chainId as keyof typeof gameViewAddress], + functionName: 'getSettings', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"shoot"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getState"`. * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) * - */ -export function usePrepareITankGameShoot( +export function useGameViewGetState< + TFunctionName extends 'getState', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, + UseContractReadConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + > & { chainId?: keyof typeof gameViewAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'shoot', + return useContractRead({ + abi: gameViewABI, + address: gameViewAddress[chainId as keyof typeof gameViewAddress], + functionName: 'getState', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"upgrade"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getTank"`. * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) * - */ -export function usePrepareITankGameUpgrade( +export function useGameViewGetTank< + TFunctionName extends 'getTank', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, + UseContractReadConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + > & { chainId?: keyof typeof gameViewAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'upgrade', + return useContractRead({ + abi: gameViewABI, + address: gameViewAddress[chainId as keyof typeof gameViewAddress], + functionName: 'getTank', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"vote"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"getUpgradeCost"`. * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) * - */ -export function usePrepareITankGameVote( +export function useGameViewGetUpgradeCost< + TFunctionName extends 'getUpgradeCost', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, + UseContractReadConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + > & { chainId?: keyof typeof gameViewAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - functionName: 'vote', + return useContractRead({ + abi: gameViewABI, + address: gameViewAddress[chainId as keyof typeof gameViewAddress], + functionName: 'getUpgradeCost', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link gameViewABI}__ and `functionName` set to `"isAuth"`. * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0xE19866944E2CD0FfaE4e35d168149b9B934eA471) * - */ -export function useITankGameEvent( +export function useGameViewIsAuth< + TFunctionName extends 'isAuth', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof gameViewAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + return useContractRead({ + abi: gameViewABI, + address: gameViewAddress[chainId as keyof typeof gameViewAddress], + functionName: 'isAuth', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"BountyCompleted"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__. */ -export function useITankGameBountyCompletedEvent( +export function useHexBoardRead< + TFunctionName extends string, + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'BountyCompleted', + return useContractRead({ + abi: hexBoardABI, ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Claim"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"boardSize"`. */ -export function useITankGameClaimEvent( +export function useHexBoardBoardSize< + TFunctionName extends 'boardSize', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'Claim', + return useContractRead({ + abi: hexBoardABI, + functionName: 'boardSize', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Commit"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"getDistance"`. */ -export function useITankGameCommitEvent( +export function useHexBoardGetDistance< + TFunctionName extends 'getDistance', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'Commit', + return useContractRead({ + abi: hexBoardABI, + functionName: 'getDistance', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Curse"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"getDistanceTankToPoint"`. */ -export function useITankGameCurseEvent( +export function useHexBoardGetDistanceTankToPoint< + TFunctionName extends 'getDistanceTankToPoint', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'Curse', + return useContractRead({ + abi: hexBoardABI, + functionName: 'getDistanceTankToPoint', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Death"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"getDistanceTanks"`. */ -export function useITankGameDeathEvent( +export function useHexBoardGetDistanceTanks< + TFunctionName extends 'getDistanceTanks', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'Death', + return useContractRead({ + abi: hexBoardABI, + functionName: 'getDistanceTanks', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Delegate"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"getEmptyTile"`. */ -export function useITankGameDelegateEvent( +export function useHexBoardGetEmptyTile< + TFunctionName extends 'getEmptyTile', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'Delegate', + return useContractRead({ + abi: hexBoardABI, + functionName: 'getEmptyTile', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Drip"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"getHeartAtPosition"`. */ -export function useITankGameDripEvent( +export function useHexBoardGetHeartAtPosition< + TFunctionName extends 'getHeartAtPosition', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'Drip', + return useContractRead({ + abi: hexBoardABI, + functionName: 'getHeartAtPosition', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"GameInit"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"getPerimeterForRadius"`. */ -export function useITankGameGameInitEvent( +export function useHexBoardGetPerimeterForRadius< + TFunctionName extends 'getPerimeterForRadius', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'GameInit', + return useContractRead({ + abi: hexBoardABI, + functionName: 'getPerimeterForRadius', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"GameOver"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"getTankPosition"`. */ -export function useITankGameGameOverEvent( +export function useHexBoardGetTankPosition< + TFunctionName extends 'getTankPosition', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, -) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'GameOver', + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, +) { + return useContractRead({ + abi: hexBoardABI, + functionName: 'getTankPosition', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"GameStarted"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"getTile"`. */ -export function useITankGameGameStartedEvent( +export function useHexBoardGetTile< + TFunctionName extends 'getTile', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'GameStarted', + return useContractRead({ + abi: hexBoardABI, + functionName: 'getTile', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Give"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"getTotalTiles"`. */ -export function useITankGameGiveEvent( +export function useHexBoardGetTotalTiles< + TFunctionName extends 'getTotalTiles', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'Give', + return useContractRead({ + abi: hexBoardABI, + functionName: 'getTotalTiles', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"HooksAdded"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"heartsOnBoard"`. */ -export function useITankGameHooksAddedEvent( +export function useHexBoardHeartsOnBoard< + TFunctionName extends 'heartsOnBoard', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'HooksAdded', + return useContractRead({ + abi: hexBoardABI, + functionName: 'heartsOnBoard', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Move"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"isValidPoint"`. */ -export function useITankGameMoveEvent( +export function useHexBoardIsValidPoint< + TFunctionName extends 'isValidPoint', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'Move', + return useContractRead({ + abi: hexBoardABI, + functionName: 'isValidPoint', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"PlayerJoined"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"pointToIndex"`. */ -export function useITankGamePlayerJoinedEvent( +export function useHexBoardPointToIndex< + TFunctionName extends 'pointToIndex', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'PlayerJoined', + return useContractRead({ + abi: hexBoardABI, + functionName: 'pointToIndex', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"PrizeIncrease"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"randomPoint"`. */ -export function useITankGamePrizeIncreaseEvent( +export function useHexBoardRandomPoint< + TFunctionName extends 'randomPoint', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'PrizeIncrease', + return useContractRead({ + abi: hexBoardABI, + functionName: 'randomPoint', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Reveal"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"tankToPosition"`. */ -export function useITankGameRevealEvent( +export function useHexBoardTankToPosition< + TFunctionName extends 'tankToPosition', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'Reveal', + return useContractRead({ + abi: hexBoardABI, + functionName: 'tankToPosition', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Revive"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"tanksOnBoard"`. */ -export function useITankGameReviveEvent( +export function useHexBoardTanksOnBoard< + TFunctionName extends 'tanksOnBoard', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'Revive', + return useContractRead({ + abi: hexBoardABI, + functionName: 'tanksOnBoard', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Shoot"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link hexBoardABI}__. */ -export function useITankGameShootEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, +export function useHexBoardWrite< + TFunctionName extends string, + TMode extends WriteContractMode = undefined, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof hexBoardABI, + string + >['request']['abi'], + TFunctionName, + TMode + > + : UseContractWriteConfig & { + abi?: never + } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'Shoot', + return useContractWrite({ + abi: hexBoardABI, ...config, - } as UseContractEventConfig) + } as any) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"SpawnHeart"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"setTile"`. */ -export function useITankGameSpawnHeartEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, +export function useHexBoardSetTile( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof hexBoardABI, + 'setTile' + >['request']['abi'], + 'setTile', + TMode + > & { functionName?: 'setTile' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'setTile' + } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'SpawnHeart', + return useContractWrite({ + abi: hexBoardABI, + functionName: 'setTile', ...config, - } as UseContractEventConfig) + } as any) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Upgrade"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link hexBoardABI}__. */ -export function useITankGameUpgradeEvent( +export function usePrepareHexBoardWrite( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UsePrepareContractWriteConfig, + 'abi' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'Upgrade', + return usePrepareContractWrite({ + abi: hexBoardABI, ...config, - } as UseContractEventConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Vote"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link hexBoardABI}__ and `functionName` set to `"setTile"`. */ -export function useITankGameVoteEvent( +export function usePrepareHexBoardSetTile( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof iTankGameAddress } = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: iTankGameABI, - address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], - eventName: 'Vote', + return usePrepareContractWrite({ + abi: hexBoardABI, + functionName: 'setTile', ...config, - } as UseContractEventConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTreatyABI}__. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link hookFactoryABI}__. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2833Ee23DdAFa959D5ca459c6A64df2164B367b3) + * - */ -export function useITreatyWrite< +export function useHookFactoryWrite< TFunctionName extends string, TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof hookFactoryAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< - PrepareWriteContractResult['request']['abi'], + PrepareWriteContractResult< + typeof hookFactoryABI, + string + >['request']['abi'], TFunctionName, TMode - > - : UseContractWriteConfig & { + > & { address?: Address; chainId?: TChainId } + : UseContractWriteConfig & { abi?: never + address?: never + chainId?: TChainId } = {} as any, ) { - return useContractWrite({ - abi: iTreatyABI, + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: hookFactoryABI, + address: hookFactoryAddress[chainId as keyof typeof hookFactoryAddress], ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTreatyABI}__ and `functionName` set to `"accept"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link hookFactoryABI}__ and `functionName` set to `"createHook"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2833Ee23DdAFa959D5ca459c6A64df2164B367b3) + * - */ -export function useITreatyAccept( +export function useHookFactoryCreateHook< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof hookFactoryAddress, +>( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof iTreatyABI, - 'accept' + typeof hookFactoryABI, + 'createHook' >['request']['abi'], - 'accept', + 'createHook', TMode - > & { functionName?: 'accept' } - : UseContractWriteConfig & { + > & { address?: Address; chainId?: TChainId; functionName?: 'createHook' } + : UseContractWriteConfig & { abi?: never - functionName?: 'accept' + address?: never + chainId?: TChainId + functionName?: 'createHook' } = {} as any, ) { - return useContractWrite({ - abi: iTreatyABI, - functionName: 'accept', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: hookFactoryABI, + address: hookFactoryAddress[chainId as keyof typeof hookFactoryAddress], + functionName: 'createHook', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTreatyABI}__ and `functionName` set to `"propose"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link hookFactoryABI}__. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2833Ee23DdAFa959D5ca459c6A64df2164B367b3) + * - */ -export function useITreatyPropose( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof iTreatyABI, - 'propose' - >['request']['abi'], - 'propose', - TMode - > & { functionName?: 'propose' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'propose' - } = {} as any, +export function usePrepareHookFactoryWrite( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'address' + > & { chainId?: keyof typeof hookFactoryAddress } = {} as any, ) { - return useContractWrite({ - abi: iTreatyABI, - functionName: 'propose', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return usePrepareContractWrite({ + abi: hookFactoryABI, + address: hookFactoryAddress[chainId as keyof typeof hookFactoryAddress], ...config, - } as any) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTreatyABI}__. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link hookFactoryABI}__ and `functionName` set to `"createHook"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2833Ee23DdAFa959D5ca459c6A64df2164B367b3) + * - */ -export function usePrepareITreatyWrite( +export function usePrepareHookFactoryCreateHook( config: Omit< - UsePrepareContractWriteConfig, - 'abi' - > = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof hookFactoryAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return usePrepareContractWrite({ - abi: iTreatyABI, + abi: hookFactoryABI, + address: hookFactoryAddress[chainId as keyof typeof hookFactoryAddress], + functionName: 'createHook', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTreatyABI}__ and `functionName` set to `"accept"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link hookFactoryABI}__. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2833Ee23DdAFa959D5ca459c6A64df2164B367b3) + * - */ -export function usePrepareITreatyAccept( +export function useHookFactoryEvent( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' + > & { chainId?: keyof typeof hookFactoryAddress } = {} as any, ) { - return usePrepareContractWrite({ - abi: iTreatyABI, - functionName: 'accept', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractEvent({ + abi: hookFactoryABI, + address: hookFactoryAddress[chainId as keyof typeof hookFactoryAddress], ...config, - } as UsePrepareContractWriteConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTreatyABI}__ and `functionName` set to `"propose"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link hookFactoryABI}__ and `eventName` set to `"HookCreated"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2833Ee23DdAFa959D5ca459c6A64df2164B367b3) + * - */ -export function usePrepareITreatyPropose( +export function useHookFactoryHookCreatedEvent( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof hookFactoryAddress } = {} as any, ) { - return usePrepareContractWrite({ - abi: iTreatyABI, - functionName: 'propose', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractEvent({ + abi: hookFactoryABI, + address: hookFactoryAddress[chainId as keyof typeof hookFactoryAddress], + eventName: 'HookCreated', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTreatyABI}__. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__. */ -export function useITreatyEvent( +export function useIGameViewRead< + TFunctionName extends string, + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, + UseContractReadConfig, 'abi' > = {} as any, ) { - return useContractEvent({ - abi: iTreatyABI, + return useContractRead({ + abi: iGameViewABI, ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTreatyABI}__ and `eventName` set to `"AcceptedTreaty"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getAllHearts"`. */ -export function useITreatyAcceptedTreatyEvent( +export function useIGameViewGetAllHearts< + TFunctionName extends 'getAllHearts', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' + UseContractReadConfig, + 'abi' | 'functionName' > = {} as any, ) { - return useContractEvent({ - abi: iTreatyABI, - eventName: 'AcceptedTreaty', + return useContractRead({ + abi: iGameViewABI, + functionName: 'getAllHearts', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTreatyABI}__ and `eventName` set to `"ProposedTreaty"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getAllTanks"`. */ -export function useITreatyProposedTreatyEvent( +export function useIGameViewGetAllTanks< + TFunctionName extends 'getAllTanks', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' + UseContractReadConfig, + 'abi' | 'functionName' > = {} as any, ) { - return useContractEvent({ - abi: iTreatyABI, - eventName: 'ProposedTreaty', + return useContractRead({ + abi: iGameViewABI, + functionName: 'getAllTanks', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getBoard"`. */ -export function useNonAggressionRead< - TFunctionName extends string, - TSelectData = ReadContractResult, +export function useIGameViewGetBoard< + TFunctionName extends 'getBoard', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' + UseContractReadConfig, + 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: nonAggressionABI, + abi: iGameViewABI, + functionName: 'getBoard', ...config, - } as UseContractReadConfig< - typeof nonAggressionABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterClaim"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getEpoch"`. */ -export function useNonAggressionAfterClaim< - TFunctionName extends 'afterClaim', - TSelectData = ReadContractResult, +export function useIGameViewGetEpoch< + TFunctionName extends 'getEpoch', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: nonAggressionABI, - functionName: 'afterClaim', + abi: iGameViewABI, + functionName: 'getEpoch', ...config, - } as UseContractReadConfig< - typeof nonAggressionABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterDelegate"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getGameEpoch"`. */ -export function useNonAggressionAfterDelegate< - TFunctionName extends 'afterDelegate', - TSelectData = ReadContractResult, +export function useIGameViewGetGameEpoch< + TFunctionName extends 'getGameEpoch', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: nonAggressionABI, - functionName: 'afterDelegate', + abi: iGameViewABI, + functionName: 'getGameEpoch', ...config, - } as UseContractReadConfig< - typeof nonAggressionABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterDrip"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getLastDrip"`. */ -export function useNonAggressionAfterDrip< - TFunctionName extends 'afterDrip', - TSelectData = ReadContractResult, +export function useIGameViewGetLastDrip< + TFunctionName extends 'getLastDrip', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: nonAggressionABI, - functionName: 'afterDrip', + abi: iGameViewABI, + functionName: 'getLastDrip', ...config, - } as UseContractReadConfig< - typeof nonAggressionABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterJoin"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getPlayerCount"`. */ -export function useNonAggressionAfterJoin< - TFunctionName extends 'afterJoin', - TSelectData = ReadContractResult, +export function useIGameViewGetPlayerCount< + TFunctionName extends 'getPlayerCount', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: nonAggressionABI, - functionName: 'afterJoin', + abi: iGameViewABI, + functionName: 'getPlayerCount', ...config, - } as UseContractReadConfig< - typeof nonAggressionABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"allies"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getSettings"`. */ -export function useNonAggressionAllies< - TFunctionName extends 'allies', - TSelectData = ReadContractResult, +export function useIGameViewGetSettings< + TFunctionName extends 'getSettings', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: nonAggressionABI, - functionName: 'allies', + abi: iGameViewABI, + functionName: 'getSettings', ...config, - } as UseContractReadConfig< - typeof nonAggressionABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeClaim"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getState"`. */ -export function useNonAggressionBeforeClaim< - TFunctionName extends 'beforeClaim', - TSelectData = ReadContractResult, +export function useIGameViewGetState< + TFunctionName extends 'getState', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: nonAggressionABI, - functionName: 'beforeClaim', + abi: iGameViewABI, + functionName: 'getState', ...config, - } as UseContractReadConfig< - typeof nonAggressionABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeDelegate"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"getTank"`. */ -export function useNonAggressionBeforeDelegate< - TFunctionName extends 'beforeDelegate', - TSelectData = ReadContractResult, +export function useIGameViewGetTank< + TFunctionName extends 'getTank', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: nonAggressionABI, - functionName: 'beforeDelegate', + abi: iGameViewABI, + functionName: 'getTank', ...config, - } as UseContractReadConfig< - typeof nonAggressionABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeDrip"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iGameViewABI}__ and `functionName` set to `"isAuth"`. */ -export function useNonAggressionBeforeDrip< - TFunctionName extends 'beforeDrip', - TSelectData = ReadContractResult, +export function useIGameViewIsAuth< + TFunctionName extends 'isAuth', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: nonAggressionABI, - functionName: 'beforeDrip', + abi: iGameViewABI, + functionName: 'isAuth', ...config, - } as UseContractReadConfig< - typeof nonAggressionABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeGive"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__. */ -export function useNonAggressionBeforeGive< - TFunctionName extends 'beforeGive', - TSelectData = ReadContractResult, +export function useIHooksWrite< + TFunctionName extends string, + TMode extends WriteContractMode = undefined, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult['request']['abi'], + TFunctionName, + TMode + > + : UseContractWriteConfig & { + abi?: never + } = {} as any, ) { - return useContractRead({ - abi: nonAggressionABI, - functionName: 'beforeGive', + return useContractWrite({ + abi: iHooksABI, ...config, - } as UseContractReadConfig< - typeof nonAggressionABI, - TFunctionName, - TSelectData - >) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeJoin"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterClaim"`. */ -export function useNonAggressionBeforeJoin< - TFunctionName extends 'beforeJoin', - TSelectData = ReadContractResult, +export function useIHooksAfterClaim< + TMode extends WriteContractMode = undefined, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iHooksABI, + 'afterClaim' + >['request']['abi'], + 'afterClaim', + TMode + > & { functionName?: 'afterClaim' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'afterClaim' + } = {} as any, ) { - return useContractRead({ - abi: nonAggressionABI, - functionName: 'beforeJoin', + return useContractWrite({ + abi: iHooksABI, + functionName: 'afterClaim', ...config, - } as UseContractReadConfig< - typeof nonAggressionABI, - TFunctionName, - TSelectData - >) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeReveal"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterDelegate"`. */ -export function useNonAggressionBeforeReveal< - TFunctionName extends 'beforeReveal', - TSelectData = ReadContractResult, +export function useIHooksAfterDelegate< + TMode extends WriteContractMode = undefined, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iHooksABI, + 'afterDelegate' + >['request']['abi'], + 'afterDelegate', + TMode + > & { functionName?: 'afterDelegate' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'afterDelegate' + } = {} as any, ) { - return useContractRead({ - abi: nonAggressionABI, - functionName: 'beforeReveal', + return useContractWrite({ + abi: iHooksABI, + functionName: 'afterDelegate', ...config, - } as UseContractReadConfig< - typeof nonAggressionABI, - TFunctionName, - TSelectData - >) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeShoot"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterDrip"`. */ -export function useNonAggressionBeforeShoot< - TFunctionName extends 'beforeShoot', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, +export function useIHooksAfterDrip( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iHooksABI, + 'afterDrip' + >['request']['abi'], + 'afterDrip', + TMode + > & { functionName?: 'afterDrip' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'afterDrip' + } = {} as any, ) { - return useContractRead({ - abi: nonAggressionABI, - functionName: 'beforeShoot', + return useContractWrite({ + abi: iHooksABI, + functionName: 'afterDrip', ...config, - } as UseContractReadConfig< - typeof nonAggressionABI, - TFunctionName, - TSelectData - >) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"ownerTank"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterGive"`. */ -export function useNonAggressionOwnerTank< - TFunctionName extends 'ownerTank', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, +export function useIHooksAfterGive( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iHooksABI, + 'afterGive' + >['request']['abi'], + 'afterGive', + TMode + > & { functionName?: 'afterGive' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'afterGive' + } = {} as any, ) { - return useContractRead({ - abi: nonAggressionABI, - functionName: 'ownerTank', + return useContractWrite({ + abi: iHooksABI, + functionName: 'afterGive', ...config, - } as UseContractReadConfig< - typeof nonAggressionABI, - TFunctionName, - TSelectData - >) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"proposals"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterJoin"`. */ -export function useNonAggressionProposals< - TFunctionName extends 'proposals', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, +export function useIHooksAfterJoin( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iHooksABI, + 'afterJoin' + >['request']['abi'], + 'afterJoin', + TMode + > & { functionName?: 'afterJoin' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'afterJoin' + } = {} as any, ) { - return useContractRead({ - abi: nonAggressionABI, - functionName: 'proposals', + return useContractWrite({ + abi: iHooksABI, + functionName: 'afterJoin', ...config, - } as UseContractReadConfig< - typeof nonAggressionABI, - TFunctionName, - TSelectData - >) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"tankGame"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterMove"`. */ -export function useNonAggressionTankGame< - TFunctionName extends 'tankGame', - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, +export function useIHooksAfterMove( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iHooksABI, + 'afterMove' + >['request']['abi'], + 'afterMove', + TMode + > & { functionName?: 'afterMove' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'afterMove' + } = {} as any, ) { - return useContractRead({ - abi: nonAggressionABI, - functionName: 'tankGame', + return useContractWrite({ + abi: iHooksABI, + functionName: 'afterMove', ...config, - } as UseContractReadConfig< - typeof nonAggressionABI, - TFunctionName, - TSelectData - >) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"tankGameView"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterReveal"`. */ -export function useNonAggressionTankGameView< - TFunctionName extends 'tankGameView', - TSelectData = ReadContractResult, +export function useIHooksAfterReveal< + TMode extends WriteContractMode = undefined, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iHooksABI, + 'afterReveal' + >['request']['abi'], + 'afterReveal', + TMode + > & { functionName?: 'afterReveal' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'afterReveal' + } = {} as any, ) { - return useContractRead({ - abi: nonAggressionABI, - functionName: 'tankGameView', + return useContractWrite({ + abi: iHooksABI, + functionName: 'afterReveal', ...config, - } as UseContractReadConfig< - typeof nonAggressionABI, - TFunctionName, - TSelectData - >) + } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterShoot"`. */ -export function useNonAggressionWrite< - TFunctionName extends string, +export function useIHooksAfterShoot< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionABI, - string + typeof iHooksABI, + 'afterShoot' >['request']['abi'], - TFunctionName, + 'afterShoot', TMode - > - : UseContractWriteConfig & { + > & { functionName?: 'afterShoot' } + : UseContractWriteConfig & { abi?: never + functionName?: 'afterShoot' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionABI, + return useContractWrite({ + abi: iHooksABI, + functionName: 'afterShoot', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"accept"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterUpgrade"`. */ -export function useNonAggressionAccept< +export function useIHooksAfterUpgrade< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionABI, - 'accept' + typeof iHooksABI, + 'afterUpgrade' >['request']['abi'], - 'accept', + 'afterUpgrade', TMode - > & { functionName?: 'accept' } - : UseContractWriteConfig & { + > & { functionName?: 'afterUpgrade' } + : UseContractWriteConfig & { abi?: never - functionName?: 'accept' + functionName?: 'afterUpgrade' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionABI, - functionName: 'accept', + return useContractWrite({ + abi: iHooksABI, + functionName: 'afterUpgrade', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterGive"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterVote"`. */ -export function useNonAggressionAfterGive< - TMode extends WriteContractMode = undefined, ->( +export function useIHooksAfterVote( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionABI, - 'afterGive' + typeof iHooksABI, + 'afterVote' >['request']['abi'], - 'afterGive', + 'afterVote', TMode - > & { functionName?: 'afterGive' } - : UseContractWriteConfig & { + > & { functionName?: 'afterVote' } + : UseContractWriteConfig & { abi?: never - functionName?: 'afterGive' + functionName?: 'afterVote' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionABI, - functionName: 'afterGive', + return useContractWrite({ + abi: iHooksABI, + functionName: 'afterVote', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterMove"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeClaim"`. */ -export function useNonAggressionAfterMove< +export function useIHooksBeforeClaim< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionABI, - 'afterMove' + typeof iHooksABI, + 'beforeClaim' >['request']['abi'], - 'afterMove', + 'beforeClaim', TMode - > & { functionName?: 'afterMove' } - : UseContractWriteConfig & { + > & { functionName?: 'beforeClaim' } + : UseContractWriteConfig & { abi?: never - functionName?: 'afterMove' + functionName?: 'beforeClaim' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionABI, - functionName: 'afterMove', + return useContractWrite({ + abi: iHooksABI, + functionName: 'beforeClaim', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterReveal"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeDelegate"`. */ -export function useNonAggressionAfterReveal< +export function useIHooksBeforeDelegate< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionABI, - 'afterReveal' + typeof iHooksABI, + 'beforeDelegate' >['request']['abi'], - 'afterReveal', + 'beforeDelegate', TMode - > & { functionName?: 'afterReveal' } - : UseContractWriteConfig & { + > & { functionName?: 'beforeDelegate' } + : UseContractWriteConfig & { abi?: never - functionName?: 'afterReveal' + functionName?: 'beforeDelegate' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionABI, - functionName: 'afterReveal', + return useContractWrite({ + abi: iHooksABI, + functionName: 'beforeDelegate', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterShoot"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeDrip"`. */ -export function useNonAggressionAfterShoot< +export function useIHooksBeforeDrip< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionABI, - 'afterShoot' + typeof iHooksABI, + 'beforeDrip' >['request']['abi'], - 'afterShoot', + 'beforeDrip', TMode - > & { functionName?: 'afterShoot' } - : UseContractWriteConfig & { + > & { functionName?: 'beforeDrip' } + : UseContractWriteConfig & { abi?: never - functionName?: 'afterShoot' + functionName?: 'beforeDrip' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionABI, - functionName: 'afterShoot', + return useContractWrite({ + abi: iHooksABI, + functionName: 'beforeDrip', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterUpgrade"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeGive"`. */ -export function useNonAggressionAfterUpgrade< +export function useIHooksBeforeGive< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionABI, - 'afterUpgrade' + typeof iHooksABI, + 'beforeGive' >['request']['abi'], - 'afterUpgrade', + 'beforeGive', TMode - > & { functionName?: 'afterUpgrade' } - : UseContractWriteConfig & { + > & { functionName?: 'beforeGive' } + : UseContractWriteConfig & { abi?: never - functionName?: 'afterUpgrade' + functionName?: 'beforeGive' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionABI, - functionName: 'afterUpgrade', + return useContractWrite({ + abi: iHooksABI, + functionName: 'beforeGive', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterVote"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeJoin"`. */ -export function useNonAggressionAfterVote< +export function useIHooksBeforeJoin< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionABI, - 'afterVote' + typeof iHooksABI, + 'beforeJoin' >['request']['abi'], - 'afterVote', + 'beforeJoin', TMode - > & { functionName?: 'afterVote' } - : UseContractWriteConfig & { + > & { functionName?: 'beforeJoin' } + : UseContractWriteConfig & { abi?: never - functionName?: 'afterVote' + functionName?: 'beforeJoin' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionABI, - functionName: 'afterVote', + return useContractWrite({ + abi: iHooksABI, + functionName: 'beforeJoin', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeMove"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeMove"`. */ -export function useNonAggressionBeforeMove< +export function useIHooksBeforeMove< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionABI, + typeof iHooksABI, 'beforeMove' >['request']['abi'], 'beforeMove', TMode > & { functionName?: 'beforeMove' } - : UseContractWriteConfig & { + : UseContractWriteConfig & { abi?: never functionName?: 'beforeMove' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionABI, + return useContractWrite({ + abi: iHooksABI, functionName: 'beforeMove', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeUpgrade"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeReveal"`. */ -export function useNonAggressionBeforeUpgrade< +export function useIHooksBeforeReveal< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionABI, - 'beforeUpgrade' + typeof iHooksABI, + 'beforeReveal' >['request']['abi'], - 'beforeUpgrade', + 'beforeReveal', TMode - > & { functionName?: 'beforeUpgrade' } - : UseContractWriteConfig< - typeof nonAggressionABI, - 'beforeUpgrade', + > & { functionName?: 'beforeReveal' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'beforeReveal' + } = {} as any, +) { + return useContractWrite({ + abi: iHooksABI, + functionName: 'beforeReveal', + ...config, + } as any) +} + +/** + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeShoot"`. + */ +export function useIHooksBeforeShoot< + TMode extends WriteContractMode = undefined, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iHooksABI, + 'beforeShoot' + >['request']['abi'], + 'beforeShoot', TMode - > & { + > & { functionName?: 'beforeShoot' } + : UseContractWriteConfig & { abi?: never - functionName?: 'beforeUpgrade' + functionName?: 'beforeShoot' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionABI, - functionName: 'beforeUpgrade', + return useContractWrite({ + abi: iHooksABI, + functionName: 'beforeShoot', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeVote"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeUpgrade"`. */ -export function useNonAggressionBeforeVote< +export function useIHooksBeforeUpgrade< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionABI, - 'beforeVote' + typeof iHooksABI, + 'beforeUpgrade' >['request']['abi'], - 'beforeVote', + 'beforeUpgrade', TMode - > & { functionName?: 'beforeVote' } - : UseContractWriteConfig & { + > & { functionName?: 'beforeUpgrade' } + : UseContractWriteConfig & { abi?: never - functionName?: 'beforeVote' + functionName?: 'beforeUpgrade' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionABI, - functionName: 'beforeVote', + return useContractWrite({ + abi: iHooksABI, + functionName: 'beforeUpgrade', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"propose"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeVote"`. */ -export function useNonAggressionPropose< +export function useIHooksBeforeVote< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionABI, - 'propose' + typeof iHooksABI, + 'beforeVote' >['request']['abi'], - 'propose', + 'beforeVote', TMode - > & { functionName?: 'propose' } - : UseContractWriteConfig & { + > & { functionName?: 'beforeVote' } + : UseContractWriteConfig & { abi?: never - functionName?: 'propose' + functionName?: 'beforeVote' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionABI, - functionName: 'propose', + return useContractWrite({ + abi: iHooksABI, + functionName: 'beforeVote', ...config, } as any) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__. */ -export function usePrepareNonAggressionWrite( +export function usePrepareIHooksWrite( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionABI, + abi: iHooksABI, ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"accept"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterClaim"`. */ -export function usePrepareNonAggressionAccept( +export function usePrepareIHooksAfterClaim( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionABI, - functionName: 'accept', + abi: iHooksABI, + functionName: 'afterClaim', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterGive"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterDelegate"`. */ -export function usePrepareNonAggressionAfterGive( +export function usePrepareIHooksAfterDelegate( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionABI, - functionName: 'afterGive', + abi: iHooksABI, + functionName: 'afterDelegate', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterMove"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterDrip"`. */ -export function usePrepareNonAggressionAfterMove( +export function usePrepareIHooksAfterDrip( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionABI, - functionName: 'afterMove', + abi: iHooksABI, + functionName: 'afterDrip', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterReveal"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterGive"`. */ -export function usePrepareNonAggressionAfterReveal( +export function usePrepareIHooksAfterGive( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionABI, - functionName: 'afterReveal', + abi: iHooksABI, + functionName: 'afterGive', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterShoot"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterJoin"`. */ -export function usePrepareNonAggressionAfterShoot( +export function usePrepareIHooksAfterJoin( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionABI, - functionName: 'afterShoot', + abi: iHooksABI, + functionName: 'afterJoin', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterUpgrade"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterMove"`. */ -export function usePrepareNonAggressionAfterUpgrade( +export function usePrepareIHooksAfterMove( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionABI, - functionName: 'afterUpgrade', + abi: iHooksABI, + functionName: 'afterMove', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterVote"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterReveal"`. */ -export function usePrepareNonAggressionAfterVote( +export function usePrepareIHooksAfterReveal( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionABI, - functionName: 'afterVote', + abi: iHooksABI, + functionName: 'afterReveal', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeMove"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterShoot"`. */ -export function usePrepareNonAggressionBeforeMove( +export function usePrepareIHooksAfterShoot( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionABI, - functionName: 'beforeMove', + abi: iHooksABI, + functionName: 'afterShoot', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeUpgrade"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterUpgrade"`. */ -export function usePrepareNonAggressionBeforeUpgrade( +export function usePrepareIHooksAfterUpgrade( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionABI, - functionName: 'beforeUpgrade', + abi: iHooksABI, + functionName: 'afterUpgrade', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeVote"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"afterVote"`. */ -export function usePrepareNonAggressionBeforeVote( +export function usePrepareIHooksAfterVote( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionABI, - functionName: 'beforeVote', + abi: iHooksABI, + functionName: 'afterVote', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"propose"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeClaim"`. */ -export function usePrepareNonAggressionPropose( +export function usePrepareIHooksBeforeClaim( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionABI, - functionName: 'propose', + abi: iHooksABI, + functionName: 'beforeClaim', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link nonAggressionABI}__. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeDelegate"`. */ -export function useNonAggressionEvent( +export function usePrepareIHooksBeforeDelegate( config: Omit< - UseContractEventConfig, - 'abi' + UsePrepareContractWriteConfig, + 'abi' | 'functionName' > = {} as any, ) { - return useContractEvent({ - abi: nonAggressionABI, + return usePrepareContractWrite({ + abi: iHooksABI, + functionName: 'beforeDelegate', ...config, - } as UseContractEventConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link nonAggressionABI}__ and `eventName` set to `"AcceptedTreaty"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeDrip"`. */ -export function useNonAggressionAcceptedTreatyEvent( +export function usePrepareIHooksBeforeDrip( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' + UsePrepareContractWriteConfig, + 'abi' | 'functionName' > = {} as any, ) { - return useContractEvent({ - abi: nonAggressionABI, - eventName: 'AcceptedTreaty', + return usePrepareContractWrite({ + abi: iHooksABI, + functionName: 'beforeDrip', ...config, - } as UseContractEventConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link nonAggressionABI}__ and `eventName` set to `"NonAggressionCreated"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeGive"`. */ -export function useNonAggressionNonAggressionCreatedEvent( +export function usePrepareIHooksBeforeGive( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' + UsePrepareContractWriteConfig, + 'abi' | 'functionName' > = {} as any, ) { - return useContractEvent({ - abi: nonAggressionABI, - eventName: 'NonAggressionCreated', + return usePrepareContractWrite({ + abi: iHooksABI, + functionName: 'beforeGive', ...config, - } as UseContractEventConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link nonAggressionABI}__ and `eventName` set to `"ProposedTreaty"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeJoin"`. */ -export function useNonAggressionProposedTreatyEvent( +export function usePrepareIHooksBeforeJoin( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' + UsePrepareContractWriteConfig, + 'abi' | 'functionName' > = {} as any, ) { - return useContractEvent({ - abi: nonAggressionABI, - eventName: 'ProposedTreaty', + return usePrepareContractWrite({ + abi: iHooksABI, + functionName: 'beforeJoin', ...config, - } as UseContractEventConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionHookABI}__. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeMove"`. */ -export function useNonAggressionHookRead< - TFunctionName extends string, - TSelectData = ReadContractResult, ->( - config: Omit< - UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >, - 'abi' +export function usePrepareIHooksBeforeMove( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'functionName' > = {} as any, ) { - return useContractRead({ - abi: nonAggressionHookABI, + return usePrepareContractWrite({ + abi: iHooksABI, + functionName: 'beforeMove', ...config, - } as UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"afterClaim"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeReveal"`. */ -export function useNonAggressionHookAfterClaim< - TFunctionName extends 'afterClaim', - TSelectData = ReadContractResult, ->( +export function usePrepareIHooksBeforeReveal( config: Omit< - UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { - return useContractRead({ - abi: nonAggressionHookABI, - functionName: 'afterClaim', + return usePrepareContractWrite({ + abi: iHooksABI, + functionName: 'beforeReveal', ...config, - } as UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"afterDelegate"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeShoot"`. */ -export function useNonAggressionHookAfterDelegate< - TFunctionName extends 'afterDelegate', - TSelectData = ReadContractResult, ->( +export function usePrepareIHooksBeforeShoot( config: Omit< - UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { - return useContractRead({ - abi: nonAggressionHookABI, - functionName: 'afterDelegate', + return usePrepareContractWrite({ + abi: iHooksABI, + functionName: 'beforeShoot', ...config, - } as UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"afterDrip"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeUpgrade"`. */ -export function useNonAggressionHookAfterDrip< - TFunctionName extends 'afterDrip', - TSelectData = ReadContractResult, ->( +export function usePrepareIHooksBeforeUpgrade( config: Omit< - UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { - return useContractRead({ - abi: nonAggressionHookABI, - functionName: 'afterDrip', + return usePrepareContractWrite({ + abi: iHooksABI, + functionName: 'beforeUpgrade', ...config, - } as UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"afterJoin"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iHooksABI}__ and `functionName` set to `"beforeVote"`. */ -export function useNonAggressionHookAfterJoin< - TFunctionName extends 'afterJoin', - TSelectData = ReadContractResult, ->( +export function usePrepareIHooksBeforeVote( config: Omit< - UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { - return useContractRead({ - abi: nonAggressionHookABI, - functionName: 'afterJoin', + return usePrepareContractWrite({ + abi: iHooksABI, + functionName: 'beforeVote', ...config, - } as UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"beforeClaim"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__. */ -export function useNonAggressionHookBeforeClaim< - TFunctionName extends 'beforeClaim', - TSelectData = ReadContractResult, +export function useIMulticall3Read< + TFunctionName extends string, + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >, - 'abi' | 'functionName' + UseContractReadConfig, + 'abi' > = {} as any, ) { return useContractRead({ - abi: nonAggressionHookABI, - functionName: 'beforeClaim', + abi: iMulticall3ABI, ...config, - } as UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"beforeDelegate"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getBasefee"`. */ -export function useNonAggressionHookBeforeDelegate< - TFunctionName extends 'beforeDelegate', - TSelectData = ReadContractResult, +export function useIMulticall3GetBasefee< + TFunctionName extends 'getBasefee', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: nonAggressionHookABI, - functionName: 'beforeDelegate', + abi: iMulticall3ABI, + functionName: 'getBasefee', ...config, - } as UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"beforeDrip"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getBlockHash"`. */ -export function useNonAggressionHookBeforeDrip< - TFunctionName extends 'beforeDrip', - TSelectData = ReadContractResult, +export function useIMulticall3GetBlockHash< + TFunctionName extends 'getBlockHash', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: nonAggressionHookABI, - functionName: 'beforeDrip', + abi: iMulticall3ABI, + functionName: 'getBlockHash', ...config, - } as UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"beforeGive"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getBlockNumber"`. */ -export function useNonAggressionHookBeforeGive< - TFunctionName extends 'beforeGive', - TSelectData = ReadContractResult, +export function useIMulticall3GetBlockNumber< + TFunctionName extends 'getBlockNumber', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: nonAggressionHookABI, - functionName: 'beforeGive', + abi: iMulticall3ABI, + functionName: 'getBlockNumber', ...config, - } as UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"beforeJoin"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getChainId"`. */ -export function useNonAggressionHookBeforeJoin< - TFunctionName extends 'beforeJoin', - TSelectData = ReadContractResult, +export function useIMulticall3GetChainId< + TFunctionName extends 'getChainId', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: nonAggressionHookABI, - functionName: 'beforeJoin', + abi: iMulticall3ABI, + functionName: 'getChainId', ...config, - } as UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"beforeReveal"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getCurrentBlockCoinbase"`. */ -export function useNonAggressionHookBeforeReveal< - TFunctionName extends 'beforeReveal', - TSelectData = ReadContractResult, +export function useIMulticall3GetCurrentBlockCoinbase< + TFunctionName extends 'getCurrentBlockCoinbase', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >, + UseContractReadConfig, 'abi' | 'functionName' > = {} as any, ) { return useContractRead({ - abi: nonAggressionHookABI, - functionName: 'beforeReveal', + abi: iMulticall3ABI, + functionName: 'getCurrentBlockCoinbase', ...config, - } as UseContractReadConfig< - typeof nonAggressionHookABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getCurrentBlockDifficulty"`. */ -export function useNonAggressionHookWrite< - TFunctionName extends string, - TMode extends WriteContractMode = undefined, +export function useIMulticall3GetCurrentBlockDifficulty< + TFunctionName extends 'getCurrentBlockDifficulty', + TSelectData = ReadContractResult, >( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof nonAggressionHookABI, - string - >['request']['abi'], - TFunctionName, - TMode - > - : UseContractWriteConfig< - typeof nonAggressionHookABI, - TFunctionName, - TMode - > & { - abi?: never - } = {} as any, + config: Omit< + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - return useContractWrite({ - abi: nonAggressionHookABI, + return useContractRead({ + abi: iMulticall3ABI, + functionName: 'getCurrentBlockDifficulty', ...config, - } as any) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"accept"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getCurrentBlockGasLimit"`. */ -export function useNonAggressionHookAccept< - TMode extends WriteContractMode = undefined, +export function useIMulticall3GetCurrentBlockGasLimit< + TFunctionName extends 'getCurrentBlockGasLimit', + TSelectData = ReadContractResult, >( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof nonAggressionHookABI, - 'accept' - >['request']['abi'], - 'accept', - TMode - > & { functionName?: 'accept' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'accept' - } = {} as any, + config: Omit< + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - return useContractWrite({ - abi: nonAggressionHookABI, - functionName: 'accept', + return useContractRead({ + abi: iMulticall3ABI, + functionName: 'getCurrentBlockGasLimit', ...config, - } as any) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"afterGive"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getCurrentBlockTimestamp"`. */ -export function useNonAggressionHookAfterGive< - TMode extends WriteContractMode = undefined, +export function useIMulticall3GetCurrentBlockTimestamp< + TFunctionName extends 'getCurrentBlockTimestamp', + TSelectData = ReadContractResult, >( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof nonAggressionHookABI, - 'afterGive' - >['request']['abi'], - 'afterGive', - TMode - > & { functionName?: 'afterGive' } - : UseContractWriteConfig< - typeof nonAggressionHookABI, - 'afterGive', - TMode - > & { - abi?: never - functionName?: 'afterGive' - } = {} as any, + config: Omit< + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - return useContractWrite({ - abi: nonAggressionHookABI, - functionName: 'afterGive', + return useContractRead({ + abi: iMulticall3ABI, + functionName: 'getCurrentBlockTimestamp', ...config, - } as any) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"afterMove"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getEthBalance"`. */ -export function useNonAggressionHookAfterMove< - TMode extends WriteContractMode = undefined, +export function useIMulticall3GetEthBalance< + TFunctionName extends 'getEthBalance', + TSelectData = ReadContractResult, >( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof nonAggressionHookABI, - 'afterMove' - >['request']['abi'], - 'afterMove', - TMode - > & { functionName?: 'afterMove' } - : UseContractWriteConfig< - typeof nonAggressionHookABI, - 'afterMove', - TMode - > & { - abi?: never - functionName?: 'afterMove' - } = {} as any, + config: Omit< + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - return useContractWrite({ - abi: nonAggressionHookABI, - functionName: 'afterMove', + return useContractRead({ + abi: iMulticall3ABI, + functionName: 'getEthBalance', ...config, - } as any) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"afterReveal"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"getLastBlockHash"`. */ -export function useNonAggressionHookAfterReveal< - TMode extends WriteContractMode = undefined, +export function useIMulticall3GetLastBlockHash< + TFunctionName extends 'getLastBlockHash', + TSelectData = ReadContractResult, >( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof nonAggressionHookABI, - 'afterReveal' - >['request']['abi'], - 'afterReveal', - TMode - > & { functionName?: 'afterReveal' } - : UseContractWriteConfig< - typeof nonAggressionHookABI, - 'afterReveal', - TMode - > & { - abi?: never - functionName?: 'afterReveal' - } = {} as any, + config: Omit< + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - return useContractWrite({ - abi: nonAggressionHookABI, - functionName: 'afterReveal', + return useContractRead({ + abi: iMulticall3ABI, + functionName: 'getLastBlockHash', ...config, - } as any) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"afterShoot"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__. */ -export function useNonAggressionHookAfterShoot< +export function useIMulticall3Write< + TFunctionName extends string, TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionHookABI, - 'afterShoot' + typeof iMulticall3ABI, + string >['request']['abi'], - 'afterShoot', - TMode - > & { functionName?: 'afterShoot' } - : UseContractWriteConfig< - typeof nonAggressionHookABI, - 'afterShoot', + TFunctionName, TMode - > & { + > + : UseContractWriteConfig & { abi?: never - functionName?: 'afterShoot' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionHookABI, - functionName: 'afterShoot', + return useContractWrite({ + abi: iMulticall3ABI, ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"afterUpgrade"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"aggregate"`. */ -export function useNonAggressionHookAfterUpgrade< +export function useIMulticall3Aggregate< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionHookABI, - 'afterUpgrade' + typeof iMulticall3ABI, + 'aggregate' >['request']['abi'], - 'afterUpgrade', - TMode - > & { functionName?: 'afterUpgrade' } - : UseContractWriteConfig< - typeof nonAggressionHookABI, - 'afterUpgrade', + 'aggregate', TMode - > & { + > & { functionName?: 'aggregate' } + : UseContractWriteConfig & { abi?: never - functionName?: 'afterUpgrade' + functionName?: 'aggregate' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionHookABI, - functionName: 'afterUpgrade', + return useContractWrite({ + abi: iMulticall3ABI, + functionName: 'aggregate', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"afterVote"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"aggregate3"`. */ -export function useNonAggressionHookAfterVote< +export function useIMulticall3Aggregate3< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionHookABI, - 'afterVote' + typeof iMulticall3ABI, + 'aggregate3' >['request']['abi'], - 'afterVote', - TMode - > & { functionName?: 'afterVote' } - : UseContractWriteConfig< - typeof nonAggressionHookABI, - 'afterVote', + 'aggregate3', TMode - > & { + > & { functionName?: 'aggregate3' } + : UseContractWriteConfig & { abi?: never - functionName?: 'afterVote' + functionName?: 'aggregate3' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionHookABI, - functionName: 'afterVote', + return useContractWrite({ + abi: iMulticall3ABI, + functionName: 'aggregate3', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"beforeMove"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"aggregate3Value"`. */ -export function useNonAggressionHookBeforeMove< +export function useIMulticall3Aggregate3Value< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionHookABI, - 'beforeMove' + typeof iMulticall3ABI, + 'aggregate3Value' >['request']['abi'], - 'beforeMove', + 'aggregate3Value', TMode - > & { functionName?: 'beforeMove' } + > & { functionName?: 'aggregate3Value' } : UseContractWriteConfig< - typeof nonAggressionHookABI, - 'beforeMove', + typeof iMulticall3ABI, + 'aggregate3Value', TMode > & { abi?: never - functionName?: 'beforeMove' + functionName?: 'aggregate3Value' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionHookABI, - functionName: 'beforeMove', + return useContractWrite({ + abi: iMulticall3ABI, + functionName: 'aggregate3Value', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"beforeShoot"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"blockAndAggregate"`. */ -export function useNonAggressionHookBeforeShoot< +export function useIMulticall3BlockAndAggregate< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionHookABI, - 'beforeShoot' + typeof iMulticall3ABI, + 'blockAndAggregate' >['request']['abi'], - 'beforeShoot', + 'blockAndAggregate', TMode - > & { functionName?: 'beforeShoot' } + > & { functionName?: 'blockAndAggregate' } : UseContractWriteConfig< - typeof nonAggressionHookABI, - 'beforeShoot', + typeof iMulticall3ABI, + 'blockAndAggregate', TMode > & { abi?: never - functionName?: 'beforeShoot' + functionName?: 'blockAndAggregate' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionHookABI, - functionName: 'beforeShoot', + return useContractWrite({ + abi: iMulticall3ABI, + functionName: 'blockAndAggregate', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"beforeUpgrade"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"tryAggregate"`. */ -export function useNonAggressionHookBeforeUpgrade< +export function useIMulticall3TryAggregate< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionHookABI, - 'beforeUpgrade' + typeof iMulticall3ABI, + 'tryAggregate' >['request']['abi'], - 'beforeUpgrade', - TMode - > & { functionName?: 'beforeUpgrade' } - : UseContractWriteConfig< - typeof nonAggressionHookABI, - 'beforeUpgrade', + 'tryAggregate', TMode - > & { + > & { functionName?: 'tryAggregate' } + : UseContractWriteConfig & { abi?: never - functionName?: 'beforeUpgrade' + functionName?: 'tryAggregate' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionHookABI, - functionName: 'beforeUpgrade', + return useContractWrite({ + abi: iMulticall3ABI, + functionName: 'tryAggregate', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"beforeVote"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"tryBlockAndAggregate"`. */ -export function useNonAggressionHookBeforeVote< +export function useIMulticall3TryBlockAndAggregate< TMode extends WriteContractMode = undefined, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof nonAggressionHookABI, - 'beforeVote' + typeof iMulticall3ABI, + 'tryBlockAndAggregate' >['request']['abi'], - 'beforeVote', + 'tryBlockAndAggregate', TMode - > & { functionName?: 'beforeVote' } + > & { functionName?: 'tryBlockAndAggregate' } : UseContractWriteConfig< - typeof nonAggressionHookABI, - 'beforeVote', + typeof iMulticall3ABI, + 'tryBlockAndAggregate', TMode > & { abi?: never - functionName?: 'beforeVote' + functionName?: 'tryBlockAndAggregate' } = {} as any, ) { - return useContractWrite({ - abi: nonAggressionHookABI, - functionName: 'beforeVote', - ...config, - } as any) + return useContractWrite( + { + abi: iMulticall3ABI, + functionName: 'tryBlockAndAggregate', + ...config, + } as any, + ) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__. */ -export function usePrepareNonAggressionHookWrite( +export function usePrepareIMulticall3Write( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionHookABI, - ...config, - } as UsePrepareContractWriteConfig< - typeof nonAggressionHookABI, - TFunctionName - >) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"accept"`. - */ -export function usePrepareNonAggressionHookAccept( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: nonAggressionHookABI, - functionName: 'accept', - ...config, - } as UsePrepareContractWriteConfig) -} - -/** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"afterGive"`. - */ -export function usePrepareNonAggressionHookAfterGive( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: nonAggressionHookABI, - functionName: 'afterGive', + abi: iMulticall3ABI, ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"afterMove"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"aggregate"`. */ -export function usePrepareNonAggressionHookAfterMove( +export function usePrepareIMulticall3Aggregate( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionHookABI, - functionName: 'afterMove', + abi: iMulticall3ABI, + functionName: 'aggregate', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"afterReveal"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"aggregate3"`. */ -export function usePrepareNonAggressionHookAfterReveal( +export function usePrepareIMulticall3Aggregate3( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionHookABI, - functionName: 'afterReveal', + abi: iMulticall3ABI, + functionName: 'aggregate3', ...config, - } as UsePrepareContractWriteConfig< - typeof nonAggressionHookABI, - 'afterReveal' - >) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"afterShoot"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"aggregate3Value"`. */ -export function usePrepareNonAggressionHookAfterShoot( +export function usePrepareIMulticall3Aggregate3Value( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionHookABI, - functionName: 'afterShoot', + abi: iMulticall3ABI, + functionName: 'aggregate3Value', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"afterUpgrade"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"blockAndAggregate"`. */ -export function usePrepareNonAggressionHookAfterUpgrade( +export function usePrepareIMulticall3BlockAndAggregate( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionHookABI, - functionName: 'afterUpgrade', + abi: iMulticall3ABI, + functionName: 'blockAndAggregate', ...config, } as UsePrepareContractWriteConfig< - typeof nonAggressionHookABI, - 'afterUpgrade' + typeof iMulticall3ABI, + 'blockAndAggregate' >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"afterVote"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"tryAggregate"`. */ -export function usePrepareNonAggressionHookAfterVote( +export function usePrepareIMulticall3TryAggregate( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionHookABI, - functionName: 'afterVote', + abi: iMulticall3ABI, + functionName: 'tryAggregate', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"beforeMove"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iMulticall3ABI}__ and `functionName` set to `"tryBlockAndAggregate"`. */ -export function usePrepareNonAggressionHookBeforeMove( +export function usePrepareIMulticall3TryBlockAndAggregate( config: Omit< - UsePrepareContractWriteConfig, + UsePrepareContractWriteConfig< + typeof iMulticall3ABI, + 'tryBlockAndAggregate' + >, 'abi' | 'functionName' > = {} as any, ) { return usePrepareContractWrite({ - abi: nonAggressionHookABI, - functionName: 'beforeMove', + abi: iMulticall3ABI, + functionName: 'tryBlockAndAggregate', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig< + typeof iMulticall3ABI, + 'tryBlockAndAggregate' + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"beforeShoot"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function usePrepareNonAggressionHookBeforeShoot( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, +export function useITankGameWrite< + TFunctionName extends string, + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof iTankGameAddress, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iTankGameABI, + string + >['request']['abi'], + TFunctionName, + TMode + > & { address?: Address; chainId?: TChainId } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + } = {} as any, ) { - return usePrepareContractWrite({ - abi: nonAggressionHookABI, - functionName: 'beforeShoot', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], ...config, - } as UsePrepareContractWriteConfig< - typeof nonAggressionHookABI, - 'beforeShoot' - >) + } as any) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"beforeUpgrade"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"addHooks"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function usePrepareNonAggressionHookBeforeUpgrade( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, +export function useITankGameAddHooks< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof iTankGameAddress, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iTankGameABI, + 'addHooks' + >['request']['abi'], + 'addHooks', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'addHooks' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'addHooks' + } = {} as any, ) { - return usePrepareContractWrite({ - abi: nonAggressionHookABI, - functionName: 'beforeUpgrade', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'addHooks', ...config, - } as UsePrepareContractWriteConfig< - typeof nonAggressionHookABI, - 'beforeUpgrade' - >) + } as any) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionHookABI}__ and `functionName` set to `"beforeVote"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"claim"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function usePrepareNonAggressionHookBeforeVote( - config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, +export function useITankGameClaim< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof iTankGameAddress, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iTankGameABI, + 'claim' + >['request']['abi'], + 'claim', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'claim' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'claim' + } = {} as any, ) { - return usePrepareContractWrite({ - abi: nonAggressionHookABI, - functionName: 'beforeVote', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'claim', ...config, - } as UsePrepareContractWriteConfig) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"delegate"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameRead< - TFunctionName extends string, - TSelectData = ReadContractResult, +export function useITankGameDelegate< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof iTankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iTankGameABI, + 'delegate' + >['request']['abi'], + 'delegate', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'delegate' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'delegate' + } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], + return useContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'delegate', ...config, - } as UseContractReadConfig) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"_getEpoch"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"drip"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameGetEpoch< - TFunctionName extends '_getEpoch', - TSelectData = ReadContractResult, +export function useITankGameDrip< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof iTankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iTankGameABI, + 'drip' + >['request']['abi'], + 'drip', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'drip' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'drip' + } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: '_getEpoch', + return useContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'drip', ...config, - } as UseContractReadConfig) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"aliveTanksIdSum"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"forceAddDefaultHook"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameAliveTanksIdSum< - TFunctionName extends 'aliveTanksIdSum', - TSelectData = ReadContractResult, +export function useITankGameForceAddDefaultHook< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof iTankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iTankGameABI, + 'forceAddDefaultHook' + >['request']['abi'], + 'forceAddDefaultHook', + TMode + > & { + address?: Address + chainId?: TChainId + functionName?: 'forceAddDefaultHook' + } + : UseContractWriteConfig< + typeof iTankGameABI, + 'forceAddDefaultHook', + TMode + > & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'forceAddDefaultHook' + } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'aliveTanksIdSum', + return useContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'forceAddDefaultHook', ...config, - } as UseContractReadConfig) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"board"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"give"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameBoard< - TFunctionName extends 'board', - TSelectData = ReadContractResult, +export function useITankGameGive< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof iTankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iTankGameABI, + 'give' + >['request']['abi'], + 'give', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'give' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'give' + } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'board', + return useContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'give', ...config, - } as UseContractReadConfig) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"claimed"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"initialize"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameClaimed< - TFunctionName extends 'claimed', - TSelectData = ReadContractResult, +export function useITankGameInitialize< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof iTankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iTankGameABI, + 'initialize' + >['request']['abi'], + 'initialize', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'initialize' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'initialize' + } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'claimed', + return useContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'initialize', ...config, - } as UseContractReadConfig) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"deadTanks"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"join"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameDeadTanks< - TFunctionName extends 'deadTanks', - TSelectData = ReadContractResult, +export function useITankGameJoin< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof iTankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iTankGameABI, + 'join' + >['request']['abi'], + 'join', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'join' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'join' + } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'deadTanks', + return useContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'join', ...config, - } as UseContractReadConfig) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"delegates"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"move"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameDelegates< - TFunctionName extends 'delegates', - TSelectData = ReadContractResult, +export function useITankGameMove< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof iTankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iTankGameABI, + 'move' + >['request']['abi'], + 'move', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'move' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'move' + } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'delegates', + return useContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'move', ...config, - } as UseContractReadConfig) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"epochStart"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"reveal"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameEpochStart< - TFunctionName extends 'epochStart', - TSelectData = ReadContractResult, +export function useITankGameReveal< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof iTankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iTankGameABI, + 'reveal' + >['request']['abi'], + 'reveal', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'reveal' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'reveal' + } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'epochStart', + return useContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'reveal', ...config, - } as UseContractReadConfig) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"factory"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"shoot"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameFactory< - TFunctionName extends 'factory', - TSelectData = ReadContractResult, +export function useITankGameShoot< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof iTankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iTankGameABI, + 'shoot' + >['request']['abi'], + 'shoot', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'shoot' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'shoot' + } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'factory', + return useContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'shoot', ...config, - } as UseContractReadConfig) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"getLastDrip"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"upgrade"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - - */ -export function useTankGameGetLastDrip< - TFunctionName extends 'getLastDrip', - TSelectData = ReadContractResult, + * - + */ +export function useITankGameUpgrade< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof iTankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iTankGameABI, + 'upgrade' + >['request']['abi'], + 'upgrade', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'upgrade' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'upgrade' + } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'getLastDrip', + return useContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'upgrade', ...config, - } as UseContractReadConfig) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"getUpgradeCost"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"vote"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameGetUpgradeCost< - TFunctionName extends 'getUpgradeCost', - TSelectData = ReadContractResult, +export function useITankGameVote< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof iTankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof iTankGameABI, + 'vote' + >['request']['abi'], + 'vote', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'vote' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'vote' + } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'getUpgradeCost', + return useContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'vote', ...config, - } as UseContractReadConfig) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"heartsOnBoard"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameHeartsOnBoard< - TFunctionName extends 'heartsOnBoard', - TSelectData = ReadContractResult, ->( +export function usePrepareITankGameWrite( config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'address' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'heartsOnBoard', + return usePrepareContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"isAuth"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"addHooks"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameIsAuth< - TFunctionName extends 'isAuth', - TSelectData = ReadContractResult, ->( +export function usePrepareITankGameAddHooks( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'isAuth', + return usePrepareContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'addHooks', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"lastDripEpoch"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"claim"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameLastDripEpoch< - TFunctionName extends 'lastDripEpoch', - TSelectData = ReadContractResult, ->( +export function usePrepareITankGameClaim( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'lastDripEpoch', + return usePrepareContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'claim', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"lastRevealBlock"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"delegate"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameLastRevealBlock< - TFunctionName extends 'lastRevealBlock', - TSelectData = ReadContractResult, ->( +export function usePrepareITankGameDelegate( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'lastRevealBlock', + return usePrepareContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'delegate', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"numTanksAlive"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"drip"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameNumTanksAlive< - TFunctionName extends 'numTanksAlive', - TSelectData = ReadContractResult, ->( +export function usePrepareITankGameDrip( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'numTanksAlive', + return usePrepareContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'drip', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"owner"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"forceAddDefaultHook"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameOwner< - TFunctionName extends 'owner', - TSelectData = ReadContractResult, ->( +export function usePrepareITankGameForceAddDefaultHook( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'owner', + return usePrepareContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'forceAddDefaultHook', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig< + typeof iTankGameABI, + 'forceAddDefaultHook' + >) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"players"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"give"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGamePlayers< - TFunctionName extends 'players', - TSelectData = ReadContractResult, ->( +export function usePrepareITankGameGive( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'players', + return usePrepareContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'give', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"playersCount"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"initialize"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGamePlayersCount< - TFunctionName extends 'playersCount', - TSelectData = ReadContractResult, ->( +export function usePrepareITankGameInitialize( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'playersCount', + return usePrepareContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'initialize', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"podium"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"join"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGamePodium< - TFunctionName extends 'podium', - TSelectData = ReadContractResult, ->( +export function usePrepareITankGameJoin( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'podium', + return usePrepareContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'join', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"prizePool"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"move"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGamePrizePool< - TFunctionName extends 'prizePool', - TSelectData = ReadContractResult, ->( +export function usePrepareITankGameMove( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'prizePool', + return usePrepareContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'move', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"revealBlock"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"reveal"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameRevealBlock< - TFunctionName extends 'revealBlock', - TSelectData = ReadContractResult, ->( +export function usePrepareITankGameReveal( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'revealBlock', + return usePrepareContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'reveal', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"settings"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"shoot"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameSettings< - TFunctionName extends 'settings', - TSelectData = ReadContractResult, ->( +export function usePrepareITankGameShoot( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'settings', + return usePrepareContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'shoot', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"state"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"upgrade"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameState< - TFunctionName extends 'state', - TSelectData = ReadContractResult, ->( +export function usePrepareITankGameUpgrade( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'state', + return usePrepareContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'upgrade', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"stateData"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTankGameABI}__ and `functionName` set to `"vote"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameStateData< - TFunctionName extends 'stateData', - TSelectData = ReadContractResult, ->( +export function usePrepareITankGameVote( config: Omit< - UseContractReadConfig, + UsePrepareContractWriteConfig, 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'stateData', + return usePrepareContractWrite({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + functionName: 'vote', ...config, - } as UseContractReadConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"tankHooks"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameTankHooks< - TFunctionName extends 'tankHooks', - TSelectData = ReadContractResult, ->( +export function useITankGameEvent( config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractEventConfig, + 'abi' | 'address' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'tankHooks', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], ...config, - } as UseContractReadConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"tankToPosition"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"BountyCompleted"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameTankToPosition< - TFunctionName extends 'tankToPosition', - TSelectData = ReadContractResult, ->( +export function useITankGameBountyCompletedEvent( config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'tankToPosition', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'BountyCompleted', ...config, - } as UseContractReadConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"tanks"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Claim"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameTanks< - TFunctionName extends 'tanks', - TSelectData = ReadContractResult, ->( +export function useITankGameClaimEvent( config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'tanks', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'Claim', ...config, - } as UseContractReadConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"tanksOnBoard"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Commit"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameTanksOnBoard< - TFunctionName extends 'tanksOnBoard', - TSelectData = ReadContractResult, ->( +export function useITankGameCommitEvent( config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'tanksOnBoard', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'Commit', ...config, - } as UseContractReadConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"votedThisEpoch"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Curse"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameVotedThisEpoch< - TFunctionName extends 'votedThisEpoch', - TSelectData = ReadContractResult, ->( +export function useITankGameCurseEvent( config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'votedThisEpoch', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'Curse', ...config, - } as UseContractReadConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"votesPerEpoch"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Death"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameVotesPerEpoch< - TFunctionName extends 'votesPerEpoch', - TSelectData = ReadContractResult, ->( +export function useITankGameDeathEvent( config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'votesPerEpoch', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'Death', ...config, - } as UseContractReadConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"votingClosed"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Delegate"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameVotingClosed< - TFunctionName extends 'votingClosed', - TSelectData = ReadContractResult, ->( +export function useITankGameDelegateEvent( config: Omit< - UseContractReadConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'votingClosed', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'Delegate', ...config, - } as UseContractReadConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Drip"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameWrite< - TFunctionName extends string, - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameABI, - string - >['request']['abi'], - TFunctionName, - TMode - > & { address?: Address; chainId?: TChainId } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - } = {} as any, +export function useITankGameDripEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'Drip', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"addHooks"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"GameInit"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameAddHooks< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameABI, - 'addHooks' - >['request']['abi'], - 'addHooks', - TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'addHooks' } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'addHooks' - } = {} as any, +export function useITankGameGameInitEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'addHooks', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'GameInit', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"claim"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"GameOver"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameClaim< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameABI, - 'claim' - >['request']['abi'], - 'claim', - TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'claim' } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'claim' - } = {} as any, +export function useITankGameGameOverEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'claim', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'GameOver', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"delegate"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"GameStarted"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameDelegate< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameABI, - 'delegate' - >['request']['abi'], - 'delegate', - TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'delegate' } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'delegate' - } = {} as any, +export function useITankGameGameStartedEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'delegate', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'GameStarted', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"donate"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Give"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameDonate< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameABI, - 'donate' - >['request']['abi'], - 'donate', - TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'donate' } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'donate' - } = {} as any, +export function useITankGameGiveEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'donate', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'Give', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"drip"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"HooksAdded"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameDrip< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameABI, - 'drip' - >['request']['abi'], - 'drip', - TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'drip' } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'drip' - } = {} as any, +export function useITankGameHooksAddedEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'drip', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'HooksAdded', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"forceAddDefaultHook"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Move"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - - */ -export function useTankGameForceAddDefaultHook< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameABI, - 'forceAddDefaultHook' - >['request']['abi'], - 'forceAddDefaultHook', - TMode - > & { - address?: Address - chainId?: TChainId - functionName?: 'forceAddDefaultHook' - } - : UseContractWriteConfig< - typeof tankGameABI, - 'forceAddDefaultHook', - TMode - > & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'forceAddDefaultHook' - } = {} as any, + */ +export function useITankGameMoveEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'forceAddDefaultHook', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'Move', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"give"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"PlayerJoined"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameGive< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameABI, - 'give' - >['request']['abi'], - 'give', - TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'give' } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'give' - } = {} as any, +export function useITankGamePlayerJoinedEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'give', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'PlayerJoined', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"initialize"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"PrizeIncrease"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameInitialize< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameABI, - 'initialize' - >['request']['abi'], - 'initialize', - TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'initialize' } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'initialize' - } = {} as any, +export function useITankGamePrizeIncreaseEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'initialize', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'PrizeIncrease', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"join"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Reveal"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameJoin< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameABI, - 'join' - >['request']['abi'], - 'join', - TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'join' } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'join' - } = {} as any, +export function useITankGameRevealEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'join', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'Reveal', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"move"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Revive"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameMove< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameABI, - 'move' - >['request']['abi'], - 'move', - TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'move' } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'move' - } = {} as any, +export function useITankGameReviveEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'move', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'Revive', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"reveal"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Shoot"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameReveal< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameABI, - 'reveal' - >['request']['abi'], - 'reveal', - TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'reveal' } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'reveal' - } = {} as any, +export function useITankGameShootEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'reveal', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'Shoot', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"setOwner"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"SpawnHeart"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameSetOwner< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameABI, - 'setOwner' - >['request']['abi'], - 'setOwner', - TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'setOwner' } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'setOwner' - } = {} as any, +export function useITankGameSpawnHeartEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'setOwner', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'SpawnHeart', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"shoot"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Upgrade"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameShoot< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameABI, - 'shoot' - >['request']['abi'], - 'shoot', - TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'shoot' } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'shoot' - } = {} as any, +export function useITankGameUpgradeEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'shoot', + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'Upgrade', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"start"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTankGameABI}__ and `eventName` set to `"Vote"`. * * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameStart< +export function useITankGameVoteEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof iTankGameAddress } = {} as any, +) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractEvent({ + abi: iTankGameABI, + address: iTankGameAddress[chainId as keyof typeof iTankGameAddress], + eventName: 'Vote', + ...config, + } as UseContractEventConfig) +} + +/** + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTreatyABI}__. + */ +export function useITreatyWrite< + TFunctionName extends string, TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameABI, - 'start' - >['request']['abi'], - 'start', + PrepareWriteContractResult['request']['abi'], + TFunctionName, TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'start' } - : UseContractWriteConfig & { + > + : UseContractWriteConfig & { abi?: never - address?: never - chainId?: TChainId - functionName?: 'start' } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'start', + return useContractWrite({ + abi: iTreatyABI, ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"upgrade"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTreatyABI}__ and `functionName` set to `"accept"`. */ -export function useTankGameUpgrade< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameAddress, ->( +export function useITreatyAccept( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof tankGameABI, - 'upgrade' + typeof iTreatyABI, + 'accept' >['request']['abi'], - 'upgrade', + 'accept', TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'upgrade' } - : UseContractWriteConfig & { + > & { functionName?: 'accept' } + : UseContractWriteConfig & { abi?: never - address?: never - chainId?: TChainId - functionName?: 'upgrade' + functionName?: 'accept' } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'upgrade', + return useContractWrite({ + abi: iTreatyABI, + functionName: 'accept', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"vote"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link iTreatyABI}__ and `functionName` set to `"propose"`. */ -export function useTankGameVote< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameAddress, ->( +export function useITreatyPropose( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof tankGameABI, - 'vote' + typeof iTreatyABI, + 'propose' >['request']['abi'], - 'vote', + 'propose', TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'vote' } - : UseContractWriteConfig & { + > & { functionName?: 'propose' } + : UseContractWriteConfig & { abi?: never - address?: never - chainId?: TChainId - functionName?: 'vote' + functionName?: 'propose' } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'vote', + return useContractWrite({ + abi: iTreatyABI, + functionName: 'propose', ...config, } as any) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTreatyABI}__. */ -export function usePrepareTankGameWrite( +export function usePrepareITreatyWrite( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UsePrepareContractWriteConfig, + 'abi' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId return usePrepareContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], + abi: iTreatyABI, ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"addHooks"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTreatyABI}__ and `functionName` set to `"accept"`. + */ +export function usePrepareITreatyAccept( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, +) { + return usePrepareContractWrite({ + abi: iTreatyABI, + functionName: 'accept', + ...config, + } as UsePrepareContractWriteConfig) +} + +/** + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link iTreatyABI}__ and `functionName` set to `"propose"`. + */ +export function usePrepareITreatyPropose( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, +) { + return usePrepareContractWrite({ + abi: iTreatyABI, + functionName: 'propose', + ...config, + } as UsePrepareContractWriteConfig) +} + +/** + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTreatyABI}__. + */ +export function useITreatyEvent( + config: Omit< + UseContractEventConfig, + 'abi' + > = {} as any, +) { + return useContractEvent({ + abi: iTreatyABI, + ...config, + } as UseContractEventConfig) +} + +/** + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTreatyABI}__ and `eventName` set to `"AcceptedTreaty"`. + */ +export function useITreatyAcceptedTreatyEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'eventName' + > = {} as any, +) { + return useContractEvent({ + abi: iTreatyABI, + eventName: 'AcceptedTreaty', + ...config, + } as UseContractEventConfig) +} + +/** + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link iTreatyABI}__ and `eventName` set to `"ProposedTreaty"`. + */ +export function useITreatyProposedTreatyEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'eventName' + > = {} as any, +) { + return useContractEvent({ + abi: iTreatyABI, + eventName: 'ProposedTreaty', + ...config, + } as UseContractEventConfig) +} + +/** + * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__. + */ +export function useNonAggressionRead< + TFunctionName extends string, + TSelectData = ReadContractResult, +>( + config: Omit< + UseContractReadConfig, + 'abi' + > = {} as any, +) { + return useContractRead({ + abi: nonAggressionABI, + ...config, + } as UseContractReadConfig< + typeof nonAggressionABI, + TFunctionName, + TSelectData + >) +} + +/** + * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterClaim"`. */ -export function usePrepareTankGameAddHooks( +export function useNonAggressionAfterClaim< + TFunctionName extends 'afterClaim', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'addHooks', + return useContractRead({ + abi: nonAggressionABI, + functionName: 'afterClaim', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof nonAggressionABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"claim"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterDelegate"`. */ -export function usePrepareTankGameClaim( +export function useNonAggressionAfterDelegate< + TFunctionName extends 'afterDelegate', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'claim', + return useContractRead({ + abi: nonAggressionABI, + functionName: 'afterDelegate', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof nonAggressionABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"delegate"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterDrip"`. */ -export function usePrepareTankGameDelegate( +export function useNonAggressionAfterDrip< + TFunctionName extends 'afterDrip', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'delegate', + return useContractRead({ + abi: nonAggressionABI, + functionName: 'afterDrip', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof nonAggressionABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"donate"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterJoin"`. */ -export function usePrepareTankGameDonate( +export function useNonAggressionAfterJoin< + TFunctionName extends 'afterJoin', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'donate', + return useContractRead({ + abi: nonAggressionABI, + functionName: 'afterJoin', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof nonAggressionABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"drip"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"allies"`. */ -export function usePrepareTankGameDrip( +export function useNonAggressionAllies< + TFunctionName extends 'allies', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'drip', + return useContractRead({ + abi: nonAggressionABI, + functionName: 'allies', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof nonAggressionABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"forceAddDefaultHook"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeClaim"`. */ -export function usePrepareTankGameForceAddDefaultHook( +export function useNonAggressionBeforeClaim< + TFunctionName extends 'beforeClaim', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'forceAddDefaultHook', + return useContractRead({ + abi: nonAggressionABI, + functionName: 'beforeClaim', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof nonAggressionABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"give"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeDelegate"`. */ -export function usePrepareTankGameGive( +export function useNonAggressionBeforeDelegate< + TFunctionName extends 'beforeDelegate', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'give', + return useContractRead({ + abi: nonAggressionABI, + functionName: 'beforeDelegate', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof nonAggressionABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"initialize"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeDrip"`. */ -export function usePrepareTankGameInitialize( +export function useNonAggressionBeforeDrip< + TFunctionName extends 'beforeDrip', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'initialize', + return useContractRead({ + abi: nonAggressionABI, + functionName: 'beforeDrip', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof nonAggressionABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"join"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeGive"`. */ -export function usePrepareTankGameJoin( +export function useNonAggressionBeforeGive< + TFunctionName extends 'beforeGive', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'join', + return useContractRead({ + abi: nonAggressionABI, + functionName: 'beforeGive', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof nonAggressionABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"move"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeJoin"`. */ -export function usePrepareTankGameMove( +export function useNonAggressionBeforeJoin< + TFunctionName extends 'beforeJoin', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'move', + return useContractRead({ + abi: nonAggressionABI, + functionName: 'beforeJoin', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof nonAggressionABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"reveal"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeReveal"`. */ -export function usePrepareTankGameReveal( +export function useNonAggressionBeforeReveal< + TFunctionName extends 'beforeReveal', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'reveal', + return useContractRead({ + abi: nonAggressionABI, + functionName: 'beforeReveal', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof nonAggressionABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"setOwner"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeShoot"`. */ -export function usePrepareTankGameSetOwner( +export function useNonAggressionBeforeShoot< + TFunctionName extends 'beforeShoot', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'setOwner', + return useContractRead({ + abi: nonAggressionABI, + functionName: 'beforeShoot', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof nonAggressionABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"shoot"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"ownerTank"`. */ -export function usePrepareTankGameShoot( +export function useNonAggressionOwnerTank< + TFunctionName extends 'ownerTank', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'shoot', + return useContractRead({ + abi: nonAggressionABI, + functionName: 'ownerTank', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof nonAggressionABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"start"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"proposals"`. */ -export function usePrepareTankGameStart( +export function useNonAggressionProposals< + TFunctionName extends 'proposals', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'start', + return useContractRead({ + abi: nonAggressionABI, + functionName: 'proposals', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof nonAggressionABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"upgrade"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"tankGame"`. */ -export function usePrepareTankGameUpgrade( +export function useNonAggressionTankGame< + TFunctionName extends 'tankGame', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'upgrade', + return useContractRead({ + abi: nonAggressionABI, + functionName: 'tankGame', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof nonAggressionABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"vote"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractRead}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"tankGameView"`. */ -export function usePrepareTankGameVote( +export function useNonAggressionTankGameView< + TFunctionName extends 'tankGameView', + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - functionName: 'vote', + return useContractRead({ + abi: nonAggressionABI, + functionName: 'tankGameView', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig< + typeof nonAggressionABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__. */ -export function useTankGameEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'address' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, +export function useNonAggressionWrite< + TFunctionName extends string, + TMode extends WriteContractMode = undefined, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof nonAggressionABI, + string + >['request']['abi'], + TFunctionName, + TMode + > + : UseContractWriteConfig & { + abi?: never + } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], + return useContractWrite({ + abi: nonAggressionABI, ...config, - } as UseContractEventConfig) + } as any) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"BountyCompleted"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"accept"`. */ -export function useTankGameBountyCompletedEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, +export function useNonAggressionAccept< + TMode extends WriteContractMode = undefined, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof nonAggressionABI, + 'accept' + >['request']['abi'], + 'accept', + TMode + > & { functionName?: 'accept' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'accept' + } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'BountyCompleted', + return useContractWrite({ + abi: nonAggressionABI, + functionName: 'accept', ...config, - } as UseContractEventConfig) + } as any) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Claim"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterGive"`. */ -export function useTankGameClaimEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, +export function useNonAggressionAfterGive< + TMode extends WriteContractMode = undefined, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof nonAggressionABI, + 'afterGive' + >['request']['abi'], + 'afterGive', + TMode + > & { functionName?: 'afterGive' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'afterGive' + } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'Claim', + return useContractWrite({ + abi: nonAggressionABI, + functionName: 'afterGive', ...config, - } as UseContractEventConfig) + } as any) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Commit"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterMove"`. */ -export function useTankGameCommitEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, +export function useNonAggressionAfterMove< + TMode extends WriteContractMode = undefined, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof nonAggressionABI, + 'afterMove' + >['request']['abi'], + 'afterMove', + TMode + > & { functionName?: 'afterMove' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'afterMove' + } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'Commit', + return useContractWrite({ + abi: nonAggressionABI, + functionName: 'afterMove', ...config, - } as UseContractEventConfig) + } as any) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Curse"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterReveal"`. */ -export function useTankGameCurseEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, +export function useNonAggressionAfterReveal< + TMode extends WriteContractMode = undefined, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof nonAggressionABI, + 'afterReveal' + >['request']['abi'], + 'afterReveal', + TMode + > & { functionName?: 'afterReveal' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'afterReveal' + } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'Curse', + return useContractWrite({ + abi: nonAggressionABI, + functionName: 'afterReveal', ...config, - } as UseContractEventConfig) + } as any) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Death"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterShoot"`. */ -export function useTankGameDeathEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, +export function useNonAggressionAfterShoot< + TMode extends WriteContractMode = undefined, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof nonAggressionABI, + 'afterShoot' + >['request']['abi'], + 'afterShoot', + TMode + > & { functionName?: 'afterShoot' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'afterShoot' + } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'Death', + return useContractWrite({ + abi: nonAggressionABI, + functionName: 'afterShoot', ...config, - } as UseContractEventConfig) + } as any) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Delegate"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterUpgrade"`. */ -export function useTankGameDelegateEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, +export function useNonAggressionAfterUpgrade< + TMode extends WriteContractMode = undefined, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof nonAggressionABI, + 'afterUpgrade' + >['request']['abi'], + 'afterUpgrade', + TMode + > & { functionName?: 'afterUpgrade' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'afterUpgrade' + } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'Delegate', + return useContractWrite({ + abi: nonAggressionABI, + functionName: 'afterUpgrade', ...config, - } as UseContractEventConfig) + } as any) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Drip"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterVote"`. */ -export function useTankGameDripEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, +export function useNonAggressionAfterVote< + TMode extends WriteContractMode = undefined, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof nonAggressionABI, + 'afterVote' + >['request']['abi'], + 'afterVote', + TMode + > & { functionName?: 'afterVote' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'afterVote' + } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'Drip', + return useContractWrite({ + abi: nonAggressionABI, + functionName: 'afterVote', ...config, - } as UseContractEventConfig) + } as any) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"GameInit"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeMove"`. */ -export function useTankGameGameInitEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, +export function useNonAggressionBeforeMove< + TMode extends WriteContractMode = undefined, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof nonAggressionABI, + 'beforeMove' + >['request']['abi'], + 'beforeMove', + TMode + > & { functionName?: 'beforeMove' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'beforeMove' + } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'GameInit', + return useContractWrite({ + abi: nonAggressionABI, + functionName: 'beforeMove', ...config, - } as UseContractEventConfig) + } as any) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"GameOver"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeUpgrade"`. */ -export function useTankGameGameOverEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, +export function useNonAggressionBeforeUpgrade< + TMode extends WriteContractMode = undefined, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof nonAggressionABI, + 'beforeUpgrade' + >['request']['abi'], + 'beforeUpgrade', + TMode + > & { functionName?: 'beforeUpgrade' } + : UseContractWriteConfig< + typeof nonAggressionABI, + 'beforeUpgrade', + TMode + > & { + abi?: never + functionName?: 'beforeUpgrade' + } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'GameOver', + return useContractWrite({ + abi: nonAggressionABI, + functionName: 'beforeUpgrade', ...config, - } as UseContractEventConfig) + } as any) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"GameStarted"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeVote"`. */ -export function useTankGameGameStartedEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, +export function useNonAggressionBeforeVote< + TMode extends WriteContractMode = undefined, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof nonAggressionABI, + 'beforeVote' + >['request']['abi'], + 'beforeVote', + TMode + > & { functionName?: 'beforeVote' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'beforeVote' + } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'GameStarted', + return useContractWrite({ + abi: nonAggressionABI, + functionName: 'beforeVote', ...config, - } as UseContractEventConfig) + } as any) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Give"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"propose"`. */ -export function useTankGameGiveEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, +export function useNonAggressionPropose< + TMode extends WriteContractMode = undefined, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof nonAggressionABI, + 'propose' + >['request']['abi'], + 'propose', + TMode + > & { functionName?: 'propose' } + : UseContractWriteConfig & { + abi?: never + functionName?: 'propose' + } = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'Give', + return useContractWrite({ + abi: nonAggressionABI, + functionName: 'propose', ...config, - } as UseContractEventConfig) + } as any) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"HooksAdded"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__. */ -export function useTankGameHooksAddedEvent( +export function usePrepareNonAggressionWrite( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UsePrepareContractWriteConfig, + 'abi' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'HooksAdded', + return usePrepareContractWrite({ + abi: nonAggressionABI, ...config, - } as UseContractEventConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Move"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"accept"`. */ -export function useTankGameMoveEvent( +export function usePrepareNonAggressionAccept( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'Move', + return usePrepareContractWrite({ + abi: nonAggressionABI, + functionName: 'accept', ...config, - } as UseContractEventConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"PlayerJoined"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterGive"`. */ -export function useTankGamePlayerJoinedEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, +export function usePrepareNonAggressionAfterGive( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'PlayerJoined', + return usePrepareContractWrite({ + abi: nonAggressionABI, + functionName: 'afterGive', ...config, - } as UseContractEventConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"PrizeIncrease"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterMove"`. */ -export function useTankGamePrizeIncreaseEvent( +export function usePrepareNonAggressionAfterMove( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'PrizeIncrease', + return usePrepareContractWrite({ + abi: nonAggressionABI, + functionName: 'afterMove', ...config, - } as UseContractEventConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Reveal"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterReveal"`. */ -export function useTankGameRevealEvent( +export function usePrepareNonAggressionAfterReveal( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'Reveal', + return usePrepareContractWrite({ + abi: nonAggressionABI, + functionName: 'afterReveal', ...config, - } as UseContractEventConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Revive"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterShoot"`. */ -export function useTankGameReviveEvent( +export function usePrepareNonAggressionAfterShoot( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'Revive', + return usePrepareContractWrite({ + abi: nonAggressionABI, + functionName: 'afterShoot', ...config, - } as UseContractEventConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Shoot"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterUpgrade"`. */ -export function useTankGameShootEvent( +export function usePrepareNonAggressionAfterUpgrade( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'Shoot', + return usePrepareContractWrite({ + abi: nonAggressionABI, + functionName: 'afterUpgrade', ...config, - } as UseContractEventConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"SpawnHeart"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"afterVote"`. */ -export function useTankGameSpawnHeartEvent( +export function usePrepareNonAggressionAfterVote( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'SpawnHeart', + return usePrepareContractWrite({ + abi: nonAggressionABI, + functionName: 'afterVote', ...config, - } as UseContractEventConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Upgrade"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeMove"`. */ -export function useTankGameUpgradeEvent( +export function usePrepareNonAggressionBeforeMove( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'Upgrade', + return usePrepareContractWrite({ + abi: nonAggressionABI, + functionName: 'beforeMove', ...config, - } as UseContractEventConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Vote"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeUpgrade"`. */ -export function useTankGameVoteEvent( +export function usePrepareNonAggressionBeforeUpgrade( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameAddress } = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameABI, - address: tankGameAddress[chainId as keyof typeof tankGameAddress], - eventName: 'Vote', + return usePrepareContractWrite({ + abi: nonAggressionABI, + functionName: 'beforeUpgrade', ...config, - } as UseContractEventConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameFactoryABI}__. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"beforeVote"`. */ -export function useTankGameFactoryRead< - TFunctionName extends string, - TSelectData = ReadContractResult, ->( +export function usePrepareNonAggressionBeforeVote( config: Omit< - UseContractReadConfig< - typeof tankGameFactoryABI, - TFunctionName, - TSelectData - >, - 'abi' | 'address' - > & { chainId?: keyof typeof tankGameFactoryAddress } = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameFactoryABI, - address: - tankGameFactoryAddress[chainId as keyof typeof tankGameFactoryAddress], + return usePrepareContractWrite({ + abi: nonAggressionABI, + functionName: 'beforeVote', ...config, - } as UseContractReadConfig< - typeof tankGameFactoryABI, - TFunctionName, - TSelectData - >) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameFactoryABI}__ and `functionName` set to `"gameView"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) - * - + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link nonAggressionABI}__ and `functionName` set to `"propose"`. */ -export function useTankGameFactoryGameView< - TFunctionName extends 'gameView', - TSelectData = ReadContractResult, ->( +export function usePrepareNonAggressionPropose( config: Omit< - UseContractReadConfig< - typeof tankGameFactoryABI, - TFunctionName, - TSelectData - >, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameFactoryAddress } = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'functionName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameFactoryABI, - address: - tankGameFactoryAddress[chainId as keyof typeof tankGameFactoryAddress], - functionName: 'gameView', + return usePrepareContractWrite({ + abi: nonAggressionABI, + functionName: 'propose', ...config, - } as UseContractReadConfig< - typeof tankGameFactoryABI, - TFunctionName, - TSelectData - >) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameFactoryABI}__ and `functionName` set to `"hookFactory"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) - * - + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link nonAggressionABI}__. */ -export function useTankGameFactoryHookFactory< - TFunctionName extends 'hookFactory', - TSelectData = ReadContractResult, ->( +export function useNonAggressionEvent( config: Omit< - UseContractReadConfig< - typeof tankGameFactoryABI, - TFunctionName, - TSelectData - >, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameFactoryAddress } = {} as any, + UseContractEventConfig, + 'abi' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractRead({ - abi: tankGameFactoryABI, - address: - tankGameFactoryAddress[chainId as keyof typeof tankGameFactoryAddress], - functionName: 'hookFactory', + return useContractEvent({ + abi: nonAggressionABI, ...config, - } as UseContractReadConfig< - typeof tankGameFactoryABI, - TFunctionName, - TSelectData - >) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameFactoryABI}__. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) - * - + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link nonAggressionABI}__ and `eventName` set to `"AcceptedTreaty"`. */ -export function useTankGameFactoryWrite< - TFunctionName extends string, - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameFactoryAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameFactoryABI, - string - >['request']['abi'], - TFunctionName, - TMode - > & { address?: Address; chainId?: TChainId } - : UseContractWriteConfig< - typeof tankGameFactoryABI, - TFunctionName, - TMode - > & { - abi?: never - address?: never - chainId?: TChainId - } = {} as any, +export function useNonAggressionAcceptedTreatyEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'eventName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameFactoryABI, - address: - tankGameFactoryAddress[chainId as keyof typeof tankGameFactoryAddress], + return useContractEvent({ + abi: nonAggressionABI, + eventName: 'AcceptedTreaty', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameFactoryABI}__ and `functionName` set to `"createGame"`. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) - * - + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link nonAggressionABI}__ and `eventName` set to `"NonAggressionCreated"`. */ -export function useTankGameFactoryCreateGame< - TMode extends WriteContractMode = undefined, - TChainId extends number = keyof typeof tankGameFactoryAddress, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameFactoryABI, - 'createGame' - >['request']['abi'], - 'createGame', - TMode - > & { address?: Address; chainId?: TChainId; functionName?: 'createGame' } - : UseContractWriteConfig & { - abi?: never - address?: never - chainId?: TChainId - functionName?: 'createGame' - } = {} as any, +export function useNonAggressionNonAggressionCreatedEvent( + config: Omit< + UseContractEventConfig, + 'abi' | 'eventName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractWrite({ - abi: tankGameFactoryABI, - address: - tankGameFactoryAddress[chainId as keyof typeof tankGameFactoryAddress], - functionName: 'createGame', + return useContractEvent({ + abi: nonAggressionABI, + eventName: 'NonAggressionCreated', ...config, - } as any) + } as UseContractEventConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameFactoryABI}__. - * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) - * - + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link nonAggressionABI}__ and `eventName` set to `"ProposedTreaty"`. */ -export function usePrepareTankGameFactoryWrite( +export function useNonAggressionProposedTreatyEvent( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' - > & { chainId?: keyof typeof tankGameFactoryAddress } = {} as any, + UseContractEventConfig, + 'abi' | 'eventName' + > = {} as any, ) { - const { chain } = useNetwork() - const defaultChainId = useChainId() - const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: tankGameFactoryABI, - address: - tankGameFactoryAddress[chainId as keyof typeof tankGameFactoryAddress], + return useContractEvent({ + abi: nonAggressionABI, + eventName: 'ProposedTreaty', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameFactoryABI}__ and `functionName` set to `"createGame"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__. * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function usePrepareTankGameFactoryCreateGame( +export function useTankGameRead< + TFunctionName extends string, + TSelectData = ReadContractResult, +>( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'address' | 'functionName' - > & { chainId?: keyof typeof tankGameFactoryAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'address' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return usePrepareContractWrite({ - abi: tankGameFactoryABI, - address: - tankGameFactoryAddress[chainId as keyof typeof tankGameFactoryAddress], - functionName: 'createGame', + return useContractRead({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], ...config, - } as UsePrepareContractWriteConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameFactoryABI}__. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"_getEpoch"`. * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameFactoryEvent( +export function useTankGameGetEpoch< + TFunctionName extends '_getEpoch', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' - > & { chainId?: keyof typeof tankGameFactoryAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameFactoryABI, - address: - tankGameFactoryAddress[chainId as keyof typeof tankGameFactoryAddress], + return useContractRead({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: '_getEpoch', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameFactoryABI}__ and `eventName` set to `"GameCreated"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"aliveTanksIdSum"`. * - * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) * - */ -export function useTankGameFactoryGameCreatedEvent( +export function useTankGameAliveTanksIdSum< + TFunctionName extends 'aliveTanksIdSum', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'address' | 'eventName' - > & { chainId?: keyof typeof tankGameFactoryAddress } = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { const { chain } = useNetwork() const defaultChainId = useChainId() const chainId = config.chainId ?? chain?.id ?? defaultChainId - return useContractEvent({ - abi: tankGameFactoryABI, - address: - tankGameFactoryAddress[chainId as keyof typeof tankGameFactoryAddress], - eventName: 'GameCreated', + return useContractRead({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'aliveTanksIdSum', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"board"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicRead< - TFunctionName extends string, - TSelectData = ReadContractResult, +export function useTankGameBoard< + TFunctionName extends 'board', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'board', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"aliveTanksIdSum"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"claimed"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicAliveTanksIdSum< - TFunctionName extends 'aliveTanksIdSum', - TSelectData = ReadContractResult, +export function useTankGameClaimed< + TFunctionName extends 'claimed', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'aliveTanksIdSum', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'claimed', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"board"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"deadTanks"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicBoard< - TFunctionName extends 'board', - TSelectData = ReadContractResult, +export function useTankGameDeadTanks< + TFunctionName extends 'deadTanks', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'board', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'deadTanks', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"claimed"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"delegates"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicClaimed< - TFunctionName extends 'claimed', - TSelectData = ReadContractResult, +export function useTankGameDelegates< + TFunctionName extends 'delegates', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'claimed', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'delegates', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"deadTanks"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"epochStart"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicDeadTanks< - TFunctionName extends 'deadTanks', - TSelectData = ReadContractResult, +export function useTankGameEpochStart< + TFunctionName extends 'epochStart', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'deadTanks', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'epochStart', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"delegates"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"factory"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicDelegates< - TFunctionName extends 'delegates', - TSelectData = ReadContractResult, +export function useTankGameFactory< + TFunctionName extends 'factory', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'delegates', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'factory', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"epochStart"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"getLastDrip"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicEpochStart< - TFunctionName extends 'epochStart', - TSelectData = ReadContractResult, +export function useTankGameGetLastDrip< + TFunctionName extends 'getLastDrip', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'epochStart', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'getLastDrip', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"getBoard"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"getUpgradeCost"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicGetBoard< - TFunctionName extends 'getBoard', - TSelectData = ReadContractResult, +export function useTankGameGetUpgradeCost< + TFunctionName extends 'getUpgradeCost', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'getBoard', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'getUpgradeCost', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"getEpoch"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"isAuth"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicGetEpoch< - TFunctionName extends 'getEpoch', - TSelectData = ReadContractResult, +export function useTankGameIsAuth< + TFunctionName extends 'isAuth', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'getEpoch', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'isAuth', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"getLastDrip"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"lastDripEpoch"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicGetLastDrip< - TFunctionName extends 'getLastDrip', - TSelectData = ReadContractResult, +export function useTankGameLastDripEpoch< + TFunctionName extends 'lastDripEpoch', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'getLastDrip', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'lastDripEpoch', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"getPlayerCount"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"lastRevealBlock"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicGetPlayerCount< - TFunctionName extends 'getPlayerCount', - TSelectData = ReadContractResult, +export function useTankGameLastRevealBlock< + TFunctionName extends 'lastRevealBlock', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'getPlayerCount', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'lastRevealBlock', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"getSettings"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"numTanksAlive"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicGetSettings< - TFunctionName extends 'getSettings', - TSelectData = ReadContractResult, +export function useTankGameNumTanksAlive< + TFunctionName extends 'numTanksAlive', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'getSettings', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'numTanksAlive', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"getState"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"owner"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicGetState< - TFunctionName extends 'getState', - TSelectData = ReadContractResult, +export function useTankGameOwner< + TFunctionName extends 'owner', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'getState', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'owner', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"getTank"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"players"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicGetTank< - TFunctionName extends 'getTank', - TSelectData = ReadContractResult, +export function useTankGamePlayers< + TFunctionName extends 'players', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'getTank', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'players', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"getUpgradeCost"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"playersCount"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicGetUpgradeCost< - TFunctionName extends 'getUpgradeCost', - TSelectData = ReadContractResult, +export function useTankGamePlayersCount< + TFunctionName extends 'playersCount', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'getUpgradeCost', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'playersCount', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"heartsOnBoard"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"podium"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicHeartsOnBoard< - TFunctionName extends 'heartsOnBoard', - TSelectData = ReadContractResult, +export function useTankGamePodium< + TFunctionName extends 'podium', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'heartsOnBoard', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'podium', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"isAuth"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"prizePool"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicIsAuth< - TFunctionName extends 'isAuth', - TSelectData = ReadContractResult, +export function useTankGamePrizePool< + TFunctionName extends 'prizePool', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'isAuth', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'prizePool', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"lastDripEpoch"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"revealBlock"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicLastDripEpoch< - TFunctionName extends 'lastDripEpoch', - TSelectData = ReadContractResult, +export function useTankGameRevealBlock< + TFunctionName extends 'revealBlock', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'lastDripEpoch', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'revealBlock', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"lastRevealBlock"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"settings"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicLastRevealBlock< - TFunctionName extends 'lastRevealBlock', - TSelectData = ReadContractResult, +export function useTankGameSettings< + TFunctionName extends 'settings', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'lastRevealBlock', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'settings', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"numTanksAlive"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"state"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicNumTanksAlive< - TFunctionName extends 'numTanksAlive', - TSelectData = ReadContractResult, +export function useTankGameState< + TFunctionName extends 'state', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'numTanksAlive', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'state', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"owner"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"stateData"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicOwner< - TFunctionName extends 'owner', - TSelectData = ReadContractResult, +export function useTankGameStateData< + TFunctionName extends 'stateData', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'owner', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'stateData', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"players"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"tankHooks"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicPlayers< - TFunctionName extends 'players', - TSelectData = ReadContractResult, +export function useTankGameTankHooks< + TFunctionName extends 'tankHooks', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'players', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'tankHooks', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"playersCount"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"tanks"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicPlayersCount< - TFunctionName extends 'playersCount', - TSelectData = ReadContractResult, +export function useTankGameTanks< + TFunctionName extends 'tanks', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'playersCount', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'tanks', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"podium"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"votedThisEpoch"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicPodium< - TFunctionName extends 'podium', - TSelectData = ReadContractResult, +export function useTankGameVotedThisEpoch< + TFunctionName extends 'votedThisEpoch', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'podium', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'votedThisEpoch', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"prizePool"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"votesPerEpoch"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicPrizePool< - TFunctionName extends 'prizePool', - TSelectData = ReadContractResult, +export function useTankGameVotesPerEpoch< + TFunctionName extends 'votesPerEpoch', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'prizePool', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'votesPerEpoch', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"revealBlock"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"votingClosed"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicRevealBlock< - TFunctionName extends 'revealBlock', - TSelectData = ReadContractResult, +export function useTankGameVotingClosed< + TFunctionName extends 'votingClosed', + TSelectData = ReadContractResult, >( config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractReadConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractRead({ - abi: tankGameLogicABI, - functionName: 'revealBlock', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'votingClosed', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as UseContractReadConfig) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"settings"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicSettings< - TFunctionName extends 'settings', - TSelectData = ReadContractResult, +export function useTankGameWrite< + TFunctionName extends string, + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof tankGameABI, + string + >['request']['abi'], + TFunctionName, + TMode + > & { address?: Address; chainId?: TChainId } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + } = {} as any, ) { - return useContractRead({ - abi: tankGameLogicABI, - functionName: 'settings', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"state"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"addHooks"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicState< - TFunctionName extends 'state', - TSelectData = ReadContractResult, +export function useTankGameAddHooks< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof tankGameABI, + 'addHooks' + >['request']['abi'], + 'addHooks', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'addHooks' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'addHooks' + } = {} as any, ) { - return useContractRead({ - abi: tankGameLogicABI, - functionName: 'state', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'addHooks', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"stateData"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"claim"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicStateData< - TFunctionName extends 'stateData', - TSelectData = ReadContractResult, +export function useTankGameClaim< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof tankGameABI, + 'claim' + >['request']['abi'], + 'claim', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'claim' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'claim' + } = {} as any, ) { - return useContractRead({ - abi: tankGameLogicABI, - functionName: 'stateData', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'claim', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"tankHooks"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"delegate"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicTankHooks< - TFunctionName extends 'tankHooks', - TSelectData = ReadContractResult, +export function useTankGameDelegate< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof tankGameABI, + 'delegate' + >['request']['abi'], + 'delegate', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'delegate' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'delegate' + } = {} as any, ) { - return useContractRead({ - abi: tankGameLogicABI, - functionName: 'tankHooks', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'delegate', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"tankToPosition"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"donate"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicTankToPosition< - TFunctionName extends 'tankToPosition', - TSelectData = ReadContractResult, +export function useTankGameDonate< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof tankGameABI, + 'donate' + >['request']['abi'], + 'donate', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'donate' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'donate' + } = {} as any, ) { - return useContractRead({ - abi: tankGameLogicABI, - functionName: 'tankToPosition', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'donate', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"tanks"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"drip"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicTanks< - TFunctionName extends 'tanks', - TSelectData = ReadContractResult, +export function useTankGameDrip< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof tankGameABI, + 'drip' + >['request']['abi'], + 'drip', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'drip' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'drip' + } = {} as any, ) { - return useContractRead({ - abi: tankGameLogicABI, - functionName: 'tanks', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'drip', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"tanksOnBoard"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"forceAddDefaultHook"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicTanksOnBoard< - TFunctionName extends 'tanksOnBoard', - TSelectData = ReadContractResult, +export function useTankGameForceAddDefaultHook< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof tankGameABI, + 'forceAddDefaultHook' + >['request']['abi'], + 'forceAddDefaultHook', + TMode + > & { + address?: Address + chainId?: TChainId + functionName?: 'forceAddDefaultHook' + } + : UseContractWriteConfig< + typeof tankGameABI, + 'forceAddDefaultHook', + TMode + > & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'forceAddDefaultHook' + } = {} as any, ) { - return useContractRead({ - abi: tankGameLogicABI, - functionName: 'tanksOnBoard', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'forceAddDefaultHook', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"votedThisEpoch"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"give"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicVotedThisEpoch< - TFunctionName extends 'votedThisEpoch', - TSelectData = ReadContractResult, +export function useTankGameGive< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof tankGameABI, + 'give' + >['request']['abi'], + 'give', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'give' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'give' + } = {} as any, ) { - return useContractRead({ - abi: tankGameLogicABI, - functionName: 'votedThisEpoch', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'give', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"votesPerEpoch"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"initialize"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicVotesPerEpoch< - TFunctionName extends 'votesPerEpoch', - TSelectData = ReadContractResult, +export function useTankGameInitialize< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof tankGameABI, + 'initialize' + >['request']['abi'], + 'initialize', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'initialize' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'initialize' + } = {} as any, ) { - return useContractRead({ - abi: tankGameLogicABI, - functionName: 'votesPerEpoch', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'initialize', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as any) } /** - * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"votingClosed"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"join"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicVotingClosed< - TFunctionName extends 'votingClosed', - TSelectData = ReadContractResult, +export function useTankGameJoin< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameAddress, >( - config: Omit< - UseContractReadConfig, - 'abi' | 'functionName' - > = {} as any, + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof tankGameABI, + 'join' + >['request']['abi'], + 'join', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'join' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'join' + } = {} as any, ) { - return useContractRead({ - abi: tankGameLogicABI, - functionName: 'votingClosed', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'join', ...config, - } as UseContractReadConfig< - typeof tankGameLogicABI, - TFunctionName, - TSelectData - >) + } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"move"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicWrite< - TFunctionName extends string, +export function useTankGameMove< TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof tankGameLogicABI, - string + typeof tankGameABI, + 'move' >['request']['abi'], - TFunctionName, + 'move', TMode - > - : UseContractWriteConfig & { + > & { address?: Address; chainId?: TChainId; functionName?: 'move' } + : UseContractWriteConfig & { abi?: never + address?: never + chainId?: TChainId + functionName?: 'move' } = {} as any, ) { - return useContractWrite({ - abi: tankGameLogicABI, + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'move', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"addHooks"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"reveal"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicAddHooks< +export function useTankGameReveal< TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof tankGameLogicABI, - 'addHooks' + typeof tankGameABI, + 'reveal' >['request']['abi'], - 'addHooks', + 'reveal', TMode - > & { functionName?: 'addHooks' } - : UseContractWriteConfig & { + > & { address?: Address; chainId?: TChainId; functionName?: 'reveal' } + : UseContractWriteConfig & { abi?: never - functionName?: 'addHooks' + address?: never + chainId?: TChainId + functionName?: 'reveal' } = {} as any, ) { - return useContractWrite({ - abi: tankGameLogicABI, - functionName: 'addHooks', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'reveal', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"claim"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"setOwner"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicClaim< +export function useTankGameSetOwner< TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof tankGameLogicABI, - 'claim' + typeof tankGameABI, + 'setOwner' >['request']['abi'], - 'claim', + 'setOwner', TMode - > & { functionName?: 'claim' } - : UseContractWriteConfig & { + > & { address?: Address; chainId?: TChainId; functionName?: 'setOwner' } + : UseContractWriteConfig & { abi?: never - functionName?: 'claim' + address?: never + chainId?: TChainId + functionName?: 'setOwner' } = {} as any, ) { - return useContractWrite({ - abi: tankGameLogicABI, - functionName: 'claim', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'setOwner', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"delegate"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"shoot"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicDelegate< +export function useTankGameShoot< TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof tankGameLogicABI, - 'delegate' + typeof tankGameABI, + 'shoot' >['request']['abi'], - 'delegate', + 'shoot', TMode - > & { functionName?: 'delegate' } - : UseContractWriteConfig & { + > & { address?: Address; chainId?: TChainId; functionName?: 'shoot' } + : UseContractWriteConfig & { abi?: never - functionName?: 'delegate' + address?: never + chainId?: TChainId + functionName?: 'shoot' } = {} as any, ) { - return useContractWrite({ - abi: tankGameLogicABI, - functionName: 'delegate', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'shoot', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"donate"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"start"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicDonate< +export function useTankGameStart< TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof tankGameLogicABI, - 'donate' + typeof tankGameABI, + 'start' >['request']['abi'], - 'donate', + 'start', TMode - > & { functionName?: 'donate' } - : UseContractWriteConfig & { + > & { address?: Address; chainId?: TChainId; functionName?: 'start' } + : UseContractWriteConfig & { abi?: never - functionName?: 'donate' + address?: never + chainId?: TChainId + functionName?: 'start' } = {} as any, ) { - return useContractWrite({ - abi: tankGameLogicABI, - functionName: 'donate', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'start', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"drip"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"upgrade"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicDrip< +export function useTankGameUpgrade< TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof tankGameLogicABI, - 'drip' + typeof tankGameABI, + 'upgrade' >['request']['abi'], - 'drip', + 'upgrade', TMode - > & { functionName?: 'drip' } - : UseContractWriteConfig & { + > & { address?: Address; chainId?: TChainId; functionName?: 'upgrade' } + : UseContractWriteConfig & { abi?: never - functionName?: 'drip' + address?: never + chainId?: TChainId + functionName?: 'upgrade' } = {} as any, ) { - return useContractWrite({ - abi: tankGameLogicABI, - functionName: 'drip', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'upgrade', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"forceAddDefaultHook"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"vote"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicForceAddDefaultHook< +export function useTankGameVote< TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameAddress, >( config: TMode extends 'prepared' ? UseContractWriteConfig< PrepareWriteContractResult< - typeof tankGameLogicABI, - 'forceAddDefaultHook' + typeof tankGameABI, + 'vote' >['request']['abi'], - 'forceAddDefaultHook', - TMode - > & { functionName?: 'forceAddDefaultHook' } - : UseContractWriteConfig< - typeof tankGameLogicABI, - 'forceAddDefaultHook', + 'vote', TMode - > & { + > & { address?: Address; chainId?: TChainId; functionName?: 'vote' } + : UseContractWriteConfig & { abi?: never - functionName?: 'forceAddDefaultHook' + address?: never + chainId?: TChainId + functionName?: 'vote' } = {} as any, ) { - return useContractWrite< - typeof tankGameLogicABI, - 'forceAddDefaultHook', - TMode - >({ - abi: tankGameLogicABI, - functionName: 'forceAddDefaultHook', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'vote', ...config, } as any) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"give"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - + */ +export function usePrepareTankGameWrite( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'address' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, +) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return usePrepareContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + ...config, + } as UsePrepareContractWriteConfig) +} + +/** + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"addHooks"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - + */ +export function usePrepareTankGameAddHooks( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, +) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return usePrepareContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'addHooks', + ...config, + } as UsePrepareContractWriteConfig) +} + +/** + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"claim"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - + */ +export function usePrepareTankGameClaim( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, +) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return usePrepareContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'claim', + ...config, + } as UsePrepareContractWriteConfig) +} + +/** + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"delegate"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicGive< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameLogicABI, - 'give' - >['request']['abi'], - 'give', - TMode - > & { functionName?: 'give' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'give' - } = {} as any, +export function usePrepareTankGameDelegate( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { - return useContractWrite({ - abi: tankGameLogicABI, - functionName: 'give', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return usePrepareContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'delegate', ...config, - } as any) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"join"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"donate"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicJoin< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameLogicABI, - 'join' - >['request']['abi'], - 'join', - TMode - > & { functionName?: 'join' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'join' - } = {} as any, +export function usePrepareTankGameDonate( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { - return useContractWrite({ - abi: tankGameLogicABI, - functionName: 'join', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return usePrepareContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'donate', ...config, - } as any) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"move"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"drip"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicMove< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameLogicABI, - 'move' - >['request']['abi'], - 'move', - TMode - > & { functionName?: 'move' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'move' - } = {} as any, +export function usePrepareTankGameDrip( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { - return useContractWrite({ - abi: tankGameLogicABI, - functionName: 'move', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return usePrepareContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'drip', ...config, - } as any) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"reveal"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"forceAddDefaultHook"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicReveal< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameLogicABI, - 'reveal' - >['request']['abi'], - 'reveal', - TMode - > & { functionName?: 'reveal' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'reveal' - } = {} as any, +export function usePrepareTankGameForceAddDefaultHook( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { - return useContractWrite({ - abi: tankGameLogicABI, - functionName: 'reveal', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return usePrepareContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'forceAddDefaultHook', ...config, - } as any) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"setOwner"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"give"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicSetOwner< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameLogicABI, - 'setOwner' - >['request']['abi'], - 'setOwner', - TMode - > & { functionName?: 'setOwner' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'setOwner' - } = {} as any, +export function usePrepareTankGameGive( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { - return useContractWrite({ - abi: tankGameLogicABI, - functionName: 'setOwner', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return usePrepareContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'give', ...config, - } as any) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"shoot"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"initialize"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicShoot< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameLogicABI, - 'shoot' - >['request']['abi'], - 'shoot', - TMode - > & { functionName?: 'shoot' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'shoot' - } = {} as any, +export function usePrepareTankGameInitialize( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { - return useContractWrite({ - abi: tankGameLogicABI, - functionName: 'shoot', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return usePrepareContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'initialize', ...config, - } as any) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"upgrade"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"join"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicUpgrade< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameLogicABI, - 'upgrade' - >['request']['abi'], - 'upgrade', - TMode - > & { functionName?: 'upgrade' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'upgrade' - } = {} as any, +export function usePrepareTankGameJoin( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { - return useContractWrite({ - abi: tankGameLogicABI, - functionName: 'upgrade', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return usePrepareContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'join', ...config, - } as any) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"vote"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"move"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicVote< - TMode extends WriteContractMode = undefined, ->( - config: TMode extends 'prepared' - ? UseContractWriteConfig< - PrepareWriteContractResult< - typeof tankGameLogicABI, - 'vote' - >['request']['abi'], - 'vote', - TMode - > & { functionName?: 'vote' } - : UseContractWriteConfig & { - abi?: never - functionName?: 'vote' - } = {} as any, +export function usePrepareTankGameMove( + config: Omit< + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { - return useContractWrite({ - abi: tankGameLogicABI, - functionName: 'vote', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return usePrepareContractWrite({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'move', ...config, - } as any) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"reveal"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function usePrepareTankGameLogicWrite( +export function usePrepareTankGameReveal( config: Omit< - UsePrepareContractWriteConfig, - 'abi' - > = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return usePrepareContractWrite({ - abi: tankGameLogicABI, + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'reveal', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"addHooks"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"setOwner"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function usePrepareTankGameLogicAddHooks( +export function usePrepareTankGameSetOwner( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return usePrepareContractWrite({ - abi: tankGameLogicABI, - functionName: 'addHooks', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'setOwner', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"claim"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"shoot"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function usePrepareTankGameLogicClaim( +export function usePrepareTankGameShoot( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return usePrepareContractWrite({ - abi: tankGameLogicABI, - functionName: 'claim', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'shoot', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"delegate"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"start"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function usePrepareTankGameLogicDelegate( +export function usePrepareTankGameStart( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return usePrepareContractWrite({ - abi: tankGameLogicABI, - functionName: 'delegate', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'start', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"donate"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"upgrade"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function usePrepareTankGameLogicDonate( +export function usePrepareTankGameUpgrade( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return usePrepareContractWrite({ - abi: tankGameLogicABI, - functionName: 'donate', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'upgrade', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"drip"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameABI}__ and `functionName` set to `"vote"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function usePrepareTankGameLogicDrip( +export function usePrepareTankGameVote( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return usePrepareContractWrite({ - abi: tankGameLogicABI, - functionName: 'drip', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + functionName: 'vote', ...config, - } as UsePrepareContractWriteConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"forceAddDefaultHook"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function usePrepareTankGameLogicForceAddDefaultHook( +export function useTankGameEvent( config: Omit< - UsePrepareContractWriteConfig< - typeof tankGameLogicABI, - 'forceAddDefaultHook' - >, - 'abi' | 'functionName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { - return usePrepareContractWrite({ - abi: tankGameLogicABI, - functionName: 'forceAddDefaultHook', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractEvent({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], ...config, - } as UsePrepareContractWriteConfig< - typeof tankGameLogicABI, - 'forceAddDefaultHook' - >) + } as UseContractEventConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"give"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"BountyCompleted"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function usePrepareTankGameLogicGive( +export function useTankGameBountyCompletedEvent( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { - return usePrepareContractWrite({ - abi: tankGameLogicABI, - functionName: 'give', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractEvent({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'BountyCompleted', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"join"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Claim"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function usePrepareTankGameLogicJoin( +export function useTankGameClaimEvent( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { - return usePrepareContractWrite({ - abi: tankGameLogicABI, - functionName: 'join', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractEvent({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'Claim', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"move"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Commit"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function usePrepareTankGameLogicMove( +export function useTankGameCommitEvent( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { - return usePrepareContractWrite({ - abi: tankGameLogicABI, - functionName: 'move', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractEvent({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'Commit', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"reveal"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Curse"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function usePrepareTankGameLogicReveal( +export function useTankGameCurseEvent( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { - return usePrepareContractWrite({ - abi: tankGameLogicABI, - functionName: 'reveal', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractEvent({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'Curse', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"setOwner"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Death"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function usePrepareTankGameLogicSetOwner( +export function useTankGameDeathEvent( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { - return usePrepareContractWrite({ - abi: tankGameLogicABI, - functionName: 'setOwner', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractEvent({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'Death', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"shoot"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Delegate"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function usePrepareTankGameLogicShoot( +export function useTankGameDelegateEvent( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { - return usePrepareContractWrite({ - abi: tankGameLogicABI, - functionName: 'shoot', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractEvent({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'Delegate', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"upgrade"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Drip"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function usePrepareTankGameLogicUpgrade( +export function useTankGameDripEvent( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, -) { - return usePrepareContractWrite({ - abi: tankGameLogicABI, - functionName: 'upgrade', + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, +) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractEvent({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'Drip', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameLogicABI}__ and `functionName` set to `"vote"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"GameInit"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function usePrepareTankGameLogicVote( +export function useTankGameGameInitEvent( config: Omit< - UsePrepareContractWriteConfig, - 'abi' | 'functionName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { - return usePrepareContractWrite({ - abi: tankGameLogicABI, - functionName: 'vote', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractEvent({ + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'GameInit', ...config, - } as UsePrepareContractWriteConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"GameOver"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicEvent( +export function useTankGameGameOverEvent( config: Omit< - UseContractEventConfig, - 'abi' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractEvent({ - abi: tankGameLogicABI, + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'GameOver', ...config, - } as UseContractEventConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"BountyCompleted"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"GameStarted"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicBountyCompletedEvent( +export function useTankGameGameStartedEvent( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'BountyCompleted', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'GameStarted', ...config, - } as UseContractEventConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"Claim"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Give"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicClaimEvent( +export function useTankGameGiveEvent( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'Claim', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'Give', ...config, - } as UseContractEventConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"Commit"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"HooksAdded"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicCommitEvent( +export function useTankGameHooksAddedEvent( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'Commit', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'HooksAdded', ...config, - } as UseContractEventConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"Curse"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Move"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicCurseEvent( +export function useTankGameMoveEvent( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'Curse', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'Move', ...config, - } as UseContractEventConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"Death"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"PlayerJoined"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicDeathEvent( +export function useTankGamePlayerJoinedEvent( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'Death', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'PlayerJoined', ...config, - } as UseContractEventConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"Delegate"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"PrizeIncrease"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicDelegateEvent( +export function useTankGamePrizeIncreaseEvent( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'Delegate', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'PrizeIncrease', ...config, - } as UseContractEventConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"Drip"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Reveal"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicDripEvent( +export function useTankGameRevealEvent( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'Drip', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'Reveal', ...config, - } as UseContractEventConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"GameInit"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Revive"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicGameInitEvent( +export function useTankGameReviveEvent( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'GameInit', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'Revive', ...config, - } as UseContractEventConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"GameOver"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Shoot"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicGameOverEvent( +export function useTankGameShootEvent( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'GameOver', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'Shoot', ...config, - } as UseContractEventConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"GameStarted"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"SpawnHeart"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicGameStartedEvent( +export function useTankGameSpawnHeartEvent( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'GameStarted', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'SpawnHeart', ...config, - } as UseContractEventConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"Give"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Upgrade"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicGiveEvent( +export function useTankGameUpgradeEvent( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'Give', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'Upgrade', ...config, - } as UseContractEventConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"HooksAdded"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameABI}__ and `eventName` set to `"Vote"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x2c927e3b60586eb229Dcc55978Bc96A7E00Fb414) + * - */ -export function useTankGameLogicHooksAddedEvent( +export function useTankGameVoteEvent( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'HooksAdded', + abi: tankGameABI, + address: tankGameAddress[chainId as keyof typeof tankGameAddress], + eventName: 'Vote', ...config, - } as UseContractEventConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"Move"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameFactoryABI}__. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) + * - */ -export function useTankGameLogicMoveEvent( +export function useTankGameFactoryRead< + TFunctionName extends string, + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UseContractReadConfig< + typeof tankGameFactoryABI, + TFunctionName, + TSelectData + >, + 'abi' | 'address' + > & { chainId?: keyof typeof tankGameFactoryAddress } = {} as any, ) { - return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'Move', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractRead({ + abi: tankGameFactoryABI, + address: + tankGameFactoryAddress[chainId as keyof typeof tankGameFactoryAddress], ...config, - } as UseContractEventConfig) + } as UseContractReadConfig< + typeof tankGameFactoryABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"PlayerJoined"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameFactoryABI}__ and `functionName` set to `"gameView"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) + * - */ -export function useTankGameLogicPlayerJoinedEvent( +export function useTankGameFactoryGameView< + TFunctionName extends 'gameView', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UseContractReadConfig< + typeof tankGameFactoryABI, + TFunctionName, + TSelectData + >, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameFactoryAddress } = {} as any, ) { - return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'PlayerJoined', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractRead({ + abi: tankGameFactoryABI, + address: + tankGameFactoryAddress[chainId as keyof typeof tankGameFactoryAddress], + functionName: 'gameView', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig< + typeof tankGameFactoryABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"PrizeIncrease"`. + * Wraps __{@link useContractRead}__ with `abi` set to __{@link tankGameFactoryABI}__ and `functionName` set to `"hookFactory"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) + * - */ -export function useTankGameLogicPrizeIncreaseEvent( +export function useTankGameFactoryHookFactory< + TFunctionName extends 'hookFactory', + TSelectData = ReadContractResult, +>( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UseContractReadConfig< + typeof tankGameFactoryABI, + TFunctionName, + TSelectData + >, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameFactoryAddress } = {} as any, ) { - return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'PrizeIncrease', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractRead({ + abi: tankGameFactoryABI, + address: + tankGameFactoryAddress[chainId as keyof typeof tankGameFactoryAddress], + functionName: 'hookFactory', ...config, - } as UseContractEventConfig) + } as UseContractReadConfig< + typeof tankGameFactoryABI, + TFunctionName, + TSelectData + >) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"Reveal"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameFactoryABI}__. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) + * - */ -export function useTankGameLogicRevealEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, +export function useTankGameFactoryWrite< + TFunctionName extends string, + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameFactoryAddress, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof tankGameFactoryABI, + string + >['request']['abi'], + TFunctionName, + TMode + > & { address?: Address; chainId?: TChainId } + : UseContractWriteConfig< + typeof tankGameFactoryABI, + TFunctionName, + TMode + > & { + abi?: never + address?: never + chainId?: TChainId + } = {} as any, ) { - return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'Reveal', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameFactoryABI, + address: + tankGameFactoryAddress[chainId as keyof typeof tankGameFactoryAddress], ...config, - } as UseContractEventConfig) + } as any) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"Revive"`. + * Wraps __{@link useContractWrite}__ with `abi` set to __{@link tankGameFactoryABI}__ and `functionName` set to `"createGame"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) + * - */ -export function useTankGameLogicReviveEvent( - config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, +export function useTankGameFactoryCreateGame< + TMode extends WriteContractMode = undefined, + TChainId extends number = keyof typeof tankGameFactoryAddress, +>( + config: TMode extends 'prepared' + ? UseContractWriteConfig< + PrepareWriteContractResult< + typeof tankGameFactoryABI, + 'createGame' + >['request']['abi'], + 'createGame', + TMode + > & { address?: Address; chainId?: TChainId; functionName?: 'createGame' } + : UseContractWriteConfig & { + abi?: never + address?: never + chainId?: TChainId + functionName?: 'createGame' + } = {} as any, ) { - return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'Revive', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return useContractWrite({ + abi: tankGameFactoryABI, + address: + tankGameFactoryAddress[chainId as keyof typeof tankGameFactoryAddress], + functionName: 'createGame', ...config, - } as UseContractEventConfig) + } as any) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"Shoot"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameFactoryABI}__. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) + * - */ -export function useTankGameLogicShootEvent( +export function usePrepareTankGameFactoryWrite( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'address' + > & { chainId?: keyof typeof tankGameFactoryAddress } = {} as any, ) { - return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'Shoot', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return usePrepareContractWrite({ + abi: tankGameFactoryABI, + address: + tankGameFactoryAddress[chainId as keyof typeof tankGameFactoryAddress], ...config, - } as UseContractEventConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"SpawnHeart"`. + * Wraps __{@link usePrepareContractWrite}__ with `abi` set to __{@link tankGameFactoryABI}__ and `functionName` set to `"createGame"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) + * - */ -export function useTankGameLogicSpawnHeartEvent( +export function usePrepareTankGameFactoryCreateGame( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UsePrepareContractWriteConfig, + 'abi' | 'address' | 'functionName' + > & { chainId?: keyof typeof tankGameFactoryAddress } = {} as any, ) { - return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'SpawnHeart', + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId + return usePrepareContractWrite({ + abi: tankGameFactoryABI, + address: + tankGameFactoryAddress[chainId as keyof typeof tankGameFactoryAddress], + functionName: 'createGame', ...config, - } as UseContractEventConfig) + } as UsePrepareContractWriteConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"Upgrade"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameFactoryABI}__. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) + * - */ -export function useTankGameLogicUpgradeEvent( +export function useTankGameFactoryEvent( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' + > & { chainId?: keyof typeof tankGameFactoryAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'Upgrade', + abi: tankGameFactoryABI, + address: + tankGameFactoryAddress[chainId as keyof typeof tankGameFactoryAddress], ...config, - } as UseContractEventConfig) + } as UseContractEventConfig) } /** - * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameLogicABI}__ and `eventName` set to `"Vote"`. + * Wraps __{@link useContractEvent}__ with `abi` set to __{@link tankGameFactoryABI}__ and `eventName` set to `"GameCreated"`. + * + * - [__View Contract on Goerli Etherscan__](https://goerli.etherscan.io/address/0x9758ce8FE412C72893b42FFEdAEDff1840e1886f) + * - */ -export function useTankGameLogicVoteEvent( +export function useTankGameFactoryGameCreatedEvent( config: Omit< - UseContractEventConfig, - 'abi' | 'eventName' - > = {} as any, + UseContractEventConfig, + 'abi' | 'address' | 'eventName' + > & { chainId?: keyof typeof tankGameFactoryAddress } = {} as any, ) { + const { chain } = useNetwork() + const defaultChainId = useChainId() + const chainId = config.chainId ?? chain?.id ?? defaultChainId return useContractEvent({ - abi: tankGameLogicABI, - eventName: 'Vote', + abi: tankGameFactoryABI, + address: + tankGameFactoryAddress[chainId as keyof typeof tankGameFactoryAddress], + eventName: 'GameCreated', ...config, - } as UseContractEventConfig) + } as UseContractEventConfig) } /**