@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.
- package/ADMINISTRATION.md +1 -1
- package/ARCHITECTURE.md +3 -3
- package/AUDIT_INSTRUCTIONS.md +1 -1
- package/CHANGE_LOG.md +41 -0
- package/README.md +2 -2
- package/RISKS.md +11 -6
- package/SKILLS.md +5 -4
- package/USER_JOURNEYS.md +6 -3
- package/package.json +4 -4
- package/script/DeployPeriphery.s.sol +14 -13
- package/src/JBChainlinkV3PriceFeed.sol +4 -1
- package/src/JBChainlinkV3SequencerPriceFeed.sol +1 -1
- package/src/JBController.sol +6 -2
- package/src/JBDirectory.sol +7 -0
- package/src/JBMultiTerminal.sol +63 -22
- package/src/JBTerminalStore.sol +7 -4
- package/src/interfaces/IJBController.sol +6 -0
- package/test/AuditFixes.t.sol +808 -0
- package/test/TestFeeFreeCashOutBypass.sol +2 -2
- package/test/TestFees.sol +6 -4
- package/test/TestTerminalMigration.sol +104 -2
- package/test/audit/FeeFreeSurplusLifecycle.t.sol +5 -2
- package/test/units/static/JBMultiTerminal/TestCashOutTokensOf.sol +4 -10
- package/test/units/static/JBMultiTerminal/TestExecutePayout.sol +4 -53
- package/test/units/static/JBMultiTerminal/TestExecuteProcessFee.sol +2 -5
- package/test/units/static/JBMultiTerminal/TestMigrateBalanceOf.sol +17 -5
- package/test/units/static/JBMultiTerminal/TestSelfPayRevert.sol +55 -0
package/src/JBTerminalStore.sol
CHANGED
|
@@ -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
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
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.
|