Having too many candidates causes denial of service on the call to selectPresident()
While the voters and number of maximum candidates per vote is predetermined, there is no predefined candidates in one election. Therefore, there can be a case where too many candidates are logged into the system.
This could lead to out-of-gas or even block gas limit exceeded problem when calling selectPresident(). This is because each candidate is tallied on the same function call, and also there is a recursive call until one candidate remains. This logic may take too much gas and may never complete.
The function selectPresident() cannot be called and therefore no president is selected.
Testing
Consider predefining a limited number of candidates.
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.