@etherisc/gif-next 0.0.2-f29e479-370 → 0.0.2-f30e0eb-805

Sign up to get free protection for your applications and to get access to all the features.
Files changed (250) hide show
  1. package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
  2. package/artifacts/contracts/components/Component.sol/Component.json +68 -89
  3. package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
  4. package/artifacts/contracts/components/Distribution.sol/Distribution.json +113 -140
  5. package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
  6. package/artifacts/contracts/components/IComponent.sol/IComponent.json +65 -73
  7. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  8. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +91 -122
  9. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  10. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +256 -189
  11. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  12. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +69 -145
  13. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  14. package/artifacts/contracts/components/Pool.sol/Pool.json +279 -245
  15. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  16. package/artifacts/contracts/components/Product.sol/Product.json +73 -162
  17. package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +4 -0
  18. package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +1206 -0
  19. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
  20. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +64 -50
  21. package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
  22. package/artifacts/contracts/instance/Cloneable.sol/Cloneable.json +5 -0
  23. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  24. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +171 -308
  25. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  26. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +98 -40
  27. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  28. package/artifacts/contracts/instance/Instance.sol/Instance.json +260 -379
  29. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
  30. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +448 -121
  31. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  32. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +120 -227
  33. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  34. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +148 -161
  35. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  36. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +31 -23
  37. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
  38. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +8 -13
  39. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +1 -1
  40. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.json +1 -1
  41. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  42. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  43. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  44. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +40 -10
  45. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  46. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +36 -11
  47. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  48. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +54 -71
  49. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  50. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +4 -0
  51. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.json +10 -0
  52. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  53. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  54. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  55. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
  56. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
  57. package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  58. package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +161 -62
  59. package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  60. package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +33 -25
  61. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
  62. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +137 -140
  63. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  64. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +12 -12
  65. package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +1 -1
  66. package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +3 -3
  67. package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  68. package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +2 -2
  69. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
  70. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +505 -91
  71. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  72. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +78 -42
  73. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  74. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +110 -27
  75. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
  76. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +93 -96
  77. package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +1 -1
  78. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  79. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +350 -8
  80. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  81. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +21 -64
  82. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
  83. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +81 -0
  84. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
  85. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
  86. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +58 -157
  87. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  88. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +19 -47
  89. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
  90. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +114 -17
  91. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  92. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +17 -9
  93. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
  94. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +7 -7
  95. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
  96. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +4 -4
  97. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  98. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +15 -2
  99. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  100. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +19 -0
  101. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  102. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  103. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +18 -0
  104. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  105. package/artifacts/contracts/registry/Registry.sol/Registry.json +31 -12
  106. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
  107. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +2 -2
  108. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  109. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +5 -5
  110. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  111. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +3 -3
  112. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
  113. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +7 -7
  114. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  115. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
  116. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
  117. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  118. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  119. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  120. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  121. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  122. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  123. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  124. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  125. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
  126. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  127. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
  128. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  129. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +2 -2
  130. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  131. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +3 -3
  132. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  133. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
  134. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  135. package/artifacts/contracts/shared/Service.sol/Service.json +1 -1
  136. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  137. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
  138. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  139. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
  140. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  141. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
  142. package/artifacts/contracts/test/TestFee.sol/TestFee.json +2 -2
  143. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
  144. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +3 -3
  145. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
  146. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +6 -6
  147. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
  148. package/artifacts/contracts/test/TestService.sol/TestService.json +3 -3
  149. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
  150. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
  151. package/artifacts/contracts/test/TestVersion.sol/TestVersion.json +2 -2
  152. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
  153. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +2 -2
  154. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
  155. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  156. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  157. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.json +2 -2
  158. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  159. package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  160. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  161. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +2 -2
  162. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
  163. package/artifacts/contracts/types/Fee.sol/FeeLib.json +2 -2
  164. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
  165. package/artifacts/contracts/types/Key32.sol/Key32Lib.json +2 -2
  166. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  167. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +17 -4
  168. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  169. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
  170. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
  171. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  172. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
  173. package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  174. package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
  175. package/artifacts/contracts/types/Referral.sol/ReferralLib.json +23 -4
  176. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
  177. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +2 -2
  178. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
  179. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
  180. package/artifacts/contracts/types/Seconds.sol/SecondsLib.dbg.json +4 -0
  181. package/artifacts/contracts/types/Seconds.sol/SecondsLib.json +124 -0
  182. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
  183. package/artifacts/contracts/types/StateId.sol/StateIdLib.json +2 -2
  184. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
  185. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +25 -7
  186. package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
  187. package/artifacts/contracts/types/UFixed.sol/MathLib.json +2 -2
  188. package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
  189. package/artifacts/contracts/types/UFixed.sol/UFixedLib.json +2 -2
  190. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
  191. package/artifacts/contracts/types/Version.sol/VersionLib.json +2 -2
  192. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
  193. package/artifacts/contracts/types/Version.sol/VersionPartLib.json +2 -2
  194. package/contracts/components/Component.sol +95 -85
  195. package/contracts/components/Distribution.sol +12 -19
  196. package/contracts/components/IComponent.sol +37 -17
  197. package/contracts/components/IDistributionComponent.sol +1 -22
  198. package/contracts/components/IPoolComponent.sol +73 -47
  199. package/contracts/components/IProductComponent.sol +3 -2
  200. package/contracts/components/Pool.sol +171 -126
  201. package/contracts/components/Product.sol +26 -18
  202. package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +13 -0
  203. package/contracts/instance/BundleManager.sol +7 -5
  204. package/contracts/instance/Cloneable.sol +7 -2
  205. package/contracts/instance/IInstance.sol +16 -10
  206. package/contracts/instance/IInstanceService.sol +18 -5
  207. package/contracts/instance/Instance.sol +45 -9
  208. package/contracts/instance/InstanceAccessManager.sol +382 -157
  209. package/contracts/instance/InstanceReader.sol +7 -10
  210. package/contracts/instance/InstanceService.sol +174 -155
  211. package/contracts/instance/ObjectManager.sol +6 -8
  212. package/contracts/instance/base/ComponentService.sol +5 -5
  213. package/contracts/instance/base/KeyValueStore.sol +5 -2
  214. package/contracts/instance/base/Lifecycle.sol +11 -2
  215. package/contracts/instance/module/IAccess.sol +20 -13
  216. package/contracts/instance/module/IBundle.sol +2 -1
  217. package/contracts/instance/module/IComponents.sol +35 -0
  218. package/contracts/instance/module/IDistribution.sol +2 -1
  219. package/contracts/instance/module/IPolicy.sol +26 -1
  220. package/contracts/instance/module/ISetup.sol +7 -22
  221. package/contracts/instance/service/ApplicationService.sol +123 -41
  222. package/contracts/instance/service/BundleService.sol +76 -38
  223. package/contracts/instance/service/DistributionService.sol +139 -47
  224. package/contracts/instance/service/IApplicationService.sol +7 -7
  225. package/contracts/instance/service/IBundleService.sol +19 -11
  226. package/contracts/instance/service/IDistributionService.sol +19 -4
  227. package/contracts/instance/service/IPolicyService.sol +3 -20
  228. package/contracts/instance/service/IPoolService.sol +17 -2
  229. package/contracts/instance/service/PolicyService.sol +59 -132
  230. package/contracts/instance/service/PoolService.sol +128 -17
  231. package/contracts/instance/service/ProductService.sol +10 -2
  232. package/contracts/registry/ChainNft.sol +8 -0
  233. package/contracts/registry/IRegistry.sol +2 -0
  234. package/contracts/registry/ITransferInterceptor.sol +1 -0
  235. package/contracts/registry/Registry.sol +23 -20
  236. package/contracts/registry/RegistryService.sol +5 -5
  237. package/contracts/shared/Registerable.sol +2 -2
  238. package/contracts/shared/TokenHandler.sol +11 -5
  239. package/contracts/types/Blocknumber.sol +1 -0
  240. package/contracts/types/Fee.sol +1 -0
  241. package/contracts/types/NftId.sol +8 -0
  242. package/contracts/types/ObjectType.sol +1 -0
  243. package/contracts/types/Referral.sol +4 -0
  244. package/contracts/types/RoleId.sol +13 -6
  245. package/contracts/types/Seconds.sol +54 -0
  246. package/contracts/types/StateId.sol +1 -0
  247. package/contracts/types/Timestamp.sol +13 -13
  248. package/contracts/types/UFixed.sol +1 -0
  249. package/contracts/types/Version.sol +1 -0
  250. package/package.json +1 -1
@@ -149,7 +149,6 @@ contract Registry is
149
149
  }
150
150
 
151
151
  if(
152
-
153
152
  parentType == PROTOCOL() ||
154
153
  parentType == REGISTRY() ||
155
154
  parentType == SERVICE()
@@ -186,7 +185,7 @@ contract Registry is
186
185
  return _releaseManager.getReleaseInfo(version);
187
186
  }
188
187
 
189
- function getObjectCount() external view override returns (uint256) {
188
+ function getObjectCount() external view returns (uint256) {
190
189
  return _chainNft.totalSupply();
191
190
  }
192
191
 
@@ -198,11 +197,11 @@ contract Registry is
198
197
  return _registryNftId;
199
198
  }
200
199
 
201
- function getNftId(address object) external view override returns (NftId id) {
200
+ function getNftId(address object) external view returns (NftId id) {
202
201
  return _nftIdByAddress[object];
203
202
  }
204
203
 
205
- function ownerOf(NftId nftId) public view override returns (address) {
204
+ function ownerOf(NftId nftId) public view returns (address) {
206
205
  return _chainNft.ownerOf(nftId.toInt());
207
206
  }
208
207
 
@@ -210,26 +209,31 @@ contract Registry is
210
209
  return _chainNft.ownerOf(_nftIdByAddress[contractAddress].toInt());
211
210
  }
212
211
 
213
- function getObjectInfo(NftId nftId) external view override returns (ObjectInfo memory) {
212
+ function getObjectInfo(NftId nftId) external view returns (ObjectInfo memory) {
214
213
  return _info[nftId];
215
214
  }
216
215
 
217
- function getObjectInfo(address object) external view override returns (ObjectInfo memory) {
216
+ function getObjectInfo(address object) external view returns (ObjectInfo memory) {
218
217
  return _info[_nftIdByAddress[object]];
219
218
  }
220
219
 
221
- function isRegistered(NftId nftId) public view override returns (bool) {
220
+ function isRegistered(NftId nftId) public view returns (bool) {
222
221
  return _info[nftId].objectType.gtz();
223
222
  }
224
223
 
225
- function isRegistered(address object) external view override returns (bool) {
224
+ function isRegistered(address object) external view returns (bool) {
226
225
  return _nftIdByAddress[object].gtz();
227
226
  }
228
227
 
229
- function isRegisteredService(address object) external view override returns (bool) {
228
+ function isRegisteredService(address object) external view returns (bool) {
230
229
  return _info[_nftIdByAddress[object]].objectType == SERVICE();
231
230
  }
232
231
 
232
+ function isRegisteredComponent(address object) external view returns (bool) {
233
+ NftId objectParentNftId = _info[_nftIdByAddress[object]].parentNftId;
234
+ return _info[objectParentNftId].objectType == INSTANCE();
235
+ }
236
+
233
237
  function isValidRelease(VersionPart version) external view returns (bool)
234
238
  {
235
239
  return _releaseManager.isValidRelease(version);
@@ -287,18 +291,9 @@ contract Registry is
287
291
  }
288
292
 
289
293
  address interceptor = _getInterceptor(info.isInterceptor, info.objectAddress, parentInfo.isInterceptor, parentAddress);
294
+ uint256 tokenId = _chainNft.getNextTokenId();
295
+ nftId = toNftId(tokenId);
290
296
 
291
- // TODO does external call
292
- // compute next nftId, do all checks and stores, mint() at most end...
293
- uint256 mintedTokenId = _chainNft.mint(
294
- info.initialOwner,
295
- interceptor,
296
- EMPTY_URI);
297
- nftId = toNftId(mintedTokenId);
298
-
299
- // TODO move nftId out of info struct
300
- // getters by nftId -> return struct without nftId
301
- // getters by address -> return nftId AND struct
302
297
  info.nftId = nftId;
303
298
  _info[nftId] = info;
304
299
 
@@ -314,6 +309,14 @@ contract Registry is
314
309
  }
315
310
 
316
311
  emit LogRegistration(nftId, parentNftId, objectType, info.isInterceptor, info.objectAddress, info.initialOwner);
312
+
313
+ // calls nft receiver(1) and interceptor(2)
314
+ uint256 mintedTokenId = _chainNft.mint(
315
+ info.initialOwner,
316
+ interceptor,
317
+ EMPTY_URI);
318
+ assert(mintedTokenId == tokenId);
319
+
317
320
  }
318
321
 
319
322
  /// @dev obtain interceptor address for this nft if applicable, address(0) otherwise
@@ -184,12 +184,12 @@ contract RegistryService is
184
184
  /*config[-1].serviceDomain = STAKE();
185
185
  config[-1].selector = RegistryService.registerStake.selector;*/
186
186
 
187
- config[0].serviceDomain = APPLICATION();
188
- config[0].selectors = new bytes4[](1);
189
- config[0].selectors[0] = RegistryService.registerPolicy.selector;
187
+ config[0].serviceDomain = POLICY();
188
+ config[0].selectors = new bytes4[](0);
190
189
 
191
- config[1].serviceDomain = POLICY();
192
- config[1].selectors = new bytes4[](0);
190
+ config[1].serviceDomain = APPLICATION();
191
+ config[1].selectors = new bytes4[](1);
192
+ config[1].selectors[0] = RegistryService.registerPolicy.selector;
193
193
 
194
194
  config[2].serviceDomain = CLAIM();
195
195
  config[2].selectors = new bytes4[](0);
@@ -37,7 +37,7 @@ contract Registerable is
37
37
  ObjectType objectType,
38
38
  bool isInterceptor,
39
39
  address initialOwner,
40
- bytes memory data
40
+ bytes memory registryData // writeonly data that will saved in the object info record of the registry
41
41
  )
42
42
  public
43
43
  virtual
@@ -51,7 +51,7 @@ contract Registerable is
51
51
  $._parentNftId = parentNftId;
52
52
  $._objectType = objectType;
53
53
  $._isInterceptor = isInterceptor;
54
- $._data = data;
54
+ $._data = registryData;
55
55
  }
56
56
 
57
57
 
@@ -4,6 +4,8 @@ pragma solidity ^0.8.20;
4
4
  import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
5
5
  import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
6
6
 
7
+ /// @dev token specific transfer helper
8
+ /// relies internally on oz SafeERC20.safeTransferFrom
7
9
  contract TokenHandler {
8
10
  IERC20Metadata private _token;
9
11
 
@@ -11,17 +13,21 @@ contract TokenHandler {
11
13
  _token = IERC20Metadata(token);
12
14
  }
13
15
 
14
- // TODO add logging
15
16
  function transfer(
16
17
  address from,
17
18
  address to,
18
- uint256 amount // TODO add authz (only treasury/instance/product/pool/ service)
19
- ) external {
19
+ uint256 amount
20
+ )
21
+ external
22
+ {
20
23
  SafeERC20.safeTransferFrom(_token, from, to, amount);
21
- // _token.transferFrom(from, to, amount);
22
24
  }
23
25
 
24
- function getToken() external view returns (IERC20Metadata) {
26
+ function getToken()
27
+ external
28
+ view
29
+ returns (IERC20Metadata)
30
+ {
25
31
  return _token;
26
32
  }
27
33
  }
@@ -52,6 +52,7 @@ function blockBlocknumber() view returns (Blocknumber) {
52
52
  return toBlocknumber(block.number);
53
53
  }
54
54
 
55
+ // TODO move to BlocknumberLib and rename to zero()
55
56
  /// @dev Return the Blocknumber zero (0)
56
57
  function zeroBlocknumber() pure returns (Blocknumber) {
57
58
  return toBlocknumber(0);
@@ -40,6 +40,7 @@ library FeeLib {
40
40
  return Fee(UFixedLib.toUFixed(percent, -2), 0);
41
41
  }
42
42
 
43
+ // TODO rename to zero
43
44
  /// @dev Return a zero fee struct (0, 0)
44
45
  function zeroFee() public pure returns (Fee memory fee) {
45
46
  return Fee(UFixed.wrap(0), 0);
@@ -24,6 +24,7 @@ function toNftId(uint256 id) pure returns (NftId) {
24
24
  return NftId.wrap(uint96(id));
25
25
  }
26
26
 
27
+ // TODO move to NftIdLib and rename to zero()
27
28
  /// @dev Return the NftId zero (0)
28
29
  function zeroNftId() pure returns (NftId) {
29
30
  return NftId.wrap(0);
@@ -40,6 +41,13 @@ function neNftId(NftId a, NftId b) pure returns (bool isDifferent) {
40
41
 
41
42
  // library functions that operate on user defined type
42
43
  library NftIdLib {
44
+
45
+ /// @dev the zero nft id
46
+ /// is never a valid nft id and implies a non-initialized value
47
+ function zero() public pure returns (NftId) {
48
+ return NftId.wrap(0);
49
+ }
50
+
43
51
  /// @dev Converts the NftId to a uint256.
44
52
  function toInt(NftId nftId) public pure returns (uint96) {
45
53
  return uint96(NftId.unwrap(nftId));
@@ -115,6 +115,7 @@ function toObjectType(uint256 objectType) pure returns (ObjectType) {
115
115
  return ObjectType.wrap(uint8(objectType));
116
116
  }
117
117
 
118
+ // TODO move to ObjecTypeLib and rename to zero()
118
119
  /// @dev Return the ObjectType zero (0)
119
120
  function zeroObjectType() pure returns (ObjectType) {
120
121
  return ObjectType.wrap(0);
@@ -82,4 +82,8 @@ library ReferralLib {
82
82
  function toKeyId(ReferralId id) public pure returns (KeyId keyId) {
83
83
  return KeyId.wrap(bytes31(ReferralId.unwrap(id)));
84
84
  }
85
+
86
+ function eqz(ReferralId id) public pure returns (bool) {
87
+ return eqReferralId(id, zero());
88
+ }
85
89
  }
@@ -16,19 +16,25 @@ using {
16
16
  RoleIdLib.toKey32
17
17
  } for RoleId global;
18
18
 
19
+
20
+ /// @dev role id needs to match with oz AccessManager.ADMIN_ROLE
21
+ function ADMIN_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(type(uint64).min); }
22
+
23
+ /// @dev role id needs to match with oz AccessManager.PUBLIC_ROLE
24
+ function PUBLIC_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(type(uint64).max); }
25
+
19
26
  // general pure free functions
20
27
  function DISTRIBUTION_OWNER_ROLE_NAME() pure returns (string memory) { return "DistributionOwnerRole"; }
21
28
  function ORACLE_OWNER_ROLE_NAME() pure returns (string memory) { return "OracleOwnerRole"; }
22
29
  function POOL_OWNER_ROLE_NAME() pure returns (string memory) { return "PoolOwnerRole"; }
23
30
  function PRODUCT_OWNER_ROLE_NAME() pure returns (string memory) { return "ProductOwnerRole"; }
24
31
 
25
- function ADMIN_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(0); }
26
-
27
- function DISTRIBUTION_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(100); }
28
- function ORACLE_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(200); }
29
- function POOL_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(300); }
30
- function PRODUCT_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(400); }
32
+ function DISTRIBUTION_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2); }
33
+ function ORACLE_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(3); }
34
+ function POOL_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(4); }
35
+ function PRODUCT_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(5); }
31
36
 
37
+ function INSTANCE_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(1900); }
32
38
  function INSTANCE_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2000); }
33
39
  function DISTRIBUTION_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2100); }
34
40
  function POOL_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2200); }
@@ -37,6 +43,7 @@ function APPLICATION_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toR
37
43
  function POLICY_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2410); }
38
44
  function CLAIM_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2420); }
39
45
  function BUNDLE_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2500); }
46
+ function INSTANCE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2600); }
40
47
 
41
48
  function GIF_ADMIN_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(1500); }
42
49
  function GIF_MANAGER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(1600); }
@@ -0,0 +1,54 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.20;
3
+
4
+ type Seconds is uint40;
5
+
6
+ using {
7
+ SecondsLib.eqz,
8
+ SecondsLib.gtz,
9
+ SecondsLib.toInt
10
+ } for Seconds global;
11
+
12
+
13
+ library SecondsLib {
14
+
15
+ error ErrorSecondsLibDurationTooBig(uint256 duration);
16
+
17
+ function zero() public pure returns (Seconds) {
18
+ return Seconds.wrap(0);
19
+ }
20
+
21
+ function max() public pure returns (Seconds) {
22
+ return Seconds.wrap(_max());
23
+ }
24
+
25
+ /// @dev converts the uint duration into Seconds
26
+ /// function reverts if duration is exceeding max Seconds value
27
+ function toSeconds(uint256 duration) public pure returns (Seconds) {
28
+ // if(duration > type(uint40).max) {
29
+ if(duration > _max()) {
30
+ revert ErrorSecondsLibDurationTooBig(duration);
31
+ }
32
+
33
+ return Seconds.wrap(uint40(duration));
34
+ }
35
+
36
+ /// @dev return true if duration equals 0
37
+ function eqz(Seconds duration) public pure returns (bool) {
38
+ return Seconds.unwrap(duration) == 0;
39
+ }
40
+
41
+ /// @dev return true if duration is larger than 0
42
+ function gtz(Seconds duration) public pure returns (bool) {
43
+ return Seconds.unwrap(duration) > 0;
44
+ }
45
+
46
+ function toInt(Seconds duration) public pure returns (uint256) {
47
+ return uint256(uint40(Seconds.unwrap(duration)));
48
+ }
49
+
50
+ function _max() internal pure returns (uint40) {
51
+ // IMPORTANT: type nees to match with actual definition for Seconds
52
+ return type(uint40).max;
53
+ }
54
+ }
@@ -67,6 +67,7 @@ function toStateId(uint256 id) pure returns (StateId) {
67
67
  return StateId.wrap(uint8(id));
68
68
  }
69
69
 
70
+ // TODO move to StateIdLib and rename to zero()
70
71
  /// @dev Return the StateId zero (0)
71
72
  function zeroStateId() pure returns (StateId) {
72
73
  return StateId.wrap(0);
@@ -1,5 +1,7 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
- pragma solidity ^0.8.19;
2
+ pragma solidity ^0.8.20;
3
+
4
+ import {Seconds} from "./Seconds.sol";
3
5
 
4
6
  type Timestamp is uint40;
5
7
 
@@ -12,7 +14,8 @@ using {
12
14
  neTimestamp as !=,
13
15
  TimestampLib.gtz,
14
16
  TimestampLib.eqz,
15
- TimestampLib.addSeconds
17
+ TimestampLib.addSeconds,
18
+ TimestampLib.toInt
16
19
  } for Timestamp global;
17
20
 
18
21
  /// @dev return true if Timestamp a is after Timestamp b
@@ -50,10 +53,7 @@ function toTimestamp(uint256 timestamp) pure returns (Timestamp) {
50
53
  return Timestamp.wrap(uint40(timestamp));
51
54
  }
52
55
 
53
- // function blockTimestamp() view returns (Timestamp) {
54
- // return toTimestamp(block.timestamp);
55
- // }
56
-
56
+ // TODO move to TimestampLib and rename to zero()
57
57
  /// @dev Return the Timestamp zero (0)
58
58
  function zeroTimestamp() pure returns (Timestamp) {
59
59
  return toTimestamp(0);
@@ -103,22 +103,22 @@ library TimestampLib {
103
103
  return neTimestamp(a, b);
104
104
  }
105
105
 
106
- /// @dev return true if Timestamp is larger than 0
107
- function gtz(Timestamp timestamp) public pure returns (bool) {
108
- return Timestamp.unwrap(timestamp) > 0;
109
- }
110
-
111
106
  /// @dev return true if Timestamp equals 0
112
107
  function eqz(Timestamp timestamp) public pure returns (bool) {
113
108
  return Timestamp.unwrap(timestamp) == 0;
114
109
  }
115
110
 
111
+ /// @dev return true if Timestamp is larger than 0
112
+ function gtz(Timestamp timestamp) public pure returns (bool) {
113
+ return Timestamp.unwrap(timestamp) > 0;
114
+ }
115
+
116
116
  /// @dev return true if Timestamp a is not equal to Timestamp b
117
117
  function addSeconds(
118
118
  Timestamp timestamp,
119
- uint256 timeDelta
119
+ Seconds duration
120
120
  ) public pure returns (Timestamp) {
121
- return toTimestamp(Timestamp.unwrap(timestamp) + uint40(timeDelta));
121
+ return toTimestamp(Timestamp.unwrap(timestamp) + duration.toInt());
122
122
  }
123
123
 
124
124
  function toInt(Timestamp timestamp) public pure returns (uint256) {
@@ -19,6 +19,7 @@ using {
19
19
  UFixedLib.gtz
20
20
  } for UFixed global;
21
21
 
22
+ // TODO move to UFixedLib and rename to zero()
22
23
  function zeroUFixed() pure returns (UFixed zero) {
23
24
  return UFixed.wrap(0);
24
25
  }
@@ -101,6 +101,7 @@ library VersionLib {
101
101
  return Version.wrap(uint24(versionNumber));
102
102
  }
103
103
 
104
+ // TODO rename to zero()
104
105
  function zeroVersion() external pure returns(Version) {
105
106
  return Version.wrap(0);
106
107
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etherisc/gif-next",
3
- "version": "0.0.2-f29e479-370",
3
+ "version": "0.0.2-f30e0eb-805",
4
4
  "description": "This is the repository for the next version of the Generic Insurance Framework (GIF) smart contracts. ",
5
5
  "main": "index.js",
6
6
  "scripts": {