@bananapus/721-hook-v6 0.0.64 → 0.0.65
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
package/src/JB721TiersHook.sol
CHANGED
|
@@ -222,7 +222,7 @@ contract JB721TiersHook is JBOwnable, ERC2771Context, JB721Hook, IJB721TiersHook
|
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
/// @notice The combined cash-out weight of specific NFTs. Divide by `
|
|
225
|
+
/// @notice The combined cash-out weight of specific NFTs. Divide by `totalCashOutWeight()` to get the fraction of
|
|
226
226
|
/// surplus these NFTs can reclaim. Weight is based on the original tier price, not any discount paid.
|
|
227
227
|
/// @param tokenIds The token IDs of the NFTs to get the combined cash-out weight of.
|
|
228
228
|
/// @return weight The combined cash-out weight.
|
|
@@ -334,7 +334,7 @@ contract JB721TiersHook is JBOwnable, ERC2771Context, JB721Hook, IJB721TiersHook
|
|
|
334
334
|
/// @notice The total cash-out weight across all outstanding NFTs and pending reserves. This is the denominator
|
|
335
335
|
/// for cash-out calculations — an NFT's share of the surplus is its weight divided by this total.
|
|
336
336
|
/// @return weight The total cash-out weight.
|
|
337
|
-
function
|
|
337
|
+
function totalCashOutWeight() public view virtual override returns (uint256) {
|
|
338
338
|
return STORE.totalCashOutWeightOf(address(this));
|
|
339
339
|
}
|
|
340
340
|
|
|
@@ -117,7 +117,7 @@ abstract contract JB721Hook is ERC721, IJB721Hook {
|
|
|
117
117
|
cashOutCount = cashOutWeightOf(decodedTokenIds);
|
|
118
118
|
|
|
119
119
|
// Use the total cash out weight of the 721s.
|
|
120
|
-
totalSupply =
|
|
120
|
+
totalSupply = totalCashOutWeight();
|
|
121
121
|
|
|
122
122
|
// Use the surplus from the context.
|
|
123
123
|
effectiveSurplusValue = context.surplus.value;
|
|
@@ -156,7 +156,7 @@ abstract contract JB721Hook is ERC721, IJB721Hook {
|
|
|
156
156
|
//*********************************************************************//
|
|
157
157
|
|
|
158
158
|
/// @notice Returns the cumulative cash out weight of the specified token IDs relative to the
|
|
159
|
-
/// `
|
|
159
|
+
/// `totalCashOutWeight`.
|
|
160
160
|
/// @param tokenIds The NFT token IDs to calculate the cumulative cash out weight of.
|
|
161
161
|
/// @return The cumulative cash out weight of the specified token IDs.
|
|
162
162
|
function cashOutWeightOf(uint256[] memory tokenIds) public view virtual returns (uint256) {
|
|
@@ -176,7 +176,7 @@ abstract contract JB721Hook is ERC721, IJB721Hook {
|
|
|
176
176
|
|
|
177
177
|
/// @notice Calculates the cumulative cash out weight of all NFT token IDs.
|
|
178
178
|
/// @return The total cumulative cash out weight of all NFT token IDs.
|
|
179
|
-
function
|
|
179
|
+
function totalCashOutWeight() public view virtual returns (uint256) {
|
|
180
180
|
return 0;
|
|
181
181
|
}
|
|
182
182
|
|