MyCut

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

There is no check for `i_players.length != i_rewards.length` in the `Pot` constructor

Summary

The manager could accidentally send arrays of players and rewards with different lengths.

Impact

If this happens, the creation of the Pot would result in an error.

Recommendation

Add a require check at the beginning of the constructor:

+ error Pot__PlayersAndRewardsNotSameLength();
constructor(address[] memory players, uint256[] memory rewards, IERC20 token, uint256 totalRewards) {
+ if (i_players.length != i_rewards.length) revert Pot__PlayersAndRewardsNotSameLength();
...
}
Updates

Lead Judging Commences

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.