The constructor function gets passed an array of voters, and assign this to the private VOTERS[]. If >1000 addresses are sent to the constructor, this can cause the deployment cost of the contract to exceed 30 million gwei, the current block limit in Ethereum.
Attempting to deploy this contract with >1000 addresses could result in a failed deployment, costing the deployer gas. Alternatively, this limitation will not allow for more than ~1000 voters to participate in the elections.
[PASS] testLargeNumberOfVoters() (gas: 23839071)
Logs:
Gas used: 23612108
[PASS] testLargeNumberOfVoters() (gas: 35211031)
Logs:
Gas used: 34872617
Implement a voter registration system where voters can be added after contract deployment, either by self-registration or by an admin. This distributes the gas cost across multiple transactions and allows for a dynamic voter base. This could also allow for new voters to be added for future elections, which is a missing functionality of the current contract implementation.
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.