MyCut

First Flight #23
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

Missing Array Length Checks in Constructor

Summary

The Pot contract constructor lacks a check to ensure that the players and rewards arrays have the same length, which can lead to reward mismatches.

Vulnerability Details

The constructor of the Pot contract takes in two arrays: players and rewards. There is no check to ensure that both arrays are of equal length, which could result in rewards being improperly assigned to players.

Impact

A mismatch in the lengths of the players and rewards arrays could cause incomplete or incorrect reward distribution.

Tools Used

Manual code review.

Recommendations

Add a check at the start of the constructor to ensure the two arrays have the same length:

require(players.length == rewards.length, "Players and rewards arrays must have the same length");
Updates

Lead Judging Commences

equious Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue

Appeal created

esoetheric Submitter
about 1 year ago
esoetheric Submitter
about 1 year ago
equious Lead Judge
about 1 year ago
equious Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.