@towns-protocol/contracts 0.0.438 → 0.0.440
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.440",
|
|
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.440",
|
|
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": "7c25c92bebcb924258f283120f670a7517895807"
|
|
54
54
|
}
|
|
@@ -14,10 +14,16 @@ contract InteractSetStreamHistoryMiniblocks is Interaction {
|
|
|
14
14
|
function __interact(address deployer) internal override {
|
|
15
15
|
address riverRegistry = getDeployment("riverRegistry");
|
|
16
16
|
|
|
17
|
+
uint64 userInboxMiniblocks = 5000;
|
|
17
18
|
uint64 userSettingsMiniblocks = 40;
|
|
18
19
|
uint64 spaceMiniblocks = 400;
|
|
19
20
|
|
|
20
21
|
vm.startBroadcast(deployer);
|
|
22
|
+
IRiverConfig(riverRegistry).setConfiguration(
|
|
23
|
+
RiverConfigValues.STREAM_HISTORY_MINIBLOCKS_USER_INBOX,
|
|
24
|
+
0,
|
|
25
|
+
abi.encode(userInboxMiniblocks)
|
|
26
|
+
);
|
|
21
27
|
IRiverConfig(riverRegistry).setConfiguration(
|
|
22
28
|
RiverConfigValues.STREAM_HISTORY_MINIBLOCKS_USER_SETTINGS,
|
|
23
29
|
0,
|
|
@@ -17,6 +17,8 @@ library RiverConfigValues {
|
|
|
17
17
|
bytes32 public constant MEDIA_CHUNK_COUNT = keccak256("stream.media.maxchunkcount");
|
|
18
18
|
bytes32 public constant ENABLE_NODE_2_NODE_AUTH = keccak256("server.enablenode2nodeauth");
|
|
19
19
|
bytes32 public constant MB_RECENCY_CHECK = keccak256("stream.recencyconstraints.ageseconds");
|
|
20
|
+
bytes32 public constant STREAM_HISTORY_MINIBLOCKS_USER_INBOX =
|
|
21
|
+
keccak256("stream.historyminiblocks.a1");
|
|
20
22
|
bytes32 public constant STREAM_HISTORY_MINIBLOCKS_USER_SETTINGS =
|
|
21
23
|
keccak256("stream.historyminiblocks.a5");
|
|
22
24
|
bytes32 public constant STREAM_HISTORY_MINIBLOCKS_SPACE =
|
|
@@ -11,6 +11,7 @@ import {ISchemaResolver} from "@ethereum-attestation-service/eas-contracts/resol
|
|
|
11
11
|
import {IPlatformRequirements} from "../../../factory/facets/platform/requirements/IPlatformRequirements.sol";
|
|
12
12
|
import {IERC173} from "@towns-protocol/diamond/src/facets/ownable/IERC173.sol";
|
|
13
13
|
import {IAppAccount} from "../../../spaces/facets/account/IAppAccount.sol";
|
|
14
|
+
import {IEntitlementsManager} from "../../../spaces/facets/entitlements/IEntitlementsManager.sol";
|
|
14
15
|
|
|
15
16
|
// libraries
|
|
16
17
|
import {CustomRevert} from "../../../utils/libraries/CustomRevert.sol";
|
|
@@ -24,6 +25,7 @@ import {LibAppRegistry} from "./LibAppRegistry.sol";
|
|
|
24
25
|
import {ExecutionManifest} from "@erc6900/reference-implementation/interfaces/IExecutionModule.sol";
|
|
25
26
|
import {Attestation, EMPTY_UID} from "@ethereum-attestation-service/eas-contracts/Common.sol";
|
|
26
27
|
import {AttestationRequest, RevocationRequestData} from "@ethereum-attestation-service/eas-contracts/IEAS.sol";
|
|
28
|
+
import {Permissions} from "../../../spaces/facets/Permissions.sol";
|
|
27
29
|
|
|
28
30
|
// contracts
|
|
29
31
|
import {SchemaBase} from "../schema/SchemaBase.sol";
|
|
@@ -32,8 +34,16 @@ import {AttestationBase} from "../attest/AttestationBase.sol";
|
|
|
32
34
|
abstract contract AppRegistryBase is IAppRegistryBase, SchemaBase, AttestationBase {
|
|
33
35
|
using CustomRevert for bytes4;
|
|
34
36
|
|
|
37
|
+
/// @notice Modifier to check if the caller is allowed to interact with the app registry
|
|
38
|
+
/// @dev Only the owner of the space or modular account can interact
|
|
35
39
|
modifier onlyAllowed(IAppAccount account) {
|
|
36
|
-
if (
|
|
40
|
+
if (
|
|
41
|
+
address(account) != msg.sender &&
|
|
42
|
+
!IEntitlementsManager(address(account)).isEntitledToSpace(
|
|
43
|
+
msg.sender,
|
|
44
|
+
Permissions.ModifyAppSettings
|
|
45
|
+
)
|
|
46
|
+
) {
|
|
37
47
|
NotAllowed.selector.revertWith();
|
|
38
48
|
}
|
|
39
49
|
_;
|
|
@@ -8,14 +8,15 @@ pragma solidity ^0.8.23;
|
|
|
8
8
|
// contracts
|
|
9
9
|
|
|
10
10
|
library Permissions {
|
|
11
|
-
string
|
|
12
|
-
string
|
|
13
|
-
string
|
|
14
|
-
string
|
|
15
|
-
string
|
|
16
|
-
string
|
|
17
|
-
string
|
|
18
|
-
string
|
|
19
|
-
string
|
|
20
|
-
string
|
|
11
|
+
string internal constant ModifyChannel = "ModifyChannel";
|
|
12
|
+
string internal constant AddRemoveChannels = "AddRemoveChannels";
|
|
13
|
+
string internal constant ModifySpaceSettings = "ModifySpaceSettings";
|
|
14
|
+
string internal constant ModifyRoles = "ModifyRoles";
|
|
15
|
+
string internal constant JoinSpace = "JoinSpace";
|
|
16
|
+
string internal constant ModifyBanning = "ModifyBanning";
|
|
17
|
+
string internal constant Read = "Read";
|
|
18
|
+
string internal constant Write = "Write";
|
|
19
|
+
string internal constant React = "React";
|
|
20
|
+
string internal constant Ping = "Ping";
|
|
21
|
+
string internal constant ModifyAppSettings = "ModifyAppSettings";
|
|
21
22
|
}
|