@etherisc/gif-next 0.0.2-90f8ffc-398 → 0.0.2-9105e58-225

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 (272) 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 +242 -34
  4. package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
  5. package/artifacts/contracts/components/Distribution.sol/Distribution.json +592 -41
  6. package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
  7. package/artifacts/contracts/components/IComponent.sol/IComponent.json +85 -27
  8. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  9. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +327 -32
  10. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  11. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +187 -43
  12. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  13. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +85 -27
  14. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  15. package/artifacts/contracts/components/Pool.sol/Pool.json +443 -54
  16. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  17. package/artifacts/contracts/components/Product.sol/Product.json +342 -34
  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 +673 -169
  44. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  45. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +96 -34
  46. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  47. package/artifacts/contracts/instance/Instance.sol/Instance.json +762 -422
  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 +289 -104
  54. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  55. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +163 -57
  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 +151 -52
  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 +1047 -0
  76. package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
  77. package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +543 -0
  78. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
  79. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +282 -118
  80. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  81. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +149 -51
  82. package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +4 -0
  83. package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +932 -0
  84. package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
  85. package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +523 -0
  86. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
  87. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +426 -74
  88. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  89. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +174 -48
  90. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +4 -0
  91. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +612 -0
  92. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
  93. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +130 -73
  94. package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +4 -0
  95. package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.json +548 -0
  96. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  97. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +220 -31
  98. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  99. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +44 -88
  100. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
  101. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +23 -31
  102. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
  103. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +23 -31
  104. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
  105. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +212 -149
  106. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  107. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +162 -64
  108. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
  109. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +173 -74
  110. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  111. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +146 -48
  112. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
  113. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +173 -74
  114. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
  115. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +146 -48
  116. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  117. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  118. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +15 -2
  119. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  120. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +82 -34
  121. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  122. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  123. package/artifacts/contracts/registry/Registry.sol/Registry.json +28 -15
  124. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
  125. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +2 -2
  126. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  127. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +218 -63
  128. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  129. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +142 -50
  130. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
  131. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +11 -11
  132. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  133. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +141 -37
  134. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
  135. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  136. package/artifacts/contracts/shared/ERC165.sol/ERC165.json +41 -3
  137. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  138. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +40 -29
  139. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
  140. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +129 -0
  141. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  142. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +21 -29
  143. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
  144. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.json +48 -0
  145. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  146. package/artifacts/contracts/shared/IService.sol/IService.json +23 -31
  147. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  148. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +2 -2
  149. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  150. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +113 -33
  151. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
  152. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +248 -0
  153. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  154. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +143 -39
  155. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  156. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +126 -45
  157. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
  158. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +84 -0
  159. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  160. package/artifacts/contracts/shared/Service.sol/Service.json +143 -44
  161. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  162. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  163. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
  164. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  165. package/artifacts/contracts/shared/Versionable.sol/Versionable.json +2 -2
  166. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
  167. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
  168. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +126 -45
  169. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
  170. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +2 -2
  171. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
  172. package/artifacts/contracts/test/TestService.sol/TestService.json +161 -62
  173. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
  174. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
  175. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
  176. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +8 -8
  177. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
  178. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  179. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  180. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  181. package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.dbg.json +4 -0
  182. package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.json +100 -0
  183. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  184. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +2 -2
  185. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
  186. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
  187. package/artifacts/contracts/types/Key32.sol/Key32Lib.json +2 -2
  188. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  189. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +2 -2
  190. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  191. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
  192. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
  193. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  194. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
  195. package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.dbg.json +4 -0
  196. package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.json +100 -0
  197. package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
  198. package/artifacts/contracts/types/Referral.sol/ReferralLib.json +2 -2
  199. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
  200. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +2 -2
  201. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
  202. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
  203. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
  204. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
  205. package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
  206. package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
  207. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
  208. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
  209. package/contracts/components/Component.sol +46 -20
  210. package/contracts/components/Distribution.sol +188 -33
  211. package/contracts/components/IComponent.sol +15 -3
  212. package/contracts/components/IDistributionComponent.sol +54 -1
  213. package/contracts/components/IPoolComponent.sol +48 -17
  214. package/contracts/components/Pool.sol +134 -95
  215. package/contracts/components/Product.sol +76 -57
  216. package/contracts/instance/IInstance.sol +21 -1
  217. package/contracts/instance/IInstanceService.sol +18 -0
  218. package/contracts/instance/Instance.sol +58 -36
  219. package/contracts/instance/InstanceAccessManager.sol +12 -13
  220. package/contracts/instance/InstanceService.sol +76 -35
  221. package/contracts/instance/InstanceServiceManager.sol +1 -1
  222. package/contracts/instance/base/ComponentService.sol +1 -1
  223. package/contracts/instance/module/IAccess.sol +3 -4
  224. package/contracts/instance/module/IPolicy.sol +4 -2
  225. package/contracts/instance/module/ISetup.sol +5 -4
  226. package/contracts/instance/service/ApplicationService.sol +268 -0
  227. package/contracts/instance/service/ApplicationServiceManager.sol +35 -0
  228. package/contracts/instance/service/BundleService.sol +11 -6
  229. package/contracts/instance/service/BundleServiceManager.sol +1 -1
  230. package/contracts/instance/service/ClaimService.sol +151 -0
  231. package/contracts/instance/service/ClaimServiceManager.sol +35 -0
  232. package/contracts/instance/service/DistributionService.sol +185 -14
  233. package/contracts/instance/service/DistributionServiceManager.sol +1 -1
  234. package/contracts/instance/service/IApplicationService.sol +82 -0
  235. package/contracts/instance/service/IBundleService.sol +11 -1
  236. package/contracts/instance/service/IClaimService.sol +61 -0
  237. package/contracts/instance/service/IDistributionService.sol +53 -0
  238. package/contracts/instance/service/IPolicyService.sol +41 -46
  239. package/contracts/instance/service/PolicyService.sol +94 -158
  240. package/contracts/instance/service/PolicyServiceManager.sol +1 -1
  241. package/contracts/instance/service/PoolService.sol +2 -3
  242. package/contracts/instance/service/PoolServiceManager.sol +1 -1
  243. package/contracts/instance/service/ProductService.sol +9 -9
  244. package/contracts/instance/service/ProductServiceManager.sol +1 -1
  245. package/contracts/registry/IRegistry.sol +3 -2
  246. package/contracts/registry/IRegistryService.sol +10 -8
  247. package/contracts/registry/Registry.sol +20 -8
  248. package/contracts/registry/RegistryService.sol +70 -49
  249. package/contracts/registry/RegistryServiceManager.sol +13 -13
  250. package/contracts/registry/ReleaseManager.sol +8 -9
  251. package/contracts/registry/TokenRegistry.sol +15 -6
  252. package/contracts/shared/ERC165.sol +14 -12
  253. package/contracts/shared/INftOwnable.sol +11 -10
  254. package/contracts/shared/IPolicyHolder.sol +26 -0
  255. package/contracts/shared/IRegisterable.sol +3 -3
  256. package/contracts/shared/IRegistryLinked.sol +12 -0
  257. package/contracts/shared/IVersionable.sol +2 -2
  258. package/contracts/shared/NftOwnable.sol +66 -85
  259. package/contracts/shared/PolicyHolder.sol +81 -0
  260. package/contracts/shared/ProxyManager.sol +13 -5
  261. package/contracts/shared/Registerable.sol +6 -14
  262. package/contracts/shared/RegistryLinked.sol +48 -0
  263. package/contracts/shared/Service.sol +5 -5
  264. package/contracts/shared/Versionable.sol +3 -2
  265. package/contracts/test/TestRegisterable.sol +1 -1
  266. package/contracts/test/TestService.sol +1 -1
  267. package/contracts/types/ClaimId.sol +52 -0
  268. package/contracts/types/DistributorType.sol +2 -2
  269. package/contracts/types/ObjectType.sol +9 -5
  270. package/contracts/types/PayoutId.sol +54 -0
  271. package/contracts/types/RoleId.sol +3 -3
  272. package/package.json +3 -3
@@ -5,7 +5,7 @@ import {POOL} from "../types/ObjectType.sol";
5
5
  import {IPoolService} from "../instance/service/IPoolService.sol";
6
6
  import {IBundleService} from "../instance/service/IBundleService.sol";
7
7
  import {NftId, NftIdLib} from "../types/NftId.sol";
8
- import {Fee} from "../types/Fee.sol";
8
+ import {Fee, FeeLib} from "../types/Fee.sol";
9
9
  import {UFixed} from "../types/UFixed.sol";
10
10
  import {IPoolComponent} from "./IPoolComponent.sol";
11
11
  import {Component} from "./Component.sol";
@@ -16,75 +16,83 @@ import {ISetup} from "../instance/module/ISetup.sol";
16
16
  import {InstanceReader} from "../instance/InstanceReader.sol";
17
17
 
18
18
 
19
- abstract contract Pool is Component, IPoolComponent {
20
- using NftIdLib for NftId;
19
+ abstract contract Pool is
20
+ Component,
21
+ IPoolComponent
22
+ {
23
+ // keccak256(abi.encode(uint256(keccak256("etherisc.storage.Pool")) - 1)) & ~bytes32(uint256(0xff));
24
+ bytes32 public constant POOL_STORAGE_LOCATION_V1 = 0x25e3e51823fbfffb988e0a2744bb93722d9f3e906c07cc0a9e77884c46c58300;
21
25
 
22
- bool internal _isConfirmingApplication;
23
- UFixed internal _collateralizationLevel;
26
+ struct PoolStorage {
27
+ UFixed _collateralizationLevel;
28
+ UFixed _retentionLevel;
24
29
 
25
- Fee internal _initialPoolFee;
26
- Fee internal _initialStakingFee;
27
- Fee internal _initialPerformanceFee;
30
+ bool _isExternallyManaged;
31
+ bool _isInterceptingBundleTransfers;
32
+ bool _isVerifyingApplications;
28
33
 
29
- TokenHandler internal _tokenHandler;
34
+ Fee _initialPoolFee;
35
+ Fee _initialStakingFee;
36
+ Fee _initialPerformanceFee;
30
37
 
31
- // may be used to interact with instance by derived contracts
32
- IPoolService internal _poolService;
33
- IBundleService private _bundleService;
38
+ TokenHandler _tokenHandler;
39
+
40
+ // may be used to interact with instance by derived contracts
41
+ IPoolService _poolService;
42
+ IBundleService _bundleService;
43
+ }
34
44
 
35
45
  modifier onlyPoolService() {
36
- require(
37
- msg.sender == address(_poolService),
38
- "ERROR:POL-001:NOT_POOL_SERVICE");
46
+ if(msg.sender != address(_getPoolStorage()._poolService)) {
47
+ revert ErrorPoolNotPoolService(msg.sender);
48
+ }
39
49
  _;
40
50
  }
41
51
 
42
- constructor(
52
+
53
+ function initializePool(
43
54
  address registry,
44
55
  NftId instanceNftId,
45
56
  string memory name,
46
57
  // TODO refactor into tokenNftId
47
58
  address token,
48
- bool isInterceptor,
49
- bool isConfirmingApplication,
59
+ bool isInterceptingNftTransfers,
60
+ bool isExternallyManaging,
61
+ bool isVerifying,
50
62
  UFixed collateralizationLevel,
51
- Fee memory poolFee,
52
- Fee memory stakingFee,
53
- Fee memory performanceFee,
63
+ UFixed retentionLevel,
54
64
  address initialOwner,
55
65
  bytes memory data
56
- ) Component(
57
- registry,
58
- instanceNftId,
59
- name,
60
- token,
61
- POOL(),
62
- isInterceptor,
63
- initialOwner,
64
- data
65
- ) {
66
- _isConfirmingApplication = isConfirmingApplication;
67
- // TODO add validation
68
- _collateralizationLevel = collateralizationLevel;
69
- _initialPoolFee = poolFee;
70
- _initialStakingFee = stakingFee;
71
- _initialPerformanceFee = performanceFee;
72
-
73
- _tokenHandler = new TokenHandler(token);
74
-
75
- _poolService = getInstance().getPoolService();
76
- _bundleService = getInstance().getBundleService();
66
+ )
67
+ public
68
+ virtual
69
+ onlyInitializing()
70
+ {
71
+ initializeComponent(registry, instanceNftId, name, token, POOL(), isInterceptingNftTransfers, initialOwner, data);
77
72
 
78
- _registerInterface(type(IPoolComponent).interfaceId);
73
+ PoolStorage storage $ = _getPoolStorage();
74
+ // TODO add validation
75
+ $._tokenHandler = new TokenHandler(token);
76
+ $._isExternallyManaged = isExternallyManaging;
77
+ $._isVerifyingApplications = isVerifying;
78
+ $._collateralizationLevel = collateralizationLevel;
79
+ $._retentionLevel = retentionLevel;
80
+ $._initialPoolFee = FeeLib.zeroFee();
81
+ $._initialStakingFee = FeeLib.zeroFee();
82
+ $._initialPerformanceFee = FeeLib.zeroFee();
83
+ $._poolService = getInstance().getPoolService();
84
+ $._bundleService = getInstance().getBundleService();
85
+
86
+ registerInterface(type(IPoolComponent).interfaceId);
79
87
  }
80
88
 
81
89
  /**
82
- * @dev see {IPool.underwrite}.
90
+ * @dev see {IPool.verifyApplication}.
83
91
  * Default implementation that only writes a {LogUnderwrittenByPool} entry.
84
92
  */
85
- function underwrite(
86
- NftId policyNftId,
87
- bytes memory policyData,
93
+ function verifyApplication(
94
+ NftId applicationNftId,
95
+ bytes memory applicationData,
88
96
  bytes memory bundleFilter,
89
97
  uint256 collateralizationAmount
90
98
  )
@@ -92,19 +100,48 @@ abstract contract Pool is Component, IPoolComponent {
92
100
  restricted()
93
101
  virtual override
94
102
  {
95
- _underwrite(policyNftId, policyData, bundleFilter, collateralizationAmount);
103
+ require(
104
+ policyMatchesBundle(applicationData, bundleFilter),
105
+ "ERROR:POL-020:POLICY_BUNDLE_MISMATCH"
106
+ );
107
+
108
+ emit LogUnderwrittenByPool(applicationNftId, collateralizationAmount, address(this));
96
109
  }
97
110
 
98
- /**
99
- * @dev see {IPoolComponent.policyMatchesBundle}.
100
- * Default implementation always returns true
101
- */
111
+
112
+ function isInterceptingBundleTransfers() external view override returns (bool) {
113
+ return isNftInterceptor();
114
+ }
115
+
116
+
117
+ function isExternallyManaged() external view override returns (bool) {
118
+ return _getPoolStorage()._isExternallyManaged;
119
+ }
120
+
121
+
122
+ function getRetentionLevel() external view override returns (UFixed retentionLevel) {
123
+ return _getPoolStorage()._retentionLevel;
124
+ }
125
+
126
+
127
+ function getCollateralizationLevel() external view override returns (UFixed collateralizationLevel) {
128
+ return _getPoolStorage()._collateralizationLevel;
129
+ }
130
+
131
+
132
+ function isVerifyingApplications() external view override returns (bool isConfirmingApplication) {
133
+ return _getPoolStorage()._isVerifyingApplications;
134
+ }
135
+
136
+
137
+ /// @dev see {IPoolComponent.policyMatchesBundle}.
138
+ /// Default implementation always returns true
102
139
  function policyMatchesBundle(
103
140
  bytes memory, // policyData
104
141
  bytes memory // bundleFilter
105
142
  )
106
143
  public
107
- view
144
+ pure
108
145
  virtual override
109
146
  returns (bool isMatching)
110
147
  {
@@ -112,14 +149,6 @@ abstract contract Pool is Component, IPoolComponent {
112
149
  }
113
150
 
114
151
 
115
- function isConfirmingApplication() external view override returns (bool isConfirmingApplication) {
116
- return _isConfirmingApplication;
117
- }
118
-
119
- function getCollateralizationLevel() external view override returns (UFixed collateralizationLevel) {
120
- return _collateralizationLevel;
121
- }
122
-
123
152
  function setFees(
124
153
  Fee memory poolFee,
125
154
  Fee memory stakingFee,
@@ -130,7 +159,7 @@ abstract contract Pool is Component, IPoolComponent {
130
159
  restricted()
131
160
  override
132
161
  {
133
- _poolService.setFees(poolFee, stakingFee, performanceFee);
162
+ _getPoolStorage()._poolService.setFees(poolFee, stakingFee, performanceFee);
134
163
  }
135
164
 
136
165
  function setBundleFee(
@@ -139,17 +168,29 @@ abstract contract Pool is Component, IPoolComponent {
139
168
  )
140
169
  external
141
170
  override
142
- // TODO: add onlyBundleOwner
171
+ // TODO add onlyBundleOwner
143
172
  {
144
- _bundleService.setBundleFee(bundleNftId, fee);
173
+ _getPoolStorage()._bundleService.setBundleFee(bundleNftId, fee);
145
174
  }
146
175
 
147
- function _lockBundle(NftId bundleNftId) internal {
148
- _bundleService.lockBundle(bundleNftId);
176
+ function lockBundle(
177
+ NftId bundleNftId
178
+ )
179
+ external
180
+ override
181
+ // TODO add onlyBundleOwner
182
+ {
183
+ _getPoolStorage()._bundleService.lockBundle(bundleNftId);
149
184
  }
150
185
 
151
- function _unlockBundle(NftId bundleNftId) internal {
152
- _bundleService.unlockBundle(bundleNftId);
186
+ function unlockBundle(
187
+ NftId bundleNftId
188
+ )
189
+ external
190
+ override
191
+ // TODO add onlyBundleOwner
192
+ {
193
+ _getPoolStorage()._bundleService.unlockBundle(bundleNftId);
153
194
  }
154
195
 
155
196
  function getSetupInfo() public view returns (ISetup.PoolSetupInfo memory setupInfo) {
@@ -163,53 +204,51 @@ abstract contract Pool is Component, IPoolComponent {
163
204
  }
164
205
 
165
206
  function _getInitialSetupInfo() internal view returns (ISetup.PoolSetupInfo memory) {
207
+ PoolStorage storage $ = _getPoolStorage();
166
208
  return ISetup.PoolSetupInfo(
167
209
  getProductNftId(),
168
- _tokenHandler,
169
- _collateralizationLevel,
170
- _initialPoolFee,
171
- _initialStakingFee,
172
- _initialPerformanceFee,
173
- false,
174
- _isConfirmingApplication,
210
+ $._tokenHandler,
211
+ isNftInterceptor(),
212
+ $._isExternallyManaged,
213
+ $._isVerifyingApplications,
214
+ $._collateralizationLevel,
215
+ $._retentionLevel,
216
+ $._initialPoolFee,
217
+ $._initialStakingFee,
218
+ $._initialPerformanceFee,
175
219
  getWallet()
176
220
  );
177
221
  }
178
222
 
179
223
  // Internals
180
224
 
181
- function _underwrite(
182
- NftId policyNftId,
183
- bytes memory policyData,
184
- bytes memory bundleFilter,
185
- uint256 collateralizationAmount
186
- )
187
- internal
188
- {
189
- require(
190
- policyMatchesBundle(policyData, bundleFilter),
191
- "ERROR:POL-020:POLICY_BUNDLE_MISMATCH"
192
- );
193
-
194
- emit LogUnderwrittenByPool(policyNftId, collateralizationAmount, address(this));
195
- }
196
-
197
225
  function _createBundle(
198
226
  address bundleOwner,
199
227
  Fee memory fee,
200
228
  uint256 amount,
201
229
  uint256 lifetime,
202
- bytes calldata filter
230
+ bytes memory filter
203
231
  )
204
232
  internal
205
233
  returns(NftId bundleNftId)
206
234
  {
207
- bundleNftId = _bundleService.createBundle(
235
+ bundleNftId = _getPoolStorage()._bundleService.createBundle(
208
236
  bundleOwner,
209
237
  fee,
210
238
  amount,
211
239
  lifetime,
212
- filter
213
- );
240
+ filter);
241
+
242
+ // TODO add logging
243
+ }
244
+
245
+ function getContractLocation(bytes memory name) external pure returns (bytes32 hash) {
246
+ return keccak256(abi.encode(uint256(keccak256(name)) - 1)) & ~bytes32(uint256(0xff));
247
+ }
248
+
249
+ function _getPoolStorage() private pure returns (PoolStorage storage $) {
250
+ assembly {
251
+ $.slot := POOL_STORAGE_LOCATION_V1
252
+ }
214
253
  }
215
254
  }
@@ -4,10 +4,12 @@ pragma solidity ^0.8.19;
4
4
  import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
5
5
 
6
6
  import {IRisk} from "../instance/module/IRisk.sol";
7
+ import {IApplicationService} from "../instance/service/IApplicationService.sol";
7
8
  import {IPolicyService} from "../instance/service/IPolicyService.sol";
9
+ import {IClaimService} from "../instance/service/IClaimService.sol";
8
10
  import {IProductComponent} from "./IProductComponent.sol";
9
11
  import {NftId, NftIdLib} from "../types/NftId.sol";
10
- import {PRODUCT} from "../types/ObjectType.sol";
12
+ import {PRODUCT, APPLICATION, POLICY, CLAIM } from "../types/ObjectType.sol";
11
13
  import {ReferralId} from "../types/Referral.sol";
12
14
  import {RiskId, RiskIdLib} from "../types/RiskId.sol";
13
15
  import {StateId} from "../types/StateId.sol";
@@ -22,22 +24,29 @@ import {ISetup} from "../instance/module/ISetup.sol";
22
24
  import {Pool} from "../components/Pool.sol";
23
25
  import {Distribution} from "../components/Distribution.sol";
24
26
 
25
- abstract contract Product is Component, IProductComponent {
26
- using NftIdLib for NftId;
27
-
28
- IPolicyService internal _policyService;
29
- Pool internal _pool;
30
- Distribution internal _distribution;
31
- Fee internal _initialProductFee;
32
- Fee internal _initialProcessingFee;
33
- TokenHandler internal _tokenHandler;
34
-
35
- NftId internal _poolNftId;
36
- NftId internal _distributionNftId;
27
+ abstract contract Product is
28
+ Component,
29
+ IProductComponent
30
+ {
31
+ // keccak256(abi.encode(uint256(keccak256("etherisc.storage.Product")) - 1)) & ~bytes32(uint256(0xff));
32
+ bytes32 public constant PRODUCT_STORAGE_LOCATION_V1 = 0x0bb7aafdb8e380f81267337bc5b5dfdf76e6d3a380ecadb51ec665246d9d6800;
33
+
34
+ struct ProductStorage {
35
+ IApplicationService _applicationService;
36
+ IPolicyService _policyService;
37
+ IClaimService _claimService;
38
+ Pool _pool;
39
+ Distribution _distribution;
40
+ Fee _initialProductFee;
41
+ Fee _initialProcessingFee;
42
+ TokenHandler _tokenHandler;
43
+ NftId _poolNftId;
44
+ NftId _distributionNftId;
45
+ }
37
46
 
38
- constructor(
47
+ function initializeProduct(
39
48
  address registry,
40
- NftId instanceNftid,
49
+ NftId instanceNftId,
41
50
  string memory name,
42
51
  address token,
43
52
  bool isInterceptor,
@@ -47,29 +56,28 @@ abstract contract Product is Component, IProductComponent {
47
56
  Fee memory processingFee,
48
57
  address initialOwner,
49
58
  bytes memory data
50
- ) Component (
51
- registry,
52
- instanceNftid,
53
- name,
54
- token,
55
- PRODUCT(),
56
- isInterceptor,
57
- initialOwner,
58
- data
59
- ) {
60
- // TODO add validation
61
- _policyService = getInstance().getPolicyService();
62
- _pool = Pool(pool);
63
- _distribution = Distribution(distribution);
64
- _initialProductFee = productFee;
65
- _initialProcessingFee = processingFee;
66
-
67
- _tokenHandler = new TokenHandler(token);
68
-
69
- _poolNftId = getRegistry().getNftId(address(_pool));
70
- _distributionNftId = getRegistry().getNftId(address(_distribution));
59
+ )
60
+ public
61
+ virtual
62
+ onlyInitializing()
63
+ {
64
+ initializeComponent(registry, instanceNftId, name, token, PRODUCT(), isInterceptor, initialOwner, data);
71
65
 
72
- _registerInterface(type(IProductComponent).interfaceId);
66
+ ProductStorage storage $ = _getProductStorage();
67
+ // TODO add validation
68
+ // TODO refactor to go via registry
69
+ $._applicationService = IApplicationService(getServiceAddress(APPLICATION()));
70
+ $._policyService = IPolicyService(getServiceAddress(POLICY()));
71
+ $._claimService = IClaimService(getServiceAddress(CLAIM()));
72
+ $._pool = Pool(pool);
73
+ $._distribution = Distribution(distribution);
74
+ $._initialProductFee = productFee;
75
+ $._initialProcessingFee = processingFee;
76
+ $._tokenHandler = new TokenHandler(token);
77
+ $._poolNftId = getRegistry().getNftId(pool);
78
+ $._distributionNftId = getRegistry().getNftId(distribution);
79
+
80
+ registerInterface(type(IProductComponent).interfaceId);
73
81
  }
74
82
 
75
83
 
@@ -86,7 +94,7 @@ abstract contract Product is Component, IProductComponent {
86
94
  override
87
95
  returns (uint256 premiumAmount)
88
96
  {
89
- (premiumAmount,,,,) = _policyService.calculatePremium(
97
+ (premiumAmount,,,,) = _getProductStorage()._policyService.calculatePremium(
90
98
  riskId,
91
99
  sumInsuredAmount,
92
100
  lifetime,
@@ -155,18 +163,21 @@ abstract contract Product is Component, IProductComponent {
155
163
  RiskId riskId,
156
164
  uint256 sumInsuredAmount,
157
165
  uint256 lifetime,
158
- bytes memory applicationData,
159
166
  NftId bundleNftId,
160
- ReferralId referralId
161
- ) internal returns (NftId nftId) {
162
- nftId = _policyService.createApplication(
167
+ ReferralId referralId,
168
+ bytes memory applicationData
169
+ )
170
+ internal
171
+ returns (NftId applicationNftId)
172
+ {
173
+ return _getProductStorage()._applicationService.create(
163
174
  applicationOwner,
164
175
  riskId,
165
176
  sumInsuredAmount,
166
177
  lifetime,
167
- applicationData,
168
178
  bundleNftId,
169
- referralId
179
+ referralId,
180
+ applicationData
170
181
  );
171
182
  }
172
183
 
@@ -177,7 +188,7 @@ abstract contract Product is Component, IProductComponent {
177
188
  )
178
189
  internal
179
190
  {
180
- _policyService.underwrite(
191
+ _getProductStorage()._policyService.underwrite(
181
192
  policyNftId,
182
193
  requirePremiumPayment,
183
194
  activateAt);
@@ -189,7 +200,7 @@ abstract contract Product is Component, IProductComponent {
189
200
  )
190
201
  internal
191
202
  {
192
- _policyService.collectPremium(
203
+ _getProductStorage()._policyService.collectPremium(
193
204
  policyNftId,
194
205
  activateAt);
195
206
  }
@@ -200,7 +211,7 @@ abstract contract Product is Component, IProductComponent {
200
211
  )
201
212
  internal
202
213
  {
203
- _policyService.activate(
214
+ _getProductStorage()._policyService.activate(
204
215
  policyNftId,
205
216
  activateAt);
206
217
  }
@@ -210,15 +221,15 @@ abstract contract Product is Component, IProductComponent {
210
221
  )
211
222
  internal
212
223
  {
213
- _policyService.close(policyNftId);
224
+ _getProductStorage()._policyService.close(policyNftId);
214
225
  }
215
226
 
216
227
  function getPoolNftId() external view override returns (NftId poolNftId) {
217
- return getRegistry().getNftId(address(_pool));
228
+ return getRegistry().getNftId(address(_getProductStorage()._pool));
218
229
  }
219
230
 
220
231
  function getDistributionNftId() external view override returns (NftId distributionNftId) {
221
- return getRegistry().getNftId(address(_distribution));
232
+ return getRegistry().getNftId(address(_getProductStorage()._distribution));
222
233
  }
223
234
 
224
235
  // from product component
@@ -245,17 +256,19 @@ abstract contract Product is Component, IProductComponent {
245
256
  }
246
257
 
247
258
  function _getInitialSetupInfo() internal view returns (ISetup.ProductSetupInfo memory setupInfo) {
248
- ISetup.DistributionSetupInfo memory distributionSetupInfo = _distribution.getSetupInfo();
249
- ISetup.PoolSetupInfo memory poolSetupInfo = _pool.getSetupInfo();
259
+ ProductStorage storage $ = _getProductStorage();
260
+
261
+ ISetup.DistributionSetupInfo memory distributionSetupInfo = $._distribution.getSetupInfo();
262
+ ISetup.PoolSetupInfo memory poolSetupInfo = $._pool.getSetupInfo();
250
263
 
251
264
  return ISetup.ProductSetupInfo(
252
265
  getToken(),
253
- _tokenHandler,
254
- _distributionNftId,
255
- _poolNftId,
266
+ $._tokenHandler,
267
+ $._distributionNftId,
268
+ $._poolNftId,
256
269
  distributionSetupInfo.distributionFee,
257
- _initialProductFee,
258
- _initialProcessingFee,
270
+ $._initialProductFee,
271
+ $._initialProcessingFee,
259
272
  poolSetupInfo.poolFee,
260
273
  poolSetupInfo.stakingFee,
261
274
  poolSetupInfo.performanceFee,
@@ -263,4 +276,10 @@ abstract contract Product is Component, IProductComponent {
263
276
  getWallet()
264
277
  );
265
278
  }
279
+
280
+ function _getProductStorage() private pure returns (ProductStorage storage $) {
281
+ assembly {
282
+ $.slot := PRODUCT_STORAGE_LOCATION_V1
283
+ }
284
+ }
266
285
  }
@@ -19,6 +19,7 @@ import {IDistributionService} from "./service/IDistributionService.sol";
19
19
  import {InstanceAccessManager} from "./InstanceAccessManager.sol";
20
20
  import {IKeyValueStore} from "./base/IKeyValueStore.sol";
21
21
  import {IPolicy} from "./module/IPolicy.sol";
22
+ import {IDistribution} from "./module/IDistribution.sol";
22
23
  import {IPolicyService} from "./service/IPolicyService.sol";
23
24
  import {IPoolService} from "./service/IPoolService.sol";
24
25
  import {IProductService} from "./service/IProductService.sol";
@@ -30,6 +31,7 @@ import {NftId} from "../types/NftId.sol";
30
31
  import {RiskId} from "../types/RiskId.sol";
31
32
  import {StateId} from "../types/StateId.sol";
32
33
  import {VersionPart} from "../types/Version.sol";
34
+ import {Key32} from "../types/Key32.sol";
33
35
 
34
36
 
35
37
 
@@ -58,14 +60,32 @@ interface IInstance is IRegisterable, IKeyValueStore, IAccessManaged {
58
60
  function updateProductSetup(NftId productNftId, ISetup.ProductSetupInfo memory setup, StateId newState) external;
59
61
  function updateProductSetupState(NftId productNftId, StateId newState) external;
60
62
 
63
+ function createDistributorType(Key32 distributorKey, IDistribution.DistributorTypeInfo memory info) external;
64
+ function updateDistributorType(Key32 distributorKey, IDistribution.DistributorTypeInfo memory info, StateId newState) external;
65
+ function updateDistributorTypeState(Key32 distributorKey, StateId newState) external;
66
+
67
+ function createDistributor(NftId nftId, IDistribution.DistributorInfo memory info) external;
68
+ function updateDistributor(NftId nftId, IDistribution.DistributorInfo memory info, StateId newState) external;
69
+ function updateDistributorState(NftId nftId, StateId newState) external;
70
+
71
+ function createReferral(Key32 referralKey, IDistribution.ReferralInfo memory referralInfo) external;
72
+ function updateReferral(Key32 referralKey, IDistribution.ReferralInfo memory referralInfo, StateId newState) external;
73
+ function updateReferralState(Key32 referralKey, StateId newState) external;
74
+
61
75
  function createRisk(RiskId riskId, IRisk.RiskInfo memory risk) external;
62
76
  function updateRisk(RiskId riskId, IRisk.RiskInfo memory risk, StateId newState) external;
63
77
  function updateRiskState(RiskId riskId, StateId newState) external;
64
78
 
65
- function createPolicy(NftId policyNftId, IPolicy.PolicyInfo memory policy) external;
79
+ function createApplication(NftId applicationNftId, IPolicy.PolicyInfo memory policy) external;
80
+ function updateApplication(NftId applicationNftId, IPolicy.PolicyInfo memory policy, StateId newState) external;
81
+ function updateApplicationState(NftId applicationNftId, StateId newState) external;
82
+
66
83
  function updatePolicy(NftId policyNftId, IPolicy.PolicyInfo memory policy, StateId newState) external;
67
84
  function updatePolicyState(NftId policyNftId, StateId newState) external;
68
85
 
86
+ // TODO add claims/payouts function to instance
87
+ // function updateClaims(NftId policyNftId, IPolicy.PolicyInfo memory policy, StateId newState) external;
88
+
69
89
  function getMajorVersion() external pure returns (VersionPart majorVersion);
70
90
  function getInstanceReader() external view returns (InstanceReader);
71
91
  function getBundleManager() external view returns (BundleManager);
@@ -17,6 +17,24 @@ import {BundleManager} from "./BundleManager.sol";
17
17
 
18
18
  interface IInstanceService is IService {
19
19
 
20
+ error ErrorInstanceServiceMasterInstanceAlreadySet();
21
+ error ErrorInstanceServiceMasterInstanceAccessManagerAlreadySet();
22
+ error ErrorInstanceServiceMasterBundleManagerAlreadySet();
23
+ error ErrorInstanceServiceInstanceAddressZero();
24
+
25
+ error ErrorInstanceServiceMasterInstanceReaderNotSet();
26
+ error ErrorInstanceServiceInstanceReaderAddressZero();
27
+ error ErrorInstanceServiceInstanceReaderSameAsMasterInstanceReader();
28
+ error ErrorInstanceServiceInstanceReaderInstanceMismatch();
29
+
30
+ error ErrorInstanceServiceAccessManagerZero();
31
+ error ErrorInstanceServiceInstanceReaderZero();
32
+ error ErrorInstanceServiceBundleManagerZero();
33
+
34
+ error ErrorInstanceServiceInstanceAuthorityMismatch();
35
+ error ErrorInstanceServiceInstanceReaderInstanceMismatch2();
36
+ error ErrorInstanceServiceBundleMangerInstanceMismatch();
37
+
20
38
  error ErrorInstanceServiceRequestUnauhorized(address caller);
21
39
  error ErrorInstanceServiceNotInstanceOwner(address caller, NftId instanceNftId);
22
40
  error ErrorInstanceServiceComponentNotRegistered(address componentAddress);