diff --git a/packages/nextjs/hooks/scaffold-eth/useScaffoldWriteContract.ts b/packages/nextjs/hooks/scaffold-eth/useScaffoldWriteContract.ts index 2c61727cc..ee721c7c5 100644 --- a/packages/nextjs/hooks/scaffold-eth/useScaffoldWriteContract.ts +++ b/packages/nextjs/hooks/scaffold-eth/useScaffoldWriteContract.ts @@ -54,10 +54,10 @@ export function useScaffoldWriteContract( configOrName: UseScaffoldWriteConfig | TContractName, writeContractParams?: UseWriteContractParameters, ): ScaffoldWriteContractReturnType { - const finalConfig: UseScaffoldWriteConfig = + const finalConfig = typeof configOrName === "string" ? { contractName: configOrName, writeContractParams, chainId: undefined } - : (configOrName as any); + : (configOrName as UseScaffoldWriteConfig); const { contractName, chainId, writeContractParams: finalWriteContractParams } = finalConfig; const { chain: accountChain } = useAccount();