@@ -159,7 +159,7 @@ const Home = () => {
159159 // Contract write functions
160160 const { sendAsync : approveToken , isPending : isApproving } = useScaffoldWriteContract ( {
161161 contractName : tokenContractName ,
162- functionName : "approve " ,
162+ functionName : "transfer " ,
163163 args : [ crowdfundingContract ?. address , 0n ] as const
164164 } ) ;
165165
@@ -267,12 +267,12 @@ const Home = () => {
267267 console . log ( "Token approved:" , approveTx ) ;
268268
269269 // 然后调用 fund_to_contract
270- console . log ( "Donating..." ) ;
271- const txHash = await fundToContract ( { args : [ amount ] } ) ;
272- if ( txHash ) {
273- console . log ( "Transaction submitted:" , txHash ) ;
274- setSendValue ( "" ) ;
275- }
270+ // console.log("Donating...");
271+ // const txHash = await fundToContract({ args: [amount] });
272+ // if (txHash) {
273+ // console.log("Transaction submitted:", txHash);
274+ // setSendValue("");
275+ // }
276276 } catch ( error ) {
277277 console . error ( "Error in transaction:" , error ) ;
278278 setError ( error instanceof Error ? error . message : "Transaction failed" ) ;
@@ -336,12 +336,12 @@ const Home = () => {
336336 console . log ( "Token approved:" , approveTx ) ;
337337
338338 // 然后调用 fund_to_contract
339- console . log ( "Donating..." ) ;
340- const txHash = await fundToContract ( { args : [ amount ] } ) ;
341- if ( txHash ) {
342- console . log ( "Transaction submitted:" , txHash ) ;
343- setSendValue ( "" ) ;
344- }
339+ // console.log("Donating...");
340+ // const txHash = await fundToContract({ args: [amount] });
341+ // if (txHash) {
342+ // console.log("Transaction submitted:", txHash);
343+ // setSendValue("");
344+ // }
345345 } catch ( error ) {
346346 console . error ( "Error in transaction:" , error ) ;
347347 setError ( error instanceof Error ? error . message : "Transaction failed" ) ;
0 commit comments