@bananapus/omnichain-deployers-v6 0.0.51 → 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 +9 -9
- package/references/operations.md +1 -1
- package/script/Deploy.s.sol +4 -4
- package/script/helpers/DeployersDeploymentLib.sol +1 -1
- package/src/JBOmnichainDeployer.sol +11 -14
- package/src/interfaces/IJBOmnichainDeployer.sol +2 -4
- package/src/structs/JBSuckerDeploymentConfig.sol +2 -2
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bananapus/omnichain-deployers-v6",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.52",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/Bananapus/nana-omnichain-deployers-v6"
|
|
7
|
+
"url": "git+https://github.com/Bananapus/nana-omnichain-deployers-v6.git"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"foundry.toml",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"src/"
|
|
15
15
|
],
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": "
|
|
17
|
+
"node": ">=20.0.0"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"test": "forge test",
|
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
"artifacts": "source ./.env && npx sphinx artifacts --org-id 'ea165b21-7cdc-4d7b-be59-ecdd4c26bee4' --project-name 'nana-omnichain-deployers-v6'"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@bananapus/721-hook-v6": "^0.0.
|
|
28
|
-
"@bananapus/core-v6": "^0.0.
|
|
29
|
-
"@bananapus/ownable-v6": "^0.0.
|
|
27
|
+
"@bananapus/721-hook-v6": "^0.0.59",
|
|
28
|
+
"@bananapus/core-v6": "^0.0.72",
|
|
29
|
+
"@bananapus/ownable-v6": "^0.0.32",
|
|
30
30
|
"@bananapus/permission-ids-v6": "^0.0.27",
|
|
31
|
-
"@bananapus/suckers-v6": "^0.0.
|
|
31
|
+
"@bananapus/suckers-v6": "^0.0.60",
|
|
32
32
|
"@openzeppelin/contracts": "5.6.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@bananapus/address-registry-v6": "^0.0.
|
|
36
|
-
"@bananapus/buyback-hook-v6": "^0.0.
|
|
35
|
+
"@bananapus/address-registry-v6": "^0.0.29",
|
|
36
|
+
"@bananapus/buyback-hook-v6": "^0.0.58",
|
|
37
37
|
"@sphinx-labs/plugins": "0.33.3",
|
|
38
38
|
"@uniswap/v4-core": "1.0.2"
|
|
39
39
|
}
|
package/references/operations.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
- If you edit launch or queue behavior, verify ruleset IDs, carry-forward behavior, and stored hook config keys together.
|
|
12
12
|
- If you edit salt handling, confirm deterministic-address assumptions for both suckers and 721 hooks.
|
|
13
|
-
- If you edit wrapper behavior, check both pay and cash-out paths, not
|
|
13
|
+
- If you edit wrapper behavior, check both pay and cash-out paths, not only one.
|
|
14
14
|
- If you touch mint-permission logic, confirm whether the permission should come from suckers, the extra hook, or neither.
|
|
15
15
|
|
|
16
16
|
## Common Failure Modes
|
package/script/Deploy.s.sol
CHANGED
|
@@ -13,13 +13,13 @@ import {JBOmnichainDeployer} from "src/JBOmnichainDeployer.sol";
|
|
|
13
13
|
contract Deploy is Script, Sphinx {
|
|
14
14
|
bytes32 constant NANA_OMNICHAIN_DEPLOYER_SALT = "JBOmnichainDeployerV6_";
|
|
15
15
|
|
|
16
|
-
/// @notice
|
|
16
|
+
/// @notice Tracks the core deployment for the current chain.
|
|
17
17
|
CoreDeployment core;
|
|
18
18
|
|
|
19
|
-
/// @notice
|
|
19
|
+
/// @notice Tracks the 721 hook deployment for the current chain.
|
|
20
20
|
Hook721Deployment hook;
|
|
21
21
|
|
|
22
|
-
/// @notice
|
|
22
|
+
/// @notice Tracks the sucker deployment for the current chain.
|
|
23
23
|
SuckerDeployment suckers;
|
|
24
24
|
|
|
25
25
|
function configureSphinx() public override {
|
|
@@ -29,7 +29,7 @@ contract Deploy is Script, Sphinx {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function run() public {
|
|
32
|
-
// Get the deployment addresses for
|
|
32
|
+
// Get the core deployment addresses for this chain.
|
|
33
33
|
// We want to do this outside of the `sphinx` modifier.
|
|
34
34
|
core = CoreDeploymentLib.getDeployment(
|
|
35
35
|
vm.envOr({
|
|
@@ -42,7 +42,7 @@ library DeployersDeploymentLib {
|
|
|
42
42
|
view
|
|
43
43
|
returns (DeployersDeployment memory deployment)
|
|
44
44
|
{
|
|
45
|
-
//
|
|
45
|
+
// Read the omnichain deployer address for this supported chain.
|
|
46
46
|
deployment.deployer = JBOmnichainDeployer(
|
|
47
47
|
_getDeploymentAddress({
|
|
48
48
|
path: path,
|
|
@@ -37,13 +37,11 @@ import {mulDiv} from "@prb/math/src/Common.sol";
|
|
|
37
37
|
/// 721 hook and cross-chain suckers in a single transaction, then inserts itself as every ruleset's data hook so it can
|
|
38
38
|
/// coordinate between the 721 hook, an optional extra hook (e.g. buyback), and the sucker registry at pay/cash-out
|
|
39
39
|
/// time. At pay time it merges weight and hook specifications from both the 721 hook and the extra hook. At cash-out
|
|
40
|
-
/// time it
|
|
41
|
-
///
|
|
42
|
-
/// tax, and delegates tax-rate adjustments to the underlying hooks.
|
|
40
|
+
/// time it computes cross-chain total supply and surplus (so the bonding curve reflects all chains), grants suckers 0%
|
|
41
|
+
/// cash-out tax, and delegates tax-rate adjustments to the underlying hooks.
|
|
43
42
|
/// @dev Project NFTs sent to this contract are not recoverable. The deployer does not implement any NFT rescue
|
|
44
43
|
/// mechanism beyond `onERC721Received` for `JBProjects`. This is acceptable because the deployer should never own
|
|
45
|
-
/// project NFTs —
|
|
46
|
-
/// it creates projects and transfers ownership in the same transaction.
|
|
44
|
+
/// project NFTs — it creates projects and transfers ownership in the same transaction.
|
|
47
45
|
contract JBOmnichainDeployer is
|
|
48
46
|
ERC2771Context,
|
|
49
47
|
JBPermissioned,
|
|
@@ -136,16 +134,14 @@ contract JBOmnichainDeployer is
|
|
|
136
134
|
HOOK_DEPLOYER = hookDeployer;
|
|
137
135
|
DIRECTORY = controller.DIRECTORY();
|
|
138
136
|
|
|
139
|
-
//
|
|
137
|
+
// Let the sucker registry map tokens for projects this deployer administers.
|
|
140
138
|
uint8[] memory permissionIds = new uint8[](1);
|
|
141
139
|
permissionIds[0] = JBPermissionIds.MAP_SUCKER_TOKEN;
|
|
142
140
|
|
|
143
|
-
//
|
|
144
|
-
// Set up the permission data.
|
|
141
|
+
// Grant the registry a deployer-scoped wildcard permission.
|
|
145
142
|
JBPermissionsData memory permissionData =
|
|
146
143
|
JBPermissionsData({operator: address(SUCKER_REGISTRY), projectId: 0, permissionIds: permissionIds});
|
|
147
144
|
|
|
148
|
-
// Set the permissions.
|
|
149
145
|
PERMISSIONS.setPermissionsFor({account: address(this), permissionsData: permissionData});
|
|
150
146
|
}
|
|
151
147
|
|
|
@@ -732,8 +728,9 @@ contract JBOmnichainDeployer is
|
|
|
732
728
|
|
|
733
729
|
/// @notice Indicates if this contract adheres to the specified interface.
|
|
734
730
|
/// @dev See `IERC165.supportsInterface`.
|
|
735
|
-
/// @
|
|
736
|
-
|
|
731
|
+
/// @param interfaceId The interface ID to check.
|
|
732
|
+
/// @return flag A flag indicating if the provided interface ID is supported.
|
|
733
|
+
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool flag) {
|
|
737
734
|
return interfaceId == type(IJBOmnichainDeployer).interfaceId
|
|
738
735
|
|| interfaceId == type(IJBRulesetDataHook).interfaceId
|
|
739
736
|
|| interfaceId == type(IJBPeerChainAdjustedAccounts).interfaceId
|
|
@@ -807,7 +804,7 @@ contract JBOmnichainDeployer is
|
|
|
807
804
|
// A fresh launch must leave the directory pointing at this deployer's canonical controller.
|
|
808
805
|
_requireController({projectId: projectId, allowUnset: false});
|
|
809
806
|
|
|
810
|
-
// Transfer the hook's ownership to the project
|
|
807
|
+
// Transfer the hook's ownership to the project after the project NFT has been minted.
|
|
811
808
|
JBOwnable(address(hook)).transferOwnershipToProject(projectId);
|
|
812
809
|
|
|
813
810
|
// Deploy the suckers (if applicable).
|
|
@@ -1001,7 +998,7 @@ contract JBOmnichainDeployer is
|
|
|
1001
998
|
_tiered721HookOf[projectId][rulesetId] =
|
|
1002
999
|
JBTiered721HookConfig({hook: hook721, useDataHookForCashOut: use721ForCashOut});
|
|
1003
1000
|
|
|
1004
|
-
// Store
|
|
1001
|
+
// Store any extra hook provided in ruleset metadata.
|
|
1005
1002
|
if (rulesetConfigurations[i].metadata.dataHook != address(0)) {
|
|
1006
1003
|
_extraDataHookOf[projectId][rulesetId] = JBDeployerHookConfig({
|
|
1007
1004
|
dataHook: IJBRulesetDataHook(rulesetConfigurations[i].metadata.dataHook),
|
|
@@ -1010,7 +1007,7 @@ contract JBOmnichainDeployer is
|
|
|
1010
1007
|
});
|
|
1011
1008
|
}
|
|
1012
1009
|
|
|
1013
|
-
// Set this contract as the data hook,
|
|
1010
|
+
// Set this contract as the data hook, forcing both pay and cash-out through this wrapper.
|
|
1014
1011
|
rulesetConfigurations[i].metadata.dataHook = address(this);
|
|
1015
1012
|
rulesetConfigurations[i].metadata.useDataHookForPay = true;
|
|
1016
1013
|
rulesetConfigurations[i].metadata.useDataHookForCashOut = true;
|
|
@@ -9,10 +9,8 @@ import {JBDeployerHookConfig} from "../structs/JBDeployerHookConfig.sol";
|
|
|
9
9
|
import {JBOmnichain721Config} from "../structs/JBOmnichain721Config.sol";
|
|
10
10
|
import {JBSuckerDeploymentConfig} from "../structs/JBSuckerDeploymentConfig.sol";
|
|
11
11
|
|
|
12
|
-
/// @notice Interface for
|
|
13
|
-
///
|
|
14
|
-
/// hook and cross-chain suckers, then serves as the data hook wrapper that coordinates pay/cash-out logic across all
|
|
15
|
-
/// chains.
|
|
12
|
+
/// @notice Interface for launching Juicebox projects with a 721 tiers hook and cross-chain suckers, then coordinating
|
|
13
|
+
/// pay/cash-out logic through a data hook wrapper.
|
|
16
14
|
interface IJBOmnichainDeployer {
|
|
17
15
|
/// @notice The controller used for every project launch and ruleset queue.
|
|
18
16
|
function CONTROLLER() external view returns (IJBController);
|
|
@@ -3,8 +3,8 @@ pragma solidity ^0.8.0;
|
|
|
3
3
|
|
|
4
4
|
import {JBSuckerDeployerConfig} from "@bananapus/suckers-v6/src/structs/JBSuckerDeployerConfig.sol";
|
|
5
5
|
|
|
6
|
-
/// @custom:member deployerConfigurations
|
|
7
|
-
/// @custom:member salt The salt
|
|
6
|
+
/// @custom:member deployerConfigurations Sucker deployer configs and token mappings for peer chains.
|
|
7
|
+
/// @custom:member salt The salt combined with `_msgSender()` to create deterministic sucker addresses.
|
|
8
8
|
struct JBSuckerDeploymentConfig {
|
|
9
9
|
JBSuckerDeployerConfig[] deployerConfigurations;
|
|
10
10
|
bytes32 salt;
|