Replies: 1 comment
-
Hi @ZurvaAziz, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Can someone please help with this error!
contract call failed Error: value must be a string (argument="value", value=undefined, code=INVALID_ARGUMENT, version=units/5.7.0)
at Logger.makeError (index.js:224:1)
at Logger.throwError (index.js:233:1)
at Logger.throwArgumentError (index.js:236:1)
at Module.parseUnits (index.js:68:1)
at createCampaign (CrowdFunding.js:40:17)
at async createNewCampaign (Hero.jsx:14:20)
This is the code snippet from Crowdfunding.js that is potentially causing the problem:
const createCampaign = async (campaign) => {
const {title, description, amount, deadline} = campaign;
const web3Modal = new Wenb3Modal();
const connection = await web3Modal.connect();
const provider = new ethers.providers.Web3Provider(connection);
const signer = provider.getSigner();
const contract = fetchContract(signer);
console.log(currentAccount);
try{
const transaction = await contract.createCampaign(
currentAccount,
title,
description,
ethers.utils.parseUnits(amount, 18),
new Date(deadline).getTime()
);
await transaction.wait();
console.log("contract call success", transaction);
} catch(error) {
console.log("contract call failed", error);
}
};
Beta Was this translation helpful? Give feedback.
All reactions