@bananapus/721-hook-v6 0.0.28 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bananapus/721-hook-v6",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1084,6 +1084,10 @@ contract JB721TiersHookStore is IJB721TiersHookStore {
1084
1084
  // Initialize a `JBBitmapWord` for checking whether tiers have been removed.
1085
1085
  JBBitmapWord memory bitmapWord;
1086
1086
 
1087
+ // Track total cost of tiers that can't be bought with credits.
1088
+ // Uses a local variable to reduce stack pressure for via_ir consumers.
1089
+ uint256 totalRestrictedCost;
1090
+
1087
1091
  for (uint256 i; i < numberOfTiers; i++) {
1088
1092
  // Set the tier ID being iterated on.
1089
1093
  uint256 tierId = tierIds[i];
@@ -1119,7 +1123,7 @@ contract JB721TiersHookStore is IJB721TiersHookStore {
1119
1123
  }
1120
1124
 
1121
1125
  // Accumulate cost of credit-restricted tiers.
1122
- if (cantBuyWithCredits) restrictedCost += price;
1126
+ if (cantBuyWithCredits) totalRestrictedCost += price;
1123
1127
 
1124
1128
  // Make sure the `amount` is greater than or equal to the tier's price.
1125
1129
  if (price > leftoverAmount) revert JB721TiersHookStore_PriceExceedsAmount(price, leftoverAmount);
@@ -1145,6 +1149,9 @@ contract JB721TiersHookStore is IJB721TiersHookStore {
1145
1149
  revert JB721TiersHookStore_InsufficientSupplyRemaining(tierId);
1146
1150
  }
1147
1151
  }
1152
+
1153
+ // Assign local to return variable.
1154
+ restrictedCost = totalRestrictedCost;
1148
1155
  }
1149
1156
 
1150
1157
  /// @notice Record reserve 721 minting for the provided tier ID on the provided 721 contract.