From e88419a97baedd81fceb37a2553bf49e80ad981b Mon Sep 17 00:00:00 2001 From: "Shiv Bhonde | shivbhonde.eth" Date: Wed, 25 Oct 2023 14:59:13 +0530 Subject: [PATCH] remove chainId from useContractWrite (#584) This also removes an issue with error messages in wagmi https://github.com/wagmi-dev/wagmi/issues/3155 --- .../components/scaffold-eth/Contract/WriteOnlyFunctionForm.tsx | 1 - packages/nextjs/hooks/scaffold-eth/useScaffoldContractWrite.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/nextjs/components/scaffold-eth/Contract/WriteOnlyFunctionForm.tsx b/packages/nextjs/components/scaffold-eth/Contract/WriteOnlyFunctionForm.tsx index d96a3c75f..5d2e9e24f 100644 --- a/packages/nextjs/components/scaffold-eth/Contract/WriteOnlyFunctionForm.tsx +++ b/packages/nextjs/components/scaffold-eth/Contract/WriteOnlyFunctionForm.tsx @@ -32,7 +32,6 @@ export const WriteOnlyFunctionForm = ({ abiFunction, onChange, contractAddress } isLoading, writeAsync, } = useContractWrite({ - chainId: getTargetNetwork().id, address: contractAddress, functionName: abiFunction.name, abi: [abiFunction] as Abi, diff --git a/packages/nextjs/hooks/scaffold-eth/useScaffoldContractWrite.ts b/packages/nextjs/hooks/scaffold-eth/useScaffoldContractWrite.ts index 773922080..7efe10fbb 100644 --- a/packages/nextjs/hooks/scaffold-eth/useScaffoldContractWrite.ts +++ b/packages/nextjs/hooks/scaffold-eth/useScaffoldContractWrite.ts @@ -35,7 +35,6 @@ export const useScaffoldContractWrite = < const configuredNetwork = getTargetNetwork(); const wagmiContractWrite = useContractWrite({ - chainId: configuredNetwork.id, address: deployedContractData?.address, abi: deployedContractData?.abi as Abi, functionName: functionName as any,