Skip to content

Commit

Permalink
chore: add split balance check #78
Browse files Browse the repository at this point in the history
  • Loading branch information
samparsky committed Sep 24, 2023
1 parent f35fcc8 commit 232480b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/controllers/ImmutableSplitController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ contract ImmutableSplitController is Clone {
/// @notice
error Unauthorized();

/// @notice Revert if split balance is > 1
/// @dev Prevent distribution of current balance
error Invalid_SplitBalance();

/// -----------------------------------------------------------------------
/// storage
/// -----------------------------------------------------------------------
Expand Down Expand Up @@ -65,6 +69,9 @@ contract ImmutableSplitController is Clone {

(address[] memory accounts, uint32[] memory percentAllocations) = getNewSplitConfiguration();

// prevent distribution of existing money
if (address(split).balance > 1) revert Invalid_SplitBalance();

ISplitMain(splitMain()).updateSplit(split, accounts, percentAllocations, uint32(distributorFee()));
}

Expand Down

0 comments on commit 232480b

Please sign in to comment.