From 07c7f636b035a69f64ed93d60f795a8e7bd3e48e Mon Sep 17 00:00:00 2001 From: metalboyrick Date: Sat, 12 Oct 2024 23:34:12 +0700 Subject: [PATCH] fix: wrong variables in scaffold write contract --- .../nextjs/hooks/scaffold-stark/useScaffoldWriteContract.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nextjs/hooks/scaffold-stark/useScaffoldWriteContract.ts b/packages/nextjs/hooks/scaffold-stark/useScaffoldWriteContract.ts index 1c082912..9fce2ee5 100644 --- a/packages/nextjs/hooks/scaffold-stark/useScaffoldWriteContract.ts +++ b/packages/nextjs/hooks/scaffold-stark/useScaffoldWriteContract.ts @@ -76,7 +76,7 @@ export const useScaffoldWriteContract = < }) => { // if no args supplied, use the one supplied from hook let newArgs = params?.args; - if (!newArgs) { + if (Object.keys(newArgs || {}).length <= 0) { newArgs = args; } @@ -100,7 +100,7 @@ export const useScaffoldWriteContract = < ? parseFunctionParams({ abiFunction, abi: deployedContractData.abi, - inputs: args as any[], + inputs: newArgs as any[], isRead: false, isReadArgsParsing: false, }).flat(Infinity)