@bananapus/core-v6 0.0.27 → 0.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1223,10 +1223,13 @@ contract JBTerminalStore is IJBTerminalStore {
1223
1223
 
1224
1224
  // Set the payout limit value to the amount still available to pay out during the ruleset.
1225
1225
  {
1226
- uint256 remaining = payoutLimit.amount
1227
- - usedPayoutLimitOf[
1228
- terminal
1229
- ][projectId][accountingContext.token][ruleset.cycleNumber][payoutLimit.currency];
1226
+ // Saturating subtraction: if a new ruleset activates with a lower payout limit than
1227
+ // what was already used under the previous limit, `used` can exceed `amount`. Clamping
1228
+ // to zero prevents an underflow revert that would DOS cashouts and surplus views.
1229
+ uint256 used = usedPayoutLimitOf[
1230
+ terminal
1231
+ ][projectId][accountingContext.token][ruleset.cycleNumber][payoutLimit.currency];
1232
+ uint256 remaining = payoutLimit.amount > used ? payoutLimit.amount - used : 0;
1230
1233
  if (remaining > type(uint224).max) revert JBTerminalStore_Uint224Overflow(remaining);
1231
1234
  // forge-lint: disable-next-line(unsafe-typecast)
1232
1235
  payoutLimit.amount = uint224(remaining);
@@ -102,6 +102,12 @@ interface IJBController is IERC165, IJBProjectUriRegistry, IJBDirectoryAccessCon
102
102
  uint256 indexed projectId, JBSplit split, uint256 tokenCount, bytes reason, address caller
103
103
  );
104
104
 
105
+ /// @notice A split hook's `processSplitWith` call reverted.
106
+ /// @param projectId The ID of the project.
107
+ /// @param hook The split hook that reverted.
108
+ /// @param reason The revert reason.
109
+ event SplitHookReverted(uint256 indexed projectId, address hook, bytes reason);
110
+
105
111
  /// @notice Reserved tokens were sent to a specific split.
106
112
  /// @param projectId The ID of the project.
107
113
  /// @param rulesetId The ID of the ruleset during the distribution.