@towns-protocol/contracts 0.0.369 → 0.0.370
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.370",
|
|
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.370",
|
|
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": "a39b3d31251fbe2ec4f6c0902d9a5195974e8b9e"
|
|
61
61
|
}
|
|
@@ -54,7 +54,6 @@ contract DeployAppRegistry is IDiamondInitHelper, DiamondHelper, Deployer {
|
|
|
54
54
|
facetHelper.add("DiamondLoupeFacet");
|
|
55
55
|
facetHelper.add("IntrospectionFacet");
|
|
56
56
|
facetHelper.add("OwnableFacet");
|
|
57
|
-
facetHelper.add("MetadataFacet");
|
|
58
57
|
|
|
59
58
|
// Deploy the first batch of facets
|
|
60
59
|
facetHelper.deployBatch(deployer);
|
|
@@ -87,26 +86,27 @@ contract DeployAppRegistry is IDiamondInitHelper, DiamondHelper, Deployer {
|
|
|
87
86
|
facet,
|
|
88
87
|
DeployOwnable.makeInitData(deployer)
|
|
89
88
|
);
|
|
90
|
-
|
|
91
|
-
facet = facetHelper.predictAddress("MetadataFacet");
|
|
92
|
-
addFacet(
|
|
93
|
-
makeCut(facet, FacetCutAction.Add, DeployMetadata.selectors()),
|
|
94
|
-
facet,
|
|
95
|
-
DeployMetadata.makeInitData(bytes32("AppRegistry"), "")
|
|
96
|
-
);
|
|
97
89
|
}
|
|
98
90
|
|
|
99
91
|
function diamondInitParams(address deployer) public returns (Diamond.InitParams memory) {
|
|
100
92
|
// Queue up feature facets for batch deployment
|
|
101
93
|
facetHelper.add("MultiInit");
|
|
94
|
+
facetHelper.add("MetadataFacet");
|
|
102
95
|
facetHelper.add("UpgradeableBeaconFacet");
|
|
103
96
|
facetHelper.add("AppRegistryFacet");
|
|
104
97
|
facetHelper.add("SimpleApp");
|
|
105
98
|
|
|
106
99
|
facetHelper.deployBatch(deployer);
|
|
107
100
|
|
|
101
|
+
address facet = facetHelper.getDeployedAddress("MetadataFacet");
|
|
102
|
+
addFacet(
|
|
103
|
+
makeCut(facet, FacetCutAction.Add, DeployMetadata.selectors()),
|
|
104
|
+
facet,
|
|
105
|
+
DeployMetadata.makeInitData(bytes32("AppRegistry"), "")
|
|
106
|
+
);
|
|
107
|
+
|
|
108
108
|
address simpleApp = facetHelper.getDeployedAddress("SimpleApp");
|
|
109
|
-
|
|
109
|
+
facet = facetHelper.getDeployedAddress("UpgradeableBeaconFacet");
|
|
110
110
|
|
|
111
111
|
addFacet(
|
|
112
112
|
makeCut(facet, FacetCutAction.Add, DeployUpgradeableBeacon.selectors()),
|
|
@@ -62,13 +62,21 @@ contract DeploySubscriptionModule is DiamondHelper, Deployer, IDiamondInitHelper
|
|
|
62
62
|
function diamondInitParams(address deployer) public returns (Diamond.InitParams memory) {
|
|
63
63
|
// Queue up feature facets for batch deployment
|
|
64
64
|
facetHelper.add("MultiInit");
|
|
65
|
+
facetHelper.add("MetadataFacet");
|
|
65
66
|
facetHelper.add("SubscriptionModuleFacet");
|
|
66
67
|
|
|
67
68
|
// Deploy all facets in a batch
|
|
68
69
|
facetHelper.deployBatch(deployer);
|
|
69
70
|
|
|
70
71
|
// Add feature facets
|
|
71
|
-
address facet = facetHelper.getDeployedAddress("
|
|
72
|
+
address facet = facetHelper.getDeployedAddress("MetadataFacet");
|
|
73
|
+
addFacet(
|
|
74
|
+
makeCut(facet, FacetCutAction.Add, DeployMetadata.selectors()),
|
|
75
|
+
facet,
|
|
76
|
+
DeployMetadata.makeInitData(METADATA_NAME, "")
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
facet = facetHelper.getDeployedAddress("SubscriptionModuleFacet");
|
|
72
80
|
addFacet(
|
|
73
81
|
makeCut(facet, FacetCutAction.Add, DeploySubscriptionModuleFacet.selectors()),
|
|
74
82
|
facet,
|
|
@@ -95,7 +103,6 @@ contract DeploySubscriptionModule is DiamondHelper, Deployer, IDiamondInitHelper
|
|
|
95
103
|
facetHelper.add("DiamondLoupeFacet");
|
|
96
104
|
facetHelper.add("IntrospectionFacet");
|
|
97
105
|
facetHelper.add("OwnableFacet");
|
|
98
|
-
facetHelper.add("MetadataFacet");
|
|
99
106
|
|
|
100
107
|
// Get predicted addresses
|
|
101
108
|
address facet = facetHelper.predictAddress("DiamondCutFacet");
|
|
@@ -125,13 +132,6 @@ contract DeploySubscriptionModule is DiamondHelper, Deployer, IDiamondInitHelper
|
|
|
125
132
|
facet,
|
|
126
133
|
DeployOwnable.makeInitData(deployer)
|
|
127
134
|
);
|
|
128
|
-
|
|
129
|
-
facet = facetHelper.predictAddress("MetadataFacet");
|
|
130
|
-
addFacet(
|
|
131
|
-
makeCut(facet, FacetCutAction.Add, DeployMetadata.selectors()),
|
|
132
|
-
facet,
|
|
133
|
-
DeployMetadata.makeInitData(METADATA_NAME, "")
|
|
134
|
-
);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
function __deploy(address deployer) internal override returns (address) {
|
|
@@ -8,6 +8,7 @@ import {IDiamondLoupe, IDiamondLoupeBase} from "@towns-protocol/diamond/src/face
|
|
|
8
8
|
import {IERC173} from "@towns-protocol/diamond/src/facets/ownable/IERC173.sol";
|
|
9
9
|
import {IOwnablePending} from "@towns-protocol/diamond/src/facets/ownable/pending/IOwnablePending.sol";
|
|
10
10
|
import {IDiamondInitHelper} from "scripts/deployments/diamonds/IDiamondInitHelper.sol";
|
|
11
|
+
import {IMetadata} from "src/diamond/facets/metadata/IMetadata.sol";
|
|
11
12
|
|
|
12
13
|
// libraries
|
|
13
14
|
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
|
@@ -55,13 +56,14 @@ abstract contract AlphaHelper is Interaction, DiamondHelper, IDiamondLoupeBase {
|
|
|
55
56
|
function getCoreFacetAddresses(
|
|
56
57
|
address diamond
|
|
57
58
|
) internal view returns (address[] memory coreFacets) {
|
|
58
|
-
coreFacets = new address[](
|
|
59
|
+
coreFacets = new address[](6);
|
|
59
60
|
|
|
60
61
|
coreFacets[0] = IDiamondLoupe(diamond).facetAddress(IDiamondCut.diamondCut.selector);
|
|
61
62
|
coreFacets[1] = IDiamondLoupe(diamond).facetAddress(IDiamondLoupe.facets.selector);
|
|
62
63
|
coreFacets[2] = IDiamondLoupe(diamond).facetAddress(IERC165.supportsInterface.selector);
|
|
63
64
|
coreFacets[3] = IDiamondLoupe(diamond).facetAddress(IERC173.owner.selector);
|
|
64
65
|
coreFacets[4] = IDiamondLoupe(diamond).facetAddress(IOwnablePending.currentOwner.selector);
|
|
66
|
+
coreFacets[5] = IDiamondLoupe(diamond).facetAddress(IMetadata.contractType.selector);
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
/// @notice Check if an address is a core facet that should not be removed
|
|
@@ -254,7 +256,7 @@ abstract contract AlphaHelper is Interaction, DiamondHelper, IDiamondLoupeBase {
|
|
|
254
256
|
}
|
|
255
257
|
|
|
256
258
|
if (removeSelectors.length() > 0) {
|
|
257
|
-
addCut(FacetCut(
|
|
259
|
+
addCut(FacetCut(facetAddr, FacetCutAction.Remove, asBytes4Array(removeSelectors)));
|
|
258
260
|
}
|
|
259
261
|
}
|
|
260
262
|
}
|