In RankedChoice::selectPresidentfunction, block.timestampis used to calculate if 1460 (~4 years) have passed after the last election.
block.timestampcan be manipulated by the attacker (mostly miners and validators) and allow the attacker to execute the function prematurely or delay the execution of the function leading to unexpected behaviour.
In RankedChoicecontract, it is vital to allow anyone to execute RankedChoice::selectPresidentfunction only after the completion of 1460 days. The usage of block.timestamp in time calculation will allow attacker to elect presidents before the maturity of 1460 days and therefore break the contract.
Foundry
Slither
Remix
Instead of using block.timestamp, block.numbercan be used for duration calculation.
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.