@etherisc/gif-next 0.0.2-bb3faee-097 → 0.0.2-bb9ecaf-723

Sign up to get free protection for your applications and to get access to all the features.
Files changed (345) hide show
  1. package/README.md +15 -320
  2. package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
  3. package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +2 -2
  4. package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
  5. package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +49 -29
  6. package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
  7. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
  8. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +201 -130
  9. package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +1 -1
  10. package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +845 -126
  11. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
  12. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +2 -2
  13. package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
  14. package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +73 -46
  15. package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
  16. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
  17. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +105 -77
  18. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
  19. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +12 -2
  20. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
  21. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +12 -2
  22. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
  23. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +38 -32
  24. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
  25. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +8 -18
  26. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
  27. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +93 -54
  28. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
  29. package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +0 -10
  30. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
  31. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +2 -2
  32. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  33. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +79 -59
  34. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  35. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +0 -10
  36. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  37. package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
  38. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
  39. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +20 -30
  40. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
  41. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +93 -54
  42. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
  43. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +64 -74
  44. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
  45. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +93 -54
  46. package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
  47. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
  48. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +21 -31
  49. package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
  50. package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +93 -54
  51. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
  52. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +16 -26
  53. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
  54. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +24 -34
  55. package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
  56. package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +93 -54
  57. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
  58. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +25 -35
  59. package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
  60. package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +93 -54
  61. package/artifacts/contracts/instance/BaseStore.sol/BaseStore.dbg.json +4 -0
  62. package/artifacts/contracts/{shared/IKeyValueStore.sol/IKeyValueStore.json → instance/BaseStore.sol/BaseStore.json} +50 -228
  63. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
  64. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
  65. package/artifacts/contracts/instance/IBaseStore.sol/IBaseStore.dbg.json +4 -0
  66. package/artifacts/contracts/instance/IBaseStore.sol/IBaseStore.json +304 -0
  67. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  68. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +23 -0
  69. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  70. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +20 -0
  71. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  72. package/artifacts/contracts/instance/Instance.sol/Instance.json +70 -35
  73. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
  74. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +335 -284
  75. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
  76. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +82 -112
  77. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  78. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +55 -175
  79. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  80. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +40 -20
  81. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  82. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +45 -25
  83. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
  84. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +1362 -2115
  85. package/artifacts/contracts/instance/ProductStore.sol/ProductStore.dbg.json +4 -0
  86. package/artifacts/contracts/instance/ProductStore.sol/ProductStore.json +3427 -0
  87. package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
  88. package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +2 -2
  89. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
  90. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
  91. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
  92. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
  93. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
  94. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
  95. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
  96. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
  97. package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +1 -1
  98. package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +2 -2
  99. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  100. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  101. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  102. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  103. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  104. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
  105. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
  106. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +6 -16
  107. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
  108. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +87 -48
  109. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
  110. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
  111. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +0 -10
  112. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
  113. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
  114. package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +0 -10
  115. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
  116. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +2 -2
  117. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
  118. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +54 -34
  119. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
  120. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +0 -10
  121. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
  122. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +93 -54
  123. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
  124. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +2 -2
  125. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  126. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +66 -46
  127. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
  128. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  129. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +0 -10
  130. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
  131. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
  132. package/artifacts/contracts/pool/Pool.sol/Pool.json +0 -10
  133. package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
  134. package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +2 -2
  135. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
  136. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +2 -2
  137. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  138. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +67 -47
  139. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  140. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +2 -2
  141. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  142. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +48 -28
  143. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
  144. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +0 -10
  145. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
  146. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +93 -54
  147. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
  148. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +74 -74
  149. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  150. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +71 -51
  151. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  152. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
  153. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  154. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
  155. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  156. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +0 -10
  157. package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
  158. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
  159. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +2 -2
  160. package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
  161. package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +2 -2
  162. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  163. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +64 -44
  164. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
  165. package/artifacts/contracts/product/PricingService.sol/PricingService.json +2 -2
  166. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
  167. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +55 -35
  168. package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
  169. package/artifacts/contracts/product/Product.sol/Product.json +0 -10
  170. package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
  171. package/artifacts/contracts/product/RiskService.sol/RiskService.json +2 -2
  172. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
  173. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +46 -26
  174. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  175. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  176. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  177. package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +1 -1
  178. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  179. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  180. package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
  181. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
  182. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +312 -217
  183. package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +1 -1
  184. package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +126 -63
  185. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  186. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +18 -18
  187. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  188. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +41 -21
  189. package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
  190. package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +330 -211
  191. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
  192. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
  193. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +98 -86
  194. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
  195. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +62 -40
  196. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  197. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
  198. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
  199. package/artifacts/contracts/shared/Component.sol/Component.json +0 -10
  200. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
  201. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +28 -28
  202. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
  203. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +65 -45
  204. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
  205. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +2 -2
  206. package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
  207. package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
  208. package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +1 -1
  209. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
  210. package/artifacts/contracts/shared/IComponent.sol/IComponent.json +0 -10
  211. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
  212. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
  213. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +0 -10
  214. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  215. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  216. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  217. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  218. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  219. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  220. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
  221. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
  222. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +0 -10
  223. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  224. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
  225. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  226. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
  227. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  228. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
  229. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  230. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  231. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
  232. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  233. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  234. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
  235. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
  236. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +2 -2
  237. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
  238. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
  239. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
  240. package/artifacts/contracts/staking/IStaking.sol/IStaking.json +0 -10
  241. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
  242. package/artifacts/contracts/staking/ITargetLimitHandler.sol/ITargetLimitHandler.dbg.json +1 -1
  243. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
  244. package/artifacts/contracts/staking/Staking.sol/Staking.json +22 -48
  245. package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +1 -1
  246. package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +2 -2
  247. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
  248. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +50 -38
  249. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
  250. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
  251. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
  252. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +2 -2
  253. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
  254. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +44 -24
  255. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
  256. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +198 -166
  257. package/artifacts/contracts/staking/TargetHandler.sol/TargetHandler.dbg.json +1 -1
  258. package/artifacts/contracts/staking/TargetHandler.sol/TargetHandler.json +2 -2
  259. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
  260. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +2 -2
  261. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  262. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
  263. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  264. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +21 -2
  265. package/artifacts/contracts/type/ChainId.sol/ChainIdLib.dbg.json +1 -1
  266. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  267. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  268. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
  269. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
  270. package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +1 -1
  271. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
  272. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  273. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  274. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  275. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
  276. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
  277. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
  278. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
  279. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
  280. package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
  281. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
  282. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
  283. package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
  284. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
  285. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
  286. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
  287. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
  288. package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
  289. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  290. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +22 -6
  291. package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  292. package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
  293. package/contracts/authorization/AccessAdmin.sol +220 -321
  294. package/contracts/authorization/AccessAdminLib.sol +309 -27
  295. package/contracts/authorization/AccessManagerCloneable.sol +0 -18
  296. package/contracts/authorization/Authorization.sol +30 -9
  297. package/contracts/authorization/IAccess.sol +13 -14
  298. package/contracts/authorization/IAccessAdmin.sol +9 -11
  299. package/contracts/authorization/ServiceAuthorization.sol +10 -30
  300. package/contracts/distribution/BasicDistribution.sol +1 -2
  301. package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
  302. package/contracts/distribution/Distribution.sol +2 -4
  303. package/contracts/instance/BaseStore.sol +93 -0
  304. package/contracts/instance/IBaseStore.sol +37 -0
  305. package/contracts/instance/IInstance.sol +11 -0
  306. package/contracts/instance/IInstanceService.sol +2 -0
  307. package/contracts/instance/Instance.sol +18 -14
  308. package/contracts/instance/InstanceAdmin.sol +43 -119
  309. package/contracts/instance/InstanceAuthorizationV3.sol +49 -40
  310. package/contracts/instance/InstanceReader.sol +33 -59
  311. package/contracts/instance/InstanceService.sol +57 -43
  312. package/contracts/instance/InstanceStore.sol +153 -128
  313. package/contracts/instance/ProductStore.sol +290 -0
  314. package/contracts/instance/TargetNames.sol +10 -0
  315. package/contracts/instance/module/IComponents.sol +0 -2
  316. package/contracts/oracle/BasicOracle.sol +1 -2
  317. package/contracts/oracle/BasicOracleAuthorization.sol +1 -1
  318. package/contracts/oracle/Oracle.sol +2 -4
  319. package/contracts/pool/BasicPool.sol +1 -2
  320. package/contracts/pool/BasicPoolAuthorization.sol +1 -1
  321. package/contracts/pool/Pool.sol +2 -4
  322. package/contracts/product/ApplicationService.sol +2 -2
  323. package/contracts/product/BasicProduct.sol +1 -2
  324. package/contracts/product/BasicProductAuthorization.sol +1 -1
  325. package/contracts/product/ClaimService.sol +49 -53
  326. package/contracts/product/PolicyService.sol +9 -9
  327. package/contracts/product/Product.sol +2 -4
  328. package/contracts/product/RiskService.sol +3 -4
  329. package/contracts/registry/RegistryAdmin.sol +12 -30
  330. package/contracts/registry/RegistryAuthorization.sol +32 -31
  331. package/contracts/registry/ReleaseAdmin.sol +13 -9
  332. package/contracts/shared/Component.sol +2 -6
  333. package/contracts/shared/ComponentService.sol +22 -18
  334. package/contracts/shared/InstanceLinkedComponent.sol +2 -4
  335. package/contracts/staking/IStaking.sol +0 -1
  336. package/contracts/staking/Staking.sol +6 -6
  337. package/contracts/staking/StakingStore.sol +6 -0
  338. package/contracts/type/Blocknumber.sol +4 -9
  339. package/contracts/upgradeability/ProxyManager.sol +2 -2
  340. package/package.json +1 -1
  341. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +0 -4
  342. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +0 -4
  343. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +0 -538
  344. package/contracts/shared/IKeyValueStore.sol +0 -54
  345. package/contracts/shared/KeyValueStore.sol +0 -131
@@ -3,7 +3,6 @@ pragma solidity ^0.8.20;
3
3
 
4
4
  import {IAccess} from "../authorization/IAccess.sol";
5
5
  import {IAuthorization} from "../authorization/IAuthorization.sol";
6
- import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
7
6
  import {IRegistry} from "../registry/IRegistry.sol";
8
7
  import {IInstance} from "./IInstance.sol";
9
8
 
@@ -14,17 +13,12 @@ import {ObjectType, INSTANCE} from "../type/ObjectType.sol";
14
13
  import {RoleId, ADMIN_ROLE} from "../type/RoleId.sol";
15
14
  import {Str} from "../type/String.sol";
16
15
  import {VersionPart} from "../type/Version.sol";
16
+ import {INSTANCE_TARGET_NAME, INSTANCE_ADMIN_TARGET_NAME, INSTANCE_STORE_TARGET_NAME, PRODUCT_STORE_TARGET_NAME, BUNDLE_SET_TARGET_NAME, RISK_SET_TARGET_NAME} from "./TargetNames.sol";
17
17
 
18
18
 
19
19
  contract InstanceAdmin is
20
20
  AccessAdmin
21
21
  {
22
- string public constant INSTANCE_TARGET_NAME = "Instance";
23
- string public constant INSTANCE_ADMIN_TARGET_NAME = "InstanceAdmin";
24
- string public constant INSTANCE_STORE_TARGET_NAME = "InstanceStore";
25
- string public constant BUNDLE_SET_TARGET_NAME = "BundleSet";
26
- string public constant RISK_SET_TARGET_NAME = "RiskSet";
27
-
28
22
  // onlyInstanceService
29
23
  error ErrorInstanceAdminNotInstanceService(address caller);
30
24
 
@@ -33,13 +27,9 @@ contract InstanceAdmin is
33
27
 
34
28
  IInstance internal _instance;
35
29
  IRegistry internal _registry;
36
- VersionPart internal _release;
37
30
 
38
31
  uint64 internal _customRoleIdNext;
39
32
 
40
- mapping(address target => RoleId roleId) internal _targetRoleId;
41
- uint64 internal _components;
42
-
43
33
 
44
34
  modifier onlyInstanceService() {
45
35
  if (msg.sender != _registry.getServiceAddress(INSTANCE(), getRelease())) {
@@ -48,6 +38,7 @@ contract InstanceAdmin is
48
38
  _;
49
39
  }
50
40
 
41
+
51
42
  /// @dev Only used for master instance admin.
52
43
  constructor(address accessManager) {
53
44
  initialize(
@@ -67,45 +58,46 @@ contract InstanceAdmin is
67
58
  )
68
59
  external
69
60
  reinitializer(uint64(release.toInt()))
70
- onlyDeployer()
71
61
  {
72
62
  // checks
73
63
  AccessAdminLib.checkIsRegistered(registry, instance, INSTANCE());
74
64
 
65
+ // effects
75
66
  AccessManagerCloneable(
76
67
  authority()).completeSetup(
77
68
  registry,
78
69
  release);
79
70
 
80
- _checkAuthorization(authorization, INSTANCE(), release, false, true);
71
+ AccessAdminLib.checkAuthorization(
72
+ address(_authorization),
73
+ authorization,
74
+ INSTANCE(), // expectedDomain
75
+ release, // expectedRelease
76
+ false, // expectServiceAuthorization
77
+ true); // checkAlreadyInitialized
81
78
 
82
- // effects
83
79
  _registry = IRegistry(registry);
84
- _release = release;
85
-
86
80
  _instance = IInstance(instance);
87
81
  _authorization = IAuthorization(authorization);
88
- _components = 0;
89
82
  _customRoleIdNext = 0;
90
83
 
91
84
  // link nft ownability to instance
92
85
  _linkToNftOwnable(instance);
93
86
 
87
+ // setup roles and services
88
+ _createRoles(_authorization);
89
+ _setupServices(_authorization);
90
+
94
91
  // setup instance targets
95
92
  _createInstanceTargets(_authorization.getMainTargetName());
96
93
 
97
- // setup non-contract roles
98
- _setupServiceRoles(_authorization);
99
- _createRoles(_authorization);
100
-
101
94
  // authorize functions of instance contracts
102
95
  _createTargetAuthorizations(_authorization);
103
96
  }
104
97
 
105
-
106
98
  /// @dev grants the service roles to the service addresses based on the authorization specification.
107
99
  /// Service addresses used for the granting are determined by the registry and the release of this instance.
108
- function _setupServiceRoles(IAuthorization authorization)
100
+ function _setupServices(IAuthorization authorization)
109
101
  internal
110
102
  {
111
103
  ObjectType[] memory serviceDomains = authorization.getServiceDomains();
@@ -113,21 +105,8 @@ contract InstanceAdmin is
113
105
  for(uint256 i = 0; i < serviceDomains.length; i++) {
114
106
  ObjectType serviceDomain = serviceDomains[i];
115
107
  RoleId serviceRoleId = authorization.getServiceRole(serviceDomain);
116
- string memory serviceRoleName = authorization.getRoleName(serviceRoleId);
117
-
118
- // create service role if missing
119
- if (!roleExists(serviceRoleId)) {
120
- _createRole(
121
- serviceRoleId,
122
- AccessAdminLib.toRole(
123
- ADMIN_ROLE(),
124
- IAccess.RoleType.Contract,
125
- 1,
126
- serviceRoleName));
127
- }
108
+ address service = _registry.getServiceAddress(serviceDomain, getRelease());
128
109
 
129
- // grant service role to service
130
- address service = _registry.getServiceAddress(serviceDomain, _release);
131
110
  _grantRoleToAccount(
132
111
  serviceRoleId,
133
112
  service);
@@ -138,11 +117,17 @@ contract InstanceAdmin is
138
117
  function _createInstanceTargets(string memory instanceTargetName)
139
118
  internal
140
119
  {
141
- _createManagedTarget(address(_instance), instanceTargetName, TargetType.Instance);
142
- _createManagedTarget(address(this), INSTANCE_ADMIN_TARGET_NAME, TargetType.Instance);
143
- _createManagedTarget(address(_instance.getInstanceStore()), INSTANCE_STORE_TARGET_NAME, TargetType.Instance);
144
- _createManagedTarget(address(_instance.getBundleSet()), BUNDLE_SET_TARGET_NAME, TargetType.Instance);
145
- _createManagedTarget(address(_instance.getRiskSet()), RISK_SET_TARGET_NAME, TargetType.Instance);
120
+ _createInstanceTarget(address(_instance), instanceTargetName);
121
+ _createInstanceTarget(address(this), INSTANCE_ADMIN_TARGET_NAME);
122
+ _createInstanceTarget(address(_instance.getInstanceStore()), INSTANCE_STORE_TARGET_NAME);
123
+ _createInstanceTarget(address(_instance.getProductStore()), PRODUCT_STORE_TARGET_NAME);
124
+ _createInstanceTarget(address(_instance.getBundleSet()), BUNDLE_SET_TARGET_NAME);
125
+ _createInstanceTarget(address(_instance.getRiskSet()), RISK_SET_TARGET_NAME);
126
+ }
127
+
128
+
129
+ function _createInstanceTarget(address target, string memory name) internal {
130
+ _createTarget(target, name, TargetType.Instance, true);
146
131
  }
147
132
 
148
133
 
@@ -155,29 +140,13 @@ contract InstanceAdmin is
155
140
  external
156
141
  restricted()
157
142
  {
158
- // checks
159
- AccessAdminLib.checkIsRegistered(address(getRegistry()), componentAddress, expectedType);
160
-
161
- IInstanceLinkedComponent component = IInstanceLinkedComponent(componentAddress);
162
- IAuthorization authorization = component.getAuthorization();
163
- _checkAuthorization(address(authorization), expectedType, getRelease(), false, false);
143
+ IAuthorization authorization = AccessAdminLib.checkComponentInitialization(
144
+ this, _authorization, componentAddress, expectedType);
164
145
 
165
146
  // effects
166
147
  _createRoles(authorization);
167
- _createManagedTarget(componentAddress, authorization.getMainTargetName(), TargetType.Component);
148
+ _createTarget(componentAddress, authorization.getMainTargetName(), TargetType.Component, true);
168
149
  _createTargetAuthorizations(authorization);
169
-
170
- // increase component count
171
- _components++;
172
- }
173
-
174
- function getRelease()
175
- public
176
- view
177
- override
178
- returns (VersionPart release)
179
- {
180
- return _release;
181
150
  }
182
151
 
183
152
 
@@ -191,24 +160,18 @@ contract InstanceAdmin is
191
160
  restricted()
192
161
  returns (RoleId roleId)
193
162
  {
194
- // check role does not yet exist
195
- if (roleExists(name)) {
196
- revert ErrorAccessAdminRoleAlreadyCreated(
197
- getRoleForName(name),
198
- name);
199
- }
200
-
201
163
  // create roleId
202
164
  roleId = AccessAdminLib.getCustomRoleId(_customRoleIdNext++);
203
165
 
204
166
  // create role
205
167
  _createRole(
206
168
  roleId,
207
- AccessAdminLib.toRole(
169
+ AccessAdminLib.roleInfo(
208
170
  adminRoleId,
209
- IAccess.RoleType.Custom,
171
+ IAccess.TargetType.Custom,
210
172
  maxMemberCount,
211
- name));
173
+ name),
174
+ true); // revert on existing role
212
175
  }
213
176
 
214
177
 
@@ -243,7 +206,7 @@ contract InstanceAdmin is
243
206
  }
244
207
 
245
208
 
246
- /// @dev Create a new custom target.
209
+ /// @dev Create a new contract target.
247
210
  /// The target needs to be an access managed contract.
248
211
  function createTarget(
249
212
  address target,
@@ -253,10 +216,11 @@ contract InstanceAdmin is
253
216
  restricted()
254
217
  returns (RoleId contractRoleId)
255
218
  {
256
- return _createManagedTarget(
219
+ return _createTarget(
257
220
  target,
258
221
  name,
259
- TargetType.Custom);
222
+ TargetType.Contract,
223
+ true); // check authority matches
260
224
  }
261
225
 
262
226
 
@@ -269,8 +233,7 @@ contract InstanceAdmin is
269
233
  external
270
234
  restricted()
271
235
  {
272
- _checkComponentOrCustomTarget(target);
273
- _authorizeTargetFunctions(target, roleId, functions, true);
236
+ _authorizeTargetFunctions(target, roleId, functions, true, true);
274
237
  }
275
238
 
276
239
 
@@ -282,8 +245,7 @@ contract InstanceAdmin is
282
245
  external
283
246
  restricted()
284
247
  {
285
- _checkComponentOrCustomTarget(target);
286
- _authorizeTargetFunctions(target, ADMIN_ROLE(), functions, false);
248
+ _authorizeTargetFunctions(target, ADMIN_ROLE(), functions, true, false);
287
249
  }
288
250
 
289
251
 
@@ -300,28 +262,20 @@ contract InstanceAdmin is
300
262
 
301
263
  function setTargetLocked(address target, bool locked)
302
264
  external
303
- // not restricted(): might need to operate on targets while instance is locked
265
+ // not restricted(): need to operate on locked instances to unlock instance
304
266
  onlyInstanceService()
305
267
  {
306
268
  _setTargetLocked(target, locked);
307
269
  }
308
270
 
309
271
 
310
- function setComponentLocked(address target, bool locked)
272
+ function setContractLocked(address target, bool locked)
311
273
  external
312
- restricted()
274
+ restricted() // component service
313
275
  {
314
276
  _setTargetLocked(target, locked);
315
277
  }
316
278
 
317
- /// @dev Returns the number of components that have been registered with this instance.
318
- function components()
319
- external
320
- view
321
- returns (uint64)
322
- {
323
- return _components;
324
- }
325
279
 
326
280
  /// @dev Returns the instance authorization specification used to set up this instance admin.
327
281
  function getInstanceAuthorization()
@@ -334,25 +288,6 @@ contract InstanceAdmin is
334
288
 
335
289
  // ------------------- Internal functions ------------------- //
336
290
 
337
- function _createRoles(IAuthorization authorization)
338
- internal
339
- {
340
- RoleId[] memory roles = authorization.getRoles();
341
- RoleId mainTargetRoleId = authorization.getTargetRole(
342
- authorization.getMainTarget());
343
-
344
- for(uint256 i = 0; i < roles.length; i++) {
345
- RoleId roleId = roles[i];
346
-
347
- // skip main target role, create role if not exists
348
- if (roleId != mainTargetRoleId && !roleExists(roleId)) {
349
- _createRole(
350
- roleId,
351
- authorization.getRoleInfo(roleId));
352
- }
353
- }
354
- }
355
-
356
291
 
357
292
  function _createTargetAuthorizations(IAuthorization authorization)
358
293
  internal
@@ -369,15 +304,4 @@ contract InstanceAdmin is
369
304
  }
370
305
  }
371
306
  }
372
-
373
-
374
- function _checkComponentOrCustomTarget(address target)
375
- internal
376
- view
377
- {
378
- IAccess.TargetType targetType = getTargetInfo(target).targetType;
379
- if (targetType != TargetType.Component && targetType != TargetType.Custom) {
380
- revert ErrorInstanceAdminNotComponentOrCustomTarget(target);
381
- }
382
- }
383
307
  }
@@ -10,6 +10,8 @@ import {ACCOUNTING, ORACLE, POOL, INSTANCE, COMPONENT, DISTRIBUTION, APPLICATION
10
10
  import {BundleSet} from "../instance/BundleSet.sol";
11
11
  import {InstanceAdmin} from "../instance/InstanceAdmin.sol";
12
12
  import {InstanceStore} from "../instance/InstanceStore.sol";
13
+ import {INSTANCE_TARGET_NAME, INSTANCE_ADMIN_TARGET_NAME, INSTANCE_STORE_TARGET_NAME, PRODUCT_STORE_TARGET_NAME, BUNDLE_SET_TARGET_NAME, RISK_SET_TARGET_NAME} from "./TargetNames.sol";
14
+ import {ProductStore} from "../instance/ProductStore.sol";
13
15
  import {ADMIN_ROLE, INSTANCE_OWNER_ROLE, PUBLIC_ROLE} from "../type/RoleId.sol";
14
16
  import {RiskSet} from "../instance/RiskSet.sol";
15
17
 
@@ -21,19 +23,13 @@ contract InstanceAuthorizationV3
21
23
  string public constant INSTANCE_ROLE_NAME = "InstanceRole";
22
24
  string public constant INSTANCE_OWNER_ROLE_NAME = "InstanceOwnerRole";
23
25
 
24
- string public constant INSTANCE_TARGET_NAME = "Instance";
25
- string public constant INSTANCE_STORE_TARGET_NAME = "InstanceStore";
26
- string public constant INSTANCE_ADMIN_TARGET_NAME = "InstanceAdmin";
27
- string public constant BUNDLE_SET_TARGET_NAME = "BundleSet";
28
- string public constant RISK_SET_TARGET_NAME = "RiskSet";
29
-
30
26
  constructor()
31
27
  Authorization(
32
28
  INSTANCE_TARGET_NAME,
33
29
  INSTANCE(),
34
30
  3,
35
31
  COMMIT_HASH,
36
- false,
32
+ TargetType.Instance,
37
33
  false)
38
34
  { }
39
35
 
@@ -58,9 +54,9 @@ contract InstanceAuthorizationV3
58
54
  {
59
55
  _addRole(
60
56
  INSTANCE_OWNER_ROLE(),
61
- AccessAdminLib.toRole(
57
+ AccessAdminLib.roleInfo(
62
58
  ADMIN_ROLE(),
63
- RoleType.Custom,
59
+ TargetType.Custom,
64
60
  0, // max member count special case: instance nft owner is sole role owner
65
61
  INSTANCE_OWNER_ROLE_NAME));
66
62
  }
@@ -70,11 +66,11 @@ contract InstanceAuthorizationV3
70
66
  override
71
67
  {
72
68
  // instance supporting targets
73
- _addTarget(INSTANCE_ADMIN_TARGET_NAME);
74
- _addTarget(INSTANCE_STORE_TARGET_NAME);
75
- _addTarget(BUNDLE_SET_TARGET_NAME);
76
- _addTarget(RISK_SET_TARGET_NAME);
77
-
69
+ _addInstanceTarget(INSTANCE_ADMIN_TARGET_NAME);
70
+ _addInstanceTarget(INSTANCE_STORE_TARGET_NAME);
71
+ _addInstanceTarget(PRODUCT_STORE_TARGET_NAME);
72
+ _addInstanceTarget(BUNDLE_SET_TARGET_NAME);
73
+ _addInstanceTarget(RISK_SET_TARGET_NAME);
78
74
  }
79
75
 
80
76
 
@@ -85,6 +81,7 @@ contract InstanceAuthorizationV3
85
81
  _setupInstanceAuthorization();
86
82
  _setupInstanceAdminAuthorization();
87
83
  _setupInstanceStoreAuthorization();
84
+ _setupProductStoreAuthorization();
88
85
  _setupBundleSetAuthorization();
89
86
  _setUpRiskSetAuthorization();
90
87
  }
@@ -178,7 +175,7 @@ contract InstanceAuthorizationV3
178
175
  // authorize component service role
179
176
  functions = _authorizeForTarget(INSTANCE_ADMIN_TARGET_NAME, getServiceRole(COMPONENT()));
180
177
  _authorize(functions, InstanceAdmin.initializeComponentAuthorization.selector, "initializeComponentAuthoriz");
181
- _authorize(functions, InstanceAdmin.setComponentLocked.selector, "setComponentLocked");
178
+ _authorize(functions, InstanceAdmin.setContractLocked.selector, "setContractLocked");
182
179
  }
183
180
 
184
181
 
@@ -199,10 +196,6 @@ contract InstanceAuthorizationV3
199
196
  _authorize(functions, InstanceStore.createComponent.selector, "createComponent");
200
197
  _authorize(functions, InstanceStore.updateComponent.selector, "updateComponent");
201
198
  _authorize(functions, InstanceStore.createPool.selector, "createPool");
202
- _authorize(functions, InstanceStore.createProduct.selector, "createProduct");
203
- _authorize(functions, InstanceStore.updateProduct.selector, "updateProduct");
204
- _authorize(functions, InstanceStore.createFee.selector, "createFee");
205
- _authorize(functions, InstanceStore.updateFee.selector, "updateFee");
206
199
 
207
200
  // authorize distribution service role
208
201
  functions = _authorizeForTarget(INSTANCE_STORE_TARGET_NAME, getServiceRole(DISTRIBUTION()));
@@ -234,33 +227,49 @@ contract InstanceAuthorizationV3
234
227
  _authorize(functions, InstanceStore.increaseLocked.selector, "increaseLocked");
235
228
  _authorize(functions, InstanceStore.decreaseLocked.selector, "decreaseLocked");
236
229
 
237
- // authorize product service role
238
- functions = _authorizeForTarget(INSTANCE_STORE_TARGET_NAME, getServiceRole(RISK()));
239
- _authorize(functions, InstanceStore.createRisk.selector, "createRisk");
240
- _authorize(functions, InstanceStore.updateRisk.selector, "updateRisk");
241
- _authorize(functions, InstanceStore.updateRiskState.selector, "updateRiskState");
230
+ }
231
+
232
+ function _setupProductStoreAuthorization()
233
+ internal
234
+ {
235
+ IAccess.FunctionInfo[] storage functions;
236
+
237
+ functions = _authorizeForTarget(PRODUCT_STORE_TARGET_NAME, getServiceRole(COMPONENT()));
238
+ _authorize(functions, ProductStore.createProduct.selector, "createProduct");
239
+ _authorize(functions, ProductStore.updateProduct.selector, "updateProduct");
240
+ _authorize(functions, ProductStore.createFee.selector, "createFee");
241
+ _authorize(functions, ProductStore.updateFee.selector, "updateFee");
242
242
 
243
243
  // authorize application service role
244
- functions = _authorizeForTarget(INSTANCE_STORE_TARGET_NAME, getServiceRole(APPLICATION()));
245
- _authorize(functions, InstanceStore.createApplication.selector, "createApplication");
246
- _authorize(functions, InstanceStore.updateApplication.selector, "updateApplication");
247
- _authorize(functions, InstanceStore.updateApplicationState.selector, "updateApplicationState");
244
+ functions = _authorizeForTarget(PRODUCT_STORE_TARGET_NAME, getServiceRole(APPLICATION()));
245
+ _authorize(functions, ProductStore.createApplication.selector, "createApplication");
246
+ _authorize(functions, ProductStore.updateApplication.selector, "updateApplication");
247
+ _authorize(functions, ProductStore.updateApplicationState.selector, "updateApplicationState");
248
+
249
+ // authorize policy service role
250
+ functions = _authorizeForTarget(PRODUCT_STORE_TARGET_NAME, getServiceRole(POLICY()));
251
+ _authorize(functions, ProductStore.updatePolicy.selector, "updatePolicy");
252
+ _authorize(functions, ProductStore.updatePolicyState.selector, "updatePolicyState");
248
253
 
249
254
  // authorize policy service role
250
- functions = _authorizeForTarget(INSTANCE_STORE_TARGET_NAME, getServiceRole(POLICY()));
251
- _authorize(functions, InstanceStore.updatePolicy.selector, "updatePolicy");
252
- _authorize(functions, InstanceStore.updatePolicyState.selector, "updatePolicyState");
253
- _authorize(functions, InstanceStore.createPremium.selector, "createPremium");
254
- _authorize(functions, InstanceStore.updatePremiumState.selector, "updatePremiumState");
255
+ functions = _authorizeForTarget(PRODUCT_STORE_TARGET_NAME, getServiceRole(POLICY()));
256
+ _authorize(functions, ProductStore.createPremium.selector, "createPremium");
257
+ _authorize(functions, ProductStore.updatePremiumState.selector, "updatePremiumState");
258
+
259
+ // authorize risk service role
260
+ functions = _authorizeForTarget(PRODUCT_STORE_TARGET_NAME, getServiceRole(RISK()));
261
+ _authorize(functions, ProductStore.createRisk.selector, "createRisk");
262
+ _authorize(functions, ProductStore.updateRisk.selector, "updateRisk");
263
+ _authorize(functions, ProductStore.updateRiskState.selector, "updateRiskState");
255
264
 
256
265
  // authorize claim service role
257
- functions = _authorizeForTarget(INSTANCE_STORE_TARGET_NAME, getServiceRole(CLAIM()));
258
- _authorize(functions, InstanceStore.updatePolicyClaims.selector, "updatePolicyClaims");
259
- _authorize(functions, InstanceStore.createClaim.selector, "createClaim");
260
- _authorize(functions, InstanceStore.updateClaim.selector, "updateClaim");
261
- _authorize(functions, InstanceStore.createPayout.selector, "createPayout");
262
- _authorize(functions, InstanceStore.updatePayout.selector, "updatePayout");
263
- _authorize(functions, InstanceStore.updatePayoutState.selector, "updatePayoutState");
266
+ functions = _authorizeForTarget(PRODUCT_STORE_TARGET_NAME, getServiceRole(CLAIM()));
267
+ _authorize(functions, ProductStore.updatePolicyClaims.selector, "updatePolicyClaims");
268
+ _authorize(functions, ProductStore.createClaim.selector, "createClaim");
269
+ _authorize(functions, ProductStore.updateClaim.selector, "updateClaim");
270
+ _authorize(functions, ProductStore.createPayout.selector, "createPayout");
271
+ _authorize(functions, ProductStore.updatePayout.selector, "updatePayout");
272
+ _authorize(functions, ProductStore.updatePayoutState.selector, "updatePayoutState");
264
273
  }
265
274
  }
266
275