@etherisc/gif-next 0.0.2-da2c7dd-538 → 0.0.2-db12733-152

Sign up to get free protection for your applications and to get access to all the features.
Files changed (399) hide show
  1. package/README.md +44 -0
  2. package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
  3. package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +38 -38
  4. package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
  5. package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +26 -26
  6. package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
  7. package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +6 -6
  8. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
  9. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +366 -251
  10. package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +1 -1
  11. package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +4 -0
  12. package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +673 -0
  13. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
  14. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +8 -39
  15. package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
  16. package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +101 -28
  17. package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
  18. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
  19. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +283 -189
  20. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
  21. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +37 -5
  22. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
  23. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
  24. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
  25. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
  26. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +32 -145
  27. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
  28. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +101 -46
  29. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
  30. package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +1 -87
  31. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
  32. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +160 -89
  33. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  34. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +56 -52
  35. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  36. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +1 -87
  37. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  38. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +68 -5
  39. package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
  40. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
  41. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +44 -74
  42. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
  43. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +101 -46
  44. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
  45. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +94 -124
  46. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
  47. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +101 -46
  48. package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
  49. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
  50. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +82 -173
  51. package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
  52. package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +101 -46
  53. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
  54. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +20 -63
  55. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
  56. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +69 -112
  57. package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
  58. package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +101 -46
  59. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
  60. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +95 -138
  61. package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
  62. package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +101 -46
  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/IInstance.sol/IInstance.dbg.json +1 -1
  66. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +104 -8
  67. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  68. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +62 -13
  69. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  70. package/artifacts/contracts/instance/Instance.sol/Instance.json +119 -26
  71. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
  72. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +520 -413
  73. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
  74. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +101 -46
  75. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  76. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +225 -196
  77. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  78. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +94 -65
  79. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  80. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +26 -36
  81. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
  82. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +356 -346
  83. package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
  84. package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +2 -2
  85. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
  86. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
  87. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
  88. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
  89. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
  90. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
  91. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
  92. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
  93. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
  94. package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +1 -1
  95. package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +20 -20
  96. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  97. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  98. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  99. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  100. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  101. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
  102. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
  103. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +14 -35
  104. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
  105. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +98 -35
  106. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
  107. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
  108. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +0 -21
  109. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
  110. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
  111. package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +0 -21
  112. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
  113. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +42 -42
  114. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
  115. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +31 -31
  116. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
  117. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +22 -43
  118. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
  119. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +101 -46
  120. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
  121. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +64 -64
  122. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  123. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +39 -39
  124. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
  125. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +6 -6
  126. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  127. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +10 -31
  128. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
  129. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +18 -18
  130. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
  131. package/artifacts/contracts/pool/Pool.sol/Pool.json +10 -31
  132. package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
  133. package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +34 -34
  134. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
  135. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +80 -80
  136. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  137. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +41 -41
  138. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  139. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +90 -24
  140. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  141. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +34 -22
  142. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
  143. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +27 -48
  144. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
  145. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +101 -46
  146. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
  147. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +78 -78
  148. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  149. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +50 -50
  150. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  151. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +42 -0
  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/IPricingService.sol/IPricingService.json +21 -0
  156. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  157. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +21 -42
  158. package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
  159. package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +21 -0
  160. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
  161. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +62 -62
  162. package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
  163. package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +32 -32
  164. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  165. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +41 -41
  166. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
  167. package/artifacts/contracts/product/PricingService.sol/PricingService.json +63 -82
  168. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
  169. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +31 -51
  170. package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
  171. package/artifacts/contracts/product/Product.sol/Product.json +21 -42
  172. package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
  173. package/artifacts/contracts/product/RiskService.sol/RiskService.json +55 -26
  174. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
  175. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +27 -23
  176. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  177. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  178. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +15 -15
  179. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  180. package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +1 -1
  181. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  182. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  183. package/artifacts/contracts/registry/Registry.sol/Registry.json +17 -17
  184. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
  185. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +445 -355
  186. package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
  187. package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +878 -0
  188. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  189. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +18 -18
  190. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  191. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +19 -19
  192. package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
  193. package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +481 -376
  194. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
  195. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
  196. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
  197. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +143 -139
  198. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
  199. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
  200. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  201. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +14 -14
  202. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
  203. package/artifacts/contracts/shared/Component.sol/Component.json +0 -21
  204. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
  205. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +114 -129
  206. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
  207. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +45 -49
  208. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
  209. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
  210. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +60 -4
  211. package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
  212. package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
  213. package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +1 -1
  214. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
  215. package/artifacts/contracts/shared/IComponent.sol/IComponent.json +0 -21
  216. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
  217. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +44 -51
  218. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
  219. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +0 -21
  220. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  221. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  222. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  223. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  224. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  225. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  226. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  227. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
  228. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -2
  229. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
  230. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +0 -21
  231. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  232. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  233. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
  234. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
  235. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  236. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
  237. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  238. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
  239. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  240. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  241. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
  242. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  243. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  244. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
  245. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
  246. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +2 -2
  247. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
  248. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
  249. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
  250. package/artifacts/contracts/staking/IStaking.sol/IStaking.json +83 -39
  251. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
  252. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +75 -4
  253. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
  254. package/artifacts/contracts/staking/Staking.sol/Staking.json +133 -94
  255. package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +4 -0
  256. package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +469 -0
  257. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
  258. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
  259. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
  260. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +41 -37
  261. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
  262. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +34 -61
  263. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
  264. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +109 -30
  265. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
  266. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +27 -23
  267. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
  268. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +148 -134
  269. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
  270. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +47 -37
  271. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  272. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
  273. package/artifacts/contracts/type/Amount.sol/AmountLib.json +10 -10
  274. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  275. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  276. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
  277. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  278. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
  279. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
  280. package/artifacts/contracts/type/Fee.sol/FeeLib.json +93 -37
  281. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
  282. package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
  283. package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +1 -1
  284. package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +2 -2
  285. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
  286. package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
  287. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  288. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
  289. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  290. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +33 -31
  291. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  292. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
  293. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
  294. package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
  295. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
  296. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
  297. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
  298. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +2 -2
  299. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
  300. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
  301. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
  302. package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
  303. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
  304. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
  305. package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
  306. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
  307. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
  308. package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +60 -36
  309. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
  310. package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -2
  311. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
  312. package/artifacts/contracts/type/Version.sol/VersionPartLib.json +56 -2
  313. package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
  314. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  315. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +4 -4
  316. package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  317. package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
  318. package/contracts/accounting/IAccountingService.sol +2 -2
  319. package/contracts/authorization/AccessAdmin.sol +201 -186
  320. package/contracts/authorization/AccessAdminLib.sol +183 -0
  321. package/contracts/authorization/AccessManagerCloneable.sol +40 -31
  322. package/contracts/authorization/Authorization.sol +61 -33
  323. package/contracts/authorization/IAccess.sol +13 -5
  324. package/contracts/authorization/IAccessAdmin.sol +63 -36
  325. package/contracts/authorization/IAuthorization.sol +6 -0
  326. package/contracts/distribution/BasicDistribution.sol +6 -6
  327. package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
  328. package/contracts/distribution/Distribution.sol +3 -48
  329. package/contracts/distribution/DistributionService.sol +57 -30
  330. package/contracts/distribution/IDistributionComponent.sol +0 -9
  331. package/contracts/distribution/IDistributionService.sol +4 -2
  332. package/contracts/examples/fire/FirePool.sol +0 -4
  333. package/contracts/examples/fire/FireProduct.sol +0 -4
  334. package/contracts/examples/unpermissioned/SimpleDistribution.sol +32 -8
  335. package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -8
  336. package/contracts/examples/unpermissioned/SimplePool.sol +0 -4
  337. package/contracts/examples/unpermissioned/SimpleProduct.sol +0 -4
  338. package/contracts/instance/IInstance.sol +45 -9
  339. package/contracts/instance/IInstanceService.sol +19 -3
  340. package/contracts/instance/Instance.sol +73 -16
  341. package/contracts/instance/InstanceAdmin.sol +120 -107
  342. package/contracts/instance/InstanceAuthorizationV3.sol +43 -21
  343. package/contracts/instance/InstanceReader.sol +13 -0
  344. package/contracts/instance/InstanceService.sol +128 -73
  345. package/contracts/instance/module/IBundle.sol +6 -5
  346. package/contracts/instance/module/IComponents.sol +16 -5
  347. package/contracts/instance/module/IDistribution.sol +19 -7
  348. package/contracts/instance/module/IPolicy.sol +28 -8
  349. package/contracts/instance/module/IRisk.sol +2 -0
  350. package/contracts/oracle/BasicOracle.sol +1 -3
  351. package/contracts/oracle/BasicOracleAuthorization.sol +1 -1
  352. package/contracts/oracle/IOracle.sol +9 -4
  353. package/contracts/oracle/Oracle.sol +0 -2
  354. package/contracts/pool/BasicPool.sol +0 -2
  355. package/contracts/pool/BasicPoolAuthorization.sol +1 -1
  356. package/contracts/pool/Pool.sol +0 -2
  357. package/contracts/pool/PoolService.sol +1 -3
  358. package/contracts/product/ApplicationService.sol +21 -6
  359. package/contracts/product/BasicProduct.sol +0 -2
  360. package/contracts/product/BasicProductAuthorization.sol +1 -1
  361. package/contracts/product/IApplicationService.sol +3 -0
  362. package/contracts/product/IPricingService.sol +1 -0
  363. package/contracts/product/IRiskService.sol +3 -0
  364. package/contracts/product/PolicyService.sol +0 -18
  365. package/contracts/product/PricingService.sol +11 -6
  366. package/contracts/product/Product.sol +0 -2
  367. package/contracts/product/RiskService.sol +10 -0
  368. package/contracts/registry/IRegistry.sol +4 -0
  369. package/contracts/registry/IRelease.sol +6 -3
  370. package/contracts/registry/RegistryAdmin.sol +133 -229
  371. package/contracts/registry/RegistryAuthorization.sol +267 -0
  372. package/contracts/registry/ReleaseAdmin.sol +30 -22
  373. package/contracts/registry/ReleaseRegistry.sol +39 -33
  374. package/contracts/registry/ServiceAuthorizationV3.sol +87 -3
  375. package/contracts/registry/TokenRegistry.sol +4 -1
  376. package/contracts/shared/Component.sol +13 -30
  377. package/contracts/shared/ComponentService.sol +58 -42
  378. package/contracts/shared/ContractLib.sol +28 -0
  379. package/contracts/shared/IComponent.sol +0 -3
  380. package/contracts/shared/IComponentService.sol +9 -9
  381. package/contracts/shared/InitializableERC165.sol +9 -1
  382. package/contracts/shared/InstanceLinkedComponent.sol +0 -2
  383. package/contracts/shared/NftOwnable.sol +1 -1
  384. package/contracts/shared/Registerable.sol +1 -4
  385. package/contracts/shared/TokenHandler.sol +5 -4
  386. package/contracts/staking/IStaking.sol +12 -2
  387. package/contracts/staking/IStakingService.sol +8 -1
  388. package/contracts/staking/Staking.sol +35 -15
  389. package/contracts/staking/{StakeManagerLib.sol → StakingLib.sol} +79 -22
  390. package/contracts/staking/StakingReader.sol +5 -15
  391. package/contracts/staking/StakingService.sol +36 -2
  392. package/contracts/staking/StakingStore.sol +2 -1
  393. package/contracts/type/Fee.sol +8 -8
  394. package/contracts/type/ObjectType.sol +5 -14
  395. package/contracts/type/UFixed.sol +27 -10
  396. package/contracts/type/Version.sol +39 -0
  397. package/package.json +2 -2
  398. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
  399. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -440
@@ -4,31 +4,28 @@ pragma solidity ^0.8.20;
4
4
  import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
5
5
 
6
6
  import {IAuthorization} from "../authorization/IAuthorization.sol";
7
- import {AccessManagerCloneable} from "../authorization/AccessManagerCloneable.sol";
8
- import {Amount} from "../type/Amount.sol";
9
- import {BundleSet} from "./BundleSet.sol";
10
- import {RiskSet} from "./RiskSet.sol";
11
- import {ChainNft} from "../registry/ChainNft.sol";
12
- import {NftId} from "../type/NftId.sol";
13
- import {RoleId} from "../type/RoleId.sol";
14
- import {UFixed} from "../type/UFixed.sol";
15
- import {ObjectType, INSTANCE, COMPONENT, INSTANCE, REGISTRY, STAKING} from "../type/ObjectType.sol";
16
-
17
- import {Service} from "../shared/Service.sol";
18
-
7
+ import {IComponentService} from "../shared/IComponentService.sol";
8
+ import {IInstance} from "./IInstance.sol";
9
+ import {IInstanceService} from "./IInstanceService.sol";
19
10
  import {IRegistry} from "../registry/IRegistry.sol";
20
11
  import {IRegistryService} from "../registry/IRegistryService.sol";
21
12
  import {IStakingService} from "../staking/IStakingService.sol";
22
- import {TargetManagerLib} from "../staking/TargetManagerLib.sol";
23
13
 
24
- import {IComponentService} from "../shared/IComponentService.sol";
14
+ import {AccessManagerCloneable} from "../authorization/AccessManagerCloneable.sol";
15
+ import {Amount} from "../type/Amount.sol";
16
+ import {BundleSet} from "./BundleSet.sol";
25
17
  import {Instance} from "./Instance.sol";
26
- import {IInstance} from "./IInstance.sol";
27
18
  import {InstanceAdmin} from "./InstanceAdmin.sol";
28
- import {IInstanceService} from "./IInstanceService.sol";
29
19
  import {InstanceReader} from "./InstanceReader.sol";
30
20
  import {InstanceStore} from "./InstanceStore.sol";
21
+ import {NftId} from "../type/NftId.sol";
22
+ import {ObjectType, INSTANCE, COMPONENT, INSTANCE, REGISTRY, STAKING} from "../type/ObjectType.sol";
23
+ import {RiskSet} from "./RiskSet.sol";
24
+ import {RoleId} from "../type/RoleId.sol";
31
25
  import {Seconds} from "../type/Seconds.sol";
26
+ import {Service} from "../shared/Service.sol";
27
+ import {TargetManagerLib} from "../staking/TargetManagerLib.sol";
28
+ import {UFixed} from "../type/UFixed.sol";
32
29
  import {VersionPart} from "../type/Version.sol";
33
30
 
34
31
 
@@ -53,23 +50,8 @@ contract InstanceService is
53
50
  address internal _masterInstanceStore;
54
51
 
55
52
 
56
- modifier onlyInstance() {
57
- address instanceAddress = msg.sender;
58
- NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
59
- if (instanceNftId.eqz()) {
60
- revert ErrorInstanceServiceNotRegistered(instanceAddress);
61
- }
62
-
63
- ObjectType objectType = getRegistry().getObjectInfo(instanceNftId).objectType;
64
- if (objectType != INSTANCE()) {
65
- revert ErrorInstanceServiceNotInstance(instanceAddress, objectType);
66
- }
67
-
68
- VersionPart instanceVersion = IInstance(instanceAddress).getRelease();
69
- if (instanceVersion != getVersion().toMajorPart()) {
70
- revert ErrorInstanceServiceInstanceVersionMismatch(instanceAddress, instanceVersion);
71
- }
72
-
53
+ modifier onlyInstance() {
54
+ _checkInstance(msg.sender, getRelease());
73
55
  _;
74
56
  }
75
57
 
@@ -90,8 +72,33 @@ contract InstanceService is
90
72
  _;
91
73
  }
92
74
 
93
- function createInstance()
75
+ /// @inheritdoc IInstanceService
76
+ function setInstanceLocked(bool locked)
77
+ external
78
+ virtual
79
+ restricted()
80
+ onlyInstance()
81
+ {
82
+ address instanceAddress = msg.sender;
83
+ IInstance(instanceAddress).getInstanceAdmin().setInstanceLocked(locked);
84
+ }
85
+
86
+
87
+ /// @dev Locks/unlocks the specified target constrolled by the corresponding instance admin.
88
+ function setTargetLocked(address target, bool locked)
89
+ external
90
+ virtual
91
+ restricted()
92
+ onlyInstance()
93
+ {
94
+ address instanceAddress = msg.sender;
95
+ IInstance(instanceAddress).getInstanceAdmin().setTargetLocked(target, locked);
96
+ }
97
+
98
+ /// @inheritdoc IInstanceService
99
+ function createInstance(bool allowAnyToken)
94
100
  external
101
+ virtual
95
102
  restricted()
96
103
  returns (
97
104
  IInstance instance,
@@ -102,26 +109,31 @@ contract InstanceService is
102
109
  address instanceOwner = msg.sender;
103
110
 
104
111
  // create instance admin and instance
105
- InstanceAdmin instanceAdmin = _createInstanceAdmin();
106
- instance = _createInstance(instanceAdmin, instanceOwner);
112
+ InstanceAdmin instanceAdmin = _cloneNewInstanceAdmin();
113
+ instance = _createInstance(instanceAdmin, instanceOwner, allowAnyToken);
107
114
 
108
115
  // register cloned instance with registry
109
116
  instanceNftId = _registryService.registerInstance(
110
117
  instance, instanceOwner).nftId;
111
118
 
119
+ // MUST be set after instance is set up and registered
120
+ IAuthorization instanceAuthorization = InstanceAdmin(_masterInstanceAdmin).getInstanceAuthorization();
121
+ instanceAdmin.completeSetup(
122
+ address(getRegistry()),
123
+ address(instance),
124
+ address(instanceAuthorization),
125
+ getRelease());
126
+
127
+ // hard checks for newly cloned instance
128
+ assert(address(instance.getRegistry()) == address(getRegistry()));
129
+ assert(instance.getRelease() == getRelease());
130
+
112
131
  // register cloned instance as staking target
113
132
  _stakingService.createInstanceTarget(
114
133
  instanceNftId,
115
134
  TargetManagerLib.getDefaultLockingPeriod(),
116
135
  TargetManagerLib.getDefaultRewardRate());
117
136
 
118
- // MUST be set after instance is set up and registered
119
- IAuthorization instanceAuthorization = InstanceAdmin(_masterInstanceAdmin).getInstanceAuthorization();
120
- VersionPart release = AccessManagerCloneable(authority()).getRelease();
121
- instanceAdmin.completeSetup(
122
- address(instance),
123
- address(instanceAuthorization));
124
-
125
137
  emit LogInstanceCloned(
126
138
  instanceNftId,
127
139
  address(instance));
@@ -153,6 +165,18 @@ contract InstanceService is
153
165
  rewardRate);
154
166
  }
155
167
 
168
+ function setStakingMaxAmount(Amount maxStakedAmount)
169
+ external
170
+ virtual
171
+ restricted()
172
+ onlyInstance()
173
+ {
174
+ NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
175
+ _stakingService.setInstanceMaxStakedAmount(
176
+ instanceNftId,
177
+ maxStakedAmount);
178
+ }
179
+
156
180
 
157
181
  function refillStakingRewardReserves(address rewardProvider, Amount dipAmount)
158
182
  external
@@ -181,22 +205,23 @@ contract InstanceService is
181
205
  dipAmount);
182
206
  }
183
207
 
184
- function upgradeInstanceReader(NftId instanceNftId)
208
+
209
+ function upgradeInstanceReader()
185
210
  external
186
- nonReentrant()
187
211
  restricted()
188
- onlyInstanceOwner(instanceNftId)
189
- onlyNftOfType(instanceNftId, INSTANCE())
212
+ onlyInstance()
190
213
  {
191
- IRegistry registry = getRegistry();
192
- IRegistry.ObjectInfo memory instanceInfo = registry.getObjectInfo(instanceNftId);
193
- Instance instance = Instance(instanceInfo.objectAddress);
214
+ address instanceAddress = msg.sender;
215
+ IInstance instance = IInstance(msg.sender);
194
216
 
195
- InstanceReader upgradedInstanceReaderClone = InstanceReader(Clones.clone(address(_masterInstanceReader)));
196
- upgradedInstanceReaderClone.initializeWithInstance(address(instance));
217
+ InstanceReader upgradedInstanceReaderClone = InstanceReader(
218
+ Clones.clone(address(_masterInstanceReader)));
219
+
220
+ upgradedInstanceReaderClone.initializeWithInstance(instanceAddress);
197
221
  instance.setInstanceReader(upgradedInstanceReaderClone);
198
222
  }
199
223
 
224
+
200
225
  function setAndRegisterMasterInstance(address instanceAddress)
201
226
  external
202
227
  onlyOwner()
@@ -269,22 +294,23 @@ contract InstanceService is
269
294
 
270
295
  /// @dev create new cloned instance admin
271
296
  /// function used to setup a new instance
272
- function _createInstanceAdmin()
297
+ function _cloneNewInstanceAdmin()
273
298
  internal
274
299
  virtual
275
- returns (InstanceAdmin clonedInstanceAdmin)
300
+ returns (InstanceAdmin clonedAdmin)
276
301
  {
277
- // start with setting up a new OZ access manager
278
- // TODO consider _masterInstanceAdmin.authority() instead of _masterAccessManager
302
+ // clone instance specific access manager
279
303
  AccessManagerCloneable clonedAccessManager = AccessManagerCloneable(
280
- Clones.clone(_masterAccessManager));
304
+ Clones.clone(
305
+ InstanceAdmin(_masterInstanceAdmin).authority()));
281
306
 
282
307
  // set up the instance admin
283
- clonedInstanceAdmin = InstanceAdmin(Clones.clone(_masterInstanceAdmin));
284
- clonedInstanceAdmin.initialize(
285
- clonedAccessManager,
286
- getRegistry(),
287
- getRelease());
308
+ clonedAdmin = InstanceAdmin(
309
+ Clones.clone(_masterInstanceAdmin));
310
+
311
+ clonedAdmin.initialize(
312
+ address(clonedAccessManager),
313
+ "InstanceAdmin");
288
314
  }
289
315
 
290
316
 
@@ -292,27 +318,26 @@ contract InstanceService is
292
318
  /// function used to setup a new instance
293
319
  function _createInstance(
294
320
  InstanceAdmin instanceAdmin,
295
- address instanceOwner
321
+ address instanceOwner,
322
+ bool allowAnyToken
296
323
  )
297
324
  internal
298
325
  virtual
299
326
  returns (IInstance)
300
327
  {
301
- InstanceStore clonedInstanceStore = InstanceStore(Clones.clone(address(_masterInstanceStore)));
302
- BundleSet clonedBundleSet = BundleSet(Clones.clone(_masterInstanceBundleSet));
303
- RiskSet clonedRiskSet = RiskSet(Clones.clone(_masterInstanceRiskSet));
304
- InstanceReader clonedInstanceReader = InstanceReader(Clones.clone(address(_masterInstanceReader)));
305
-
306
328
  // clone instance
307
329
  Instance clonedInstance = Instance(Clones.clone(_masterInstance));
308
330
  clonedInstance.initialize(
309
331
  instanceAdmin,
310
- clonedInstanceStore,
311
- clonedBundleSet,
312
- clonedRiskSet,
313
- clonedInstanceReader,
332
+ InstanceStore(Clones.clone(address(_masterInstanceStore))),
333
+ BundleSet(Clones.clone(_masterInstanceBundleSet)),
334
+ RiskSet(Clones.clone(_masterInstanceRiskSet)),
335
+ InstanceReader(Clones.clone(address(_masterInstanceReader))),
314
336
  getRegistry(),
315
- instanceOwner);
337
+ getRelease(),
338
+ instanceOwner,
339
+ allowAnyToken);
340
+
316
341
  return clonedInstance;
317
342
  }
318
343
 
@@ -397,6 +422,36 @@ contract InstanceService is
397
422
 
398
423
  }
399
424
 
425
+
426
+ function _checkInstance(
427
+ address instanceAddress,
428
+ VersionPart expectedRelease
429
+ )
430
+ internal
431
+ virtual
432
+ view
433
+ {
434
+ IRegistry registry = getRegistry();
435
+
436
+ NftId instanceNftId = registry.getNftIdForAddress(instanceAddress);
437
+ if (instanceNftId.eqz()) {
438
+ revert ErrorInstanceServiceNotRegistered(instanceAddress);
439
+ }
440
+
441
+ ObjectType objectType = registry.getObjectInfo(instanceNftId).objectType;
442
+ if (objectType != INSTANCE()) {
443
+ revert ErrorInstanceServiceNotInstance(instanceAddress, objectType);
444
+ }
445
+
446
+ if (expectedRelease.gtz()) {
447
+ VersionPart instanceRelease = IInstance(instanceAddress).getRelease();
448
+ if (instanceRelease != expectedRelease) {
449
+ revert ErrorInstanceServiceInstanceVersionMismatch(instanceNftId, expectedRelease, instanceRelease);
450
+ }
451
+ }
452
+ }
453
+
454
+
400
455
  // From IService
401
456
  function _getDomain() internal pure override returns(ObjectType) {
402
457
  return INSTANCE();
@@ -1,20 +1,21 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
- import {Amount} from "../../type/Amount.sol";
5
4
  import {NftId} from "../../type/NftId.sol";
6
5
  import {Fee} from "../../type/Fee.sol";
7
- import {Seconds} from "../../type/Seconds.sol";
8
6
  import {Timestamp} from "../../type/Timestamp.sol";
9
7
 
10
8
  interface IBundle {
11
9
 
12
10
  struct BundleInfo {
13
- NftId poolNftId;
14
- Fee fee; // bundle fee on net premium amounts
15
- bytes filter; // required conditions for applications to be considered for collateralization by this bundle
11
+ // slot 0
16
12
  Timestamp activatedAt;
17
13
  Timestamp expiredAt; // no new policies starting with this timestamp
18
14
  Timestamp closedAt; // no open policies, locked amount = 0
15
+ NftId poolNftId;
16
+ // slot 1
17
+ Fee fee; // bundle fee on net premium amounts
18
+ // slot 2
19
+ bytes filter; // required conditions for applications to be considered for collateralization by this bundle
19
20
  }
20
21
  }
@@ -1,8 +1,6 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
- import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
5
-
6
4
  import {Amount} from "../../type/Amount.sol";
7
5
  import {Fee} from "../../type/Fee.sol";
8
6
  import {NftId} from "../../type/NftId.sol";
@@ -12,13 +10,16 @@ import {UFixed} from "../../type/UFixed.sol";
12
10
  interface IComponents {
13
11
 
14
12
  struct ComponentInfo {
13
+ // slot 0
15
14
  string name; // component name (needs to be unique per instance)
16
- IERC20Metadata token;
15
+ // slot 1
17
16
  TokenHandler tokenHandler;
17
+ // slot 2
18
18
  bytes data; // will hold component type specific additional info (eg encoded pool info)
19
19
  }
20
20
 
21
21
  struct ProductInfo {
22
+ // slot 0
22
23
  bool isProcessingFundedClaims; // custom logic to react to pool events for funded claims
23
24
  bool isInterceptingPolicyTransfers; // custom logic for policy nft transfers
24
25
  bool hasDistribution; // flag to indicate if distribution is enabled
@@ -26,26 +27,36 @@ interface IComponents {
26
27
  uint8 numberOfOracles; // actual number of oracles
27
28
  NftId poolNftId; // mandatory
28
29
  NftId distributionNftId; // 0..1 (optional)
30
+ // slot 1
29
31
  NftId [] oracleNftId; // 0..n (optional)
30
32
  }
31
33
 
32
34
  struct FeeInfo {
35
+ // slot 0
33
36
  Fee productFee; // product fee on net premium
37
+ // slot 1
34
38
  Fee processingFee; // product fee on payout amounts
39
+ // slot 2
35
40
  Fee distributionFee; // distribution fee for sales that do not include commissions
41
+ // slot 3
36
42
  Fee minDistributionOwnerFee; // min fee required by distribution owner (not including commissions for distributors)
43
+ // slot 4
37
44
  Fee poolFee; // pool fee on net premium
45
+ // slot 5
38
46
  Fee stakingFee; // pool fee on staked capital from investor
47
+ // slot 6
39
48
  Fee performanceFee; // pool fee on profits from capital investors
40
49
  }
41
50
 
42
51
  struct PoolInfo {
52
+ // slot 0
43
53
  Amount maxBalanceAmount; // max balance amount allowed for pool
54
+ UFixed collateralizationLevel; // factor to calculate collateral for sum insurance (default 100%)
55
+ // slot 1
56
+ UFixed retentionLevel; // amount of collateral held in pool (default 100%)
44
57
  bool isInterceptingBundleTransfers; // custom logic for bundle nft transfers
45
58
  bool isProcessingConfirmedClaims; // custom logic for claims confirmation
46
59
  bool isExternallyManaged; // funding bundles is restricted to book keeping, actual funds may be provided as needed to support payouts
47
60
  bool isVerifyingApplications; // underwriting requires the pool component checks/confirms the applications
48
- UFixed collateralizationLevel; // factor to calculate collateral for sum insurance (default 100%)
49
- UFixed retentionLevel; // amount of collateral held in pool (default 100%)
50
61
  }
51
62
  }
@@ -1,7 +1,6 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
- import {Amount} from "../../type/Amount.sol";
5
4
  import {DistributorType} from "../../type/DistributorType.sol";
6
5
  import {NftId} from "../../type/NftId.sol";
7
6
  import {Seconds} from "../../type/Seconds.sol";
@@ -11,31 +10,44 @@ import {UFixed} from "../../type/UFixed.sol";
11
10
  interface IDistribution {
12
11
 
13
12
  struct DistributorTypeInfo {
14
- string name;
13
+ // slot 0
15
14
  UFixed minDiscountPercentage;
15
+ NftId distributionNftId;
16
+ // slot 1
16
17
  UFixed maxDiscountPercentage;
17
- UFixed commissionPercentage;
18
18
  uint32 maxReferralCount;
19
19
  Seconds maxReferralLifetime;
20
20
  bool allowSelfReferrals;
21
21
  bool allowRenewals;
22
+ // slot 2
23
+ UFixed commissionPercentage;
24
+ // slot 3
25
+ string name;
26
+ // slot 4
22
27
  bytes data;
23
28
  }
24
29
 
25
30
  struct DistributorInfo {
31
+ // slot 0
26
32
  DistributorType distributorType;
27
33
  bool active;
28
- bytes data;
29
34
  uint32 numPoliciesSold;
35
+ // slot 1
36
+ bytes data;
30
37
  }
31
38
 
32
- struct ReferralInfo {
39
+ struct ReferralInfo {
40
+ // slot 0
41
+ NftId distributionNftId;
33
42
  NftId distributorNftId;
34
- string referralCode;
35
- UFixed discountPercentage;
36
43
  uint32 maxReferrals;
37
44
  uint32 usedReferrals;
45
+ // slot 1
46
+ UFixed discountPercentage;
38
47
  Timestamp expiryAt;
48
+ // slot 2
49
+ string referralCode;
50
+ // slot 3
39
51
  bytes data;
40
52
  }
41
53
 
@@ -12,29 +12,38 @@ import {Timestamp} from "../../type/Timestamp.sol";
12
12
  interface IPolicy {
13
13
 
14
14
  struct PremiumInfo {
15
+ // slot 0
15
16
  // premium splitting per target wallet
16
17
  Amount productFeeAmount;
17
18
  Amount distributionFeeAndCommissionAmount;
19
+ // slot 1
18
20
  Amount poolPremiumAndFeeAmount;
19
21
 
20
22
  // detailed positions
21
23
  // this is the net premium calculated by the product
22
24
  Amount netPremiumAmount;
25
+ // slot 2
23
26
  // fullPremium = netPremium + all fixed amounts + all variable amounts (excl commission and minDistribtuionOwnerFee variable part)
24
27
  Amount fullPremiumAmount;
25
28
  // effective premium = fullPremium - discount
26
29
  Amount premiumAmount;
30
+ // slot 3
27
31
  Amount productFeeFixAmount;
28
32
  Amount poolFeeFixAmount;
33
+ // slot 4
29
34
  Amount bundleFeeFixAmount;
30
35
  Amount distributionFeeFixAmount;
36
+ // slot 5
31
37
  Amount productFeeVarAmount;
32
38
  Amount poolFeeVarAmount;
39
+ // slot 6
33
40
  Amount bundleFeeVarAmount;
34
41
  Amount distributionFeeVarAmount;
42
+ // slot 7
35
43
  Amount distributionOwnerFeeFixAmount;
36
44
  // this is the remaining amount when the commission and discount are subtracted from the distribution fee variable part (must be at least the minDistributionOwnerFee)
37
45
  Amount distributionOwnerFeeVarAmount;
46
+ // slot 8
38
47
  // this value is based on distributor type referenced in the referral
39
48
  Amount commissionAmount;
40
49
  // this is based on referral used
@@ -43,43 +52,54 @@ interface IPolicy {
43
52
 
44
53
  /// @dev policy data for the full policy lifecycle
45
54
  struct PolicyInfo {
46
- // application data, no changes after applying for a policy
55
+ // slot 0
47
56
  NftId productNftId;
48
57
  NftId bundleNftId;
49
- ReferralId referralId;
50
58
  RiskId riskId;
59
+ // slot 1
51
60
  Amount sumInsuredAmount;
52
61
  Amount premiumAmount; // expected premium at application time
53
- Seconds lifetime;
54
- bytes applicationData;
55
- // policy data that may change during the lifecycle
56
- bytes processData;
62
+ ReferralId referralId;
63
+ // slot 2
57
64
  uint16 claimsCount;
58
65
  uint16 openClaimsCount;
59
66
  Amount claimAmount; // sum of confirmed claim amounts (max = sum insured amount)
60
67
  Amount payoutAmount; // sum of payouts (max = sum confirmed claim amountst)
68
+ // slot 3
61
69
  Timestamp activatedAt; // time of underwriting
70
+ Seconds lifetime;
62
71
  Timestamp expiredAt; // no new claims (activatedAt + lifetime)
63
72
  Timestamp closedAt; // no locked capital (or declinedAt)
73
+ // slot 4
74
+ bytes applicationData;
75
+ // slot 5
76
+ bytes processData;
64
77
  }
65
78
 
66
79
  // claimId neeeds to be encoded policyNftId:claimId combination
67
80
  struct ClaimInfo {
81
+ // slot 0
68
82
  Amount claimAmount;
69
83
  Amount paidAmount;
84
+ Timestamp closedAt; // payment of confirmed claim amount (or declinedAt)
70
85
  uint24 payoutsCount;
86
+ // slot 1
71
87
  uint24 openPayoutsCount;
88
+ // slot 2
72
89
  bytes submissionData; // use case specific claim submission data, no changes after submitting the claim
90
+ // slot 3
73
91
  bytes processData; // use case specific data that may include information supporting confirm or decline
74
- Timestamp closedAt; // payment of confirmed claim amount (or declinedAt)
75
92
  }
76
93
 
77
94
  // claimId neeeds to be encoded policyNftId:claimId combination
78
95
  struct PayoutInfo {
96
+ // slot 0
79
97
  ClaimId claimId;
80
98
  Amount amount;
99
+ Timestamp paidAt; // timestamp for actual payout
100
+ // slot 1
81
101
  address beneficiary; // for address(0) beneficiary is policy nft owner
102
+ // slot 2
82
103
  bytes data; // use case specific supporting data
83
- Timestamp paidAt; // timestamp for actual payout
84
104
  }
85
105
  }
@@ -7,8 +7,10 @@ import {Timestamp} from "../../type/Timestamp.sol";
7
7
  interface IRisk {
8
8
 
9
9
  struct RiskInfo {
10
+ // slot 0
10
11
  NftId productNftId;
11
12
  Timestamp createdAt;
13
+ // slot 1
12
14
  bytes data;
13
15
  }
14
16
  }
@@ -27,8 +27,7 @@ contract BasicOracle is
27
27
  NftId instanceNftId,
28
28
  IAuthorization authorization,
29
29
  address initialOwner,
30
- string memory name,
31
- address token
30
+ string memory name
32
31
  )
33
32
  internal
34
33
  virtual
@@ -41,7 +40,6 @@ contract BasicOracle is
41
40
  authorization,
42
41
  initialOwner,
43
42
  name,
44
- token,
45
43
  "");
46
44
  }
47
45
  }
@@ -15,7 +15,7 @@ contract BasicOracleAuthorization
15
15
  {
16
16
 
17
17
  constructor(string memory componentName)
18
- Authorization(componentName, ORACLE())
18
+ Authorization(componentName, ORACLE(), true, false)
19
19
  {}
20
20
 
21
21
  function _setupTargetAuthorizations()
@@ -9,14 +9,19 @@ import {Timestamp} from "../type/Timestamp.sol";
9
9
  interface IOracle {
10
10
 
11
11
  struct RequestInfo {
12
+ // slot 0
12
13
  NftId requesterNftId; // originator of the request
13
- string callbackMethodName; // callback function of the requestor to call to provide response data
14
14
  NftId oracleNftId; // responsible oracle component
15
- bytes requestData;
16
- bytes responseData;
15
+ bool isCancelled;
17
16
  Timestamp respondedAt; // response timestamp
17
+ // slot 1
18
18
  Timestamp expiredAt; // expiry timestamp
19
- bool isCancelled;
19
+ // slot 2
20
+ string callbackMethodName; // callback function of the requestor to call to provide response data
21
+ // slot 3
22
+ bytes requestData;
23
+ // slot 4
24
+ bytes responseData;
20
25
  }
21
26
 
22
27
 
@@ -81,7 +81,6 @@ abstract contract Oracle is
81
81
  IAuthorization authorization,
82
82
  address initialOwner,
83
83
  string memory name,
84
- address token,
85
84
  bytes memory componentData // component specifidc data
86
85
  )
87
86
  internal
@@ -92,7 +91,6 @@ abstract contract Oracle is
92
91
  registry,
93
92
  productNftId,
94
93
  name,
95
- token,
96
94
  ORACLE(),
97
95
  authorization,
98
96
  true,
@@ -21,7 +21,6 @@ abstract contract BasicPool is
21
21
  address registry,
22
22
  NftId productNftId,
23
23
  string memory name,
24
- address token,
25
24
  IComponents.PoolInfo memory poolInfo,
26
25
  IAuthorization authorization,
27
26
  address initialOwner
@@ -34,7 +33,6 @@ abstract contract BasicPool is
34
33
  registry,
35
34
  productNftId,
36
35
  name,
37
- token,
38
36
  poolInfo,
39
37
  authorization,
40
38
  initialOwner,
@@ -18,7 +18,7 @@ contract BasicPoolAuthorization
18
18
  {
19
19
 
20
20
  constructor(string memory poolName)
21
- Authorization(poolName, POOL())
21
+ Authorization(poolName, POOL(), true, true)
22
22
  {}
23
23
 
24
24
  function _setupServiceTargets()