Open Ash1shh opened 1 year ago
yes , I have a same question , I can see any value ,and also i can print value!,but just have that question
I find the answer, at publicCampaign , try { ... const data - await createCampaign({ args:[ ... ] }) }
bro @Div-Denis can u please provide some goerli to my acc 0xE834bf72F2df2F4E8e6fd2b9Cfeb0C3EcBdB8A4e thank you 🥇
I find the answer, at publicCampaign , try { ... const data - await createCampaign({ args:[ ... ] }) }
@Div-Denis can you please explain it in more detail?
@tanayvaswani You can look at the contract you deployed in thirdweb, which is explained in detail https://portal.thirdweb.com/react/react.usecontractwrite @Ash1shh sorry man ,I used as much as I could, so I ran out of deployment
- Go to your index.jsx file in the context folder.
- Change the code in the file to this one: const publishCampaign = async (form) => { try { const data = await createCampaign({args:[ address, //owner form.title, form.description, form.target, new Date(form.deadline).getTime(), form.image ]}); console.log("contract call success ", data); } catch (error) { console.log("contract call failed ", error); } }
- The problem lies in the const data = await createCampaign();. It will be solved with the use of {args: [ ]}
Thanks it is working.
I have changed the index.js file in the context folder with the above mentioned method, but the the problem persist
@Div-Denis Works well thanks
Error: Function "createCampaign" requires 6 arguments, but 0 were provided. Expected function signature: contract.call("createCampaign", _owner: string, _title: string, _description: string, _target: BigNumberish, _deadline: BigNumberish, _image: string): Promise