Severity: Important
The max_participants field on Hackathon is set at creation but never checked when registering teams. The cap is decorative.
Location
register_team in contracts/hackathon_registry/src/contract.rs (around line 238)
Fix
Before incrementing submission_count:
if hackathon.max_participants > 0 && hackathon.submission_count >= hackathon.max_participants {
return Err(HackathonError::MaxParticipantsReached);
}
(MaxParticipantsReached already exists in error.rs:13.)
Tests
- Registration at cap →
MaxParticipantsReached
- Registration below cap → ok
- max_participants == 0 means unlimited (current behavior)
Severity: Important
The
max_participantsfield onHackathonis set at creation but never checked when registering teams. The cap is decorative.Location
register_teamincontracts/hackathon_registry/src/contract.rs(around line 238)Fix
Before incrementing
submission_count:(
MaxParticipantsReachedalready exists in error.rs:13.)Tests
MaxParticipantsReached