The teams array is hardcoded to 48 elements, forcing all 48 storage slots to be set even for tournaments with fewer teams, wasting hundreds of thousands of gas.
Normal behavior for flexible contracts expects using dynamic arrays that accommodate different use cases. Not all tournaments have exactly 48 teams.
The current implementation uses a fixed-size array string[48], which means every tournament must pay to initialize all 48 slots even if only using 16, 32, or other counts.
Likelihood:
Many tournaments have fewer than 48 teams
Each unused slot still costs gas to set (even if empty string)
Every tournament deployment incurs this cost
Impact:
Tournament with 16 teams wastes gas setting 32 empty slots
Each SSTORE operation costs ~20,000 gas for first write
32 unused slots = ~640,000 wasted gas
Makes smaller tournaments unnecessarily expensive
Reduces flexibility for different competition formats
Hardcoded assumption limits reusability
Additional benefits:
Supports tournaments with 2, 4, 8, 16, 32, or any number of teams
More flexible for different competition formats
Validates all team names are non-empty
Can clear and reset teams if needed
Estimated Gas Savings:
16-team tournament: ~640,000 gas saved
32-team tournament: ~320,000 gas saved
Variable based on actual team count vs 48
Gas optimizations are invalid according to the CodeHawks documentation.
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.