@etherisc/gif-next 0.0.2-bc11089-132 → 0.0.2-bca28f1-161

Sign up to get free protection for your applications and to get access to all the features.
Files changed (286) hide show
  1. package/README.md +73 -1
  2. package/artifacts/contracts/components/Component.sol/Component.dbg.json +4 -0
  3. package/artifacts/contracts/components/Component.sol/Component.json +897 -0
  4. package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
  5. package/artifacts/contracts/components/Distribution.sol/Distribution.json +896 -235
  6. package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +4 -0
  7. package/artifacts/contracts/components/{BaseComponent.sol/BaseComponent.json → IComponent.sol/IComponent.json} +137 -86
  8. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  9. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +798 -0
  10. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  11. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +662 -43
  12. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  13. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +661 -5
  14. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  15. package/artifacts/contracts/components/Pool.sol/Pool.json +603 -204
  16. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  17. package/artifacts/contracts/components/Product.sol/Product.json +529 -122
  18. package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +1 -1
  19. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +1 -1
  20. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +1 -1
  21. package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +1 -1
  22. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +1 -1
  23. package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +1 -1
  24. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +1 -1
  25. package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +1 -1
  26. package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +1 -1
  27. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +1 -1
  28. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +1 -1
  29. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +1 -1
  30. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +1 -1
  31. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +1 -1
  32. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +2 -2
  33. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +1 -1
  34. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +1 -1
  35. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +1 -1
  36. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +1 -1
  37. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +1 -1
  38. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +1 -1
  39. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
  40. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +38 -62
  41. package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
  42. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  43. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +706 -56
  44. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  45. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +152 -19
  46. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  47. package/artifacts/contracts/instance/Instance.sol/Instance.json +560 -272
  48. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
  49. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +103 -176
  50. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  51. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +61 -97
  52. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  53. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +460 -191
  54. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  55. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +187 -85
  56. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
  57. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +8 -32
  58. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +4 -0
  59. package/artifacts/contracts/{shared/RegisterableUpgradable.sol/RegisterableUpgradable.json → instance/base/ComponentService.sol/ComponentService.json} +321 -9
  60. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  61. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  62. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  63. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +2 -2
  64. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  65. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +2 -2
  66. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  67. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +24 -13
  68. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  69. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  70. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  71. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  72. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
  73. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
  74. package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.dbg.json +4 -0
  75. package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +1117 -0
  76. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
  77. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +495 -100
  78. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  79. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +172 -26
  80. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
  81. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +554 -62
  82. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  83. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +197 -23
  84. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +4 -0
  85. package/artifacts/contracts/instance/{base/ComponentServiceBase.sol/ComponentServiceBase.json → service/IApplicationService.sol/IApplicationService.json} +221 -104
  86. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
  87. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +181 -52
  88. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  89. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +229 -19
  90. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  91. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +152 -32
  92. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
  93. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +32 -19
  94. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
  95. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +32 -19
  96. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
  97. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +481 -87
  98. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  99. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +203 -25
  100. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
  101. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +301 -62
  102. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  103. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +169 -23
  104. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
  105. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +301 -62
  106. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
  107. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +169 -15
  108. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  109. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
  110. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  111. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +225 -133
  112. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  113. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +185 -77
  114. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  115. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  116. package/artifacts/contracts/registry/Registry.sol/Registry.json +238 -235
  117. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +4 -0
  118. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +285 -0
  119. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  120. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +243 -129
  121. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  122. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +181 -97
  123. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +4 -0
  124. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +547 -0
  125. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  126. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +150 -29
  127. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
  128. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  129. package/artifacts/contracts/shared/ERC165.sol/ERC165.json +41 -3
  130. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  131. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +37 -0
  132. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
  133. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +129 -0
  134. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  135. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +18 -5
  136. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
  137. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.json +69 -0
  138. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  139. package/artifacts/contracts/shared/IService.sol/IService.json +32 -19
  140. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  141. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +2 -2
  142. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  143. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +156 -11
  144. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
  145. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +269 -0
  146. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  147. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +156 -6
  148. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  149. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +152 -11
  150. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
  151. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +105 -0
  152. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  153. package/artifacts/contracts/shared/Service.sol/Service.json +178 -19
  154. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  155. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  156. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
  157. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  158. package/artifacts/contracts/shared/Versionable.sol/Versionable.json +2 -2
  159. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
  160. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
  161. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +152 -11
  162. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
  163. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +2 -2
  164. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
  165. package/artifacts/contracts/test/TestService.sol/TestService.json +196 -37
  166. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
  167. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
  168. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
  169. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +8 -8
  170. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
  171. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  172. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  173. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  174. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  175. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +2 -2
  176. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
  177. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
  178. package/artifacts/contracts/types/Key32.sol/Key32Lib.json +2 -2
  179. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  180. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +2 -2
  181. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  182. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
  183. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
  184. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  185. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
  186. package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
  187. package/artifacts/contracts/types/Referral.sol/ReferralLib.json +2 -2
  188. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
  189. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +2 -2
  190. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
  191. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
  192. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
  193. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
  194. package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
  195. package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
  196. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
  197. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
  198. package/contracts/components/Component.sol +236 -0
  199. package/contracts/components/Distribution.sol +209 -64
  200. package/contracts/components/IComponent.sol +50 -0
  201. package/contracts/components/IDistributionComponent.sol +59 -3
  202. package/contracts/components/IPoolComponent.sol +50 -29
  203. package/contracts/components/IProductComponent.sol +7 -3
  204. package/contracts/components/Pool.sol +135 -152
  205. package/contracts/components/Product.sol +103 -117
  206. package/contracts/instance/BundleManager.sol +7 -11
  207. package/contracts/instance/IInstance.sol +35 -11
  208. package/contracts/instance/IInstanceService.sol +23 -2
  209. package/contracts/instance/Instance.sol +67 -62
  210. package/contracts/instance/InstanceAccessManager.sol +31 -38
  211. package/contracts/instance/InstanceReader.sol +3 -25
  212. package/contracts/instance/InstanceService.sol +198 -56
  213. package/contracts/instance/InstanceServiceManager.sol +5 -8
  214. package/contracts/instance/ObjectManager.sol +7 -24
  215. package/contracts/instance/base/ComponentService.sol +134 -0
  216. package/contracts/instance/module/IAccess.sol +4 -5
  217. package/contracts/instance/module/ISetup.sol +5 -4
  218. package/contracts/instance/service/ApplicationService.sol +268 -0
  219. package/contracts/instance/service/BundleService.sol +52 -14
  220. package/contracts/instance/service/BundleServiceManager.sol +5 -8
  221. package/contracts/instance/service/DistributionService.sol +208 -49
  222. package/contracts/instance/service/DistributionServiceManager.sol +6 -9
  223. package/contracts/instance/service/IApplicationService.sol +82 -0
  224. package/contracts/instance/service/IBundleService.sol +12 -3
  225. package/contracts/instance/service/IDistributionService.sol +53 -0
  226. package/contracts/instance/service/IPolicyService.sol +17 -16
  227. package/contracts/instance/service/PolicyService.sol +148 -132
  228. package/contracts/instance/service/PoolService.sol +27 -42
  229. package/contracts/instance/service/PoolServiceManager.sol +5 -8
  230. package/contracts/instance/service/ProductService.sol +100 -40
  231. package/contracts/registry/ChainNft.sol +1 -1
  232. package/contracts/registry/IRegistry.sol +37 -19
  233. package/contracts/registry/IRegistryService.sol +30 -13
  234. package/contracts/registry/Registry.sol +233 -217
  235. package/contracts/registry/RegistryAccessManager.sol +216 -0
  236. package/contracts/registry/RegistryService.sol +81 -162
  237. package/contracts/registry/RegistryServiceManager.sol +18 -36
  238. package/contracts/registry/ReleaseManager.sol +331 -0
  239. package/contracts/registry/TokenRegistry.sol +11 -9
  240. package/contracts/shared/ERC165.sol +12 -11
  241. package/contracts/shared/INftOwnable.sol +12 -6
  242. package/contracts/shared/IPolicyHolder.sol +26 -0
  243. package/contracts/shared/IRegisterable.sol +4 -6
  244. package/contracts/shared/IRegistryLinked.sol +15 -0
  245. package/contracts/shared/IService.sol +2 -1
  246. package/contracts/shared/IVersionable.sol +2 -2
  247. package/contracts/shared/NftOwnable.sol +113 -57
  248. package/contracts/shared/PolicyHolder.sol +81 -0
  249. package/contracts/shared/ProxyManager.sol +6 -5
  250. package/contracts/shared/Registerable.sol +15 -24
  251. package/contracts/shared/RegistryLinked.sol +64 -0
  252. package/contracts/shared/Service.sol +18 -13
  253. package/contracts/shared/Versionable.sol +3 -2
  254. package/contracts/test/TestRegisterable.sol +1 -1
  255. package/contracts/test/TestService.sol +4 -3
  256. package/contracts/types/DistributorType.sol +2 -2
  257. package/contracts/types/ObjectType.sol +6 -2
  258. package/contracts/types/RoleId.sol +4 -5
  259. package/package.json +3 -3
  260. package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +0 -4
  261. package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +0 -4
  262. package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.json +0 -384
  263. package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
  264. package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +0 -1206
  265. package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
  266. package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.json +0 -448
  267. package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.dbg.json +0 -4
  268. package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.json +0 -763
  269. package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +0 -4
  270. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
  271. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +0 -113
  272. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +0 -4
  273. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +0 -827
  274. package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +0 -4
  275. package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.json +0 -466
  276. package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.dbg.json +0 -4
  277. package/contracts/components/BaseComponent.sol +0 -148
  278. package/contracts/components/IBaseComponent.sol +0 -32
  279. package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +0 -23
  280. package/contracts/instance/IInstanceBase.sol +0 -26
  281. package/contracts/instance/InstanceBase.sol +0 -41
  282. package/contracts/instance/base/ComponentServiceBase.sol +0 -72
  283. package/contracts/instance/base/IInstanceBase.sol +0 -23
  284. package/contracts/instance/service/ComponentOwnerService.sol +0 -317
  285. package/contracts/instance/service/IComponentOwnerService.sol +0 -20
  286. package/contracts/shared/RegisterableUpgradable.sol +0 -16
@@ -1,48 +1,51 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
- import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
5
- import {ShortString, ShortStrings} from "@openzeppelin/contracts/utils/ShortStrings.sol";
6
- import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
7
4
  import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
8
5
 
9
- import {IAccess} from "./module/IAccess.sol";
10
- import {IBundle} from "./module/IBundle.sol";
11
- import {IPolicy} from "./module/IPolicy.sol";
12
- import {IRisk} from "./module/IRisk.sol";
13
- import {ISetup} from "./module/ISetup.sol";
14
6
  import {Key32, KeyId, Key32Lib} from "../types/Key32.sol";
15
- import {KeyValueStore} from "./base/KeyValueStore.sol";
16
- import {IInstance} from "./IInstance.sol";
17
- import {InstanceReader} from "./InstanceReader.sol";
18
- import {InstanceAccessManager} from "./InstanceAccessManager.sol";
19
- import {BundleManager} from "./BundleManager.sol";
20
7
  import {NftId} from "../types/NftId.sol";
21
8
  import {NumberId} from "../types/NumberId.sol";
22
- import {ObjectType, BUNDLE, DISTRIBUTION, INSTANCE, POLICY, POOL, ROLE, PRODUCT, TARGET} from "../types/ObjectType.sol";
9
+ import {ObjectType, BUNDLE, DISTRIBUTION, INSTANCE, POLICY, POOL, ROLE, PRODUCT, TARGET, COMPONENT, DISTRIBUTOR, DISTRIBUTOR_TYPE} from "../types/ObjectType.sol";
23
10
  import {RiskId, RiskIdLib} from "../types/RiskId.sol";
24
11
  import {RoleId, RoleIdLib} from "../types/RoleId.sol";
25
12
  import {StateId, ACTIVE} from "../types/StateId.sol";
26
13
  import {TimestampLib} from "../types/Timestamp.sol";
14
+ import {VersionPart} from "../types/Version.sol";
15
+
27
16
  import {ERC165} from "../shared/ERC165.sol";
28
17
  import {Registerable} from "../shared/Registerable.sol";
29
- import {ComponentOwnerService} from "./service/ComponentOwnerService.sol";
30
- import {IComponentOwnerService} from "./service/IComponentOwnerService.sol";
18
+
19
+ import {IInstance} from "./IInstance.sol";
20
+ import {InstanceReader} from "./InstanceReader.sol";
21
+ import {InstanceAccessManager} from "./InstanceAccessManager.sol";
22
+ import {BundleManager} from "./BundleManager.sol";
23
+
24
+ import {KeyValueStore} from "./base/KeyValueStore.sol";
25
+
26
+ import {IAccess} from "./module/IAccess.sol";
27
+ import {IBundle} from "./module/IBundle.sol";
28
+ import {IDistribution} from "./module/IDistribution.sol";
29
+ import {IPolicy} from "./module/IPolicy.sol";
30
+ import {IRisk} from "./module/IRisk.sol";
31
+ import {ISetup} from "./module/ISetup.sol";
32
+
31
33
  import {IDistributionService} from "./service/IDistributionService.sol";
32
34
  import {IPoolService} from "./service/IPoolService.sol";
33
35
  import {IProductService} from "./service/IProductService.sol";
34
36
  import {IPolicyService} from "./service/IPolicyService.sol";
35
37
  import {IBundleService} from "./service/IBundleService.sol";
36
- import {VersionPart} from "../types/Version.sol";
37
- import {InstanceBase} from "./InstanceBase.sol";
38
+ import {VersionPart, VersionPartLib} from "../types/Version.sol";
38
39
 
39
40
  contract Instance is
40
- AccessManagedUpgradeable,
41
41
  IInstance,
42
- // Initializable,
43
- InstanceBase
42
+ AccessManagedUpgradeable,
43
+ Registerable,
44
+ KeyValueStore
44
45
  {
45
46
 
47
+ uint256 public constant GIF_MAJOR_VERSION = 3;
48
+
46
49
  uint64 public constant ADMIN_ROLE = type(uint64).min;
47
50
  uint64 public constant PUBLIC_ROLE = type(uint64).max;
48
51
  uint64 public constant CUSTOM_ROLE_ID_MIN = 10000;
@@ -57,18 +60,12 @@ contract Instance is
57
60
 
58
61
  function initialize(address accessManagerAddress, address registryAddress, NftId registryNftId, address initialOwner)
59
62
  public
60
- initializer
63
+ initializer()
61
64
  {
62
- require(!_initialized, "Contract instance has already been initialized");
63
-
64
65
  __AccessManaged_init(accessManagerAddress);
65
-
66
- _accessManager = InstanceAccessManager(accessManagerAddress);
67
66
 
68
- _initializeRegisterable(registryAddress, registryNftId, INSTANCE(), false, initialOwner, "");
69
-
70
- _registerInterface(type(IInstance).interfaceId);
71
- _initialized = true;
67
+ initializeRegisterable(registryAddress, registryNftId, INSTANCE(), false, initialOwner, "");
68
+ registerInterface(type(IInstance).interfaceId);
72
69
  }
73
70
 
74
71
  //--- ProductSetup ------------------------------------------------------//
@@ -110,43 +107,43 @@ contract Instance is
110
107
  updateState(_toNftKey32(poolNftId, POOL()), newState);
111
108
  }
112
109
 
113
- //--- DistributorType ---------------------------------------------------//
114
- function createDistributorType(NftId policyNftId, NumberId payoutId, IPolicy.PayoutInfo memory payout) external restricted() {
115
- create(toPolicyKey32(policyNftId), abi.encode(payout));
110
+ //--- DistributorType -------------------------------------------------------//
111
+ function createDistributorType(Key32 distributorKey, IDistribution.DistributorTypeInfo memory info) external restricted() {
112
+ create(distributorKey, abi.encode(info));
116
113
  }
117
114
 
118
- function updateDistributorType(NftId policyNftId, NumberId payoutId, IPolicy.PayoutInfo memory payout, StateId newState) external restricted() {
119
- update(toPolicyKey32(policyNftId), abi.encode(payout), newState);
115
+ function updateDistributorType(Key32 distributorKey, IDistribution.DistributorTypeInfo memory info, StateId newState) external restricted() {
116
+ update(distributorKey, abi.encode(info), newState);
120
117
  }
121
118
 
122
- function updateDistributorTypeState(NftId policyNftId, StateId newState) external restricted() {
123
- updateState(toPolicyKey32(policyNftId), newState);
119
+ function updateDistributorTypeState(Key32 distributorKey, StateId newState) external restricted() {
120
+ updateState(distributorKey, newState);
124
121
  }
125
122
 
126
123
  //--- Distributor -------------------------------------------------------//
127
- function createDistributor(NftId policyNftId, NumberId payoutId, IPolicy.PayoutInfo memory payout) external restricted() {
128
- create(toPolicyKey32(policyNftId), abi.encode(payout));
124
+ function createDistributor(NftId nftId, IDistribution.DistributorInfo memory info) external restricted() {
125
+ create(toDistributorKey32(nftId), abi.encode(info));
129
126
  }
130
127
 
131
- function updateDistributor(NftId policyNftId, NumberId payoutId, IPolicy.PayoutInfo memory payout, StateId newState) external restricted() {
132
- update(toPolicyKey32(policyNftId), abi.encode(payout), newState);
128
+ function updateDistributor(NftId nftId, IDistribution.DistributorInfo memory info, StateId newState) external restricted() {
129
+ update(toDistributorKey32(nftId), abi.encode(info), newState);
133
130
  }
134
131
 
135
- function updateDistributorState(NftId policyNftId, StateId newState) external restricted() {
136
- updateState(toPolicyKey32(policyNftId), newState);
132
+ function updateDistributorState(NftId nftId, StateId newState) external restricted() {
133
+ updateState(toDistributorKey32(nftId), newState);
137
134
  }
138
135
 
139
136
  //--- Referral ----------------------------------------------------------//
140
- function createReferral(NftId policyNftId, NumberId payoutId, IPolicy.PayoutInfo memory payout) external restricted() {
141
- create(toPolicyKey32(policyNftId), abi.encode(payout));
137
+ function createReferral(Key32 referralKey, IDistribution.ReferralInfo memory referralInfo) external restricted() {
138
+ create(referralKey, abi.encode(referralInfo));
142
139
  }
143
140
 
144
- function updateReferral(NftId policyNftId, NumberId payoutId, IPolicy.PayoutInfo memory payout, StateId newState) external restricted() {
145
- update(toPolicyKey32(policyNftId), abi.encode(payout), newState);
141
+ function updateReferral(Key32 referralKey, IDistribution.ReferralInfo memory referralInfo, StateId newState) external restricted() {
142
+ update(referralKey, abi.encode(referralInfo), newState);
146
143
  }
147
144
 
148
- function updateReferralState(NftId policyNftId, StateId newState) external restricted() {
149
- updateState(toPolicyKey32(policyNftId), newState);
145
+ function updateReferralState(Key32 referralKey, StateId newState) external restricted() {
146
+ updateState(referralKey, newState);
150
147
  }
151
148
 
152
149
  //--- Bundle ------------------------------------------------------------//
@@ -227,46 +224,54 @@ contract Instance is
227
224
  return policyNftId.toKey32(POLICY());
228
225
  }
229
226
 
230
- function getComponentOwnerService() external view returns (IComponentOwnerService) {
231
- return ComponentOwnerService(_registry.getServiceAddress("ComponentOwnerService", VersionPart.wrap(3)));
227
+ function toDistributionKey32(NftId distNftId) public pure returns (Key32) {
228
+ return distNftId.toKey32(DISTRIBUTION());
229
+ }
230
+
231
+ function toDistributorTypeKey32(NftId distNftId) public pure returns (Key32) {
232
+ return distNftId.toKey32(DISTRIBUTOR_TYPE());
232
233
  }
233
234
 
235
+ function toDistributorKey32(NftId distNftId) public pure returns (Key32) {
236
+ return distNftId.toKey32(DISTRIBUTOR());
237
+ }
238
+
234
239
  function getDistributionService() external view returns (IDistributionService) {
235
- return IDistributionService(_registry.getServiceAddress("DistributionService", VersionPart.wrap(3)));
240
+ return IDistributionService(getRegistry().getServiceAddress(DISTRIBUTION(), VersionPart.wrap(3)));
236
241
  }
237
242
 
238
243
  function getProductService() external view returns (IProductService) {
239
- return IProductService(_registry.getServiceAddress("ProductService", VersionPart.wrap(3)));
244
+ return IProductService(getRegistry().getServiceAddress(PRODUCT(), VersionPart.wrap(3)));
240
245
  }
241
246
 
242
247
  function getPoolService() external view returns (IPoolService) {
243
- return IPoolService(_registry.getServiceAddress("PoolService", VersionPart.wrap(3)));
248
+ return IPoolService(getRegistry().getServiceAddress(POOL(), VersionPart.wrap(3)));
244
249
  }
245
250
 
246
251
  function getPolicyService() external view returns (IPolicyService) {
247
- return IPolicyService(_registry.getServiceAddress("PolicyService", VersionPart.wrap(3)));
252
+ return IPolicyService(getRegistry().getServiceAddress(POLICY(), VersionPart.wrap(3)));
248
253
  }
249
254
 
250
255
  function getBundleService() external view returns (IBundleService) {
251
- return IBundleService(_registry.getServiceAddress("BundleService", VersionPart.wrap(3)));
252
- }
253
-
254
- function getInstanceAccessManager() external view returns (InstanceAccessManager) {
255
- return _accessManager;
256
+ return IBundleService(getRegistry().getServiceAddress(BUNDLE(), VersionPart.wrap(3)));
256
257
  }
257
258
 
258
259
  function setInstanceReader(InstanceReader instanceReader) external restricted() {
259
- require(instanceReader.getInstanceNftId() == getNftId(), "NFT ID of InstanceReader does not match");
260
+ require(instanceReader.getInstance() == Instance(this), "InstanceReader instance mismatch");
260
261
  _instanceReader = instanceReader;
261
262
  }
262
263
 
264
+ function getMajorVersion() external pure returns (VersionPart majorVersion) {
265
+ return VersionPartLib.toVersionPart(GIF_MAJOR_VERSION);
266
+ }
267
+
263
268
  function getInstanceReader() external view returns (InstanceReader) {
264
269
  return _instanceReader;
265
270
  }
266
271
 
267
272
  function setBundleManager(BundleManager bundleManager) external restricted() {
268
273
  require(address(_bundleManager) == address(0), "BundleManager is set");
269
- require(bundleManager.getInstanceNftId() == getNftId(), "NFT ID of BundleManager does not match");
274
+ require(bundleManager.getInstance() == Instance(this), "BundleManager instance mismatch");
270
275
  _bundleManager = bundleManager;
271
276
  }
272
277
 
@@ -1,12 +1,12 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
+ import {AccessManager} from "@openzeppelin/contracts/access/manager/AccessManager.sol";
5
+ import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
4
6
  import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
5
7
  import {ShortString, ShortStrings} from "@openzeppelin/contracts/utils/ShortStrings.sol";
6
- import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
7
8
 
8
- import {AccessManagerUpgradeableInitializeable} from "../../contracts/instance/AccessManagerUpgradeableInitializeable.sol";
9
- import {RoleId, RoleIdLib, DISTRIBUTION_OWNER_ROLE, POOL_OWNER_ROLE, PRODUCT_OWNER_ROLE, DISTRIBUTION_SERVICE_ROLE, POOL_SERVICE_ROLE, PRODUCT_SERVICE_ROLE, POLICY_SERVICE_ROLE, BUNDLE_SERVICE_ROLE, INSTANCE_SERVICE_ROLE } from "../types/RoleId.sol";
9
+ import {RoleId, RoleIdLib } from "../types/RoleId.sol";
10
10
  import {TimestampLib} from "../types/Timestamp.sol";
11
11
  import {IAccess} from "./module/IAccess.sol";
12
12
 
@@ -32,35 +32,19 @@ contract InstanceAccessManager is
32
32
  mapping(ShortString name => address target) internal _targetForName;
33
33
  address [] internal _targets;
34
34
 
35
- AccessManagerUpgradeableInitializeable internal _accessManager;
35
+ AccessManager internal _accessManager;
36
36
 
37
- function __InstanceAccessManager_initialize(address initialAdmin) external initializer
37
+ function initialize(address initialAdmin) external initializer
38
38
  {
39
39
  // if size of the contract gets too large, this can be externalized which will reduce the contract size considerably
40
- _accessManager = new AccessManagerUpgradeableInitializeable();
41
- // this service required adin rights to access manager to be able to grant/revoke roles
42
- _accessManager.__AccessManagerUpgradeableInitializeable_init(address(this));
40
+ _accessManager = new AccessManager(address(this));
41
+ // this service required admin rights to access manager to be able to grant/revoke roles
43
42
  _accessManager.grantRole(_accessManager.ADMIN_ROLE(), initialAdmin, 0);
44
43
 
45
44
  __AccessManaged_init(address(_accessManager));
46
45
 
47
46
  _createRole(RoleIdLib.toRoleId(_accessManager.ADMIN_ROLE()), ADMIN_ROLE_NAME, false, false);
48
47
  _createRole(RoleIdLib.toRoleId(_accessManager.PUBLIC_ROLE()), PUBLIC_ROLE_NAME, false, false);
49
-
50
- createDefaultGifRoles();
51
- }
52
-
53
- function createDefaultGifRoles() public restricted() {
54
- _createRole(DISTRIBUTION_OWNER_ROLE(), "DistributionOwnerRole", false, true);
55
- _createRole(POOL_OWNER_ROLE(), "PoolOwnerRole", false, true);
56
- _createRole(PRODUCT_OWNER_ROLE(), "ProductOwnerRole", false, true);
57
-
58
- _createRole(DISTRIBUTION_SERVICE_ROLE(), "DistributionServiceRole", false, true);
59
- _createRole(POOL_SERVICE_ROLE(), "PoolServiceRole", false, true);
60
- _createRole(PRODUCT_SERVICE_ROLE(), "ProductServiceRole", false, true);
61
- _createRole(POLICY_SERVICE_ROLE(), "PolicyServiceRole", false, true);
62
- _createRole(BUNDLE_SERVICE_ROLE(), "BundleServiceRole", false, true);
63
- _createRole(INSTANCE_SERVICE_ROLE(), "InstanceServiceRole", false, true);
64
48
  }
65
49
 
66
50
  //--- Role ------------------------------------------------------//
@@ -74,7 +58,7 @@ contract InstanceAccessManager is
74
58
 
75
59
  function setRoleLocked(RoleId roleId, bool locked) external restricted() {
76
60
  if (!roleExists(roleId)) {
77
- revert IAccess.ErrorIAccessSetLockedForNonexstentRole(roleId);
61
+ revert IAccess.ErrorIAccessRoleIdInvalid(roleId);
78
62
  }
79
63
 
80
64
  _role[roleId].isLocked = locked;
@@ -87,7 +71,7 @@ contract InstanceAccessManager is
87
71
 
88
72
  function grantRole(RoleId roleId, address member) external restricted() returns (bool granted) {
89
73
  if (!roleExists(roleId)) {
90
- revert IAccess.ErrorIAccessGrantNonexstentRole(roleId);
74
+ revert IAccess.ErrorIAccessRoleIdInvalid(roleId);
91
75
  }
92
76
 
93
77
  if (_role[roleId].isLocked) {
@@ -177,7 +161,7 @@ contract InstanceAccessManager is
177
161
  address target = _targetForName[ShortStrings.toShortString(targetName)];
178
162
 
179
163
  if (target == address(0)) {
180
- revert IAccess.ErrorIAccessSetLockedForNonexstentTarget(target);
164
+ revert IAccess.ErrorIAccessTargetDoesNotExist(ShortStrings.toShortString(targetName));
181
165
  }
182
166
 
183
167
  _target[target].isLocked = locked;
@@ -251,6 +235,13 @@ contract InstanceAccessManager is
251
235
  _validateTargetParameters(target, name, isCustom);
252
236
  }
253
237
 
238
+ if (_target[target].createdAt.gtz()) {
239
+ revert IAccess.ErrorIAccessTargetExists(target, _target[target].name);
240
+ }
241
+ if (_targetForName[ShortStrings.toShortString(name)] != address(0)) {
242
+ revert IAccess.ErrorIAccessTargetNameExists(target, _targetForName[ShortStrings.toShortString(name)], ShortStrings.toShortString(name));
243
+ }
244
+
254
245
  IAccess.TargetInfo memory info = IAccess.TargetInfo(
255
246
  ShortStrings.toShortString(name),
256
247
  isCustom,
@@ -267,33 +258,35 @@ contract InstanceAccessManager is
267
258
  // TODO: implement
268
259
  }
269
260
 
270
- function setTargetFunctionRole(
271
- address target,
272
- bytes4[] calldata selectors,
273
- uint64 roleId
274
- ) public virtual restricted() {
275
- _accessManager.setTargetFunctionRole(target, selectors, roleId);
276
- }
277
-
278
261
  function setTargetFunctionRole(
279
262
  string memory targetName,
280
263
  bytes4[] calldata selectors,
281
264
  RoleId roleId
282
265
  ) public virtual restricted() {
283
266
  address target = _targetForName[ShortStrings.toShortString(targetName)];
267
+
268
+ if (target == address(0)) {
269
+ revert IAccess.ErrorIAccessTargetDoesNotExist(ShortStrings.toShortString(targetName));
270
+ }
271
+ if (! roleExists(roleId)) {
272
+ revert IAccess.ErrorIAccessRoleIdInvalid(roleId);
273
+ }
284
274
  uint64 roleIdInt = RoleId.unwrap(roleId);
285
275
  _accessManager.setTargetFunctionRole(target, selectors, roleIdInt);
286
276
  }
287
277
 
288
- function getAccessManager() public restricted() returns (AccessManagerUpgradeableInitializeable) {
289
- return _accessManager;
290
- }
291
-
292
278
  function setTargetClosed(string memory targetName, bool closed) public restricted() {
293
279
  address target = _targetForName[ShortStrings.toShortString(targetName)];
280
+ if (target == address(0)) {
281
+ revert IAccess.ErrorIAccessTargetDoesNotExist(ShortStrings.toShortString(targetName));
282
+ }
294
283
  _accessManager.setTargetClosed(target, closed);
295
284
  }
296
285
 
286
+ function isTargetLocked(address target) public view returns (bool locked) {
287
+ return _accessManager.isTargetClosed(target);
288
+ }
289
+
297
290
  function canCall(
298
291
  address caller,
299
292
  address target,
@@ -31,39 +31,21 @@ contract InstanceReader {
31
31
  bool private _initialized;
32
32
 
33
33
  IRegistry internal _registry;
34
- NftId internal _instanceNftId;
35
34
  IInstance internal _instance;
36
35
  IKeyValueStore internal _store;
37
36
 
38
- constructor(
39
- address registry,
40
- NftId instanceNftId
41
- )
42
- {
43
- initialize(registry, instanceNftId);
44
- }
45
-
46
- function initialize(address registry, NftId instanceNftId) public {
37
+ function initialize(address registry, address instance) public {
47
38
  require(!_initialized, "ERROR:CRD-000:ALREADY_INITIALIZED");
48
39
 
49
40
  require(
50
41
  address(registry) != address(0),
51
42
  "ERROR:CRD-001:REGISTRY_ZERO");
52
43
 
53
- require(
54
- instanceNftId.gtz(),
55
- "ERROR:CRD-002:NFT_ID_ZERO");
56
44
 
57
45
  _registry = IRegistry(registry);
58
- _instanceNftId = instanceNftId;
59
- IRegistry.ObjectInfo memory instanceInfo = _registry.getObjectInfo(_instanceNftId);
60
46
 
61
- require(
62
- instanceInfo.objectType == INSTANCE(),
63
- "ERROR:CRD-003:PARENT_NOT_INSTANCE");
64
-
65
- _instance = IInstance(instanceInfo.objectAddress);
66
- _store = IKeyValueStore(instanceInfo.objectAddress);
47
+ _instance = IInstance(instance);
48
+ _store = IKeyValueStore(instance);
67
49
 
68
50
  _initialized = true;
69
51
  }
@@ -301,10 +283,6 @@ contract InstanceReader {
301
283
  return _store;
302
284
  }
303
285
 
304
- function getInstanceNftId() external view returns (NftId nftId) {
305
- return _instanceNftId;
306
- }
307
-
308
286
  function toUFixed(uint256 value, int8 exp) public pure returns (UFixed) {
309
287
  return UFixedLib.toUFixed(value, exp);
310
288
  }