@etherisc/gif-next 0.0.2-7c8d286-020 → 0.0.2-7d488b3-675

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. package/README.md +1 -1
  2. package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
  3. package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +32 -48
  4. package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
  5. package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +26 -34
  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 +246 -361
  9. package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +1 -1
  10. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
  11. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +39 -8
  12. package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
  13. package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +23 -96
  14. package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
  15. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
  16. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +184 -278
  17. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
  18. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +0 -32
  19. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
  20. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
  21. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
  22. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
  23. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +109 -33
  24. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
  25. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +41 -96
  26. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
  27. package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +65 -0
  28. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
  29. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +106 -142
  30. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  31. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +53 -61
  32. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  33. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +65 -0
  34. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  35. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +20 -40
  36. package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
  37. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
  38. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +17 -33
  39. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
  40. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +41 -96
  41. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
  42. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +59 -75
  43. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
  44. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +41 -96
  45. package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
  46. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
  47. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +118 -42
  48. package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
  49. package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +41 -96
  50. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
  51. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +23 -23
  52. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
  53. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +27 -43
  54. package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
  55. package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +41 -96
  56. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
  57. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +29 -45
  58. package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
  59. package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +41 -96
  60. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
  61. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
  62. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  63. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +7 -85
  64. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  65. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +11 -54
  66. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  67. package/artifacts/contracts/instance/Instance.sol/Instance.json +25 -95
  68. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
  69. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +405 -512
  70. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
  71. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +41 -96
  72. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  73. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +2 -2
  74. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  75. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +63 -86
  76. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  77. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +36 -26
  78. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
  79. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2 -2
  80. package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
  81. package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +2 -2
  82. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
  83. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
  84. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
  85. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
  86. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
  87. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
  88. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
  89. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
  90. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
  91. package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +1 -1
  92. package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +2 -2
  93. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  94. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  95. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  96. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  97. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  98. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
  99. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
  100. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +14 -14
  101. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
  102. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +30 -93
  103. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
  104. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
  105. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
  106. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
  107. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
  108. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +42 -58
  109. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
  110. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +31 -39
  111. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
  112. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
  113. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +41 -96
  114. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
  115. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +58 -74
  116. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  117. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +39 -47
  118. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
  119. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  120. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
  121. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
  122. package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
  123. package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +22 -38
  124. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
  125. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +74 -106
  126. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  127. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +47 -63
  128. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  129. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +26 -71
  130. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  131. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +23 -35
  132. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
  133. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
  134. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +41 -96
  135. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
  136. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +80 -96
  137. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  138. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +50 -58
  139. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  140. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +0 -21
  141. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
  142. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  143. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
  144. package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +0 -21
  145. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  146. package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
  147. package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +0 -21
  148. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
  149. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +86 -94
  150. package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
  151. package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +18 -452
  152. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  153. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +53 -57
  154. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
  155. package/artifacts/contracts/product/PricingService.sol/PricingService.json +52 -89
  156. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
  157. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +36 -44
  158. package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
  159. package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
  160. package/artifacts/contracts/product/RiskService.sol/RiskService.json +26 -55
  161. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
  162. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +23 -27
  163. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  164. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  165. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  166. package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +1 -1
  167. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  168. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  169. package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
  170. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
  171. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +350 -440
  172. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  173. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +18 -18
  174. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  175. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +19 -19
  176. package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
  177. package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +368 -473
  178. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
  179. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
  180. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
  181. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +124 -128
  182. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
  183. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
  184. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  185. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
  186. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
  187. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
  188. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +102 -63
  189. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
  190. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +49 -41
  191. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
  192. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
  193. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +4 -60
  194. package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
  195. package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
  196. package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +1 -1
  197. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
  198. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
  199. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +24 -1
  200. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
  201. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  202. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  203. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  204. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  205. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  206. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  207. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  208. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
  209. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -2
  210. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
  211. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  212. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  213. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
  214. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
  215. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  216. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
  217. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  218. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
  219. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  220. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  221. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
  222. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  223. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  224. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
  225. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
  226. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +2 -2
  227. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
  228. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
  229. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
  230. package/artifacts/contracts/staking/IStaking.sol/IStaking.json +9 -74
  231. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
  232. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +3 -74
  233. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +4 -0
  234. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +440 -0
  235. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
  236. package/artifacts/contracts/staking/Staking.sol/Staking.json +57 -141
  237. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
  238. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
  239. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
  240. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +34 -50
  241. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
  242. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +57 -30
  243. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
  244. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +29 -124
  245. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
  246. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +23 -35
  247. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
  248. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +128 -142
  249. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
  250. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +14 -24
  251. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  252. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
  253. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  254. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  255. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
  256. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  257. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
  258. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
  259. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
  260. package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
  261. package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +1 -1
  262. package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +2 -2
  263. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
  264. package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
  265. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  266. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
  267. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  268. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +31 -33
  269. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  270. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
  271. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
  272. package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
  273. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
  274. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
  275. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
  276. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +2 -2
  277. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
  278. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
  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/VersionLib.json +2 -2
  288. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
  289. package/artifacts/contracts/type/Version.sol/VersionPartLib.json +2 -56
  290. package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
  291. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  292. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +4 -4
  293. package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  294. package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
  295. package/contracts/accounting/AccountingService.sol +3 -2
  296. package/contracts/authorization/AccessAdmin.sol +186 -201
  297. package/contracts/authorization/AccessManagerCloneable.sol +31 -40
  298. package/contracts/authorization/Authorization.sol +33 -61
  299. package/contracts/authorization/IAccessAdmin.sol +36 -63
  300. package/contracts/authorization/IAuthorization.sol +0 -6
  301. package/contracts/distribution/BasicDistribution.sol +3 -5
  302. package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
  303. package/contracts/distribution/Distribution.sol +47 -4
  304. package/contracts/distribution/DistributionService.sol +6 -10
  305. package/contracts/distribution/IDistributionComponent.sol +9 -0
  306. package/contracts/distribution/IDistributionService.sol +5 -3
  307. package/contracts/instance/IInstance.sol +8 -43
  308. package/contracts/instance/IInstanceService.sol +2 -14
  309. package/contracts/instance/Instance.sol +13 -62
  310. package/contracts/instance/InstanceAdmin.sol +107 -120
  311. package/contracts/instance/InstanceAuthorizationV3.sol +21 -43
  312. package/contracts/instance/InstanceReader.sol +1 -1
  313. package/contracts/instance/InstanceService.sol +60 -118
  314. package/contracts/oracle/BasicOracleAuthorization.sol +1 -1
  315. package/contracts/oracle/OracleService.sol +4 -4
  316. package/contracts/pool/BasicPoolAuthorization.sol +1 -1
  317. package/contracts/pool/PoolLib.sol +1 -94
  318. package/contracts/pool/PoolService.sol +89 -91
  319. package/contracts/product/ApplicationService.sol +1 -10
  320. package/contracts/product/BasicProductAuthorization.sol +1 -1
  321. package/contracts/product/ClaimService.sol +0 -8
  322. package/contracts/product/IApplicationService.sol +0 -2
  323. package/contracts/product/IPricingService.sol +0 -1
  324. package/contracts/product/IRiskService.sol +0 -3
  325. package/contracts/product/PolicyService.sol +53 -35
  326. package/contracts/product/PolicyServiceLib.sol +1 -55
  327. package/contracts/product/PricingService.sol +0 -5
  328. package/contracts/product/RiskService.sol +0 -10
  329. package/contracts/registry/RegistryAdmin.sol +229 -133
  330. package/contracts/registry/ReleaseAdmin.sol +22 -30
  331. package/contracts/registry/ReleaseRegistry.sol +33 -39
  332. package/contracts/registry/ServiceAuthorizationV3.sol +3 -88
  333. package/contracts/shared/Component.sol +6 -6
  334. package/contracts/shared/ComponentService.sol +29 -33
  335. package/contracts/shared/ContractLib.sol +0 -28
  336. package/contracts/shared/IComponentService.sol +6 -4
  337. package/contracts/shared/InitializableERC165.sol +1 -9
  338. package/contracts/shared/NftOwnable.sol +1 -2
  339. package/contracts/shared/Registerable.sol +4 -1
  340. package/contracts/shared/TokenHandler.sol +4 -5
  341. package/contracts/staking/IStaking.sol +2 -12
  342. package/contracts/staking/IStakingService.sol +1 -11
  343. package/contracts/staking/{StakingLib.sol → StakeManagerLib.sol} +22 -79
  344. package/contracts/staking/Staking.sol +13 -33
  345. package/contracts/staking/StakingReader.sol +15 -5
  346. package/contracts/staking/StakingService.sol +2 -39
  347. package/contracts/staking/StakingStore.sol +1 -2
  348. package/contracts/type/ObjectType.sol +14 -5
  349. package/contracts/type/Version.sol +0 -39
  350. package/package.json +1 -1
  351. package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +0 -4
  352. package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +0 -673
  353. package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +0 -4
  354. package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +0 -878
  355. package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +0 -4
  356. package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +0 -469
  357. package/contracts/authorization/AccessAdminLib.sol +0 -183
  358. package/contracts/registry/RegistryAuthorization.sol +0 -267
@@ -71,7 +71,6 @@ contract DistributionService is
71
71
  bytes memory data
72
72
  )
73
73
  external
74
- restricted()
75
74
  returns (DistributorType distributorType)
76
75
  {
77
76
  (NftId distributionNftId,, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
@@ -117,7 +116,6 @@ contract DistributionService is
117
116
  )
118
117
  external
119
118
  virtual
120
- restricted()
121
119
  returns (NftId distributorNftId)
122
120
  {
123
121
  (NftId distributionNftId,, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
@@ -145,19 +143,18 @@ contract DistributionService is
145
143
 
146
144
  function changeDistributorType(
147
145
  NftId distributorNftId,
148
- DistributorType newDistributorType,
146
+ DistributorType distributorType,
149
147
  bytes memory data
150
148
  )
151
149
  external
152
150
  virtual
153
- restricted()
154
151
  {
155
152
  _checkNftType(distributorNftId, DISTRIBUTOR());
156
153
  (NftId distributionNftId,, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
157
- _checkDistributionType(instance.getInstanceReader(), newDistributorType, distributionNftId);
154
+ _checkDistributionType(instance.getInstanceReader(), distributorType, distributionNftId);
158
155
 
159
156
  IDistribution.DistributorInfo memory distributorInfo = instance.getInstanceReader().getDistributorInfo(distributorNftId);
160
- distributorInfo.distributorType = newDistributorType;
157
+ distributorInfo.distributorType = distributorType;
161
158
  distributorInfo.data = data;
162
159
  instance.getInstanceStore().updateDistributor(distributorNftId, distributorInfo, KEEP_STATE());
163
160
  }
@@ -173,7 +170,6 @@ contract DistributionService is
173
170
  )
174
171
  external
175
172
  virtual
176
- restricted()
177
173
  onlyNftOfType(distributorNftId, DISTRIBUTOR())
178
174
  returns (ReferralId referralId)
179
175
  {
@@ -188,7 +184,7 @@ contract DistributionService is
188
184
 
189
185
  NftId distributorDistributionNftId = getRegistry().getParentNftId(distributorNftId);
190
186
  if (distributorDistributionNftId != distributionNftId) {
191
- revert ErrorDistributionServiceDistributorDistributionMismatch(distributorNftId, distributorDistributionNftId, distributionNftId);
187
+ revert ErrorDistributionServiceInvalidDistributor(distributorNftId);
192
188
  }
193
189
 
194
190
  {
@@ -294,7 +290,7 @@ contract DistributionService is
294
290
  function withdrawCommission(NftId distributorNftId, Amount amount)
295
291
  public
296
292
  virtual
297
- restricted()
293
+ // TODO: restricted() (once #462 is done)
298
294
  onlyNftOfType(distributorNftId, DISTRIBUTOR())
299
295
  returns (Amount withdrawnAmount)
300
296
  {
@@ -369,7 +365,7 @@ contract DistributionService is
369
365
  NftId distributorTypeDistributionNftId = instanceReader.getDistributorTypeInfo(distributorType).distributionNftId;
370
366
 
371
367
  if (distributorTypeDistributionNftId != expectedDistributionNftId) {
372
- revert ErrorDistributionServiceDistributorTypeDistributionMismatch(distributorType, distributorTypeDistributionNftId, expectedDistributionNftId);
368
+ revert ErrorDistributionServiceInvalidDistributorType(distributorType);
373
369
  }
374
370
  }
375
371
 
@@ -9,8 +9,17 @@ import {UFixed} from "../type/UFixed.sol";
9
9
 
10
10
  interface IDistributionComponent is IInstanceLinkedComponent {
11
11
 
12
+ error ErrorDistributionNotDistributor(address distributor);
13
+ error ErrorDistributionAlreadyDistributor(address distributor, NftId distributorNftId);
14
+
12
15
  event LogDistributorUpdated(address to, address operator);
13
16
 
17
+ /// @dev Returns true iff the provided address is registered as a distributor with this distribution component.
18
+ function isDistributor(address candidate) external view returns (bool);
19
+
20
+ /// @dev Returns the distributor Nft Id for the provided address
21
+ function getDistributorNftId(address distributor) external view returns (NftId distributorNftId);
22
+
14
23
  function getDiscountPercentage(
15
24
  string memory referralCode
16
25
  ) external view returns (UFixed discountPercentage, ReferralStatus status);
@@ -13,6 +13,10 @@ import {Timestamp} from "../type/Timestamp.sol";
13
13
 
14
14
 
15
15
  interface IDistributionService is IService {
16
+ // TODO: rename
17
+ error ErrorDistributionServiceInvalidDistributorType(DistributorType distributorType);
18
+ // TODO: rename
19
+ error ErrorDistributionServiceInvalidDistributor(NftId distributorNftId);
16
20
  error ErrorDistributionServiceCallerNotRegistered(address caller);
17
21
  error ErrorDistributionServiceParentNftIdNotInstance(NftId nftId, NftId parentNftId);
18
22
  error ErrorDistributionServiceCallerNotDistributor(address caller);
@@ -25,8 +29,6 @@ interface IDistributionService is IService {
25
29
  error ErrorDistributionServiceExpirationInvalid(Timestamp expiryAt);
26
30
  error ErrorDistributionServiceCommissionTooHigh(uint256 commissionPercentage, uint256 maxCommissionPercentage);
27
31
  error ErrorDistributionServiceMinFeeTooHigh(uint256 minFee, uint256 limit);
28
- error ErrorDistributionServiceDistributorTypeDistributionMismatch(DistributorType distributorType, NftId distributorTypeDistributionNftId, NftId distributionNftId);
29
- error ErrorDistributionServiceDistributorDistributionMismatch(NftId distributorNftId, NftId distributorDistributionNftId, NftId distributionNftId);
30
32
 
31
33
  error ErrorDistributionServiceCommissionWithdrawAmountExceedsLimit(Amount amount, Amount limit);
32
34
 
@@ -61,7 +63,7 @@ interface IDistributionService is IService {
61
63
 
62
64
  function changeDistributorType(
63
65
  NftId distributorNftId,
64
- DistributorType newDistributorType,
66
+ DistributorType distributorType,
65
67
  bytes memory data
66
68
  ) external;
67
69
 
@@ -18,7 +18,7 @@ interface IInstance is
18
18
  IRegisterable
19
19
  {
20
20
  error ErrorInstanceInstanceAdminZero();
21
- error ErrorInstanceInstanceAdminAlreadySet(address instanceAdmin);
21
+ error ErrorInstanceInstanceAdminAlreadySet(address InstanceAdmin);
22
22
  error ErrorInstanceInstanceAdminAuthorityMismatch(address instanceAuthority);
23
23
 
24
24
  error ErrorInstanceBundleSetAlreadySet(address instanceBundleSet);
@@ -38,59 +38,24 @@ interface IInstance is
38
38
  uint64 requestsCount;
39
39
  }
40
40
 
41
- ///--- instance ---------------------------------------------------------//
42
-
43
- /// @dev Locks/unlocks the complete instance, including all its components.
44
- function setInstanceLocked(bool locked) external;
45
-
46
- /// @dev Upgrades the instance reader to the specified target.
47
- function upgradeInstanceReader() external;
48
-
49
- /// @dev Sets the instance reader for the instance.
50
- /// Permissioned: only the instance service may call this function.
51
- function setInstanceReader(InstanceReader instanceReader) external;
52
-
53
- ///--- staking ----------------------------------------------------------//
54
-
55
- /// @dev Sets the duration for locking new stakes on this instance..
56
- function setStakingLockingPeriod(Seconds stakeLockingPeriod) external;
57
-
58
- /// @dev Sets the staking reward rate [apr] for this instance.
59
- function setStakingRewardRate(UFixed rewardRate) external;
60
-
61
- /// @dev Sets the maximum staked amount for this instance.
62
- function setStakingMaxAmount(Amount maxStakedAmount) external;
63
-
64
- /// @dev Refills the staking reward reserves for the specified target.
65
- function refillStakingRewardReserves(Amount dipAmount) external;
66
-
67
- /// @dev Defunds the staking reward reserves for the specified target.
68
- function withdrawStakingRewardReserves(Amount dipAmount) external returns (Amount newBalance);
69
-
70
- ///--- product/component ------------------------------------------------//
71
-
72
- /// @dev Locks/unlocks the specified target.
73
- function setTargetLocked(address target, bool locked) external;
74
-
75
41
  /// @dev Register a product with the instance.
76
42
  function registerProduct(address product) external returns (NftId productNftId);
77
43
 
78
- ///--- authz ------------------------------------------------------------//
79
-
80
44
  function createRole(string memory roleName, string memory adminName) external returns (RoleId roleId, RoleId admin);
81
45
  function grantRole(RoleId roleId, address account) external;
82
46
  function revokeRole(RoleId roleId, address account) external;
83
47
 
84
48
  function createTarget(address target, string memory name) external;
85
49
  function setTargetFunctionRole(string memory targetName, bytes4[] calldata selectors, RoleId roleId) external;
50
+ function setLocked(address target, bool locked) external;
86
51
 
87
- //--- getters -----------------------------------------------------------//
88
-
89
- /// @dev returns the overall locking state of the instance (including all components)
90
- function isInstanceLocked() external view returns (bool isLocked);
52
+ function setStakingLockingPeriod(Seconds stakeLockingPeriod) external;
53
+ function setStakingRewardRate(UFixed rewardRate) external;
54
+ function refillStakingRewardReserves(Amount dipAmount) external;
91
55
 
92
- /// @dev returns the locking state of the specified target
93
- function isTargetLocked(address target) external view returns (bool isLocked);
56
+ /// @dev Defunds the staking reward reserves for the specified target.
57
+ /// Permissioned: only the target owner may call this function.
58
+ function withdrawStakingRewardReserves(Amount dipAmount) external returns (Amount newBalance);
94
59
 
95
60
  // get products
96
61
  function products() external view returns (uint256 productCount);
@@ -15,7 +15,7 @@ interface IInstanceService is IService {
15
15
  // onlyInstance
16
16
  error ErrorInstanceServiceNotRegistered(address instance);
17
17
  error ErrorInstanceServiceNotInstance(address instance, ObjectType objectType);
18
- error ErrorInstanceServiceInstanceVersionMismatch(NftId instanceNftId, VersionPart expectedRelease, VersionPart instanceRelease);
18
+ error ErrorInstanceServiceInstanceVersionMismatch(address instance, VersionPart instanceVersion);
19
19
 
20
20
  error ErrorInstanceServiceComponentNotInstanceLinked(address component);
21
21
 
@@ -53,17 +53,6 @@ interface IInstanceService is IService {
53
53
 
54
54
  event LogInstanceCloned(NftId instanceNftId, address instance);
55
55
 
56
- /// @dev Locks the complete instance, including all its components.
57
- function setInstanceLocked(bool locked) external;
58
-
59
- /// @dev Locks/unlocks the specified target constrolled by the corresponding instance admin.
60
- function setTargetLocked(address target, bool locked) external;
61
-
62
- /// @dev Creates a new instance.
63
- /// The caller becomes the owner of the new instance.
64
- /// Creation of a new instance is achieved by this service through the creation and registration
65
- /// of a new clone of the master instance and then setting up the initial wiring and authorization
66
- /// of the necessary components.
67
56
  function createInstance()
68
57
  external
69
58
  returns (
@@ -71,12 +60,11 @@ interface IInstanceService is IService {
71
60
  NftId instanceNftId
72
61
  );
73
62
 
74
- function upgradeInstanceReader() external;
63
+ function upgradeInstanceReader(NftId instanceNftId) external;
75
64
  function upgradeMasterInstanceReader(address instanceReaderAddress) external;
76
65
 
77
66
  function setStakingLockingPeriod(Seconds stakeLockingPeriod) external;
78
67
  function setStakingRewardRate(UFixed rewardRate) external;
79
- function setStakingMaxAmount(Amount maxStakedAmount) external;
80
68
  function refillStakingRewardReserves(address rewardProvider, Amount dipAmount) external;
81
69
 
82
70
  /// @dev Defunds the staking reward reserves for the specified target.
@@ -1,24 +1,22 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
- import {IInstance} from "./IInstance.sol";
5
- import {IComponentService} from "../shared/IComponentService.sol";
6
- import {IInstanceService} from "./IInstanceService.sol";
7
- import {IRegistry} from "../registry/IRegistry.sol";
8
-
9
4
  import {Amount} from "../type/Amount.sol";
10
5
  import {BundleSet} from "./BundleSet.sol";
11
6
  import {RiskSet} from "./RiskSet.sol";
12
7
  import {COMPONENT, INSTANCE} from "../type/ObjectType.sol";
8
+ import {IInstance} from "./IInstance.sol";
9
+ import {IComponentService} from "../shared/IComponentService.sol";
10
+ import {IInstanceService} from "./IInstanceService.sol";
13
11
  import {InstanceReader} from "./InstanceReader.sol";
14
12
  import {InstanceAdmin} from "./InstanceAdmin.sol";
15
13
  import {InstanceStore} from "./InstanceStore.sol";
14
+ import {IRegistry} from "../registry/IRegistry.sol";
16
15
  import {NftId} from "../type/NftId.sol";
17
16
  import {Registerable} from "../shared/Registerable.sol";
18
17
  import {RoleId} from "../type/RoleId.sol";
19
18
  import {Seconds} from "../type/Seconds.sol";
20
19
  import {UFixed} from "../type/UFixed.sol";
21
- import {VersionPart} from "../type/Version.sol";
22
20
 
23
21
  contract Instance is
24
22
  IInstance,
@@ -50,7 +48,6 @@ contract Instance is
50
48
  RiskSet riskSet,
51
49
  InstanceReader instanceReader,
52
50
  IRegistry registry,
53
- VersionPart release,
54
51
  address initialOwner
55
52
  )
56
53
  external
@@ -87,40 +84,20 @@ contract Instance is
87
84
  _componentService = IComponentService(
88
85
  getRegistry().getServiceAddress(
89
86
  COMPONENT(),
90
- release));
87
+ getRelease()));
91
88
 
92
89
  _instanceService = IInstanceService(
93
90
  getRegistry().getServiceAddress(
94
91
  INSTANCE(),
95
- release));
92
+ getRelease()));
96
93
 
97
94
  _registerInterface(type(IInstance).interfaceId);
98
95
  }
99
96
 
100
-
101
- function setInstanceLocked(bool locked)
102
- external
103
- // not restricted(): need to be able to unlock a locked instance
104
- onlyOwner()
105
- {
106
- _instanceService.setInstanceLocked(locked);
107
- }
108
-
109
-
110
- function upgradeInstanceReader()
111
- external
112
- restricted()
113
- onlyOwner()
114
- {
115
- _instanceService.upgradeInstanceReader();
116
- }
117
-
118
-
119
97
  //--- ProductRegistration ----------------------------------------------//
120
98
 
121
99
  function registerProduct(address product)
122
100
  external
123
- restricted()
124
101
  onlyOwner()
125
102
  returns (NftId productNftId)
126
103
  {
@@ -132,7 +109,6 @@ contract Instance is
132
109
 
133
110
  function setStakingLockingPeriod(Seconds stakeLockingPeriod)
134
111
  external
135
- restricted()
136
112
  onlyOwner()
137
113
  {
138
114
  _instanceService.setStakingLockingPeriod(stakeLockingPeriod);
@@ -140,22 +116,13 @@ contract Instance is
140
116
 
141
117
  function setStakingRewardRate(UFixed rewardRate)
142
118
  external
143
- restricted()
144
119
  onlyOwner()
145
120
  {
146
121
  _instanceService.setStakingRewardRate(rewardRate);
147
122
  }
148
123
 
149
- function setStakingMaxAmount(Amount maxStakedAmount)
150
- external
151
- onlyOwner()
152
- {
153
- _instanceService.setStakingMaxAmount(maxStakedAmount);
154
- }
155
-
156
124
  function refillStakingRewardReserves(Amount dipAmount)
157
125
  external
158
- restricted()
159
126
  onlyOwner()
160
127
  {
161
128
  address instanceOwner = msg.sender;
@@ -164,7 +131,6 @@ contract Instance is
164
131
 
165
132
  function withdrawStakingRewardReserves(Amount dipAmount)
166
133
  external
167
- restricted()
168
134
  onlyOwner()
169
135
  returns (Amount newBalance)
170
136
  {
@@ -175,7 +141,6 @@ contract Instance is
175
141
 
176
142
  function createRole(string memory roleName, string memory adminName)
177
143
  external
178
- restricted()
179
144
  onlyOwner()
180
145
  returns (RoleId roleId, RoleId admin)
181
146
  {
@@ -185,7 +150,6 @@ contract Instance is
185
150
 
186
151
  function grantRole(RoleId roleId, address account)
187
152
  external
188
- restricted()
189
153
  onlyOwner()
190
154
  {
191
155
  _instanceAdmin.grantRole(roleId, account);
@@ -193,7 +157,6 @@ contract Instance is
193
157
 
194
158
  function revokeRole(RoleId roleId, address account)
195
159
  external
196
- restricted()
197
160
  onlyOwner()
198
161
  {
199
162
  // TODO refactor
@@ -202,18 +165,8 @@ contract Instance is
202
165
 
203
166
  //--- Targets ------------------------------------------------------------//
204
167
 
205
-
206
- function setTargetLocked(address target, bool locked)
207
- external
208
- // not restricted(): instance owner may need to be able to unlock targets on an locked instance
209
- onlyOwner()
210
- {
211
- _instanceService.setTargetLocked(target, locked);
212
- }
213
-
214
168
  function createTarget(address target, string memory name)
215
169
  external
216
- restricted()
217
170
  onlyOwner()
218
171
  {
219
172
  // TODO refactor
@@ -226,13 +179,19 @@ contract Instance is
226
179
  RoleId roleId
227
180
  )
228
181
  external
229
- restricted()
230
182
  onlyOwner()
231
183
  {
232
184
  // TODO refactor
233
185
  // _instanceAdmin.setTargetFunctionRoleByInstance(targetName, selectors, roleId);
234
186
  }
235
187
 
188
+ function setLocked(address target, bool locked)
189
+ external
190
+ onlyOwner()
191
+ {
192
+ _componentService.setLockedFromInstance(target, locked);
193
+ }
194
+
236
195
  //--- ITransferInterceptor ----------------------------------------------//
237
196
 
238
197
  function nftTransferFrom(address from, address to, uint256 tokenId, address operator) external onlyChainNft {
@@ -256,14 +215,6 @@ contract Instance is
256
215
 
257
216
  //--- external view functions -------------------------------------------//
258
217
 
259
- function isInstanceLocked() external view returns (bool) {
260
- return _instanceAdmin.isLocked();
261
- }
262
-
263
- function isTargetLocked(address target) external view returns (bool) {
264
- return _instanceAdmin.isTargetLocked(target);
265
- }
266
-
267
218
  function products() external view returns (uint256 productCount) {
268
219
  return _products.length;
269
220
  }