@bananapus/distributor-v6 0.0.26 → 0.0.28

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/distributor-v6",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,6 +38,9 @@ contract JB721Distributor is JBDistributor, IJB721Distributor {
38
38
  /// @notice Thrown when native ETH does not match the split hook context amount.
39
39
  error JB721Distributor_NativeAmountMismatch(uint256 msgValue, uint256 contextAmount);
40
40
 
41
+ /// @notice Thrown when claim batch NFT token IDs are not strictly increasing.
42
+ error JB721Distributor_TokenIdsNotIncreasing(uint256 previousTokenId, uint256 tokenId);
43
+
41
44
  /// @notice Thrown when native ETH is sent but context.token is not NATIVE_TOKEN.
42
45
  error JB721Distributor_TokenMismatch(address token, address expectedToken, uint256 msgValue);
43
46
 
@@ -544,10 +547,16 @@ contract JB721Distributor is JBDistributor, IJB721Distributor {
544
547
  /// @param hook The 721 hook whose NFT owners are claiming.
545
548
  /// @param tokenIds The NFT token IDs to check.
546
549
  function _requireCanClaimTokenIds(address hook, uint256[] calldata tokenIds) internal view {
547
- // Each requested NFT must currently belong to msg.sender.
550
+ // Each requested NFT must currently belong to msg.sender and appear in strictly increasing order.
548
551
  for (uint256 i; i < tokenIds.length;) {
549
- if (!_canClaim({hook: hook, tokenId: tokenIds[i], account: msg.sender})) {
550
- revert JBDistributor_NoAccess({hook: hook, tokenId: tokenIds[i], account: msg.sender});
552
+ uint256 tokenId = tokenIds[i];
553
+
554
+ if (i != 0 && tokenId <= tokenIds[i - 1]) {
555
+ revert JB721Distributor_TokenIdsNotIncreasing({previousTokenId: tokenIds[i - 1], tokenId: tokenId});
556
+ }
557
+
558
+ if (!_canClaim({hook: hook, tokenId: tokenId, account: msg.sender})) {
559
+ revert JBDistributor_NoAccess({hook: hook, tokenId: tokenId, account: msg.sender});
551
560
  }
552
561
 
553
562
  unchecked {