@bananapus/721-hook-v6 0.0.25 → 0.0.27
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 +1 -1
- package/src/JB721TiersHook.sol +35 -45
- package/src/JB721TiersHookStore.sol +46 -35
- package/src/interfaces/IJB721TiersHookStore.sol +2 -1
- package/src/structs/JB721Tier.sol +6 -4
- package/src/structs/JB721TierConfig.sol +6 -3
- package/src/structs/JBStored721Tier.sol +1 -1
- package/test/721HookAttacks.t.sol +10 -8
- package/test/E2E/Pay_Mint_Redeem_E2E.t.sol +6 -4
- package/test/Fork.t.sol +26 -19
- package/test/TestAuditGaps.sol +24 -16
- package/test/TestVotingUnitsLifecycle.t.sol +1 -1
- package/test/audit/CodexPayCreditsBypassTierSplits.t.sol +3 -2
- package/test/audit/CodexSplitCreditsMismatch.t.sol +3 -2
- package/test/fork/ERC20CashOutFork.t.sol +12 -8
- package/test/fork/ERC20TierSplitFork.t.sol +9 -6
- package/test/fork/IssueTokensForSplitsFork.t.sol +3 -2
- package/test/invariants/handlers/TierLifecycleHandler.sol +5 -4
- package/test/invariants/handlers/TierStoreHandler.sol +4 -3
- package/test/regression/ProjectDeployerRulesets.t.sol +3 -2
- package/test/unit/AuditFixes_Unit.t.sol +12 -8
- package/test/unit/adjustTier_Unit.t.sol +96 -64
- package/test/unit/getters_constructor_Unit.t.sol +14 -11
- package/test/unit/mintFor_mintReservesFor_Unit.t.sol +6 -6
- package/test/unit/redeem_Unit.t.sol +3 -3
package/test/TestAuditGaps.sol
CHANGED
|
@@ -453,8 +453,9 @@ contract TestAuditGaps_GasLimits is UnitTestSetup {
|
|
|
453
453
|
allowOwnerMint: false,
|
|
454
454
|
useReserveBeneficiaryAsDefault: false,
|
|
455
455
|
transfersPausable: false,
|
|
456
|
-
|
|
457
|
-
|
|
456
|
+
cantBeRemoved: false,
|
|
457
|
+
cantIncreaseDiscountPercent: false,
|
|
458
|
+
cantBuyWithCredits: false,
|
|
458
459
|
useVotingUnits: false,
|
|
459
460
|
splitPercent: 0,
|
|
460
461
|
splits: new JBSplit[](0)
|
|
@@ -506,8 +507,9 @@ contract TestAuditGaps_GasLimits is UnitTestSetup {
|
|
|
506
507
|
allowOwnerMint: false,
|
|
507
508
|
useReserveBeneficiaryAsDefault: false,
|
|
508
509
|
transfersPausable: false,
|
|
509
|
-
|
|
510
|
-
|
|
510
|
+
cantBeRemoved: false,
|
|
511
|
+
cantIncreaseDiscountPercent: false,
|
|
512
|
+
cantBuyWithCredits: false,
|
|
511
513
|
useVotingUnits: false,
|
|
512
514
|
splitPercent: 0,
|
|
513
515
|
splits: new JBSplit[](0)
|
|
@@ -561,8 +563,9 @@ contract TestAuditGaps_GasLimits is UnitTestSetup {
|
|
|
561
563
|
allowOwnerMint: false,
|
|
562
564
|
useReserveBeneficiaryAsDefault: false,
|
|
563
565
|
transfersPausable: false,
|
|
564
|
-
|
|
565
|
-
|
|
566
|
+
cantBeRemoved: false,
|
|
567
|
+
cantIncreaseDiscountPercent: false,
|
|
568
|
+
cantBuyWithCredits: false,
|
|
566
569
|
useVotingUnits: false,
|
|
567
570
|
splitPercent: 0,
|
|
568
571
|
splits: new JBSplit[](0)
|
|
@@ -662,8 +665,9 @@ contract TestAuditGaps_GasLimits is UnitTestSetup {
|
|
|
662
665
|
allowOwnerMint: false,
|
|
663
666
|
useReserveBeneficiaryAsDefault: false,
|
|
664
667
|
transfersPausable: false,
|
|
665
|
-
|
|
666
|
-
|
|
668
|
+
cantBeRemoved: false,
|
|
669
|
+
cantIncreaseDiscountPercent: false,
|
|
670
|
+
cantBuyWithCredits: false,
|
|
667
671
|
useVotingUnits: false,
|
|
668
672
|
splitPercent: 0,
|
|
669
673
|
splits: new JBSplit[](0)
|
|
@@ -711,8 +715,9 @@ contract TestAuditGaps_GasLimits is UnitTestSetup {
|
|
|
711
715
|
allowOwnerMint: false,
|
|
712
716
|
useReserveBeneficiaryAsDefault: false,
|
|
713
717
|
transfersPausable: false,
|
|
714
|
-
|
|
715
|
-
|
|
718
|
+
cantBeRemoved: false,
|
|
719
|
+
cantIncreaseDiscountPercent: false,
|
|
720
|
+
cantBuyWithCredits: false,
|
|
716
721
|
useVotingUnits: false,
|
|
717
722
|
splitPercent: 0,
|
|
718
723
|
splits: new JBSplit[](0)
|
|
@@ -772,8 +777,9 @@ contract TestAuditGaps_GasLimits is UnitTestSetup {
|
|
|
772
777
|
allowOwnerMint: false,
|
|
773
778
|
useReserveBeneficiaryAsDefault: false,
|
|
774
779
|
transfersPausable: false,
|
|
775
|
-
|
|
776
|
-
|
|
780
|
+
cantBeRemoved: false,
|
|
781
|
+
cantIncreaseDiscountPercent: false,
|
|
782
|
+
cantBuyWithCredits: false,
|
|
777
783
|
useVotingUnits: false,
|
|
778
784
|
splitPercent: 0,
|
|
779
785
|
splits: new JBSplit[](0)
|
|
@@ -844,8 +850,9 @@ contract TestAuditGaps_GasLimits is UnitTestSetup {
|
|
|
844
850
|
allowOwnerMint: false,
|
|
845
851
|
useReserveBeneficiaryAsDefault: false,
|
|
846
852
|
transfersPausable: false,
|
|
847
|
-
|
|
848
|
-
|
|
853
|
+
cantBeRemoved: false,
|
|
854
|
+
cantIncreaseDiscountPercent: false,
|
|
855
|
+
cantBuyWithCredits: false,
|
|
849
856
|
useVotingUnits: false,
|
|
850
857
|
splitPercent: 0,
|
|
851
858
|
splits: new JBSplit[](0)
|
|
@@ -1039,8 +1046,9 @@ contract TestAuditGaps_GasLimits is UnitTestSetup {
|
|
|
1039
1046
|
allowOwnerMint: false,
|
|
1040
1047
|
useReserveBeneficiaryAsDefault: false,
|
|
1041
1048
|
transfersPausable: false,
|
|
1042
|
-
|
|
1043
|
-
|
|
1049
|
+
cantBeRemoved: false,
|
|
1050
|
+
cantIncreaseDiscountPercent: false,
|
|
1051
|
+
cantBuyWithCredits: false,
|
|
1044
1052
|
useVotingUnits: false,
|
|
1045
1053
|
splitPercent: 0,
|
|
1046
1054
|
splits: new JBSplit[](0)
|
|
@@ -281,7 +281,7 @@ contract TestVotingUnitsLifecycle is UnitTestSetup {
|
|
|
281
281
|
reserveFrequency: uint16(0),
|
|
282
282
|
category: uint24(100),
|
|
283
283
|
discountPercent: uint8(0),
|
|
284
|
-
packedBools: testHook.test_store().ForTest_packBools(true, false, false, false, false),
|
|
284
|
+
packedBools: testHook.test_store().ForTest_packBools(true, false, false, false, false, false),
|
|
285
285
|
splitPercent: 0
|
|
286
286
|
})
|
|
287
287
|
);
|
|
@@ -121,8 +121,9 @@ contract CodexPayCreditsBypassTierSplits is UnitTestSetup {
|
|
|
121
121
|
allowOwnerMint: false,
|
|
122
122
|
useReserveBeneficiaryAsDefault: false,
|
|
123
123
|
transfersPausable: false,
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
cantBeRemoved: false,
|
|
125
|
+
cantIncreaseDiscountPercent: false,
|
|
126
|
+
cantBuyWithCredits: false,
|
|
126
127
|
useVotingUnits: false,
|
|
127
128
|
splitPercent: 1_000_000_000,
|
|
128
129
|
splits: new JBSplit[](0)
|
|
@@ -124,8 +124,9 @@ contract CodexSplitCreditsMismatch is UnitTestSetup {
|
|
|
124
124
|
allowOwnerMint: false,
|
|
125
125
|
useReserveBeneficiaryAsDefault: false,
|
|
126
126
|
transfersPausable: false,
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
cantBeRemoved: false,
|
|
128
|
+
cantIncreaseDiscountPercent: false,
|
|
129
|
+
cantBuyWithCredits: false,
|
|
129
130
|
useVotingUnits: false,
|
|
130
131
|
splitPercent: 1_000_000_000,
|
|
131
132
|
splits: new JBSplit[](0)
|
|
@@ -353,8 +353,9 @@ contract ERC20CashOutFork is Test {
|
|
|
353
353
|
useReserveBeneficiaryAsDefault: false,
|
|
354
354
|
transfersPausable: false,
|
|
355
355
|
useVotingUnits: false,
|
|
356
|
-
|
|
357
|
-
|
|
356
|
+
cantBeRemoved: false,
|
|
357
|
+
cantIncreaseDiscountPercent: false,
|
|
358
|
+
cantBuyWithCredits: false,
|
|
358
359
|
splitPercent: 0,
|
|
359
360
|
splits: new JBSplit[](0)
|
|
360
361
|
});
|
|
@@ -438,8 +439,9 @@ contract ERC20CashOutFork is Test {
|
|
|
438
439
|
useReserveBeneficiaryAsDefault: false,
|
|
439
440
|
transfersPausable: false,
|
|
440
441
|
useVotingUnits: false,
|
|
441
|
-
|
|
442
|
-
|
|
442
|
+
cantBeRemoved: false,
|
|
443
|
+
cantIncreaseDiscountPercent: false,
|
|
444
|
+
cantBuyWithCredits: false,
|
|
443
445
|
splitPercent: 0,
|
|
444
446
|
splits: new JBSplit[](0)
|
|
445
447
|
});
|
|
@@ -524,8 +526,9 @@ contract ERC20CashOutFork is Test {
|
|
|
524
526
|
useReserveBeneficiaryAsDefault: false,
|
|
525
527
|
transfersPausable: false,
|
|
526
528
|
useVotingUnits: false,
|
|
527
|
-
|
|
528
|
-
|
|
529
|
+
cantBeRemoved: false,
|
|
530
|
+
cantIncreaseDiscountPercent: false,
|
|
531
|
+
cantBuyWithCredits: false,
|
|
529
532
|
splitPercent: 0,
|
|
530
533
|
splits: new JBSplit[](0)
|
|
531
534
|
});
|
|
@@ -543,8 +546,9 @@ contract ERC20CashOutFork is Test {
|
|
|
543
546
|
useReserveBeneficiaryAsDefault: false,
|
|
544
547
|
transfersPausable: false,
|
|
545
548
|
useVotingUnits: false,
|
|
546
|
-
|
|
547
|
-
|
|
549
|
+
cantBeRemoved: false,
|
|
550
|
+
cantIncreaseDiscountPercent: false,
|
|
551
|
+
cantBuyWithCredits: false,
|
|
548
552
|
splitPercent: 0,
|
|
549
553
|
splits: new JBSplit[](0)
|
|
550
554
|
});
|
|
@@ -406,8 +406,9 @@ contract ERC20TierSplitFork is Test {
|
|
|
406
406
|
useReserveBeneficiaryAsDefault: false,
|
|
407
407
|
transfersPausable: false,
|
|
408
408
|
useVotingUnits: false,
|
|
409
|
-
|
|
410
|
-
|
|
409
|
+
cantBeRemoved: false,
|
|
410
|
+
cantIncreaseDiscountPercent: false,
|
|
411
|
+
cantBuyWithCredits: false,
|
|
411
412
|
splitPercent: 300_000_000, // 30%
|
|
412
413
|
splits: splits
|
|
413
414
|
});
|
|
@@ -475,8 +476,9 @@ contract ERC20TierSplitFork is Test {
|
|
|
475
476
|
useReserveBeneficiaryAsDefault: false,
|
|
476
477
|
transfersPausable: false,
|
|
477
478
|
useVotingUnits: false,
|
|
478
|
-
|
|
479
|
-
|
|
479
|
+
cantBeRemoved: false,
|
|
480
|
+
cantIncreaseDiscountPercent: false,
|
|
481
|
+
cantBuyWithCredits: false,
|
|
480
482
|
splitPercent: 300_000_000, // 30%
|
|
481
483
|
splits: splits
|
|
482
484
|
});
|
|
@@ -542,8 +544,9 @@ contract ERC20TierSplitFork is Test {
|
|
|
542
544
|
useReserveBeneficiaryAsDefault: false,
|
|
543
545
|
transfersPausable: false,
|
|
544
546
|
useVotingUnits: false,
|
|
545
|
-
|
|
546
|
-
|
|
547
|
+
cantBeRemoved: false,
|
|
548
|
+
cantIncreaseDiscountPercent: false,
|
|
549
|
+
cantBuyWithCredits: false,
|
|
547
550
|
splitPercent: 500_000_000, // 50%
|
|
548
551
|
splits: splits
|
|
549
552
|
});
|
|
@@ -353,8 +353,9 @@ contract IssueTokensForSplitsFork is Test {
|
|
|
353
353
|
useReserveBeneficiaryAsDefault: false,
|
|
354
354
|
transfersPausable: false,
|
|
355
355
|
useVotingUnits: false,
|
|
356
|
-
|
|
357
|
-
|
|
356
|
+
cantBeRemoved: false,
|
|
357
|
+
cantIncreaseDiscountPercent: false,
|
|
358
|
+
cantBuyWithCredits: false,
|
|
358
359
|
splitPercent: splitPercent,
|
|
359
360
|
splits: splits
|
|
360
361
|
});
|
|
@@ -129,7 +129,7 @@ contract TierLifecycleHandler is Test {
|
|
|
129
129
|
tierIds[0] = uint16(tierId);
|
|
130
130
|
|
|
131
131
|
vm.prank(hookAddress);
|
|
132
|
-
try store.recordMint(tierPrice, tierIds, false) returns (uint256[] memory tokenIds, uint256) {
|
|
132
|
+
try store.recordMint(tierPrice, tierIds, false) returns (uint256[] memory tokenIds, uint256, uint256) {
|
|
133
133
|
// Track minted tokens
|
|
134
134
|
for (uint256 i = 0; i < tokenIds.length; i++) {
|
|
135
135
|
_actorTokenIds[actor].push(tokenIds[i]);
|
|
@@ -193,8 +193,9 @@ contract TierLifecycleHandler is Test {
|
|
|
193
193
|
useReserveBeneficiaryAsDefault: false,
|
|
194
194
|
transfersPausable: false,
|
|
195
195
|
useVotingUnits: false,
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
cantBeRemoved: false,
|
|
197
|
+
cantIncreaseDiscountPercent: false,
|
|
198
|
+
cantBuyWithCredits: false,
|
|
198
199
|
splitPercent: 0,
|
|
199
200
|
splits: new JBSplit[](0)
|
|
200
201
|
});
|
|
@@ -268,7 +269,7 @@ contract TierLifecycleHandler is Test {
|
|
|
268
269
|
tierIds[0] = uint16(tierId);
|
|
269
270
|
|
|
270
271
|
vm.prank(hookAddress);
|
|
271
|
-
try store.recordMint(0, tierIds, true) returns (uint256[] memory tokenIds, uint256) {
|
|
272
|
+
try store.recordMint(0, tierIds, true) returns (uint256[] memory tokenIds, uint256, uint256) {
|
|
272
273
|
address actor = _getActor(seed);
|
|
273
274
|
for (uint256 i = 0; i < tokenIds.length; i++) {
|
|
274
275
|
_actorTokenIds[actor].push(tokenIds[i]);
|
|
@@ -63,8 +63,9 @@ contract TierStoreHandler is CommonBase, StdCheats, StdUtils {
|
|
|
63
63
|
useReserveBeneficiaryAsDefault: false,
|
|
64
64
|
transfersPausable: false,
|
|
65
65
|
useVotingUnits: false,
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
cantBeRemoved: false,
|
|
67
|
+
cantIncreaseDiscountPercent: false,
|
|
68
|
+
cantBuyWithCredits: false,
|
|
68
69
|
splitPercent: 0,
|
|
69
70
|
splits: new JBSplit[](0)
|
|
70
71
|
});
|
|
@@ -122,7 +123,7 @@ contract TierStoreHandler is CommonBase, StdCheats, StdUtils {
|
|
|
122
123
|
|
|
123
124
|
/// @dev External wrapper for calldata.
|
|
124
125
|
function _doMint(uint256 amount, uint16[] calldata tierIds) external returns (uint256[] memory tokenIds) {
|
|
125
|
-
(tokenIds
|
|
126
|
+
(tokenIds,,) = STORE.recordMint(amount, tierIds, true);
|
|
126
127
|
}
|
|
127
128
|
|
|
128
129
|
/// @notice Burn a minted token.
|
|
@@ -123,8 +123,9 @@ contract Test_ProjectDeployerRulesets is UnitTestSetup {
|
|
|
123
123
|
useReserveBeneficiaryAsDefault: false,
|
|
124
124
|
transfersPausable: false,
|
|
125
125
|
useVotingUnits: true,
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
cantBeRemoved: false,
|
|
127
|
+
cantIncreaseDiscountPercent: false,
|
|
128
|
+
cantBuyWithCredits: false,
|
|
128
129
|
splitPercent: 0,
|
|
129
130
|
splits: new JBSplit[](0)
|
|
130
131
|
});
|
|
@@ -473,8 +473,9 @@ contract Test_AuditFixes_Unit is UnitTestSetup {
|
|
|
473
473
|
useReserveBeneficiaryAsDefault: false,
|
|
474
474
|
transfersPausable: false,
|
|
475
475
|
useVotingUnits: false,
|
|
476
|
-
|
|
477
|
-
|
|
476
|
+
cantBeRemoved: false,
|
|
477
|
+
cantIncreaseDiscountPercent: false,
|
|
478
|
+
cantBuyWithCredits: false,
|
|
478
479
|
splitPercent: 0,
|
|
479
480
|
splits: new JBSplit[](0)
|
|
480
481
|
});
|
|
@@ -491,8 +492,9 @@ contract Test_AuditFixes_Unit is UnitTestSetup {
|
|
|
491
492
|
useReserveBeneficiaryAsDefault: false,
|
|
492
493
|
transfersPausable: false,
|
|
493
494
|
useVotingUnits: false,
|
|
494
|
-
|
|
495
|
-
|
|
495
|
+
cantBeRemoved: false,
|
|
496
|
+
cantIncreaseDiscountPercent: false,
|
|
497
|
+
cantBuyWithCredits: false,
|
|
496
498
|
splitPercent: 0,
|
|
497
499
|
splits: new JBSplit[](0)
|
|
498
500
|
});
|
|
@@ -509,8 +511,9 @@ contract Test_AuditFixes_Unit is UnitTestSetup {
|
|
|
509
511
|
useReserveBeneficiaryAsDefault: false,
|
|
510
512
|
transfersPausable: false,
|
|
511
513
|
useVotingUnits: false,
|
|
512
|
-
|
|
513
|
-
|
|
514
|
+
cantBeRemoved: false,
|
|
515
|
+
cantIncreaseDiscountPercent: false,
|
|
516
|
+
cantBuyWithCredits: false,
|
|
514
517
|
splitPercent: 0,
|
|
515
518
|
splits: new JBSplit[](0)
|
|
516
519
|
});
|
|
@@ -577,8 +580,9 @@ contract Test_AuditFixes_Unit is UnitTestSetup {
|
|
|
577
580
|
useReserveBeneficiaryAsDefault: false,
|
|
578
581
|
transfersPausable: false,
|
|
579
582
|
useVotingUnits: false,
|
|
580
|
-
|
|
581
|
-
|
|
583
|
+
cantBeRemoved: false,
|
|
584
|
+
cantIncreaseDiscountPercent: false,
|
|
585
|
+
cantBuyWithCredits: false,
|
|
582
586
|
splitPercent: 0,
|
|
583
587
|
splits: new JBSplit[](0)
|
|
584
588
|
});
|