adrianhajdin / project_crowdfunding

With a stunning design, connected to the blockchain, metamask pairing, interaction with smart contracts, sending Ethereum through the blockchain network, and writing solidity code.
https://jsmastery.pro
704 stars 380 forks source link

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<BigNumber> #34

Open Ash1shh opened 1 year ago

Ash1shh commented 1 year ago

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

Div-Denis commented 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

Div-Denis commented 1 year ago

I find the answer, at publicCampaign , try { ... const data - await createCampaign({ args:[ ... ] }) }

Ash1shh commented 1 year ago

bro @Div-Denis can u please provide some goerli to my acc 0xE834bf72F2df2F4E8e6fd2b9Cfeb0C3EcBdB8A4e thank you 🥇

tanayvaswani commented 1 year ago

I find the answer, at publicCampaign , try { ... const data - await createCampaign({ args:[ ... ] }) }

@Div-Denis can you please explain it in more detail?

Div-Denis commented 1 year ago

@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

KhGunindro commented 1 year ago
  1. Go to your index.jsx file in the context folder.
  2. 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); } }
  3. The problem lies in the const data = await createCampaign();. It will be solved with the use of {args: [ ]}
arslanmaqsood713 commented 1 year ago
  1. Go to your index.jsx file in the context folder.
  2. 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); } }
  3. The problem lies in the const data = await createCampaign();. It will be solved with the use of {args: [ ]}

Thanks it is working.

Prasun60 commented 1 year ago

I have changed the index.js file in the context folder with the above mentioned method, but the the problem persist

patooz commented 9 months ago

@Div-Denis Works well thanks