@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.
Files changed (36) hide show
  1. package/ADMINISTRATION.md +62 -164
  2. package/ARCHITECTURE.md +59 -44
  3. package/AUDIT_INSTRUCTIONS.md +35 -32
  4. package/README.md +22 -3
  5. package/RISKS.md +7 -1
  6. package/SKILLS.md +8 -2
  7. package/USER_JOURNEYS.md +144 -49
  8. package/foundry.toml +2 -0
  9. package/package.json +1 -1
  10. package/references/operations.md +7 -3
  11. package/references/runtime.md +5 -4
  12. package/src/JB721TiersHook.sol +6 -6
  13. package/src/JB721TiersHookProjectDeployer.sol +0 -1
  14. package/src/JB721TiersHookStore.sol +1 -2
  15. package/src/abstract/JB721Hook.sol +0 -1
  16. package/src/interfaces/IJB721TiersHook.sol +0 -2
  17. package/src/interfaces/IJB721TiersHookStore.sol +1 -1
  18. package/src/libraries/JB721Constants.sol +0 -1
  19. package/src/structs/JB721InitTiersConfig.sol +0 -1
  20. package/src/structs/JB721Tier.sol +0 -2
  21. package/src/structs/JB721TierConfig.sol +0 -2
  22. package/src/structs/JB721TierConfigFlags.sol +0 -1
  23. package/src/structs/JB721TierFlags.sol +0 -1
  24. package/src/structs/JB721TiersHookFlags.sol +0 -1
  25. package/src/structs/JB721TiersMintReservesConfig.sol +0 -1
  26. package/src/structs/JB721TiersRulesetMetadata.sol +0 -1
  27. package/src/structs/JB721TiersSetDiscountPercentConfig.sol +0 -1
  28. package/src/structs/JBBitmapWord.sol +0 -1
  29. package/src/structs/JBDeploy721TiersHookConfig.sol +0 -1
  30. package/src/structs/JBLaunchProjectConfig.sol +0 -1
  31. package/src/structs/JBLaunchRulesetsConfig.sol +0 -1
  32. package/src/structs/JBPayDataHookRulesetConfig.sol +0 -1
  33. package/src/structs/JBPayDataHookRulesetMetadata.sol +0 -1
  34. package/src/structs/JBQueueRulesetsConfig.sol +0 -1
  35. package/src/structs/JBStored721Tier.sol +0 -1
  36. 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 eagerly during initialize
51
+ // Test 1: Checkpoint module is deployed lazily on first transfer
52
52
  // -------------------------------------------------------------------
53
- function test_checkpointModule_isDeployed() public {
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 immediately after initialization.
59
+ // CHECKPOINTS should NOT be deployed after initialization (lazy deployment).
60
60
  assertTrue(
61
- address(tiersHook.CHECKPOINTS()) != address(0), "Checkpoint module should be deployed after initialization"
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