Wrong error
message in selectPresident()::RankedChoice.sol
.
https://github.com/Cyfrin/2024-09-president-elector/blob/main/src/RankedChoice.sol#L65
The selectPresident()
function starts with a timestamp
check (#L60-L66):
If this condition is respected, then it means that we are in the presidential period
, meaning we still have to vote for the next president. We cannot select the new president if the voting period is not finished, hence we shouldn't get an error
message saying :
revert RankedChoice__NotTimeToVote();
but instead one of these two :
=> revert RankedChoice__NotTimeToSelectPresident();
or
=> revert RankedChoice__TimeToVote();
Wrong information returned when transaction failing could mislead the end user.
Github, VisualCode.
Change the error
message with one of these :
=> revert RankedChoice__NotTimeToSelectPresident();
or revert RankedChoice__TimeToVote();
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.