@bananapus/721-hook-v6 0.0.43 → 0.0.46
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/CHANGELOG.md +2 -3
- package/README.md +2 -2
- package/package.json +2 -2
- package/references/operations.md +2 -2
- package/references/runtime.md +1 -1
- package/script/helpers/Hook721DeploymentLib.sol +21 -5
- package/src/JB721Checkpoints.sol +5 -7
- package/src/JB721CheckpointsDeployer.sol +9 -1
- package/src/JB721TiersHook.sol +72 -76
- package/src/JB721TiersHookDeployer.sol +8 -6
- package/src/JB721TiersHookProjectDeployer.sol +22 -20
- package/src/JB721TiersHookStore.sol +170 -134
- package/src/abstract/ERC721.sol +24 -22
- package/src/abstract/JB721Hook.sol +20 -14
- package/src/interfaces/IJB721Checkpoints.sol +1 -1
- package/src/interfaces/IJB721CheckpointsDeployer.sol +0 -3
- package/src/interfaces/IJB721TiersHook.sol +2 -10
- package/src/interfaces/IJB721TiersHookProjectDeployer.sol +2 -2
- package/src/interfaces/IJB721TiersHookStore.sol +11 -11
- package/src/libraries/JB721Constants.sol +1 -0
- package/src/libraries/JB721TiersHookLib.sol +20 -33
- package/src/libraries/JBBitmap.sol +1 -1
- package/src/structs/JB721TiersHookFlags.sol +1 -1
- package/src/structs/JBPayDataHookRulesetMetadata.sol +3 -3
- package/test/utils/UnitTestSetup.sol +2 -2
|
@@ -24,8 +24,9 @@ import {JBPayDataHookRulesetConfig} from "./structs/JBPayDataHookRulesetConfig.s
|
|
|
24
24
|
import {JBQueueRulesetsConfig} from "./structs/JBQueueRulesetsConfig.sol";
|
|
25
25
|
|
|
26
26
|
/// @title JB721TiersHookProjectDeployer
|
|
27
|
-
/// @notice
|
|
28
|
-
///
|
|
27
|
+
/// @notice All-in-one deployer that creates a Juicebox project, deploys a 721 tiers hook, and configures its
|
|
28
|
+
/// rulesets in a single transaction. Can also attach a hook to an existing project by launching or queuing rulesets
|
|
29
|
+
/// with `LAUNCH_RULESETS` or `QUEUE_RULESETS` permission.
|
|
29
30
|
contract JB721TiersHookProjectDeployer is
|
|
30
31
|
ERC2771Context,
|
|
31
32
|
JBPermissioned,
|
|
@@ -39,7 +40,7 @@ contract JB721TiersHookProjectDeployer is
|
|
|
39
40
|
/// @notice The directory of terminals and controllers for projects.
|
|
40
41
|
IJBDirectory public immutable override DIRECTORY;
|
|
41
42
|
|
|
42
|
-
/// @notice The 721 tiers hook
|
|
43
|
+
/// @notice The deployer contract used to create new 721 tiers hook instances via clone.
|
|
43
44
|
IJB721TiersHookDeployer public immutable override HOOK_DEPLOYER;
|
|
44
45
|
|
|
45
46
|
//*********************************************************************//
|
|
@@ -70,9 +71,8 @@ contract JB721TiersHookProjectDeployer is
|
|
|
70
71
|
/// @notice Launches a new project with a 721 tiers hook attached.
|
|
71
72
|
/// @param owner The address to set as the owner of the project. The ERC-721 which confers this project's ownership
|
|
72
73
|
/// will be sent to this address.
|
|
73
|
-
/// @param deployTiersHookConfig Configuration which dictates the behavior of the 721 tiers hook
|
|
74
|
-
///
|
|
75
|
-
/// @param launchProjectConfig Configuration which dictates the behavior of the project which is being launched.
|
|
74
|
+
/// @param deployTiersHookConfig Configuration which dictates the behavior of the 721 tiers hook to deploy.
|
|
75
|
+
/// @param launchProjectConfig Configuration which dictates the behavior of the project to launch.
|
|
76
76
|
/// @param controller The controller that the project's rulesets will be queued with.
|
|
77
77
|
/// @param salt A salt to use for the deterministic deployment.
|
|
78
78
|
/// @return projectId The ID of the newly launched project.
|
|
@@ -114,9 +114,8 @@ contract JB721TiersHookProjectDeployer is
|
|
|
114
114
|
/// @notice Launches rulesets for a project with an attached 721 tiers hook.
|
|
115
115
|
/// @dev Only a project's owner or an operator with the `LAUNCH_RULESETS & SET_TERMINALS` permission can launch its
|
|
116
116
|
/// rulesets.
|
|
117
|
-
/// @param projectId The ID of the project
|
|
118
|
-
/// @param deployTiersHookConfig Configuration which dictates the behavior of the 721 tiers hook
|
|
119
|
-
/// deployed.
|
|
117
|
+
/// @param projectId The ID of the project to launch rulesets for.
|
|
118
|
+
/// @param deployTiersHookConfig Configuration which dictates the behavior of the 721 tiers hook to deploy.
|
|
120
119
|
/// @param launchRulesetsConfig Configuration which dictates the project's new rulesets.
|
|
121
120
|
/// @param projectUri Metadata URI to associate with the project. Pass an empty string to leave it unchanged.
|
|
122
121
|
/// @param controller The controller that the project's rulesets will be queued with.
|
|
@@ -176,9 +175,8 @@ contract JB721TiersHookProjectDeployer is
|
|
|
176
175
|
|
|
177
176
|
/// @notice Queues rulesets for a project with an attached 721 tiers hook.
|
|
178
177
|
/// @dev Only a project's owner or an operator with the `QUEUE_RULESETS` permission can queue its rulesets.
|
|
179
|
-
/// @param projectId The ID of the project
|
|
180
|
-
/// @param deployTiersHookConfig Configuration which dictates the behavior of the 721 tiers hook
|
|
181
|
-
/// deployed.
|
|
178
|
+
/// @param projectId The ID of the project to queue rulesets for.
|
|
179
|
+
/// @param deployTiersHookConfig Configuration which dictates the behavior of the 721 tiers hook to deploy.
|
|
182
180
|
/// @param queueRulesetsConfig Configuration which dictates the project's newly queued rulesets.
|
|
183
181
|
/// @param controller The controller that the project's rulesets will be queued with.
|
|
184
182
|
/// @param salt A salt to use for the deterministic deployment.
|
|
@@ -232,9 +230,11 @@ contract JB721TiersHookProjectDeployer is
|
|
|
232
230
|
// ----------------------- internal helpers -------------------------- //
|
|
233
231
|
//*********************************************************************//
|
|
234
232
|
|
|
235
|
-
/// @notice
|
|
233
|
+
/// @notice Configure and launch rulesets for a newly created project. Converts `JBPayDataHookRulesetConfig` entries
|
|
234
|
+
/// into standard `JBRulesetConfig` entries with `useDataHookForPay` forced to `true` and the deployed hook set as
|
|
235
|
+
/// the data hook.
|
|
236
236
|
/// @param projectId The ID of the reserved project.
|
|
237
|
-
/// @param launchProjectConfig Configuration which dictates the behavior of the project
|
|
237
|
+
/// @param launchProjectConfig Configuration which dictates the behavior of the project to launch.
|
|
238
238
|
/// @param dataHook The data hook to use for the project.
|
|
239
239
|
/// @param controller The controller that the project's rulesets will be queued with.
|
|
240
240
|
function _launchProjectFor(
|
|
@@ -276,7 +276,7 @@ contract JB721TiersHookProjectDeployer is
|
|
|
276
276
|
allowAddPriceFeed: payDataRulesetConfig.metadata.allowAddPriceFeed,
|
|
277
277
|
ownerMustSendPayouts: payDataRulesetConfig.metadata.ownerMustSendPayouts,
|
|
278
278
|
holdFees: payDataRulesetConfig.metadata.holdFees,
|
|
279
|
-
|
|
279
|
+
scopeCashOutsToLocalBalances: payDataRulesetConfig.metadata.scopeCashOutsToLocalBalances,
|
|
280
280
|
useDataHookForPay: true,
|
|
281
281
|
useDataHookForCashOut: payDataRulesetConfig.metadata.useDataHookForCashOut,
|
|
282
282
|
dataHook: address(dataHook),
|
|
@@ -292,7 +292,6 @@ contract JB721TiersHookProjectDeployer is
|
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
// Launch the rulesets for the reserved project.
|
|
295
|
-
// slither-disable-next-line unused-return
|
|
296
295
|
controller.launchRulesetsFor({
|
|
297
296
|
projectId: projectId,
|
|
298
297
|
projectUri: launchProjectConfig.projectUri,
|
|
@@ -302,7 +301,8 @@ contract JB721TiersHookProjectDeployer is
|
|
|
302
301
|
});
|
|
303
302
|
}
|
|
304
303
|
|
|
305
|
-
/// @notice
|
|
304
|
+
/// @notice Launch rulesets for an existing project. Same conversion logic as `_launchProjectFor` — each
|
|
305
|
+
/// `JBPayDataHookRulesetConfig` is transformed into a `JBRulesetConfig` with the hook wired as the data hook.
|
|
306
306
|
/// @param projectId The ID of the project to launch rulesets for.
|
|
307
307
|
/// @param launchRulesetsConfig Configuration which dictates the behavior of the project's rulesets.
|
|
308
308
|
/// @param projectUri Metadata URI to associate with the project. Pass an empty string to leave it unchanged.
|
|
@@ -350,7 +350,7 @@ contract JB721TiersHookProjectDeployer is
|
|
|
350
350
|
allowAddPriceFeed: payDataRulesetConfig.metadata.allowAddPriceFeed,
|
|
351
351
|
ownerMustSendPayouts: payDataRulesetConfig.metadata.ownerMustSendPayouts,
|
|
352
352
|
holdFees: payDataRulesetConfig.metadata.holdFees,
|
|
353
|
-
|
|
353
|
+
scopeCashOutsToLocalBalances: payDataRulesetConfig.metadata.scopeCashOutsToLocalBalances,
|
|
354
354
|
useDataHookForPay: true,
|
|
355
355
|
useDataHookForCashOut: payDataRulesetConfig.metadata.useDataHookForCashOut,
|
|
356
356
|
dataHook: address(dataHook),
|
|
@@ -377,7 +377,9 @@ contract JB721TiersHookProjectDeployer is
|
|
|
377
377
|
return rulesetId;
|
|
378
378
|
}
|
|
379
379
|
|
|
380
|
-
/// @notice
|
|
380
|
+
/// @notice Queue future rulesets for an existing project. Same conversion logic as the launch functions — each
|
|
381
|
+
/// `JBPayDataHookRulesetConfig` is transformed into a `JBRulesetConfig` with the hook wired as the data hook.
|
|
382
|
+
/// Queued rulesets take effect after the current ruleset expires.
|
|
381
383
|
/// @param projectId The ID of the project to queue rulesets for.
|
|
382
384
|
/// @param queueRulesetsConfig Configuration which dictates the behavior of the project's rulesets.
|
|
383
385
|
/// @param dataHook The data hook to use for the project.
|
|
@@ -423,7 +425,7 @@ contract JB721TiersHookProjectDeployer is
|
|
|
423
425
|
allowAddPriceFeed: payDataRulesetConfig.metadata.allowAddPriceFeed,
|
|
424
426
|
ownerMustSendPayouts: payDataRulesetConfig.metadata.ownerMustSendPayouts,
|
|
425
427
|
holdFees: payDataRulesetConfig.metadata.holdFees,
|
|
426
|
-
|
|
428
|
+
scopeCashOutsToLocalBalances: payDataRulesetConfig.metadata.scopeCashOutsToLocalBalances,
|
|
427
429
|
useDataHookForPay: true,
|
|
428
430
|
useDataHookForCashOut: payDataRulesetConfig.metadata.useDataHookForCashOut,
|
|
429
431
|
dataHook: address(dataHook),
|