@etherisc/gif-next 0.0.2-2a0a7d0-893 → 0.0.2-2a59cd5-352

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 (249) hide show
  1. package/README.md +73 -1
  2. package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
  3. package/artifacts/contracts/components/Component.sol/Component.json +405 -6
  4. package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
  5. package/artifacts/contracts/components/Distribution.sol/Distribution.json +883 -141
  6. package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
  7. package/artifacts/contracts/components/IComponent.sol/IComponent.json +113 -6
  8. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  9. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +798 -0
  10. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  11. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +662 -43
  12. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  13. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +656 -0
  14. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  15. package/artifacts/contracts/components/Pool.sol/Pool.json +583 -75
  16. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  17. package/artifacts/contracts/components/Product.sol/Product.json +504 -5
  18. package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +1 -1
  19. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +1 -1
  20. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +1 -1
  21. package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
  22. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
  23. package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
  24. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
  25. package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
  26. package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
  27. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
  28. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
  29. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
  30. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
  31. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +1 -1
  32. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +2 -2
  33. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +1 -1
  34. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +1 -1
  35. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +1 -1
  36. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
  37. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
  38. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
  39. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
  40. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +2 -2
  41. package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
  42. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  43. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +450 -35
  44. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  45. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +111 -7
  46. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  47. package/artifacts/contracts/instance/Instance.sol/Instance.json +589 -223
  48. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
  49. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +39 -89
  50. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  51. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +58 -53
  52. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  53. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +400 -96
  54. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  55. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +175 -25
  56. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
  57. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +2 -2
  58. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +1 -1
  59. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.json +166 -7
  60. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  61. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  62. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  63. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +2 -2
  64. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  65. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +2 -2
  66. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  67. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +13 -13
  68. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  69. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  70. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  71. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  72. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
  73. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
  74. package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.dbg.json +4 -0
  75. package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +1117 -0
  76. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
  77. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +290 -66
  78. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  79. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +169 -19
  80. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
  81. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +439 -27
  82. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  83. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +194 -16
  84. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +4 -0
  85. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +638 -0
  86. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
  87. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +118 -40
  88. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  89. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +217 -7
  90. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  91. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +33 -20
  92. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
  93. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +20 -7
  94. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
  95. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +20 -7
  96. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
  97. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +223 -64
  98. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  99. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +182 -32
  100. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
  101. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +186 -27
  102. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  103. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +166 -16
  104. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
  105. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +186 -27
  106. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
  107. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +166 -16
  108. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  109. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  110. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +15 -2
  111. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  112. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +100 -26
  113. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  114. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  115. package/artifacts/contracts/registry/Registry.sol/Registry.json +28 -15
  116. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
  117. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +2 -2
  118. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  119. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +260 -40
  120. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  121. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +166 -16
  122. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
  123. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +11 -11
  124. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  125. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +160 -10
  126. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
  127. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  128. package/artifacts/contracts/shared/ERC165.sol/ERC165.json +41 -3
  129. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  130. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +37 -0
  131. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
  132. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +129 -0
  133. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  134. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +18 -5
  135. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
  136. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.json +69 -0
  137. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  138. package/artifacts/contracts/shared/IService.sol/IService.json +20 -7
  139. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  140. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +2 -2
  141. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  142. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +156 -11
  143. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
  144. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +269 -0
  145. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  146. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +156 -6
  147. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  148. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +152 -11
  149. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
  150. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +105 -0
  151. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  152. package/artifacts/contracts/shared/Service.sol/Service.json +166 -7
  153. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  154. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  155. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
  156. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  157. package/artifacts/contracts/shared/Versionable.sol/Versionable.json +2 -2
  158. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
  159. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
  160. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +152 -11
  161. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
  162. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +2 -2
  163. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
  164. package/artifacts/contracts/test/TestService.sol/TestService.json +184 -25
  165. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
  166. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
  167. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
  168. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +8 -8
  169. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
  170. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  171. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  172. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  173. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  174. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +2 -2
  175. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
  176. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
  177. package/artifacts/contracts/types/Key32.sol/Key32Lib.json +2 -2
  178. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  179. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +2 -2
  180. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  181. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
  182. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
  183. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  184. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
  185. package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
  186. package/artifacts/contracts/types/Referral.sol/ReferralLib.json +2 -2
  187. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
  188. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +2 -2
  189. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
  190. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
  191. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
  192. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
  193. package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
  194. package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
  195. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
  196. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
  197. package/contracts/components/Component.sol +121 -62
  198. package/contracts/components/Distribution.sol +207 -53
  199. package/contracts/components/IComponent.sol +16 -3
  200. package/contracts/components/IDistributionComponent.sol +59 -3
  201. package/contracts/components/IPoolComponent.sol +50 -29
  202. package/contracts/components/IProductComponent.sol +5 -1
  203. package/contracts/components/Pool.sol +133 -137
  204. package/contracts/components/Product.sol +90 -107
  205. package/contracts/instance/IInstance.sol +26 -6
  206. package/contracts/instance/IInstanceService.sol +19 -0
  207. package/contracts/instance/Instance.sol +58 -30
  208. package/contracts/instance/InstanceAccessManager.sol +12 -13
  209. package/contracts/instance/InstanceService.sol +119 -39
  210. package/contracts/instance/base/ComponentService.sol +3 -2
  211. package/contracts/instance/module/IAccess.sol +3 -4
  212. package/contracts/instance/module/ISetup.sol +5 -4
  213. package/contracts/instance/service/ApplicationService.sol +268 -0
  214. package/contracts/instance/service/BundleService.sol +11 -6
  215. package/contracts/instance/service/DistributionService.sol +197 -30
  216. package/contracts/instance/service/IApplicationService.sol +82 -0
  217. package/contracts/instance/service/IBundleService.sol +11 -1
  218. package/contracts/instance/service/IDistributionService.sol +53 -0
  219. package/contracts/instance/service/IPolicyService.sol +10 -16
  220. package/contracts/instance/service/PolicyService.sol +84 -98
  221. package/contracts/instance/service/PoolService.sol +9 -42
  222. package/contracts/instance/service/ProductService.sol +20 -28
  223. package/contracts/registry/IRegistry.sol +3 -2
  224. package/contracts/registry/IRegistryService.sol +16 -6
  225. package/contracts/registry/Registry.sol +20 -8
  226. package/contracts/registry/RegistryService.sol +50 -85
  227. package/contracts/registry/ReleaseManager.sol +19 -40
  228. package/contracts/registry/TokenRegistry.sol +4 -3
  229. package/contracts/shared/ERC165.sol +12 -11
  230. package/contracts/shared/INftOwnable.sol +12 -6
  231. package/contracts/shared/IPolicyHolder.sol +26 -0
  232. package/contracts/shared/IRegisterable.sol +4 -4
  233. package/contracts/shared/IRegistryLinked.sol +15 -0
  234. package/contracts/shared/IVersionable.sol +2 -2
  235. package/contracts/shared/NftOwnable.sol +113 -59
  236. package/contracts/shared/PolicyHolder.sol +81 -0
  237. package/contracts/shared/ProxyManager.sol +5 -4
  238. package/contracts/shared/Registerable.sol +15 -24
  239. package/contracts/shared/RegistryLinked.sol +64 -0
  240. package/contracts/shared/Service.sol +5 -5
  241. package/contracts/shared/Versionable.sol +3 -2
  242. package/contracts/test/TestRegisterable.sol +1 -1
  243. package/contracts/test/TestService.sol +1 -1
  244. package/contracts/types/DistributorType.sol +2 -2
  245. package/contracts/types/ObjectType.sol +6 -2
  246. package/package.json +3 -3
  247. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
  248. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +0 -100
  249. package/contracts/instance/base/IInstanceBase.sol +0 -21
@@ -2,24 +2,25 @@
2
2
  pragma solidity ^0.8.19;
3
3
 
4
4
  import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
5
+ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
5
6
 
6
- contract ERC165 is IERC165 {
7
+ contract ERC165 is
8
+ Initializable,
9
+ IERC165
10
+ {
7
11
  mapping(bytes4 => bool) private _isSupported;
8
12
 
9
- constructor() {
10
- _initializeERC165();
11
- }
12
-
13
- function supportsInterface(bytes4 interfaceId) external view override returns (bool) {
14
- return _isSupported[interfaceId];
15
- }
16
-
17
13
  // @dev register support for ERC165 itself
18
- function _initializeERC165() internal {
14
+ function initializeERC165() public onlyInitializing() {
19
15
  _isSupported[type(IERC165).interfaceId] = true;
20
16
  }
21
17
 
22
- function _registerInterface(bytes4 interfaceId) internal {
18
+ // @dev register support for provided interfaceId
19
+ function registerInterface(bytes4 interfaceId) public onlyInitializing() {
23
20
  _isSupported[interfaceId] = true;
24
21
  }
22
+
23
+ function supportsInterface(bytes4 interfaceId) external view override returns (bool) {
24
+ return _isSupported[interfaceId];
25
+ }
25
26
  }
@@ -1,22 +1,28 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
+ import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
5
+
4
6
  import {IRegistry} from "../registry/IRegistry.sol";
7
+ import {IRegistryLinked} from "./IRegistryLinked.sol";
5
8
  import {NftId} from "../types/NftId.sol";
6
9
 
7
- interface INftOwnable {
10
+ interface INftOwnable is
11
+ IERC165,
12
+ IRegistryLinked
13
+ {
14
+ error ErrorInitialOwnerZero();
8
15
  error ErrorNotOwner(address account);
9
16
 
10
17
  error ErrorAlreadyLinked(address registry, NftId nftId);
11
- error ErrorRegistryAlreadyInitialized(address registry);
12
- error ErrorRegistryNotInitialized();
13
- error ErrorRegistryAddressZero();
14
- error ErrorNotRegistry(address registryAddress);
18
+ // error ErrorRegistryAlreadyInitialized(address registry);
19
+ // error ErrorRegistryNotInitialized();
20
+ // error ErrorRegistryAddressZero();
21
+ // error ErrorNotRegistry(address registryAddress);
15
22
  error ErrorContractNotRegistered(address contractAddress);
16
23
 
17
24
  function linkToRegisteredNftId() external;
18
25
 
19
- function getRegistry() external view returns (IRegistry);
20
26
  function getNftId() external view returns (NftId);
21
27
  function getOwner() external view returns (address);
22
28
  }
@@ -0,0 +1,26 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.20;
3
+
4
+ import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
5
+ import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
6
+
7
+ import {IRegistry} from "../registry/IRegistry.sol";
8
+ import {NftId} from "../types/NftId.sol";
9
+ import {NumberId} from "../types/NumberId.sol";
10
+
11
+ /// @dev generic interface for contracts that need to hold policies and receive payouts
12
+ /// GIF will notify policy holder contracts for policy creation and payout execution
13
+ ///
14
+
15
+ interface IPolicyHolder is IERC165, IERC721Receiver {
16
+
17
+ /// @dev callback function that will be called after successful policy creation
18
+ function policyCreatedCallback(NftId policyNftId) external;
19
+
20
+ /// @dev callback function that will be called after a successful payout
21
+ function payoutExecutedCallback(NftId policyNftId, NumberId payoutId, address beneficiary, uint256 amount) external;
22
+
23
+ /// @dev determines beneficiary address that will be used in payouts targeting this contract
24
+ /// returned address will override GIF default where the policy nft holder is treated as beneficiary
25
+ function getBeneficiary(NftId policyId, NumberId claimId) external view returns (address beneficiary);
26
+ }
@@ -1,15 +1,15 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
- import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
5
-
6
4
  import {INftOwnable} from "./INftOwnable.sol";
7
5
  import {IRegistry} from "../registry/IRegistry.sol";
8
6
 
9
- interface IRegisterable is IERC165, INftOwnable {
7
+ interface IRegisterable is
8
+ INftOwnable
9
+ {
10
10
 
11
11
  function getInitialInfo()
12
12
  external
13
13
  view
14
- returns (IRegistry.ObjectInfo memory, bytes memory data);
14
+ returns (IRegistry.ObjectInfo memory);
15
15
  }
@@ -0,0 +1,15 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.20;
3
+
4
+ import {IRegistry} from "../registry/IRegistry.sol";
5
+
6
+ interface IRegistryLinked {
7
+
8
+ error ErrorRegistryAlreadyInitialized(address registry);
9
+ error ErrorRegistryNotInitialized();
10
+ error ErrorRegistryAddressZero();
11
+ error ErrorNotRegistry(address registryAddress);
12
+
13
+ function getRegistry() external view returns (IRegistry);
14
+ function getRegistryAddress() external view returns (address);
15
+ }
@@ -49,7 +49,7 @@ interface IVersionable {
49
49
  * implementation MUST call internal function Versionable._updateVersionHistory
50
50
  * new version MUST inherit from previous version
51
51
  */
52
- function initialize(address implementation, address activatedBy, bytes memory activationData) external;
52
+ function initializeVersionable(address implementation, address activatedBy, bytes memory activationData) external;
53
53
 
54
54
  /**
55
55
  * @dev
@@ -58,7 +58,7 @@ interface IVersionable {
58
58
  * new version MUST inherit from previous version
59
59
  * the first verion MUST revert
60
60
  */
61
- function upgrade(address implementation, address activatedBy, bytes memory upgradeData) external;
61
+ function upgradeVersionable(address implementation, address activatedBy, bytes memory upgradeData) external;
62
62
 
63
63
  /**
64
64
  * @dev returns true if the specified version has been activated for the current contract
@@ -1,17 +1,27 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
+ // import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
5
+
6
+ import {ERC165} from "./ERC165.sol";
4
7
  import {INftOwnable} from "./INftOwnable.sol";
5
8
  import {IRegistry} from "../registry/IRegistry.sol";
6
9
  import {NftId, zeroNftId} from "../types/NftId.sol";
7
-
8
- // TODO make contract upgradeable
9
- contract NftOwnable is INftOwnable {
10
-
11
- // TODO move vars to struct and add _getNftOwnableStorage
12
- IRegistry internal _registry;
13
- NftId private _nftId;
14
- address private _initialOwner;
10
+ import {RegistryLinked} from "./RegistryLinked.sol";
11
+
12
+ contract NftOwnable is
13
+ ERC165,
14
+ RegistryLinked,
15
+ INftOwnable
16
+ {
17
+ // keccak256(abi.encode(uint256(keccak256("etherisc.storage.NftOwnable")) - 1)) & ~bytes32(uint256(0xff));
18
+ bytes32 public constant NFT_OWNABLE_STORAGE_LOCATION_V1 = 0x07ebcf49758b6ed3af50fa146bec0abe157c0218fe65dc0874c286e9d5da4f00;
19
+
20
+ struct NftOwnableStorage {
21
+ // IRegistry _registry;
22
+ NftId _nftId;
23
+ address _initialOwner;
24
+ }
15
25
 
16
26
  /// @dev enforces msg.sender is owner of nft (or initial owner of nft ownable)
17
27
  modifier onlyOwner() {
@@ -21,67 +31,100 @@ contract NftOwnable is INftOwnable {
21
31
  _;
22
32
  }
23
33
 
24
- constructor() {
25
- _initialOwner = msg.sender;
34
+
35
+ /// @dev initialization for upgradable contracts
36
+ // used in _initializeRegisterable
37
+ function initializeNftOwnable(
38
+ address initialOwner,
39
+ address registryAddress
40
+ )
41
+ public
42
+ virtual
43
+ onlyInitializing()
44
+ {
45
+ _setInitialOwner(initialOwner);
46
+
47
+ initializeRegistryLinked(registryAddress);
48
+ initializeERC165();
49
+ registerInterface(type(INftOwnable).interfaceId);
50
+ }
51
+
52
+
53
+ function initializeOwner(address initialOwner)
54
+ public
55
+ initializer()
56
+ {
57
+ _setInitialOwner(initialOwner);
58
+ initializeERC165();
59
+ registerInterface(type(INftOwnable).interfaceId);
26
60
  }
27
61
 
62
+
28
63
  /// @dev links this contract to nft after registration
29
64
  // needs to be done once per registered contract and
30
65
  // reduces registry calls to check ownership
31
66
  // does not need any protection as function can only do the "right thing"
32
- function linkToRegisteredNftId() public {
33
- if (_nftId.gtz()) {
34
- revert ErrorAlreadyLinked(address(_registry), _nftId);
67
+ function linkToRegisteredNftId()
68
+ public
69
+ virtual
70
+ {
71
+ NftOwnableStorage storage $ = _getNftOwnableStorage();
72
+
73
+ if ($._nftId.gtz()) {
74
+ revert ErrorAlreadyLinked(address(getRegistry()), $._nftId);
35
75
  }
36
76
 
37
- if (address(_registry) == address(0)) {
77
+ if (address(getRegistry()) == address(0)) {
38
78
  revert ErrorRegistryNotInitialized();
39
79
  }
40
80
 
41
81
  address contractAddress = address(this);
42
82
 
43
- if (!_registry.isRegistered(contractAddress)) {
83
+ if (!getRegistry().isRegistered(contractAddress)) {
44
84
  revert ErrorContractNotRegistered(contractAddress);
45
85
  }
46
86
 
47
- _nftId = _registry.getNftId(contractAddress);
87
+ $._nftId = getRegistry().getNftId(contractAddress);
48
88
  }
49
89
 
50
90
 
51
- function getRegistry() public view virtual override returns (IRegistry) {
52
- return _registry;
53
- }
54
-
91
+ // function getRegistry() public view virtual override returns (IRegistry) {
92
+ // return _getNftOwnableStorage()._registry;
93
+ // }
55
94
 
56
95
  function getNftId() public view virtual override returns (NftId) {
57
- return _nftId;
96
+ return _getNftOwnableStorage()._nftId;
58
97
  }
59
98
 
99
+ function getInitialOwner() public view returns (address) {
100
+ return _getNftOwnableStorage()._initialOwner;
101
+ }
60
102
 
61
103
  function getOwner() public view virtual override returns (address) {
62
- if (_nftId.gtz()) {
63
- return _registry.ownerOf(_nftId);
104
+ NftOwnableStorage storage $ = _getNftOwnableStorage();
105
+
106
+ if ($._nftId.gtz()) {
107
+ return getRegistry().ownerOf($._nftId);
64
108
  }
65
109
 
66
- return _initialOwner;
110
+ return $._initialOwner;
67
111
  }
68
112
 
69
-
70
- /// @dev initialization for upgradable contracts
71
- // used in _initializeRegisterable
72
- function _initializeNftOwnable(
73
- address initialOwner,
74
- address registryAddress
75
- )
113
+ /// @dev set initialOwner
114
+ /// initial owner may only be set during initialization
115
+ function _setInitialOwner(address initialOwner)
76
116
  internal
77
117
  virtual
118
+ onlyInitializing()
78
119
  {
79
- require(initialOwner > address(0), "NftOwnable: initial owner is 0");
80
- _initialOwner = initialOwner;
81
- _setRegistry(registryAddress);
82
- }
120
+ if(initialOwner == address(0)) {
121
+ revert ErrorInitialOwnerZero();
122
+ }
83
123
 
124
+ _getNftOwnableStorage()._initialOwner = initialOwner;
125
+ }
84
126
 
127
+ // TODO check if function can be refactored to work with a registry address set in an initializer
85
128
  /// @dev used in constructor of registry service manager
86
129
  // links ownership of registry service manager ot nft owner of registry service
87
130
  function _linkToNftOwnable(
@@ -92,45 +135,56 @@ contract NftOwnable is INftOwnable {
92
135
  onlyOwner()
93
136
  returns (NftId)
94
137
  {
95
- if (_nftId.gtz()) {
96
- revert ErrorAlreadyLinked(address(_registry), _nftId);
138
+ NftOwnableStorage storage $ = _getNftOwnableStorage();
139
+
140
+ if ($._nftId.gtz()) {
141
+ revert ErrorAlreadyLinked(address(getRegistry()), $._nftId);
97
142
  }
98
143
 
99
144
  _setRegistry(registryAddress);
100
145
 
101
- if (!_registry.isRegistered(nftOwnableAddress)) {
146
+ if (!getRegistry().isRegistered(nftOwnableAddress)) {
102
147
  revert ErrorContractNotRegistered(nftOwnableAddress);
103
148
  }
104
149
 
105
- _nftId = _registry.getNftId(nftOwnableAddress);
150
+ $._nftId = getRegistry().getNftId(nftOwnableAddress);
106
151
 
107
- return _nftId;
152
+ return $._nftId;
108
153
  }
109
154
 
110
155
 
111
- function _setRegistry(address registryAddress)
112
- private
113
- {
114
- if (address(_registry) != address(0)) {
115
- revert ErrorRegistryAlreadyInitialized(address(_registry));
116
- }
156
+ // function _setRegistry(address registryAddress)
157
+ // private
158
+ // {
159
+ // NftOwnableStorage storage $ = _getNftOwnableStorage();
117
160
 
118
- if (registryAddress == address(0)) {
119
- revert ErrorRegistryAddressZero();
120
- }
161
+ // if (address($._registry) != address(0)) {
162
+ // revert ErrorRegistryAlreadyInitialized(address($._registry));
163
+ // }
121
164
 
122
- if (registryAddress.code.length == 0) {
123
- revert ErrorNotRegistry(registryAddress);
124
- }
165
+ // if (registryAddress == address(0)) {
166
+ // revert ErrorRegistryAddressZero();
167
+ // }
168
+
169
+ // if (registryAddress.code.length == 0) {
170
+ // revert ErrorNotRegistry(registryAddress);
171
+ // }
172
+
173
+ // $._registry = IRegistry(registryAddress);
174
+
175
+ // try $._registry.supportsInterface(type(IRegistry).interfaceId) returns (bool isRegistry) {
176
+ // if (!isRegistry) {
177
+ // revert ErrorNotRegistry(registryAddress);
178
+ // }
179
+ // } catch {
180
+ // revert ErrorNotRegistry(registryAddress);
181
+ // }
182
+ // }
125
183
 
126
- _registry = IRegistry(registryAddress);
127
184
 
128
- try _registry.supportsInterface(type(IRegistry).interfaceId) returns (bool isRegistry) {
129
- if (!isRegistry) {
130
- revert ErrorNotRegistry(registryAddress);
131
- }
132
- } catch {
133
- revert ErrorNotRegistry(registryAddress);
185
+ function _getNftOwnableStorage() private pure returns (NftOwnableStorage storage $) {
186
+ assembly {
187
+ $.slot := NFT_OWNABLE_STORAGE_LOCATION_V1
134
188
  }
135
189
  }
136
190
  }
@@ -0,0 +1,81 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.20;
3
+
4
+ import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
5
+ import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
6
+ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
7
+
8
+ import {ERC165} from "./ERC165.sol";
9
+ import {IPolicyHolder} from "./IPolicyHolder.sol";
10
+ import {IRegistry} from "../registry/IRegistry.sol";
11
+ import {NftId} from "../types/NftId.sol";
12
+ import {NumberId} from "../types/NumberId.sol";
13
+ import {RegistryLinked} from "./RegistryLinked.sol";
14
+
15
+ /// @dev template implementation for IPolicyHolder
16
+ contract PolicyHolder is
17
+ ERC165,
18
+ RegistryLinked,
19
+ IPolicyHolder
20
+ {
21
+ // keccak256(abi.encode(uint256(keccak256("etherisc.storage.PolicyHolder")) - 1)) & ~bytes32(uint256(0xff));
22
+ // TODO fix address
23
+ bytes32 public constant POLICY_HOLDER_STORAGE_LOCATION_V1 = 0x07ebcf49758b6ed3af50fa146bec0abe157c0218fe65dc0874c286e9d5da4f00;
24
+
25
+ // TODO uncomment/fix/refactor
26
+ struct PolicyHolderStorage {
27
+ // mapping(NftId policyId => mapping(NumberId claimId => address beneficiary)) private _claimBeneficiary;
28
+ // mapping(NftId policyId => address beneficiary) private _beneficiary;
29
+ bool dummy;
30
+ }
31
+
32
+ function initializePolicyHolder(
33
+ address registryAddress
34
+ )
35
+ public
36
+ virtual
37
+ onlyInitializing()
38
+ {
39
+ initializeRegistryLinked(registryAddress);
40
+ }
41
+
42
+ /// @dev empty default implementation
43
+ function policyCreatedCallback(NftId policyNftId) external virtual { }
44
+
45
+ /// @dev empty default implementation
46
+ function payoutExecutedCallback(NftId policyNftId, NumberId payoutId, address beneficiary, uint256 amount) external virtual { }
47
+
48
+ /// @dev determines beneficiary address that will be used in payouts targeting this contract
49
+ /// returned address will override GIF default where the policy nft holder is treated as beneficiary
50
+ function getBeneficiary(NftId policyId, NumberId claimId) external virtual view returns (address beneficiary) {
51
+ // TODO add implementation
52
+ }
53
+
54
+ //--- IERC165 functions ---------------//
55
+ function onERC721Received(
56
+ address, // operator
57
+ address, // from
58
+ uint256, // tokenId
59
+ bytes calldata // data
60
+ )
61
+ external
62
+ virtual
63
+ returns (bytes4)
64
+ {
65
+ return IERC721Receiver.onERC721Received.selector;
66
+ }
67
+
68
+ function _setBeneficiary(address beneficiary) internal {
69
+
70
+ }
71
+
72
+ function _setBeneficiary(NftId policyId, address beneficiary) internal {
73
+
74
+ }
75
+
76
+ function _getPolicyHolderStorage() private pure returns (PolicyHolderStorage storage $) {
77
+ assembly {
78
+ $.slot := POLICY_HOLDER_STORAGE_LOCATION_V1
79
+ }
80
+ }
81
+ }
@@ -27,8 +27,9 @@ contract ProxyManager is
27
27
 
28
28
  /// @dev only used to capture proxy owner
29
29
  constructor()
30
- NftOwnable()
31
- { }
30
+ {
31
+ initializeOwner(msg.sender);
32
+ }
32
33
 
33
34
  /// @dev deploy initial contract
34
35
  function deploy(address initialImplementation, bytes memory initializationData)
@@ -81,11 +82,11 @@ contract ProxyManager is
81
82
  }
82
83
 
83
84
  function getDeployData(address implementation, address proxyOwner, bytes memory deployData) public pure returns (bytes memory data) {
84
- return abi.encodeWithSelector(IVersionable.initialize.selector, implementation, proxyOwner, deployData);
85
+ return abi.encodeWithSelector(IVersionable.initializeVersionable.selector, implementation, proxyOwner, deployData);
85
86
  }
86
87
 
87
88
  function getUpgradeData(address implementation, address proxyOwner, bytes memory upgradeData) public pure returns (bytes memory data) {
88
- return abi.encodeWithSelector(IVersionable.upgrade.selector, implementation, proxyOwner, upgradeData);
89
+ return abi.encodeWithSelector(IVersionable.upgradeVersionable.selector, implementation, proxyOwner, upgradeData);
89
90
  }
90
91
 
91
92
  function getProxy() public returns (UpgradableProxyWithAdmin) {
@@ -11,11 +11,7 @@ import {IRegistry} from "../registry/IRegistry.sol";
11
11
  import {IRegisterable} from "./IRegisterable.sol";
12
12
  import {Versionable} from "./Versionable.sol";
13
13
 
14
- import {ERC165} from "./ERC165.sol";
15
-
16
14
  contract Registerable is
17
- ERC165,
18
- Initializable,
19
15
  NftOwnable,
20
16
  IRegisterable
21
17
  {
@@ -37,7 +33,7 @@ contract Registerable is
37
33
  }
38
34
  }
39
35
 
40
- function _initializeRegisterable(
36
+ function initializeRegisterable(
41
37
  address registryAddress,
42
38
  NftId parentNftId,
43
39
  ObjectType objectType,
@@ -45,12 +41,11 @@ contract Registerable is
45
41
  address initialOwner,
46
42
  bytes memory data
47
43
  )
48
- internal
49
- //onlyInitializing//TODO uncomment when "fully" upgradeable
44
+ public
50
45
  virtual
46
+ onlyInitializing
51
47
  {
52
- _initializeERC165();
53
- _initializeNftOwnable(
48
+ initializeNftOwnable(
54
49
  initialOwner,
55
50
  registryAddress);
56
51
 
@@ -63,7 +58,7 @@ contract Registerable is
63
58
  $._isInterceptor = isInterceptor;
64
59
  $._data = data;
65
60
 
66
- _registerInterface(type(IRegisterable).interfaceId);
61
+ registerInterface(type(IRegisterable).interfaceId);
67
62
  }
68
63
 
69
64
 
@@ -71,20 +66,16 @@ contract Registerable is
71
66
  public
72
67
  view
73
68
  virtual
74
- returns (IRegistry.ObjectInfo memory, bytes memory data)
69
+ returns (IRegistry.ObjectInfo memory info)
75
70
  {
76
- RegisterableStorage storage $ = _getRegisterableStorage();
77
- return (
78
- IRegistry.ObjectInfo(
79
- getNftId(),
80
- $._parentNftId,
81
- $._objectType,
82
- $._isInterceptor,
83
- address(this),
84
- getOwner(),
85
- $._data
86
- ),
87
- bytes("")
88
- );
71
+ RegisterableStorage memory $ = _getRegisterableStorage();
72
+ info = IRegistry.ObjectInfo(
73
+ zeroNftId(),
74
+ $._parentNftId,
75
+ $._objectType,
76
+ $._isInterceptor,
77
+ address(this),
78
+ getInitialOwner(),
79
+ $._data);
89
80
  }
90
81
  }
@@ -0,0 +1,64 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.20;
3
+
4
+ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
5
+ import {IRegistry} from "../registry/IRegistry.sol";
6
+ import {IRegistryLinked} from "./IRegistryLinked.sol";
7
+
8
+ contract RegistryLinked is
9
+ Initializable,
10
+ IRegistryLinked
11
+ {
12
+
13
+ IRegistry private _registry;
14
+
15
+ /// @dev initialization for upgradable contracts
16
+ // used in _initializeRegisterable
17
+ function initializeRegistryLinked(
18
+ address registryAddress
19
+ )
20
+ public
21
+ virtual
22
+ onlyInitializing()
23
+ {
24
+ _setRegistry(registryAddress);
25
+ }
26
+
27
+
28
+ function getRegistry() public view returns (IRegistry) {
29
+ return _registry;
30
+ }
31
+
32
+
33
+ function getRegistryAddress() public view returns (address) {
34
+ return address(_registry);
35
+ }
36
+
37
+
38
+ function _setRegistry(address registryAddress)
39
+ internal
40
+ {
41
+
42
+ if (address(_registry) != address(0)) {
43
+ revert ErrorRegistryAlreadyInitialized(address(_registry));
44
+ }
45
+
46
+ if (registryAddress == address(0)) {
47
+ revert ErrorRegistryAddressZero();
48
+ }
49
+
50
+ if (registryAddress.code.length == 0) {
51
+ revert ErrorNotRegistry(registryAddress);
52
+ }
53
+
54
+ _registry = IRegistry(registryAddress);
55
+
56
+ try _registry.supportsInterface(type(IRegistry).interfaceId) returns (bool isRegistry) {
57
+ if (!isRegistry) {
58
+ revert ErrorNotRegistry(registryAddress);
59
+ }
60
+ } catch {
61
+ revert ErrorNotRegistry(registryAddress);
62
+ }
63
+ }
64
+ }
@@ -36,21 +36,21 @@ abstract contract Service is
36
36
  return VersionLib.toVersion(3,0,0);
37
37
  }
38
38
 
39
- function _initializeService(
39
+ function initializeService(
40
40
  address registry,
41
41
  address initialOwner
42
42
  )
43
- internal
43
+ public
44
44
  virtual
45
- //onlyInitializing //TODO uncomment when "fully" upgradeable
45
+ onlyInitializing()
46
46
  {
47
47
  // service must provide its name and version upon registration
48
48
  bytes memory data = abi.encode(getDomain(), getMajorVersion());
49
49
  NftId registryNftId = _getRegistryNftId(registry);
50
50
  bool isInterceptor = false;
51
51
 
52
- _initializeRegisterable(registry, registryNftId, SERVICE(), isInterceptor, initialOwner, data);
53
- _registerInterface(type(IService).interfaceId);
52
+ initializeRegisterable(registry, registryNftId, SERVICE(), isInterceptor, initialOwner, data);
53
+ registerInterface(type(IService).interfaceId);
54
54
  }
55
55
 
56
56
  // this is just a conveniene function, actual validation will be done upon registration