@towns-protocol/contracts 0.0.434 → 0.0.435
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.435",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"clean": "forge clean",
|
|
6
6
|
"compile": "forge build",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@layerzerolabs/oapp-evm": "^0.3.2",
|
|
34
34
|
"@openzeppelin/merkle-tree": "^1.0.8",
|
|
35
35
|
"@prb/test": "^0.6.4",
|
|
36
|
-
"@towns-protocol/prettier-config": "^0.0.
|
|
36
|
+
"@towns-protocol/prettier-config": "^0.0.435",
|
|
37
37
|
"@wagmi/cli": "^2.2.0",
|
|
38
38
|
"forge-std": "github:foundry-rs/forge-std#v1.10.0",
|
|
39
39
|
"prettier": "^3.5.3",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "6b93d4cf1197625fd10a793981b6301820e34cfe"
|
|
54
54
|
}
|
|
@@ -23,6 +23,7 @@ contract PrepayFacet is IPrepay, PrepayBase, ReentrancyGuard, Entitled, Facet {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
function prepayMembership(uint256 supply) external payable nonReentrant {
|
|
26
|
+
_validatePrepayCaller();
|
|
26
27
|
if (supply == 0) revert Prepay__InvalidSupplyAmount();
|
|
27
28
|
|
|
28
29
|
MembershipStorage.Layout storage ds = MembershipStorage.layout();
|
|
@@ -56,4 +57,9 @@ contract PrepayFacet is IPrepay, PrepayBase, ReentrancyGuard, Entitled, Facet {
|
|
|
56
57
|
IPlatformRequirements platform = IPlatformRequirements(ds.spaceFactory);
|
|
57
58
|
return supply * platform.getMembershipFee();
|
|
58
59
|
}
|
|
60
|
+
|
|
61
|
+
function _validatePrepayCaller() internal view {
|
|
62
|
+
address spaceFactory = MembershipStorage.layout().spaceFactory;
|
|
63
|
+
if (msg.sender != spaceFactory && msg.sender != _owner()) revert Prepay__NotAllowed();
|
|
64
|
+
}
|
|
59
65
|
}
|