@bananapus/721-hook-v6 0.0.34 → 0.0.36
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/ADMINISTRATION.md +62 -164
- package/ARCHITECTURE.md +59 -44
- package/AUDIT_INSTRUCTIONS.md +35 -32
- package/README.md +22 -3
- package/RISKS.md +7 -1
- package/SKILLS.md +8 -2
- package/USER_JOURNEYS.md +144 -49
- package/foundry.toml +2 -0
- package/package.json +1 -1
- package/references/operations.md +7 -3
- package/references/runtime.md +5 -4
- package/src/JB721TiersHook.sol +6 -6
- package/src/JB721TiersHookProjectDeployer.sol +0 -1
- package/src/JB721TiersHookStore.sol +1 -2
- package/src/abstract/JB721Hook.sol +0 -1
- package/src/interfaces/IJB721TiersHook.sol +0 -2
- package/src/interfaces/IJB721TiersHookStore.sol +1 -1
- package/src/libraries/JB721Constants.sol +0 -1
- package/src/structs/JB721InitTiersConfig.sol +0 -1
- package/src/structs/JB721Tier.sol +0 -2
- package/src/structs/JB721TierConfig.sol +0 -2
- package/src/structs/JB721TierConfigFlags.sol +0 -1
- package/src/structs/JB721TierFlags.sol +0 -1
- package/src/structs/JB721TiersHookFlags.sol +0 -1
- package/src/structs/JB721TiersMintReservesConfig.sol +0 -1
- package/src/structs/JB721TiersRulesetMetadata.sol +0 -1
- package/src/structs/JB721TiersSetDiscountPercentConfig.sol +0 -1
- package/src/structs/JBBitmapWord.sol +0 -1
- package/src/structs/JBDeploy721TiersHookConfig.sol +0 -1
- package/src/structs/JBLaunchProjectConfig.sol +0 -1
- package/src/structs/JBLaunchRulesetsConfig.sol +0 -1
- package/src/structs/JBPayDataHookRulesetConfig.sol +0 -1
- package/src/structs/JBPayDataHookRulesetMetadata.sol +0 -1
- package/src/structs/JBQueueRulesetsConfig.sol +0 -1
- package/src/structs/JBStored721Tier.sol +0 -1
- package/test/TestCheckpoints.t.sol +16 -4
|
@@ -48,17 +48,29 @@ contract TestCheckpoints is UnitTestSetup {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
// -------------------------------------------------------------------
|
|
51
|
-
// Test 1: Checkpoint module is deployed
|
|
51
|
+
// Test 1: Checkpoint module is deployed lazily on first transfer
|
|
52
52
|
// -------------------------------------------------------------------
|
|
53
|
-
function
|
|
53
|
+
function test_checkpointModule_isDeployedLazily() public {
|
|
54
54
|
defaultTierConfig.flags.allowOwnerMint = true;
|
|
55
55
|
defaultTierConfig.reserveFrequency = 0;
|
|
56
56
|
|
|
57
57
|
ForTest_JB721TiersHook tiersHook = _initializeHookWithCheckpoints(1);
|
|
58
58
|
|
|
59
|
-
// CHECKPOINTS should be deployed
|
|
59
|
+
// CHECKPOINTS should NOT be deployed after initialization (lazy deployment).
|
|
60
60
|
assertTrue(
|
|
61
|
-
address(tiersHook.CHECKPOINTS())
|
|
61
|
+
address(tiersHook.CHECKPOINTS()) == address(0),
|
|
62
|
+
"Checkpoint module should not be deployed after initialization"
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
// Mint a token to trigger lazy deployment.
|
|
66
|
+
uint16[] memory tiersToMint = new uint16[](1);
|
|
67
|
+
tiersToMint[0] = 1;
|
|
68
|
+
vm.prank(owner);
|
|
69
|
+
tiersHook.mintFor(tiersToMint, owner);
|
|
70
|
+
|
|
71
|
+
// CHECKPOINTS should now be deployed after the first mint.
|
|
72
|
+
assertTrue(
|
|
73
|
+
address(tiersHook.CHECKPOINTS()) != address(0), "Checkpoint module should be deployed after first mint"
|
|
62
74
|
);
|
|
63
75
|
}
|
|
64
76
|
|