Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion blockchain/contracts/ElectionFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ contract ElectionFactory is CCIPReceiver {
error OwnerRestricted();
error NotWhitelistedSender();
error InvalidCandidatesLength();
error InvalidStartTime();
error InvalidEndTime();

struct CCIPVote {
address election;
Expand Down Expand Up @@ -61,7 +63,8 @@ contract ElectionFactory is CCIPReceiver {
uint _resultType
) external {
if (_candidates.length<2) revert InvalidCandidatesLength();
//add checks of time
if (_electionInfo.startTime <= block.timestamp) revert InvalidStartTime();
if (_electionInfo.endTime <= _electionInfo.startTime) revert InvalidEndTime();
address electionAddress = Clones.clone(electionGenerator);
address _ballot = ballotGenerator.generateBallot(
_ballotType,
Expand Down