diff --git a/packages/nextjs/hooks/scaffold-eth/useDeployedContractInfo.ts b/packages/nextjs/hooks/scaffold-eth/useDeployedContractInfo.ts index cfd01e3c1..379785901 100644 --- a/packages/nextjs/hooks/scaffold-eth/useDeployedContractInfo.ts +++ b/packages/nextjs/hooks/scaffold-eth/useDeployedContractInfo.ts @@ -37,6 +37,12 @@ export function useDeployedContractInfo( const finalConfig: UseDeployedContractConfig = typeof configOrName === "string" ? { contractName: configOrName } : (configOrName as any); + if (typeof configOrName === "string") { + console.warn( + "Using `useDeployedContractInfo` with a string parameter is deprecated. Please use the object parameter version instead.", + ); + } + const { contractName, chainId } = finalConfig; const selectedNetwork = useSelectedNetwork(chainId); const deployedContract = contracts?.[selectedNetwork.id]?.[contractName as ContractName] as Contract; diff --git a/packages/nextjs/hooks/scaffold-eth/useScaffoldWriteContract.ts b/packages/nextjs/hooks/scaffold-eth/useScaffoldWriteContract.ts index ee721c7c5..c061ce464 100644 --- a/packages/nextjs/hooks/scaffold-eth/useScaffoldWriteContract.ts +++ b/packages/nextjs/hooks/scaffold-eth/useScaffoldWriteContract.ts @@ -60,6 +60,12 @@ export function useScaffoldWriteContract( : (configOrName as UseScaffoldWriteConfig); const { contractName, chainId, writeContractParams: finalWriteContractParams } = finalConfig; + if (typeof configOrName === "string") { + console.warn( + "Using `useScaffoldWriteContract` with a string parameter is deprecated. Please use the object parameter version instead.", + ); + } + const { chain: accountChain } = useAccount(); const writeTx = useTransactor(); const [isMining, setIsMining] = useState(false);