@etherisc/gif-next 0.0.2-34d25ca → 0.0.2-35bac6a

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.
Files changed (114) hide show
  1. package/README.md +0 -18
  2. package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
  3. package/artifacts/contracts/components/Component.sol/InstanceLinked.dbg.json +1 -1
  4. package/artifacts/contracts/components/Component.sol/InstanceLinked.json +2 -2
  5. package/artifacts/contracts/components/IPool.sol/IPoolComponent.dbg.json +1 -1
  6. package/artifacts/contracts/components/IProduct.sol/IProductComponent.dbg.json +1 -1
  7. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  8. package/artifacts/contracts/components/Pool.sol/Pool.json +2 -2
  9. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  10. package/artifacts/contracts/components/Product.sol/Product.json +2 -2
  11. package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
  12. package/artifacts/contracts/experiment/errors/Require.sol/Require.json +2 -2
  13. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
  14. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.json +2 -2
  15. package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
  16. package/artifacts/contracts/experiment/inheritance/A.sol/A.json +2 -2
  17. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
  18. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.json +2 -2
  19. package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
  20. package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
  21. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
  22. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
  23. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
  24. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
  25. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
  26. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.json +2 -2
  27. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
  28. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.json +2 -2
  29. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  30. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  31. package/artifacts/contracts/instance/Instance.sol/Instance.json +2 -2
  32. package/artifacts/contracts/instance/access/Access.sol/AccessModule.dbg.json +1 -1
  33. package/artifacts/contracts/instance/access/IAccess.sol/IAccess.dbg.json +1 -1
  34. package/artifacts/contracts/instance/access/IAccess.sol/IAccessCheckRole.dbg.json +1 -1
  35. package/artifacts/contracts/instance/access/IAccess.sol/IAccessComponentTypeRoles.dbg.json +1 -1
  36. package/artifacts/contracts/instance/access/IAccess.sol/IAccessModule.dbg.json +1 -1
  37. package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentModule.dbg.json +1 -1
  38. package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.dbg.json +1 -1
  39. package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.json +2 -2
  40. package/artifacts/contracts/instance/component/IComponent.sol/IComponent.dbg.json +1 -1
  41. package/artifacts/contracts/instance/component/IComponent.sol/IComponentContract.dbg.json +1 -1
  42. package/artifacts/contracts/instance/component/IComponent.sol/IComponentModule.dbg.json +1 -1
  43. package/artifacts/contracts/instance/component/IComponent.sol/IComponentOwnerService.dbg.json +1 -1
  44. package/artifacts/contracts/instance/component/IComponent.sol/IInstanceLinked.dbg.json +1 -1
  45. package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicy.dbg.json +1 -1
  46. package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicyModule.dbg.json +1 -1
  47. package/artifacts/contracts/instance/policy/PolicyModule.sol/PolicyModule.dbg.json +1 -1
  48. package/artifacts/contracts/instance/pool/IPoolModule.sol/IPool.dbg.json +1 -1
  49. package/artifacts/contracts/instance/pool/IPoolModule.sol/IPoolModule.dbg.json +1 -1
  50. package/artifacts/contracts/instance/pool/PoolModule.sol/PoolModule.dbg.json +1 -1
  51. package/artifacts/contracts/instance/product/IProductService.sol/IProductModule.dbg.json +1 -1
  52. package/artifacts/contracts/instance/product/IProductService.sol/IProductService.dbg.json +1 -1
  53. package/artifacts/contracts/instance/product/ProductService.sol/ProductModule.dbg.json +1 -1
  54. package/artifacts/contracts/instance/product/ProductService.sol/ProductService.dbg.json +1 -1
  55. package/artifacts/contracts/instance/product/ProductService.sol/ProductService.json +2 -2
  56. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  57. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
  58. package/artifacts/contracts/registry/IChainNft.sol/IChainNft.dbg.json +1 -1
  59. package/artifacts/contracts/registry/IRegistry.sol/IOwnable.dbg.json +1 -1
  60. package/artifacts/contracts/registry/IRegistry.sol/IRegisterable.dbg.json +1 -1
  61. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  62. package/artifacts/contracts/registry/IRegistry.sol/IRegistryLinked.dbg.json +1 -1
  63. package/artifacts/contracts/registry/Registry.sol/Registerable.dbg.json +1 -1
  64. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  65. package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
  66. package/artifacts/contracts/registry/Registry.sol/RegistryLinked.dbg.json +1 -1
  67. package/artifacts/contracts/registry/Registry.sol/RegistryLinked.json +2 -2
  68. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  69. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.json +2 -2
  70. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  71. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.json +2 -2
  72. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  73. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +2 -2
  74. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
  75. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +2 -2
  76. package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.dbg.json +1 -1
  77. package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.json +2 -2
  78. package/contracts/components/Component.sol +18 -16
  79. package/contracts/components/IPool.sol +3 -3
  80. package/contracts/components/IProduct.sol +6 -3
  81. package/contracts/components/Pool.sol +13 -6
  82. package/contracts/components/Product.sol +21 -10
  83. package/contracts/experiment/errors/Require.sol +5 -10
  84. package/contracts/experiment/errors/Revert.sol +8 -13
  85. package/contracts/experiment/inheritance/A.sol +11 -8
  86. package/contracts/experiment/inheritance/B.sol +5 -10
  87. package/contracts/experiment/inheritance/C.sol +5 -11
  88. package/contracts/experiment/inheritance/IA.sol +7 -2
  89. package/contracts/experiment/inheritance/IB.sol +2 -3
  90. package/contracts/experiment/inheritance/IC.sol +3 -4
  91. package/contracts/experiment/types/TypeA.sol +9 -14
  92. package/contracts/experiment/types/TypeB.sol +9 -14
  93. package/contracts/instance/IInstance.sol +3 -1
  94. package/contracts/instance/Instance.sol +13 -13
  95. package/contracts/instance/access/Access.sol +116 -63
  96. package/contracts/instance/access/IAccess.sol +48 -28
  97. package/contracts/instance/component/ComponentModule.sol +98 -63
  98. package/contracts/instance/component/IComponent.sol +52 -30
  99. package/contracts/instance/policy/IPolicy.sol +24 -9
  100. package/contracts/instance/policy/PolicyModule.sol +35 -19
  101. package/contracts/instance/pool/IPoolModule.sol +19 -7
  102. package/contracts/instance/pool/PoolModule.sol +35 -22
  103. package/contracts/instance/product/IProductService.sol +15 -5
  104. package/contracts/instance/product/ProductService.sol +39 -43
  105. package/contracts/registry/ChainNft.sol +61 -23
  106. package/contracts/registry/IChainNft.sol +7 -10
  107. package/contracts/registry/IRegistry.sol +36 -46
  108. package/contracts/registry/Registry.sol +53 -80
  109. package/contracts/types/Blocknumber.sol +18 -76
  110. package/contracts/types/ChainId.sol +10 -18
  111. package/contracts/types/NftId.sol +13 -29
  112. package/contracts/types/Timestamp.sol +16 -63
  113. package/contracts/types/UFixed.sol +64 -58
  114. package/package.json +3 -7
@@ -5,25 +5,20 @@ pragma solidity ^0.8.19;
5
5
  type TypeB is uint248;
6
6
 
7
7
  // type bindings
8
- using {eqTypeB as ==, addTypeB as +, TypeBLib.toInt} for TypeB global;
8
+ using {
9
+ eqTypeB as ==,
10
+ addTypeB as +,
11
+ TypeBLib.toInt
12
+ } for TypeB global;
9
13
 
10
14
  // general pure free functions
11
- function toTypeB(uint256 x) pure returns (TypeB) {
12
- return TypeB.wrap(uint248(x));
13
- }
15
+ function toTypeB(uint256 x) pure returns(TypeB) { return TypeB.wrap(uint248(x)); }
14
16
 
15
17
  // pure free functions for operators
16
- function eqTypeB(TypeB a, TypeB b) pure returns (bool isSame) {
17
- return TypeB.unwrap(a) == TypeB.unwrap(b);
18
- }
19
-
20
- function addTypeB(TypeB a, TypeB b) pure returns (TypeB sum) {
21
- return TypeB.wrap(TypeB.unwrap(a) + TypeB.unwrap(b));
22
- }
18
+ function eqTypeB(TypeB a, TypeB b) pure returns(bool isSame) { return TypeB.unwrap(a) == TypeB.unwrap(b); }
19
+ function addTypeB(TypeB a, TypeB b) pure returns(TypeB sum) { return TypeB.wrap(TypeB.unwrap(a) + TypeB.unwrap(b)); }
23
20
 
24
21
  // library functions that operate on user defined type
25
22
  library TypeBLib {
26
- function toInt(TypeB b) internal pure returns (uint256) {
27
- return uint256(TypeB.unwrap(b));
28
- }
23
+ function toInt(TypeB b) internal pure returns(uint256) { return uint256(TypeB.unwrap(b)); }
29
24
  }
@@ -8,6 +8,7 @@ import {IProductModule} from "./product/IProductService.sol";
8
8
  import {IPolicyModule} from "./policy/IPolicy.sol";
9
9
  import {IPoolModule} from "./pool/IPoolModule.sol";
10
10
 
11
+
11
12
  interface IInstance is
12
13
  IRegisterable,
13
14
  IAccessModule,
@@ -15,4 +16,5 @@ interface IInstance is
15
16
  IPoolModule,
16
17
  IComponentModule,
17
18
  IProductModule
18
- {}
19
+ { }
20
+
@@ -16,12 +16,13 @@ import {NftId, toNftId} from "../types/NftId.sol";
16
16
  contract Instance is
17
17
  Registerable,
18
18
  AccessModule,
19
- ComponentModule,
20
- PolicyModule,
19
+ ComponentModule,
20
+ PolicyModule,
21
21
  PoolModule,
22
- ProductModule,
22
+ ProductModule,
23
23
  IInstance
24
24
  {
25
+
25
26
  constructor(
26
27
  address registry,
27
28
  address componentOwnerService,
@@ -33,32 +34,31 @@ contract Instance is
33
34
  PolicyModule(productService)
34
35
  ProductModule(productService)
35
36
  PoolModule(productService)
36
- {}
37
+ { }
37
38
 
38
39
  // from registerable
39
- function register() external override returns (NftId nftId) {
40
- require(
41
- address(_registry) != address(0),
42
- "ERROR:PRD-001:REGISTRY_ZERO"
43
- );
40
+ function register() external override returns(NftId nftId) {
41
+ require(address(_registry) != address(0), "ERROR:PRD-001:REGISTRY_ZERO");
44
42
  return _registry.register(address(this));
45
43
  }
46
44
 
47
45
  // from registerable
48
- function getParentNftId() public view override returns (NftId) {
46
+ function getParentNftId() public view override returns(NftId) {
49
47
  // TODO add self registry and exchange 0 for_registry.getNftId();
50
48
  // define parent tree for all registerables
51
- // eg 0 <- chain(mainnet) <- global registry <- chain registry <- instance <- component <- policy/bundle
49
+ // eg 0 <- chain(mainnet) <- global registry <- chain registry <- instance <- component <- policy/bundle
52
50
  return toNftId(0);
53
51
  }
54
52
 
55
53
  // from registerable
56
- function getType() external view override returns (uint256 objectType) {
54
+ function getType() external view override returns(uint256 objectType) {
57
55
  return _registry.INSTANCE();
58
56
  }
59
57
 
60
58
  // from registerable
61
- function getData() external view override returns (bytes memory data) {
59
+ function getData() external view override returns(bytes memory data) {
62
60
  return bytes(abi.encode(0));
63
61
  }
62
+
63
+
64
64
  }
@@ -7,24 +7,26 @@ import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
7
7
 
8
8
  import {IAccessModule} from "./IAccess.sol";
9
9
 
10
- abstract contract AccessModule is IAccessModule {
11
- string public constant PRODUCT_OWNER = "ProductOwner";
12
- string public constant ORACLE_OWNER = "OracleOwner";
13
- string public constant POOL_OWNER = "PoolOwner";
10
+
11
+ abstract contract AccessModule is
12
+ IAccessModule
13
+ {
14
+ string constant public PRODUCT_OWNER = "ProductOwner";
15
+ string constant public ORACLE_OWNER = "OracleOwner";
16
+ string constant public POOL_OWNER = "PoolOwner";
14
17
 
15
18
  using EnumerableSet for EnumerableSet.AddressSet;
16
19
 
17
20
  event LogAccessRoleGranted(bytes32 role, address member, bool isMember);
18
21
 
19
22
  mapping(bytes32 role => RoleInfo info) private _info;
20
- bytes32[] private _roles;
23
+ bytes32 [] private _roles;
21
24
 
22
25
  bytes32 private immutable _productOwnerRole;
23
26
  bytes32 private immutable _oracleOwnerRole;
24
27
  bytes32 private immutable _poolOwnerRole;
25
28
 
26
- mapping(bytes32 role => mapping(address member => bool isMember))
27
- private _isRoleMember;
29
+ mapping(bytes32 role => mapping(address member => bool isMember)) private _isRoleMember;
28
30
  mapping(bytes32 role => EnumerableSet.AddressSet) private _roleMembers;
29
31
 
30
32
  modifier onlyOwner() {
@@ -38,54 +40,70 @@ abstract contract AccessModule is IAccessModule {
38
40
  _poolOwnerRole = _createRole(POOL_OWNER);
39
41
  }
40
42
 
41
- function PRODUCT_OWNER_ROLE() public view override returns (bytes32 role) {
42
- return _productOwnerRole;
43
- }
44
-
45
- function ORACLE_OWNER_ROLE() public view override returns (bytes32 role) {
46
- return _oracleOwnerRole;
47
- }
43
+ function PRODUCT_OWNER_ROLE() public view override returns(bytes32 role) { return _productOwnerRole; }
44
+ function ORACLE_OWNER_ROLE() public view override returns(bytes32 role) { return _oracleOwnerRole; }
45
+ function POOL_OWNER_ROLE() public view override returns(bytes32 role) { return _poolOwnerRole; }
48
46
 
49
- function POOL_OWNER_ROLE() public view override returns (bytes32 role) {
50
- return _poolOwnerRole;
51
- }
52
47
 
53
- function createRole(
54
- string memory roleName
55
- ) external override onlyOwner returns (bytes32 role) {
48
+ function createRole(string memory roleName)
49
+ external
50
+ override
51
+ onlyOwner
52
+ returns(bytes32 role)
53
+ {
56
54
  return _createRole(roleName);
57
55
  }
58
56
 
59
- function _createRole(
60
- string memory roleName
61
- ) internal returns (bytes32 role) {
62
- RoleInfo memory info = RoleInfo(0, roleName, true);
57
+ function _createRole(string memory roleName)
58
+ internal
59
+ returns(bytes32 role)
60
+ {
61
+ RoleInfo memory info = RoleInfo(
62
+ 0,
63
+ roleName,
64
+ true
65
+ );
63
66
 
64
67
  role = _setRoleInfo(info);
68
+
69
+
65
70
  }
66
71
 
67
72
  // TODO move to module
68
- function disableRole(bytes32 role) external override onlyOwner {
73
+ function disableRole(bytes32 role)
74
+ external
75
+ override
76
+ onlyOwner
77
+ {
69
78
  RoleInfo memory info = _info[role];
70
79
  require(info.id == role, "ERROR:AOS-001:ROLE_DOES_NOT_EXIST");
71
80
 
72
81
  info.isActive = false;
73
82
  _setRoleInfo(info);
74
- }
83
+
84
+
85
+ }
75
86
 
76
87
  // TODO move to module
77
- function enableRole(bytes32 role) external override onlyOwner {
88
+ function enableRole(bytes32 role)
89
+ external
90
+ override
91
+ onlyOwner
92
+ {
78
93
  RoleInfo memory info = _info[role];
79
94
  require(info.id == role, "ERROR:AOS-002:ROLE_DOES_NOT_EXIST");
80
95
 
81
96
  info.isActive = true;
82
97
  _setRoleInfo(info);
83
- }
84
98
 
85
- function grantRole(
86
- bytes32 role,
87
- address member
88
- ) external override onlyOwner {
99
+
100
+ }
101
+
102
+ function grantRole(bytes32 role, address member)
103
+ external
104
+ override
105
+ onlyOwner
106
+ {
89
107
  require(_info[role].id == role, "ERROR:ACM-010:ROLE_NOT_EXISTING");
90
108
  require(_info[role].isActive, "ERROR:ACM-011:ROLE_NOT_ACTIVE");
91
109
 
@@ -95,71 +113,106 @@ abstract contract AccessModule is IAccessModule {
95
113
  emit LogAccessRoleGranted(role, member, _isRoleMember[role][member]);
96
114
  }
97
115
 
98
- function revokeRole(
99
- bytes32 role,
100
- address member
101
- ) external override onlyOwner {
116
+
117
+ function revokeRole(bytes32 role, address member)
118
+ external
119
+ override
120
+ onlyOwner
121
+ {
102
122
  require(_info[role].id == role, "ERROR:ACM-020:ROLE_NOT_EXISTING");
103
123
 
104
124
  _isRoleMember[role][member] = false;
105
125
  _roleMembers[role].remove(member);
126
+
127
+
106
128
  }
107
129
 
108
- function hasRole(
109
- bytes32 role,
110
- address member
111
- ) external view override returns (bool) {
130
+
131
+ function hasRole(bytes32 role, address member)
132
+ external
133
+ view
134
+ override
135
+ returns(bool)
136
+ {
112
137
  return _isRoleMember[role][member];
113
138
  }
114
139
 
115
- function getRoleInfo(
116
- bytes32 role
117
- ) external view override returns (RoleInfo memory info) {
140
+
141
+ function getRoleInfo(bytes32 role)
142
+ external
143
+ override
144
+ view
145
+ returns(RoleInfo memory info)
146
+ {
118
147
  return _info[role];
119
148
  }
120
149
 
121
- function getRole(
122
- uint256 idx
123
- ) external view override returns (bytes32 role) {
150
+
151
+ function getRole(uint256 idx)
152
+ external
153
+ override
154
+ view
155
+ returns(bytes32 role)
156
+ {
124
157
  return _roles[idx];
125
158
  }
126
159
 
127
- function getRoleCount() external view override returns (uint256 roles) {
128
- return _roles.length;
129
- }
130
160
 
131
- function getRoleMemberCount(
132
- bytes32 role
133
- ) public view override returns (uint256 roleMembers) {
161
+ function getRoleCount()
162
+ external
163
+ override
164
+ view
165
+ returns(uint256 roles)
166
+ {
167
+ return _roles.length;
168
+ }
169
+
170
+ function getRoleMemberCount(bytes32 role)
171
+ public
172
+ override
173
+ view
174
+ returns(uint256 roleMembers)
175
+ {
134
176
  return _roleMembers[role].length();
135
177
  }
136
178
 
137
- function getRoleMember(
138
- bytes32 role,
139
- uint256 idx
140
- ) public view override returns (address roleMembers) {
179
+ function getRoleMember(bytes32 role, uint256 idx)
180
+ public
181
+ override
182
+ view
183
+ returns(address roleMembers)
184
+ {
141
185
  return _roleMembers[role].at(idx);
142
186
  }
143
187
 
144
- function getRoleForName(
145
- string memory roleName
146
- ) public pure override returns (bytes32 role) {
188
+ function getRoleForName(string memory roleName)
189
+ public
190
+ override
191
+ pure
192
+ returns(bytes32 role)
193
+ {
147
194
  return keccak256(abi.encode(roleName));
148
195
  }
149
196
 
150
- function _setRoleInfo(
151
- RoleInfo memory info
152
- ) internal returns (bytes32 role) {
197
+
198
+ function _setRoleInfo(RoleInfo memory info)
199
+ internal
200
+ returns(bytes32 role)
201
+ {
153
202
  role = info.id;
154
203
 
155
- if (role == bytes32(0)) {
204
+ if(role == bytes32(0)) {
156
205
  role = getRoleForName(info.name);
157
206
  // TODO check that this is a new role id
158
207
 
159
208
  info.id = role;
160
209
  _roles.push(role);
210
+
211
+
161
212
  }
162
213
 
163
214
  _info[role] = info;
215
+
216
+
164
217
  }
165
218
  }
@@ -4,6 +4,7 @@ pragma solidity ^0.8.19;
4
4
  import {IOwnable, IRegistryLinked} from "../../registry/IRegistry.sol";
5
5
 
6
6
  interface IAccess {
7
+
7
8
  struct RoleInfo {
8
9
  bytes32 id;
9
10
  string name;
@@ -12,52 +13,71 @@ interface IAccess {
12
13
  }
13
14
 
14
15
  interface IAccessCheckRole {
15
- function hasRole(bytes32 role, address member) external view returns (bool);
16
+
17
+ function hasRole(bytes32 role, address member)
18
+ external
19
+ view
20
+ returns(bool);
16
21
  }
17
22
 
18
23
  interface IAccessComponentTypeRoles {
19
- function PRODUCT_OWNER_ROLE() external view returns (bytes32 role);
20
-
21
- function ORACLE_OWNER_ROLE() external view returns (bytes32 role);
22
-
23
- function POOL_OWNER_ROLE() external view returns (bytes32 role);
24
+ function PRODUCT_OWNER_ROLE() external view returns(bytes32 role);
25
+ function ORACLE_OWNER_ROLE() external view returns(bytes32 role);
26
+ function POOL_OWNER_ROLE() external view returns(bytes32 role);
24
27
  }
25
28
 
26
- interface IAccessModule is
29
+
30
+ interface IAccessModule is
27
31
  IOwnable,
28
32
  IRegistryLinked,
29
33
  IAccess,
30
34
  IAccessComponentTypeRoles,
31
35
  IAccessCheckRole
32
36
  {
33
- function createRole(string memory roleName) external returns (bytes32 role);
34
37
 
35
- function enableRole(bytes32 role) external;
38
+ function createRole(string memory roleName)
39
+ external
40
+ returns(bytes32 role);
36
41
 
37
- function disableRole(bytes32 role) external;
42
+ function enableRole(bytes32 role)
43
+ external;
38
44
 
39
- function grantRole(bytes32 role, address member) external;
45
+ function disableRole(bytes32 role)
46
+ external;
40
47
 
41
- function revokeRole(bytes32 role, address member) external;
48
+ function grantRole(bytes32 role, address member)
49
+ external;
42
50
 
43
- function getRole(uint256 idx) external view returns (bytes32 role);
51
+ function revokeRole(bytes32 role, address member)
52
+ external;
44
53
 
45
- function getRoleInfo(
46
- bytes32 role
47
- ) external view returns (RoleInfo memory info);
54
+ function getRole(uint256 idx)
55
+ external
56
+ view
57
+ returns(bytes32 role);
48
58
 
49
- function getRoleForName(
50
- string memory roleName
51
- ) external pure returns (bytes32 role);
59
+ function getRoleInfo(bytes32 role)
60
+ external
61
+ view
62
+ returns(RoleInfo memory info);
52
63
 
53
- function getRoleCount() external view returns (uint256 roles);
64
+ function getRoleForName(string memory roleName)
65
+ external
66
+ pure
67
+ returns(bytes32 role);
54
68
 
55
- function getRoleMemberCount(
56
- bytes32 role
57
- ) external view returns (uint256 roleMembers);
69
+ function getRoleCount()
70
+ external
71
+ view
72
+ returns(uint256 roles);
58
73
 
59
- function getRoleMember(
60
- bytes32 role,
61
- uint256 idx
62
- ) external view returns (address roleMembers);
63
- }
74
+ function getRoleMemberCount(bytes32 role)
75
+ external
76
+ view
77
+ returns(uint256 roleMembers);
78
+
79
+ function getRoleMember(bytes32 role, uint256 idx)
80
+ external
81
+ view
82
+ returns(address roleMembers);
83
+ }