@towns-protocol/contracts 0.0.360 → 0.0.362
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@towns-protocol/contracts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.362",
|
|
4
4
|
"packageManager": "yarn@3.8.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build-types": "bash scripts/build-contract-types.sh",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@layerzerolabs/oapp-evm": "^0.3.2",
|
|
36
36
|
"@openzeppelin/merkle-tree": "^1.0.8",
|
|
37
37
|
"@prb/test": "^0.6.4",
|
|
38
|
-
"@towns-protocol/prettier-config": "^0.0.
|
|
38
|
+
"@towns-protocol/prettier-config": "^0.0.362",
|
|
39
39
|
"@typechain/ethers-v5": "^11.1.2",
|
|
40
40
|
"@wagmi/cli": "^2.2.0",
|
|
41
41
|
"forge-std": "github:foundry-rs/forge-std#v1.10.0",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "c792e161ba8803a0c303ee2b89fb3d767605c5a4"
|
|
61
61
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity ^0.8.23;
|
|
3
3
|
|
|
4
|
+
// interfaces
|
|
5
|
+
import {IDiamondInitHelper} from "./IDiamondInitHelper.sol";
|
|
6
|
+
|
|
4
7
|
// libraries
|
|
5
8
|
import {DeployDiamondCut} from "@towns-protocol/diamond/scripts/deployments/facets/DeployDiamondCut.sol";
|
|
6
9
|
import {DeployDiamondLoupe} from "@towns-protocol/diamond/scripts/deployments/facets/DeployDiamondLoupe.sol";
|
|
@@ -19,7 +22,7 @@ import {DiamondHelper} from "@towns-protocol/diamond/scripts/common/helpers/Diam
|
|
|
19
22
|
import {DeployFacet} from "../../common/DeployFacet.s.sol";
|
|
20
23
|
import {Deployer} from "../../common/Deployer.s.sol";
|
|
21
24
|
|
|
22
|
-
contract DeploySubscriptionModule is DiamondHelper, Deployer {
|
|
25
|
+
contract DeploySubscriptionModule is DiamondHelper, Deployer, IDiamondInitHelper {
|
|
23
26
|
using LibString for string;
|
|
24
27
|
|
|
25
28
|
DeployFacet private facetHelper = new DeployFacet();
|
|
@@ -30,6 +33,32 @@ contract DeploySubscriptionModule is DiamondHelper, Deployer {
|
|
|
30
33
|
return "subscriptionModule";
|
|
31
34
|
}
|
|
32
35
|
|
|
36
|
+
function diamondInitHelper(
|
|
37
|
+
address deployer,
|
|
38
|
+
string[] memory facetNames
|
|
39
|
+
) external override returns (FacetCut[] memory) {
|
|
40
|
+
// Queue up all requested facets for batch deployment
|
|
41
|
+
for (uint256 i; i < facetNames.length; ++i) {
|
|
42
|
+
facetHelper.add(facetNames[i]);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Deploy all requested facets in a single batch transaction
|
|
46
|
+
facetHelper.deployBatch(deployer);
|
|
47
|
+
|
|
48
|
+
for (uint256 i; i < facetNames.length; ++i) {
|
|
49
|
+
string memory facetName = facetNames[i];
|
|
50
|
+
address facet = facetHelper.getDeployedAddress(facetName);
|
|
51
|
+
|
|
52
|
+
if (facetName.eq("SubscriptionModuleFacet")) {
|
|
53
|
+
addCut(
|
|
54
|
+
makeCut(facet, FacetCutAction.Add, DeploySubscriptionModuleFacet.selectors())
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return baseFacets();
|
|
60
|
+
}
|
|
61
|
+
|
|
33
62
|
function diamondInitParams(address deployer) public returns (Diamond.InitParams memory) {
|
|
34
63
|
// Queue up feature facets for batch deployment
|
|
35
64
|
facetHelper.add("MultiInit");
|
|
@@ -12,6 +12,7 @@ import {DeploySpace} from "scripts/deployments/diamonds/DeploySpace.s.sol";
|
|
|
12
12
|
import {DeploySpaceFactory} from "scripts/deployments/diamonds/DeploySpaceFactory.s.sol";
|
|
13
13
|
import {DeploySpaceOwner} from "scripts/deployments/diamonds/DeploySpaceOwner.s.sol";
|
|
14
14
|
import {DeployAppRegistry} from "scripts/deployments/diamonds/DeployAppRegistry.s.sol";
|
|
15
|
+
import {DeploySubscriptionModule} from "scripts/deployments/diamonds/DeploySubscriptionModule.s.sol";
|
|
15
16
|
import {AlphaHelper} from "scripts/interactions/helpers/AlphaHelper.sol";
|
|
16
17
|
|
|
17
18
|
contract InteractBaseAlpha is AlphaHelper {
|
|
@@ -21,6 +22,7 @@ contract InteractBaseAlpha is AlphaHelper {
|
|
|
21
22
|
DeploySpaceOwner deploySpaceOwner = new DeploySpaceOwner();
|
|
22
23
|
DeployRiverAirdrop deployRiverAirdrop = new DeployRiverAirdrop();
|
|
23
24
|
DeployAppRegistry deployAppRegistry = new DeployAppRegistry();
|
|
25
|
+
DeploySubscriptionModule deploySubscriptionModule = new DeploySubscriptionModule();
|
|
24
26
|
|
|
25
27
|
function __interact(address deployer) internal override {
|
|
26
28
|
vm.pauseGasMetering();
|
|
@@ -31,6 +33,7 @@ contract InteractBaseAlpha is AlphaHelper {
|
|
|
31
33
|
address baseRegistry = getDeployment("baseRegistry");
|
|
32
34
|
address riverAirdrop = getDeployment("riverAirdrop");
|
|
33
35
|
address appRegistry = getDeployment("appRegistry");
|
|
36
|
+
address subscriptionModule = getDeployment("subscriptionModule");
|
|
34
37
|
|
|
35
38
|
executeDiamondCutsWithLogging(deployer, space, "Space", deploySpace);
|
|
36
39
|
executeDiamondCutsWithLogging(deployer, spaceOwner, "SpaceOwner", deploySpaceOwner);
|
|
@@ -49,6 +52,12 @@ contract InteractBaseAlpha is AlphaHelper {
|
|
|
49
52
|
executeDiamondCutsWithLogging(deployer, baseRegistry, "BaseRegistry", deployBaseRegistry);
|
|
50
53
|
executeDiamondCutsWithLogging(deployer, riverAirdrop, "RiverAirdrop", deployRiverAirdrop);
|
|
51
54
|
executeDiamondCutsWithLogging(deployer, appRegistry, "AppRegistry", deployAppRegistry);
|
|
55
|
+
executeDiamondCutsWithLogging(
|
|
56
|
+
deployer,
|
|
57
|
+
subscriptionModule,
|
|
58
|
+
"SubscriptionModule",
|
|
59
|
+
deploySubscriptionModule
|
|
60
|
+
);
|
|
52
61
|
|
|
53
62
|
vm.resumeGasMetering();
|
|
54
63
|
}
|