Skip to content

Commit

Permalink
chore: add IMSC recipients array size check #73
Browse files Browse the repository at this point in the history
  • Loading branch information
samparsky committed Sep 24, 2023
1 parent 50ce277 commit f35fcc8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/controllers/ImmutableSplitControllerFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ contract ImmutableSplitControllerFactory {
/// 10% (1e5)
/// @param distributorFee Invalid distributorFee amount
error InvalidSplit__InvalidDistributorFee(uint32 distributorFee);
/// @notice Array of accounts size
/// @param size acounts size
error InvalidSplit__TooManyAccounts(uint256 size);

/// -----------------------------------------------------------------------
/// libraries
Expand Down Expand Up @@ -199,6 +202,8 @@ contract ImmutableSplitControllerFactory {
uint32 distributorFee
) internal view returns (bytes memory data) {
uint256 recipientsSize = accounts.length;
if (recipientsSize > type(uint8).max) revert InvalidSplit__TooManyAccounts(recipientsSize);

uint256[] memory recipients = new uint[](recipientsSize);

uint256 i = 0;
Expand Down

0 comments on commit f35fcc8

Please sign in to comment.