Open rohitx01 opened 1 year ago
Campaign storage campaign = campaigns[numberOfCampaigns];
require(campaign.deadline < block.timestamp, "The deadline should be a date in the future.");
campaign.owner = _owner;
campaign.title = _title;
campaign.description = _description;
campaign.target = _target;
campaign.deadline = _deadline;
campaign.amountCollected = 0;
campaign.image = _image;
numberOfCampaigns++;
return numberOfCampaigns - 1;
}
I thought there was an error in this Solidity function, i.e. there should be a ">" symbol in require statement and redeployed after changing it , but the form couldn't be submitted anymore.
Does anyone know , How can I fix it?
@rohitx01 Are you still facing the error ?
I'd suggest to change the contract code require
to following
require(_deadline > block.timestamp, "Deadline should be future date.");
Also, on getCampaigns
are you converting the deadline to number before passing to contract call?
deadline: campaign.deadline.toNumber(),
HELP!!!!! The End date in the form isn't working correctly!