@etherisc/gif-next 0.0.2-8bdd2eb-413 → 0.0.2-8d9d4d6-542

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 (324) hide show
  1. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
  2. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +1502 -0
  3. package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +4 -0
  4. package/artifacts/contracts/authorization/IAccess.sol/IAccess.json +10 -0
  5. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
  6. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +1168 -0
  7. package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +4 -0
  8. package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.json +110 -0
  9. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
  10. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +129 -0
  11. package/artifacts/contracts/authorization/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
  12. package/artifacts/contracts/authorization/InstanceAdmin.sol/InstanceAdmin.json +1639 -0
  13. package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +4 -0
  14. package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +134 -0
  15. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
  16. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +171 -0
  17. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
  18. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
  19. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +108 -79
  20. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  21. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +48 -40
  22. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  23. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  24. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +13 -0
  25. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
  26. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +32 -101
  27. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  28. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +58 -65
  29. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  30. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +120 -1
  31. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  32. package/artifacts/contracts/instance/Instance.sol/Instance.json +72 -79
  33. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
  34. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +22 -22
  35. package/artifacts/contracts/instance/InstanceAdminNew.sol/InstanceAdminNew.dbg.json +4 -0
  36. package/artifacts/contracts/instance/InstanceAdminNew.sol/InstanceAdminNew.json +1676 -0
  37. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +4 -0
  38. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +289 -0
  39. package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +1 -1
  40. package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +70 -46
  41. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  42. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +192 -56
  43. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  44. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +201 -34
  45. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  46. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +41 -17
  47. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
  48. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +248 -108
  49. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
  50. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
  51. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
  52. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.json +0 -53
  53. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +4 -0
  54. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +10 -0
  55. package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +1 -1
  56. package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +2 -71
  57. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  58. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  59. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  60. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  61. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  62. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  63. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
  64. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +4 -0
  65. package/artifacts/contracts/oracle/IOracle.sol/IOracle.json +10 -0
  66. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +4 -0
  67. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +759 -0
  68. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +4 -0
  69. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +675 -0
  70. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +4 -0
  71. package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +1146 -0
  72. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +4 -0
  73. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +1034 -0
  74. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +4 -0
  75. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +730 -0
  76. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
  77. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +78 -49
  78. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  79. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +33 -25
  80. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
  81. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +13 -0
  82. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  83. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
  84. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +13 -0
  85. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
  86. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
  87. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +62 -41
  88. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  89. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +25 -21
  90. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  91. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +66 -37
  92. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  93. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +27 -19
  94. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
  95. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +106 -69
  96. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  97. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +47 -35
  98. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  99. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +13 -0
  100. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
  101. package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +13 -0
  102. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  103. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +13 -0
  104. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
  105. package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +13 -0
  106. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  107. package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +1 -1
  108. package/artifacts/contracts/product/IProductService.sol/IProductService.json +13 -0
  109. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
  110. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +84 -47
  111. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  112. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +36 -24
  113. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
  114. package/artifacts/contracts/product/PricingService.sol/PricingService.json +92 -63
  115. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
  116. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +40 -32
  117. package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
  118. package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +1 -1
  119. package/artifacts/contracts/product/ProductService.sol/ProductService.json +54 -25
  120. package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
  121. package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +21 -13
  122. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  123. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  124. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  125. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +13 -0
  126. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  127. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  128. package/artifacts/contracts/registry/Registry.sol/Registry.json +19 -19
  129. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
  130. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +1678 -153
  131. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  132. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +51 -14
  133. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  134. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +20 -8
  135. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
  136. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +99 -154
  137. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
  138. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +195 -0
  139. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  140. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
  141. package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.dbg.json +1 -1
  142. package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.dbg.json +1 -1
  143. package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.json +42 -10
  144. package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.dbg.json +1 -1
  145. package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.json +42 -10
  146. package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.dbg.json +1 -1
  147. package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.json +52 -20
  148. package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.dbg.json +1 -1
  149. package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.json +52 -20
  150. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
  151. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
  152. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +107 -71
  153. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
  154. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +44 -36
  155. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
  156. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +13 -0
  157. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  158. package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.dbg.json +1 -1
  159. package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.dbg.json +1 -1
  160. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
  161. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
  162. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +20 -0
  163. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
  164. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  165. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  166. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  167. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  168. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  169. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  170. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  171. package/artifacts/contracts/shared/IService.sol/IService.json +13 -0
  172. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  173. package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +1 -1
  174. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
  175. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  176. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +8 -8
  177. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  178. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +6 -6
  179. package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.dbg.json +1 -1
  180. package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +2 -2
  181. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  182. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
  183. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  184. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
  185. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  186. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +2 -2
  187. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  188. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +2 -2
  189. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  190. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
  191. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  192. package/artifacts/contracts/shared/Service.sol/Service.json +13 -0
  193. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  194. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  195. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  196. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
  197. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
  198. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +49 -7
  199. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
  200. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +44 -28
  201. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
  202. package/artifacts/contracts/staking/Staking.sol/Staking.json +44 -84
  203. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
  204. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +23 -39
  205. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
  206. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +6 -6
  207. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
  208. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +92 -73
  209. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
  210. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +33 -41
  211. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
  212. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +186 -114
  213. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
  214. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +18 -18
  215. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  216. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
  217. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  218. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  219. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
  220. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  221. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
  222. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
  223. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
  224. package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
  225. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
  226. package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
  227. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  228. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
  229. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  230. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +125 -2
  231. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  232. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
  233. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
  234. package/artifacts/contracts/type/Referral.sol/ReferralLib.json +4 -4
  235. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +4 -0
  236. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +204 -0
  237. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
  238. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +2 -2
  239. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
  240. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +114 -4
  241. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
  242. package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +4 -0
  243. package/artifacts/contracts/type/Selector.sol/SelectorLib.json +129 -0
  244. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +4 -0
  245. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +10 -0
  246. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
  247. package/artifacts/contracts/type/StateId.sol/StateIdLib.json +2 -2
  248. package/artifacts/contracts/type/String.sol/StrLib.dbg.json +4 -0
  249. package/artifacts/contracts/type/String.sol/StrLib.json +132 -0
  250. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
  251. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +17 -4
  252. package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
  253. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
  254. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
  255. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
  256. package/contracts/authorization/AccessAdmin.sol +749 -0
  257. package/contracts/authorization/IAccess.sol +43 -0
  258. package/contracts/authorization/IAccessAdmin.sol +130 -0
  259. package/contracts/authorization/IModuleAuthorization.sol +27 -0
  260. package/contracts/authorization/IServiceAuthorization.sol +35 -0
  261. package/contracts/authorization/InstanceAdmin.sol +108 -0
  262. package/contracts/authorization/ModuleAuthorization.sol +116 -0
  263. package/contracts/authorization/ServiceAuthorization.sol +86 -0
  264. package/contracts/distribution/DistributionService.sol +3 -4
  265. package/contracts/instance/IInstance.sol +14 -6
  266. package/contracts/instance/IInstanceService.sol +24 -8
  267. package/contracts/instance/Instance.sol +63 -39
  268. package/contracts/instance/InstanceAdminNew.sol +74 -0
  269. package/contracts/instance/InstanceAuthorizationV3.sol +176 -0
  270. package/contracts/instance/InstanceAuthorizationsLib.sol +31 -3
  271. package/contracts/instance/InstanceReader.sol +29 -2
  272. package/contracts/instance/InstanceService.sol +85 -8
  273. package/contracts/instance/InstanceStore.sol +29 -20
  274. package/contracts/instance/base/BalanceStore.sol +11 -6
  275. package/contracts/instance/base/Cloneable.sol +2 -25
  276. package/contracts/instance/base/ObjectCounter.sol +21 -0
  277. package/contracts/instance/base/ObjectManager.sol +1 -3
  278. package/contracts/oracle/IOracle.sol +20 -0
  279. package/contracts/oracle/IOracleComponent.sol +32 -0
  280. package/contracts/oracle/IOracleService.sol +65 -0
  281. package/contracts/oracle/Oracle.sol +145 -0
  282. package/contracts/oracle/OracleService.sol +278 -0
  283. package/contracts/oracle/OracleServiceManager.sol +42 -0
  284. package/contracts/pool/BundleService.sol +19 -19
  285. package/contracts/pool/PoolService.sol +6 -7
  286. package/contracts/product/ApplicationService.sol +5 -5
  287. package/contracts/product/ClaimService.sol +5 -5
  288. package/contracts/product/IClaimService.sol +6 -0
  289. package/contracts/product/PolicyService.sol +5 -5
  290. package/contracts/product/PricingService.sol +5 -6
  291. package/contracts/product/ProductService.sol +5 -5
  292. package/contracts/registry/IRegistry.sol +1 -1
  293. package/contracts/registry/Registry.sol +7 -1
  294. package/contracts/registry/RegistryAdmin.sol +236 -148
  295. package/contracts/registry/RegistryService.sol +5 -5
  296. package/contracts/registry/RegistryServiceManager.sol +0 -5
  297. package/contracts/registry/ReleaseManager.sol +102 -172
  298. package/contracts/registry/ServiceAuthorizationV3.sol +200 -0
  299. package/contracts/shared/AccessManagerCustom.sol +6 -1
  300. package/contracts/shared/AccessManagerExtended.sol +12 -1
  301. package/contracts/shared/Component.sol +3 -0
  302. package/contracts/shared/ComponentService.sol +30 -9
  303. package/contracts/shared/ComponentVerifyingService.sol +13 -7
  304. package/contracts/shared/IComponentService.sol +11 -0
  305. package/contracts/shared/IService.sol +7 -0
  306. package/contracts/shared/Lifecycle.sol +11 -2
  307. package/contracts/shared/Service.sol +27 -21
  308. package/contracts/staking/IStakingService.sol +11 -7
  309. package/contracts/staking/StakeManagerLib.sol +52 -0
  310. package/contracts/staking/Staking.sol +58 -96
  311. package/contracts/staking/StakingService.sol +61 -56
  312. package/contracts/staking/StakingServiceManager.sol +0 -1
  313. package/contracts/staking/StakingStore.sol +79 -38
  314. package/contracts/type/ObjectType.sol +162 -67
  315. package/contracts/type/RequestId.sol +75 -0
  316. package/contracts/type/RoleId.sol +77 -19
  317. package/contracts/type/Selector.sol +102 -0
  318. package/contracts/type/StateId.sol +12 -0
  319. package/contracts/type/String.sol +53 -0
  320. package/contracts/type/Timestamp.sol +6 -2
  321. package/package.json +3 -3
  322. package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.dbg.json +0 -4
  323. package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.json +0 -137
  324. package/contracts/registry/ServiceAuthorizationsLib.sol +0 -173
@@ -9,7 +9,6 @@ import {IRegistryService} from "../registry/IRegistryService.sol";
9
9
  import {IStaking} from "./IStaking.sol";
10
10
  import {IVersionable} from "../shared/IVersionable.sol";
11
11
  import {Key32} from "../type/Key32.sol";
12
- import {KEEP_STATE} from "../type/StateId.sol";
13
12
  import {LibNftIdSet} from "../type/NftIdSet.sol";
14
13
  import {NftId, NftIdLib} from "../type/NftId.sol";
15
14
  import {NftIdSetManager} from "../shared/NftIdSetManager.sol";
@@ -61,22 +60,11 @@ contract Staking is
61
60
  _;
62
61
  }
63
62
 
64
-
65
- // from Versionable
66
- function getVersion()
67
- public
68
- pure
69
- virtual override (IVersionable, Versionable)
70
- returns(Version)
71
- {
72
- return VersionLib.toVersion(GIF_MAJOR_VERSION,0,0);
73
- }
74
-
75
63
  // set/update staking reader
76
64
  function setStakingReader(StakingReader stakingReader)
77
65
  external
78
66
  virtual
79
- onlyOwner
67
+ onlyOwner()
80
68
  {
81
69
  if(stakingReader.getStaking() != IStaking(this)) {
82
70
  revert ErrorStakingStakingReaderStakingMismatch(address(stakingReader.getStaking()));
@@ -90,7 +78,7 @@ contract Staking is
90
78
  function setStakingRate(uint256 chainId, address token, UFixed stakingRate)
91
79
  external
92
80
  virtual
93
- onlyOwner
81
+ onlyOwner()
94
82
  {
95
83
  StakingStorage storage $ = _getStakingStorage();
96
84
 
@@ -104,8 +92,6 @@ contract Staking is
104
92
  emit LogStakingStakingRateSet(chainId, token, oldStakingRate, stakingRate);
105
93
  }
106
94
 
107
- // reward management
108
-
109
95
  // target management
110
96
 
111
97
  function registerTarget(
@@ -117,7 +103,7 @@ contract Staking is
117
103
  )
118
104
  external
119
105
  virtual
120
- // restricted // staking service access
106
+ restricted()
121
107
  {
122
108
  TargetManagerLib.checkTargetParameters(
123
109
  getRegistry(),
@@ -143,7 +129,7 @@ contract Staking is
143
129
  )
144
130
  external
145
131
  virtual
146
- // TODO add restricted // only staking service
132
+ restricted()
147
133
  onlyTarget(targetNftId)
148
134
  {
149
135
  (
@@ -165,7 +151,7 @@ contract Staking is
165
151
  function setRewardRate(NftId targetNftId, UFixed rewardRate)
166
152
  external
167
153
  virtual
168
- // TODO add restricted // only staking service
154
+ restricted()
169
155
  onlyTarget(targetNftId)
170
156
  {
171
157
  (
@@ -185,7 +171,7 @@ contract Staking is
185
171
  function refillRewardReserves(NftId targetNftId, Amount dipAmount)
186
172
  external
187
173
  virtual
188
- // TODO add restricted // only for target locking
174
+ restricted()
189
175
  returns (Amount newBalance)
190
176
  {
191
177
  // update book keeping of reward reserves
@@ -197,8 +183,7 @@ contract Staking is
197
183
  function withdrawRewardReserves(NftId targetNftId, Amount dipAmount)
198
184
  external
199
185
  virtual
200
- // TODO add restricted // only staking service
201
- // onlyNftOwner(targetNftId)
186
+ restricted()
202
187
  returns (Amount newBalance)
203
188
  {
204
189
  // update book keeping of reward reserves
@@ -210,7 +195,7 @@ contract Staking is
210
195
  function increaseTotalValueLocked(NftId targetNftId, address token, Amount amount)
211
196
  external
212
197
  virtual
213
- // restricted() // only pool service
198
+ restricted() // only pool service
214
199
  returns (Amount newBalance)
215
200
  {
216
201
  StakingStorage storage $ = _getStakingStorage();
@@ -223,7 +208,7 @@ contract Staking is
223
208
  function decreaseTotalValueLocked(NftId targetNftId, address token, Amount amount)
224
209
  external
225
210
  virtual
226
- // restricted() // only pool service
211
+ restricted() // only pool service
227
212
  returns (Amount newBalance)
228
213
  {
229
214
  StakingStorage storage $ = _getStakingStorage();
@@ -236,6 +221,7 @@ contract Staking is
236
221
  function registerRemoteTarget(NftId targetNftId, TargetInfo memory targetInfo)
237
222
  external
238
223
  virtual
224
+ restricted()
239
225
  onlyOwner // or CCIP
240
226
  {
241
227
 
@@ -244,6 +230,7 @@ contract Staking is
244
230
  function updateRemoteTvl(NftId targetNftId, address token, Amount amount)
245
231
  external
246
232
  virtual
233
+ restricted()
247
234
  onlyOwner // or CCIP
248
235
  {
249
236
 
@@ -258,7 +245,7 @@ contract Staking is
258
245
  )
259
246
  external
260
247
  virtual
261
- // TODO add restricted() // only staking service
248
+ restricted() // only staking service
262
249
  {
263
250
  StakingStorage storage $ = _getStakingStorage();
264
251
  Timestamp lockedUntil = StakeManagerLib.checkCreateParameters(
@@ -286,51 +273,17 @@ contract Staking is
286
273
  )
287
274
  external
288
275
  virtual
289
- // TODO add restricted() // only staking service
276
+ restricted() // only staking service
290
277
  onlyStake(stakeNftId)
291
278
  returns (Amount stakeBalance)
292
279
  {
293
280
  StakingStorage storage $ = _getStakingStorage();
294
-
295
- // check that target is active for staking
296
- (
297
- UFixed rewardRate,
298
- Seconds lockingPeriod
299
- ) = StakeManagerLib.checkStakeParameters(
300
- $._reader,
301
- stakeNftId);
302
-
303
- // calculate new rewards (if any)
304
- (
305
- Amount rewardIncrementAmount,
306
- Amount currentTotalDipAmount
307
- ) = StakeManagerLib.calculateRewardIncrease(
308
- $._reader,
281
+ stakeBalance = StakeManagerLib.stake(
282
+ getRegistry(),
283
+ $._reader,
284
+ $._store,
309
285
  stakeNftId,
310
- rewardRate);
311
-
312
- stakeBalance = currentTotalDipAmount + stakeAmount;
313
-
314
- // TODO check that additional dip, rewards and rewards increment
315
- // are still ok with max target staking amount
316
- NftId targetNftId = getRegistry().getObjectInfo(stakeNftId).parentNftId;
317
-
318
- $._store.restakeRewards(
319
- stakeNftId,
320
- targetNftId,
321
- rewardIncrementAmount);
322
-
323
- $._store.increaseStake(
324
- stakeNftId,
325
- targetNftId,
326
286
  stakeAmount);
327
-
328
- // update locked until with target locking period
329
- $._store.update(
330
- stakeNftId,
331
- StakeInfo({
332
- lockedUntil: TimestampLib.blockTimestamp().addSeconds(
333
- lockingPeriod)}));
334
287
  }
335
288
 
336
289
 
@@ -340,7 +293,7 @@ contract Staking is
340
293
  )
341
294
  external
342
295
  virtual
343
- // TODO add restricted() // only staking service
296
+ restricted() // only staking service
344
297
  onlyStake(stakeNftId)
345
298
  returns (NftId newStakeNftId)
346
299
  {
@@ -354,7 +307,7 @@ contract Staking is
354
307
  function updateRewards(NftId stakeNftId)
355
308
  external
356
309
  virtual
357
- // TODO add restricted() // only staking service
310
+ restricted() // only staking service
358
311
  onlyStake(stakeNftId)
359
312
  {
360
313
  StakingStorage storage $ = _getStakingStorage();
@@ -365,7 +318,7 @@ contract Staking is
365
318
  function claimRewards(NftId stakeNftId)
366
319
  external
367
320
  virtual
368
- // TODO add restricted() // only staking service
321
+ restricted() // only staking service
369
322
  onlyStake(stakeNftId)
370
323
  returns (
371
324
  Amount rewardsClaimedAmount
@@ -390,7 +343,7 @@ contract Staking is
390
343
  function unstake(NftId stakeNftId)
391
344
  external
392
345
  virtual
393
- // TODO add restricted() // only staking service
346
+ restricted() // only staking service
394
347
  onlyStake(stakeNftId)
395
348
  returns (
396
349
  Amount unstakedAmount,
@@ -419,35 +372,11 @@ contract Staking is
419
372
 
420
373
 
421
374
 
422
- function _updateRewards(
423
- StakingReader reader,
424
- StakingStore store,
425
- NftId stakeNftId
426
- )
427
- internal
428
- virtual
429
- returns (NftId targetNftId)
430
- {
431
- UFixed rewardRate;
432
-
433
- (targetNftId, rewardRate) = reader.getTargetRewardRate(stakeNftId);
434
- (Amount rewardIncrement, ) = StakeManagerLib.calculateRewardIncrease(
435
- reader,
436
- stakeNftId,
437
- rewardRate);
438
-
439
- store.updateRewards(
440
- stakeNftId,
441
- targetNftId,
442
- rewardIncrement);
443
- }
444
-
445
-
446
375
  //--- other functions ---------------------------------------------------//
447
376
 
448
377
  function collectDipAmount(address from, Amount dipAmount)
449
378
  external
450
- // TODO add restricted() // only staking service
379
+ restricted() // only staking service
451
380
  {
452
381
  TokenHandler tokenHandler = getTokenHandler();
453
382
  address stakingWallet = getWallet();
@@ -464,7 +393,7 @@ contract Staking is
464
393
 
465
394
  function transferDipAmount(address to, Amount dipAmount)
466
395
  external
467
- // TODO add restricted() // only staking service
396
+ restricted() // only staking service
468
397
  {
469
398
  TokenHandler tokenHandler = getTokenHandler();
470
399
  address stakingWallet = getWallet();
@@ -493,8 +422,43 @@ contract Staking is
493
422
  return address(_getStakingStorage()._tokenRegistry);
494
423
  }
495
424
 
425
+
426
+ // from Versionable
427
+ function getVersion()
428
+ public
429
+ pure
430
+ virtual override (IVersionable, Versionable)
431
+ returns(Version)
432
+ {
433
+ return VersionLib.toVersion(GIF_MAJOR_VERSION,0,0);
434
+ }
435
+
496
436
  //--- internal functions ------------------------------------------------//
497
437
 
438
+ function _updateRewards(
439
+ StakingReader reader,
440
+ StakingStore store,
441
+ NftId stakeNftId
442
+ )
443
+ internal
444
+ virtual
445
+ returns (NftId targetNftId)
446
+ {
447
+ UFixed rewardRate;
448
+
449
+ (targetNftId, rewardRate) = reader.getTargetRewardRate(stakeNftId);
450
+ (Amount rewardIncrement, ) = StakeManagerLib.calculateRewardIncrease(
451
+ reader,
452
+ stakeNftId,
453
+ rewardRate);
454
+
455
+ store.updateRewards(
456
+ stakeNftId,
457
+ targetNftId,
458
+ rewardIncrement);
459
+ }
460
+
461
+
498
462
  function _initialize(
499
463
  address owner,
500
464
  bytes memory data
@@ -530,7 +494,6 @@ contract Staking is
530
494
 
531
495
  _createAndSetTokenHandler();
532
496
 
533
-
534
497
  // wiring to external contracts
535
498
  StakingStorage storage $ = _getStakingStorage();
536
499
  $._protocolNftId = getRegistry().getProtocolNftId();
@@ -547,5 +510,4 @@ contract Staking is
547
510
  $.slot := STAKING_LOCATION_V1
548
511
  }
549
512
  }
550
-
551
513
  }
@@ -45,29 +45,6 @@ contract StakingService is
45
45
  _;
46
46
  }
47
47
 
48
- function getDomain() public pure override returns(ObjectType) {
49
- return STAKING();
50
- }
51
-
52
-
53
- function registerProtocolTarget()
54
- external
55
- virtual
56
- {
57
- uint256 protocolId = ChainNft(
58
- getRegistry().getChainNftAddress()).PROTOCOL_NFT_ID();
59
-
60
- NftId protocolNftId = NftIdLib.toNftId(protocolId);
61
- _getStakingServiceStorage()._staking.registerTarget(
62
- protocolNftId,
63
- PROTOCOL(),
64
- 1, // protocol is registered on mainnet
65
- TargetManagerLib.getDefaultLockingPeriod(),
66
- TargetManagerLib.getDefaultRewardRate());
67
-
68
- emit LogStakingServiceProtocolTargetRegistered(protocolNftId);
69
- }
70
-
71
48
 
72
49
  function createInstanceTarget(
73
50
  NftId targetNftId,
@@ -76,7 +53,7 @@ contract StakingService is
76
53
  )
77
54
  external
78
55
  virtual
79
- // restricted // TODO re-enable once services have stable roles
56
+ restricted()
80
57
  {
81
58
  uint256 chainId = block.chainid;
82
59
  _getStakingServiceStorage()._staking.registerTarget(
@@ -90,66 +67,66 @@ contract StakingService is
90
67
  }
91
68
 
92
69
 
93
- function setLockingPeriod(NftId targetNftId, Seconds lockingPeriod)
70
+ function setInstanceLockingPeriod(NftId instanceNftId, Seconds lockingPeriod)
94
71
  external
95
72
  virtual
96
- onlyNftOwner(targetNftId)
73
+ restricted()
97
74
  {
98
75
  _getStakingServiceStorage()._staking.setLockingPeriod(
99
- targetNftId, lockingPeriod);
76
+ instanceNftId,
77
+ lockingPeriod);
100
78
  }
101
79
 
102
80
 
103
- function setRewardRate(NftId targetNftId, UFixed rewardRate)
81
+ function setInstanceRewardRate(NftId instanceNftId, UFixed rewardRate)
104
82
  external
105
83
  virtual
106
- onlyNftOwner(targetNftId)
84
+ restricted()
107
85
  {
108
86
  _getStakingServiceStorage()._staking.setRewardRate(
109
- targetNftId, rewardRate);
110
-
87
+ instanceNftId,
88
+ rewardRate);
111
89
  }
112
90
 
113
91
 
114
- function refillRewardReserves(NftId targetNftId, Amount dipAmount)
92
+ function refillInstanceRewardReserves(NftId instanceNftId, address rewardProvider, Amount dipAmount)
115
93
  external
116
94
  virtual
95
+ restricted()
117
96
  returns (Amount newBalance)
118
97
  {
119
- address rewardProvider = msg.sender;
98
+ return _refillRewardReserves(instanceNftId, rewardProvider, dipAmount);
99
+ }
120
100
 
121
- // update reward reserve book keeping
122
- StakingServiceStorage storage $ = _getStakingServiceStorage();
123
- newBalance = $._staking.refillRewardReserves(targetNftId, dipAmount);
124
101
 
125
- // collect reward dip from provider
126
- $._staking.collectDipAmount(
127
- rewardProvider,
128
- dipAmount);
129
-
130
- emit LogStakingServiceRewardReservesIncreased(targetNftId, rewardProvider, dipAmount, newBalance);
102
+ function refillRewardReservesBySender(NftId targetNftId, Amount dipAmount)
103
+ external
104
+ virtual
105
+ restricted()
106
+ returns (Amount newBalance)
107
+ {
108
+ address rewardProvider = msg.sender;
109
+ return _refillRewardReserves(targetNftId, rewardProvider, dipAmount);
131
110
  }
132
111
 
133
112
 
134
- function withdrawRewardReserves(NftId targetNftId, Amount dipAmount)
113
+ function withdrawInstanceRewardReserves(NftId instanceNftId, Amount dipAmount)
135
114
  external
136
115
  virtual
137
- onlyNftOwner(targetNftId)
116
+ restricted()
138
117
  returns (Amount newBalance)
139
118
  {
140
- // modifyier checks that sender is owner
141
- address targetOwner = msg.sender;
142
-
143
119
  // update reward reserve book keeping
144
120
  StakingServiceStorage storage $ = _getStakingServiceStorage();
145
- newBalance = $._staking.withdrawRewardReserves(targetNftId, dipAmount);
121
+ newBalance = $._staking.withdrawRewardReserves(instanceNftId, dipAmount);
146
122
 
147
123
  // transfer withdrawal amount to target owner
124
+ address instanceOwner = getRegistry().ownerOf(instanceNftId);
148
125
  $._staking.transferDipAmount(
149
- targetOwner,
126
+ instanceOwner,
150
127
  dipAmount);
151
128
 
152
- emit LogStakingServiceRewardReservesDecreased(targetNftId, targetOwner, dipAmount, newBalance);
129
+ emit LogStakingServiceRewardReservesDecreased(instanceNftId, instanceOwner, dipAmount, newBalance);
153
130
  }
154
131
 
155
132
 
@@ -165,7 +142,7 @@ contract StakingService is
165
142
  )
166
143
  external
167
144
  virtual
168
- // restricted // TODO re-enable once services have stable roles
145
+ restricted()
169
146
  returns (
170
147
  NftId stakeNftId
171
148
  )
@@ -207,7 +184,7 @@ contract StakingService is
207
184
  )
208
185
  external
209
186
  virtual
210
- // restricted // TODO re-enable once services have stable roles
187
+ restricted()
211
188
  onlyNftOwner(stakeNftId)
212
189
  {
213
190
  StakingServiceStorage storage $ = _getStakingServiceStorage();
@@ -235,7 +212,7 @@ contract StakingService is
235
212
  )
236
213
  external
237
214
  virtual
238
- // restricted // TODO re-enable once services have stable roles
215
+ restricted()
239
216
  onlyNftOwner(stakeNftId)
240
217
  returns (
241
218
  NftId newStakeNftId
@@ -250,7 +227,8 @@ contract StakingService is
250
227
  NftId stakeNftId
251
228
  )
252
229
  external
253
- // restricted // TODO re-enable once services have stable roles
230
+ virtual
231
+ restricted()
254
232
  {
255
233
  StakingServiceStorage storage $ = _getStakingServiceStorage();
256
234
  $._staking.updateRewards(stakeNftId);
@@ -262,7 +240,7 @@ contract StakingService is
262
240
  function claimRewards(NftId stakeNftId)
263
241
  external
264
242
  virtual
265
- // restricted // TODO re-enable once services have stable roles
243
+ restricted()
266
244
  onlyNftOwner(stakeNftId)
267
245
  {
268
246
  StakingServiceStorage storage $ = _getStakingServiceStorage();
@@ -280,7 +258,7 @@ contract StakingService is
280
258
  function unstake(NftId stakeNftId)
281
259
  external
282
260
  virtual
283
- // restricted // TODO re-enable once services have stable roles
261
+ restricted()
284
262
  onlyNftOwner(stakeNftId)
285
263
  {
286
264
  StakingServiceStorage storage $ = _getStakingServiceStorage();
@@ -307,10 +285,13 @@ contract StakingService is
307
285
  )
308
286
  external
309
287
  virtual
288
+ restricted()
310
289
  {
290
+ // TODO implement
311
291
 
312
292
  }
313
293
 
294
+ //--- view functions ----------------------------------------------------//
314
295
 
315
296
  function getDipToken()
316
297
  external
@@ -338,6 +319,7 @@ contract StakingService is
338
319
  return _getStakingServiceStorage()._staking;
339
320
  }
340
321
 
322
+ //--- internal functions ------------------------------------------------//
341
323
 
342
324
  function _initialize(
343
325
  address owner,
@@ -398,9 +380,32 @@ contract StakingService is
398
380
  }
399
381
 
400
382
 
383
+ function _refillRewardReserves(NftId targetNftId, address rewardProvider, Amount dipAmount)
384
+ internal
385
+ virtual
386
+ returns (Amount newBalance)
387
+ {
388
+ // update reward reserve book keeping
389
+ StakingServiceStorage storage $ = _getStakingServiceStorage();
390
+ newBalance = $._staking.refillRewardReserves(targetNftId, dipAmount);
391
+
392
+ // collect reward dip from provider
393
+ $._staking.collectDipAmount(
394
+ rewardProvider,
395
+ dipAmount);
396
+
397
+ emit LogStakingServiceRewardReservesIncreased(targetNftId, rewardProvider, dipAmount, newBalance);
398
+ }
399
+
400
+
401
401
  function _getStakingServiceStorage() private pure returns (StakingServiceStorage storage $) {
402
402
  assembly {
403
403
  $.slot := STAKING_SERVICE_LOCATION_V1
404
404
  }
405
405
  }
406
+
407
+
408
+ function _getDomain() internal pure override returns(ObjectType) {
409
+ return STAKING();
410
+ }
406
411
  }
@@ -31,7 +31,6 @@ contract StakingServiceManager is
31
31
  salt);
32
32
 
33
33
  _stakingService = StakingService(address(versionable));
34
- _stakingService.registerProtocolTarget();
35
34
  }
36
35
 
37
36
  //--- view functions ----------------------------------------------------//