@bananapus/distributor-v6 0.0.45 → 0.0.46

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/README.md CHANGED
@@ -75,7 +75,9 @@ This repo does not explain why an allocation exists. It only defines how funded
75
75
  NFT's tier
76
76
  - `recycleExpiredRewards` is permissionless; it recycles the expired round's unmaterialized remainder while preserving
77
77
  amounts that already started vesting
78
- - eligible expired and forfeited rewards stay in distributor inventory and are recycled into the current reward round
78
+ - eligible expired and forfeited rewards stay in distributor inventory and are recycled into the current reward round.
79
+ A reward round never recycles into itself; if the requested round is still current, the call is a no-op, including
80
+ for zero-stake rounds
79
81
  - revnet loan-backed vesting is opt-in at deployment; the reward token must be a REVOwner-owned revnet token, the
80
82
  distributor keeps the loan NFT, and repayment restores the original vesting schedule instead of releasing all
81
83
  collateral immediately
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bananapus/distributor-v6",
3
- "version": "0.0.45",
3
+ "version": "0.0.46",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -305,7 +305,8 @@ abstract contract JBDistributor is IJBDistributor {
305
305
  }
306
306
 
307
307
  /// @notice Recycle unclaimed rewards from expired reward rounds into the current reward round.
308
- /// @dev Recycling is permissionless; any keeper or frontend can sweep an expired round.
308
+ /// @dev Recycling is permissionless; any keeper or frontend can sweep an eligible prior round. Passing the current
309
+ /// reward round is a no-op, even when its snapshot stake is zero.
309
310
  /// @param hook The hook whose expired rewards should be recycled.
310
311
  /// @param token The reward token to recycle.
311
312
  /// @param rounds The reward rounds to recycle.
@@ -1185,6 +1186,11 @@ abstract contract JBDistributor is IJBDistributor {
1185
1186
  internal
1186
1187
  returns (uint256 recycleAmount)
1187
1188
  {
1189
+ // Never recycle a round into itself. This keeps raw round accounting stable for zero-stake current rounds; the
1190
+ // same inventory can be swept once a later round is current.
1191
+ uint256 recycledToRound = currentRound();
1192
+ if (round == recycledToRound) return 0;
1193
+
1188
1194
  // Load the reward round once so expiry, claimed amount, and funded amount stay in sync.
1189
1195
  JBRewardRoundData storage rewardRound = rewardRoundOf[hook][groupId][token][round];
1190
1196
 
@@ -1204,7 +1210,6 @@ abstract contract JBDistributor is IJBDistributor {
1204
1210
  rewardRound.claimedAmount = rewardRound.amount;
1205
1211
 
1206
1212
  // Keep the inventory in the distributor and give the current staker set a new claimable round.
1207
- uint256 recycledToRound = currentRound();
1208
1213
  _recordRewardRound({hook: hook, groupId: groupId, token: token, amount: recycleAmount});
1209
1214
 
1210
1215
  // Surface the permissionless recycle for off-chain accounting.
@@ -301,7 +301,8 @@ interface IJBDistributor {
301
301
  /// @notice Record the snapshot block for the current round. Callable by anyone (keepers, frontends).
302
302
  function poke() external;
303
303
 
304
- /// @notice Recycle unclaimed rewards from expired default-group reward rounds into the current reward round.
304
+ /// @notice Recycle unclaimed rewards from eligible prior default-group reward rounds into the current reward round.
305
+ /// @dev Passing the current round is a no-op, including for zero-stake rounds.
305
306
  /// @param hook The hook whose expired reward rounds should be recycled.
306
307
  /// @param token The reward token to recycle.
307
308
  /// @param rounds The reward rounds to recycle.