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
680 stars 372 forks source link

createCampaign deadline corrected #91

Closed abhi9ab closed 2 months ago

abhi9ab commented 2 months ago
require(campaign.deadline < block.timestamp, "The deadline should be a date in the future.");

Now, the code has been updated to:

require(_deadline > block.timestamp, "The deadline should be a date in the future.");

OR

require(campaign.deadline > block.timestamp, "The deadline should be a date in the future.");

Here, _deadline is provided by the user through a function parameter. Since _deadline represents a future date, it should always be greater than block.timestamp. Otherwise, the error statement will be executed.