@bananapus/721-hook-v6 0.0.50 → 0.0.52
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 +4 -4
- package/script/Deploy.s.sol +36 -39
- package/script/helpers/Hook721DeploymentLib.sol +18 -24
- package/src/JB721Checkpoints.sol +11 -11
- package/src/JB721TiersHook.sol +33 -36
- package/src/JB721TiersHookDeployer.sol +1 -1
- package/src/JB721TiersHookProjectDeployer.sol +5 -8
- package/src/JB721TiersHookStore.sol +9 -9
- package/src/abstract/ERC721.sol +3 -3
- package/src/abstract/JB721Hook.sol +15 -13
- package/src/interfaces/IJB721Checkpoints.sol +3 -3
- package/src/interfaces/IJB721Hook.sol +1 -1
- package/src/interfaces/IJB721TiersHook.sol +8 -9
- package/src/interfaces/IJB721TiersHookStore.sol +3 -3
- package/src/libraries/JB721TiersHookLib.sol +182 -43
- package/src/structs/JB721Tier.sol +2 -2
- package/src/structs/JB721TierConfig.sol +2 -2
- package/src/structs/JBPayDataHookRulesetMetadata.sol +0 -3
- package/test/utils/ForTest_JB721TiersHook.sol +1 -1
- package/test/utils/UnitTestSetup.sol +8 -10
|
@@ -190,7 +190,7 @@ contract UnitTestSetup is Test {
|
|
|
190
190
|
tiers[i].price = uint104((i + 1) * 10); // The price is `tierId` * 10.
|
|
191
191
|
tiers[i].initialSupply = uint32(100);
|
|
192
192
|
tiers[i].reserveBeneficiary = reserveBeneficiary;
|
|
193
|
-
tiers[i].
|
|
193
|
+
tiers[i].encodedIpfsUri = tokenUris[i];
|
|
194
194
|
tiers[i].category = uint24(100);
|
|
195
195
|
tiers[i].flags.useVotingUnits = true;
|
|
196
196
|
}
|
|
@@ -224,7 +224,6 @@ contract UnitTestSetup is Test {
|
|
|
224
224
|
ownerMustSendPayouts: false,
|
|
225
225
|
holdFees: false,
|
|
226
226
|
scopeCashOutsToLocalBalances: true,
|
|
227
|
-
pauseCrossProjectFeeFreeInflows: false,
|
|
228
227
|
useDataHookForPay: true,
|
|
229
228
|
useDataHookForCashOut: true,
|
|
230
229
|
dataHook: address(0),
|
|
@@ -326,7 +325,7 @@ contract UnitTestSetup is Test {
|
|
|
326
325
|
assertEq(first.votingUnits, second.votingUnits);
|
|
327
326
|
assertEq(first.reserveFrequency, second.reserveFrequency);
|
|
328
327
|
assertEq(first.reserveBeneficiary, second.reserveBeneficiary);
|
|
329
|
-
assertEq(first.
|
|
328
|
+
assertEq(first.encodedIpfsUri, second.encodedIpfsUri);
|
|
330
329
|
}
|
|
331
330
|
|
|
332
331
|
// Compare two arrays of `JB721Tier`s.
|
|
@@ -340,7 +339,7 @@ contract UnitTestSetup is Test {
|
|
|
340
339
|
assertEq(first[i].votingUnits, second[i].votingUnits);
|
|
341
340
|
assertEq(first[i].reserveFrequency, second[i].reserveFrequency);
|
|
342
341
|
assertEq(first[i].reserveBeneficiary, second[i].reserveBeneficiary);
|
|
343
|
-
assertEq(first[i].
|
|
342
|
+
assertEq(first[i].encodedIpfsUri, second[i].encodedIpfsUri);
|
|
344
343
|
}
|
|
345
344
|
}
|
|
346
345
|
|
|
@@ -391,7 +390,7 @@ contract UnitTestSetup is Test {
|
|
|
391
390
|
&& first.initialSupply == second.initialSupply && first.votingUnits == second.votingUnits
|
|
392
391
|
&& first.reserveFrequency == second.reserveFrequency
|
|
393
392
|
&& first.reserveBeneficiary == second.reserveBeneficiary
|
|
394
|
-
&& first.
|
|
393
|
+
&& first.encodedIpfsUri == second.encodedIpfsUri
|
|
395
394
|
&& keccak256(abi.encodePacked(first.resolvedUri)) == keccak256(abi.encodePacked(second.resolvedUri)));
|
|
396
395
|
}
|
|
397
396
|
|
|
@@ -517,7 +516,7 @@ contract UnitTestSetup is Test {
|
|
|
517
516
|
votingUnits: tierConfig.votingUnits,
|
|
518
517
|
reserveFrequency: tierConfig.reserveFrequency,
|
|
519
518
|
reserveBeneficiary: reserveBeneficiary,
|
|
520
|
-
|
|
519
|
+
encodedIpfsUri: i < tokenUris.length ? tokenUris[i] : tokenUris[0],
|
|
521
520
|
category: categoryIncrement == 0
|
|
522
521
|
// forge-lint: disable-next-line(unsafe-typecast)
|
|
523
522
|
? tierConfig.category == type(uint24).max ? uint24(i * 2 + 1) : tierConfig.category
|
|
@@ -546,7 +545,7 @@ contract UnitTestSetup is Test {
|
|
|
546
545
|
votingUnits: tierConfigs[i].votingUnits,
|
|
547
546
|
reserveFrequency: tierConfigs[i].reserveFrequency,
|
|
548
547
|
reserveBeneficiary: tierConfigs[i].reserveBeneficiary,
|
|
549
|
-
|
|
548
|
+
encodedIpfsUri: tierConfigs[i].encodedIpfsUri,
|
|
550
549
|
category: tierConfigs[i].category,
|
|
551
550
|
discountPercent: tierConfigs[i].discountPercent,
|
|
552
551
|
flags: JB721TierFlags({
|
|
@@ -557,7 +556,7 @@ contract UnitTestSetup is Test {
|
|
|
557
556
|
cantBuyWithCredits: tierConfigs[i].flags.cantBuyWithCredits
|
|
558
557
|
}),
|
|
559
558
|
splitPercent: tierConfigs[i].splitPercent,
|
|
560
|
-
resolvedUri: defaultTierConfig.
|
|
559
|
+
resolvedUri: defaultTierConfig.encodedIpfsUri == bytes32(0)
|
|
561
560
|
? ""
|
|
562
561
|
: string(abi.encodePacked("resolverURI", _generateTokenId(initialId + i + 1, 0)))
|
|
563
562
|
});
|
|
@@ -722,7 +721,7 @@ contract UnitTestSetup is Test {
|
|
|
722
721
|
votingUnits: uint16(0),
|
|
723
722
|
reserveFrequency: uint16(0),
|
|
724
723
|
reserveBeneficiary: reserveBeneficiary,
|
|
725
|
-
|
|
724
|
+
encodedIpfsUri: tokenUris[i],
|
|
726
725
|
category: uint24(100),
|
|
727
726
|
discountPercent: uint8(0),
|
|
728
727
|
flags: JB721TierConfigFlags({
|
|
@@ -774,7 +773,6 @@ contract UnitTestSetup is Test {
|
|
|
774
773
|
allowAddPriceFeed: false,
|
|
775
774
|
holdFees: false,
|
|
776
775
|
scopeCashOutsToLocalBalances: true,
|
|
777
|
-
pauseCrossProjectFeeFreeInflows: false,
|
|
778
776
|
useDataHookForCashOut: false,
|
|
779
777
|
metadata: 0x00
|
|
780
778
|
});
|