As per the protocol documentation:
The initial president is set as the msg.sender, and each president should have a term of roughly 4 years (1460 days)
However, for the initial president this is not true.
Function RankedChoice::selectPresident
checks if the current president's term has passed as below:
The issue is that the variable s_previousVoteEndTimeStamp
is not set initially, and the statement block.timestamp - s_previousVoteEndTimeStamp <= i_presidentalDuration
is always true foe the initial president.
The initial president's term can be less than 1460 days if anyone calls selectPresident
before the term has passed.
Manual review
Initialize the variable s_previousVoteEndTimeStamp
in the constructor:
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.