The s_currentPresident
declared in the constructor can be re-elected immediately because s_previousVoteEndTimeStamp
is 0.
The s_currentPresident
can be re-elected immediately because s_previousVoteEndTimeStamp
is 0 because it is not initialized in the constructor. When deploying a contract, s_currentPresident
is initialized, which can be re-elected immediately in the selectPresident function, since the first time the function is called, s_previousVoteEndTimeStamp
will be 0, and the re-election condition in the selectPresident
function will always be false the first time selectPresident
is called in the contract.
The first president in the contract can be re-elected immediately, without waiting for 1460 days.
Manual code review
Initialize s_previousVoteEndTimeStamp in the constructor with the value block.timestamp
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.