@etherisc/gif-next 0.0.2-b244df3-779 → 0.0.2-b38343e-249

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 (309) 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 +853 -0
  4. package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
  5. package/artifacts/contracts/components/Distribution.sol/Distribution.json +887 -242
  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} +160 -100
  8. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  9. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +791 -0
  10. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  11. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +655 -43
  12. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  13. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +654 -5
  14. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  15. package/artifacts/contracts/components/Pool.sol/Pool.json +600 -217
  16. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  17. package/artifacts/contracts/components/Product.sol/Product.json +543 -152
  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 +881 -121
  44. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  45. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +168 -166
  46. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  47. package/artifacts/contracts/instance/Instance.sol/Instance.json +791 -438
  48. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
  49. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +118 -173
  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 +390 -362
  54. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  55. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +299 -130
  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/instance/base/{ComponentServiceBase.sol/ComponentServiceBase.json → ComponentService.sol/ComponentService.json} +188 -168
  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 +858 -0
  76. package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
  77. package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +657 -0
  78. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
  79. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +408 -246
  80. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  81. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +302 -81
  82. package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +4 -0
  83. package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +743 -0
  84. package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
  85. package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +637 -0
  86. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
  87. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +443 -192
  88. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  89. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +322 -73
  90. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +4 -0
  91. package/artifacts/contracts/instance/service/{IComponentOwnerService.sol/IComponentOwnerService.json → IApplicationService.sol/IApplicationService.json} +200 -204
  92. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
  93. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +170 -217
  94. package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +4 -0
  95. package/artifacts/contracts/{components/IBaseComponent.sol/IBaseComponent.json → instance/service/IClaimService.sol/IClaimService.json} +154 -124
  96. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  97. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +197 -163
  98. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  99. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +138 -230
  100. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
  101. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +23 -186
  102. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
  103. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +29 -192
  104. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
  105. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +392 -267
  106. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  107. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +339 -86
  108. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
  109. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +216 -218
  110. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  111. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +299 -78
  112. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
  113. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +217 -219
  114. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
  115. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +305 -76
  116. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  117. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
  118. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  119. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +225 -133
  120. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  121. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +149 -217
  122. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  123. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  124. package/artifacts/contracts/registry/Registry.sol/Registry.json +238 -235
  125. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +4 -0
  126. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +285 -0
  127. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  128. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +195 -322
  129. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  130. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +298 -145
  131. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +4 -0
  132. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +547 -0
  133. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  134. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +141 -53
  135. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
  136. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  137. package/artifacts/contracts/shared/ERC165.sol/ERC165.json +41 -3
  138. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  139. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +40 -29
  140. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
  141. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +129 -0
  142. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  143. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +21 -34
  144. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
  145. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.json +48 -0
  146. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  147. package/artifacts/contracts/shared/IService.sol/IService.json +23 -186
  148. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  149. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +2 -152
  150. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  151. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +120 -27
  152. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
  153. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +248 -0
  154. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  155. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +294 -61
  156. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  157. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +129 -51
  158. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
  159. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +84 -0
  160. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  161. package/artifacts/contracts/shared/Service.sol/Service.json +119 -173
  162. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  163. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  164. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
  165. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  166. package/artifacts/contracts/shared/Versionable.sol/Versionable.json +2 -152
  167. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
  168. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
  169. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +129 -51
  170. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
  171. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +2 -2
  172. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
  173. package/artifacts/contracts/test/TestService.sol/TestService.json +140 -230
  174. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
  175. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
  176. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
  177. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +8 -190
  178. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
  179. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  180. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  181. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  182. package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.dbg.json +4 -0
  183. package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.json +100 -0
  184. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  185. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +2 -2
  186. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
  187. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
  188. package/artifacts/contracts/types/Key32.sol/Key32Lib.json +2 -2
  189. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  190. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +2 -2
  191. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  192. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
  193. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
  194. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  195. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
  196. package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.dbg.json +4 -0
  197. package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.json +100 -0
  198. package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
  199. package/artifacts/contracts/types/Referral.sol/ReferralLib.json +2 -2
  200. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
  201. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +2 -2
  202. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
  203. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
  204. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
  205. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
  206. package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
  207. package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
  208. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
  209. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
  210. package/contracts/components/Component.sol +242 -0
  211. package/contracts/components/Distribution.sol +209 -64
  212. package/contracts/components/IComponent.sol +55 -0
  213. package/contracts/components/IDistributionComponent.sol +59 -3
  214. package/contracts/components/IPoolComponent.sol +50 -29
  215. package/contracts/components/IProductComponent.sol +7 -3
  216. package/contracts/components/Pool.sol +135 -152
  217. package/contracts/components/Product.sol +114 -121
  218. package/contracts/instance/BundleManager.sol +7 -11
  219. package/contracts/instance/IInstance.sol +42 -10
  220. package/contracts/instance/IInstanceService.sol +27 -2
  221. package/contracts/instance/Instance.sol +84 -69
  222. package/contracts/instance/InstanceAccessManager.sol +36 -41
  223. package/contracts/instance/InstanceReader.sol +3 -25
  224. package/contracts/instance/InstanceService.sol +271 -79
  225. package/contracts/instance/InstanceServiceManager.sol +6 -9
  226. package/contracts/instance/ObjectManager.sol +7 -24
  227. package/contracts/instance/base/ComponentService.sol +134 -0
  228. package/contracts/instance/module/IAccess.sol +4 -5
  229. package/contracts/instance/module/IPolicy.sol +4 -2
  230. package/contracts/instance/module/ISetup.sol +5 -4
  231. package/contracts/instance/service/ApplicationService.sol +268 -0
  232. package/contracts/instance/service/ApplicationServiceManager.sol +35 -0
  233. package/contracts/instance/service/BundleService.sol +52 -14
  234. package/contracts/instance/service/BundleServiceManager.sol +6 -9
  235. package/contracts/instance/service/ClaimService.sol +151 -0
  236. package/contracts/instance/service/ClaimServiceManager.sol +35 -0
  237. package/contracts/instance/service/DistributionService.sol +208 -49
  238. package/contracts/instance/service/DistributionServiceManager.sol +7 -10
  239. package/contracts/instance/service/IApplicationService.sol +82 -0
  240. package/contracts/instance/service/IBundleService.sol +12 -3
  241. package/contracts/instance/service/IClaimService.sol +61 -0
  242. package/contracts/instance/service/IDistributionService.sol +53 -0
  243. package/contracts/instance/service/IPolicyService.sol +48 -46
  244. package/contracts/instance/service/PolicyService.sol +156 -190
  245. package/contracts/instance/service/PolicyServiceManager.sol +2 -2
  246. package/contracts/instance/service/PoolService.sol +27 -42
  247. package/contracts/instance/service/PoolServiceManager.sol +6 -9
  248. package/contracts/instance/service/ProductService.sol +100 -40
  249. package/contracts/instance/service/ProductServiceManager.sol +2 -2
  250. package/contracts/registry/ChainNft.sol +1 -1
  251. package/contracts/registry/IRegistry.sol +37 -19
  252. package/contracts/registry/IRegistryService.sol +30 -13
  253. package/contracts/registry/Registry.sol +233 -217
  254. package/contracts/registry/RegistryAccessManager.sol +216 -0
  255. package/contracts/registry/RegistryService.sol +96 -171
  256. package/contracts/registry/RegistryServiceManager.sol +21 -39
  257. package/contracts/registry/ReleaseManager.sol +322 -0
  258. package/contracts/registry/TokenRegistry.sol +22 -17
  259. package/contracts/shared/ERC165.sol +14 -12
  260. package/contracts/shared/INftOwnable.sol +11 -10
  261. package/contracts/shared/IPolicyHolder.sol +26 -0
  262. package/contracts/shared/IRegisterable.sol +4 -6
  263. package/contracts/shared/IRegistryLinked.sol +12 -0
  264. package/contracts/shared/IService.sol +2 -1
  265. package/contracts/shared/IVersionable.sol +4 -47
  266. package/contracts/shared/NftOwnable.sol +66 -80
  267. package/contracts/shared/PolicyHolder.sol +81 -0
  268. package/contracts/shared/ProxyManager.sol +100 -25
  269. package/contracts/shared/Registerable.sol +14 -30
  270. package/contracts/shared/RegistryLinked.sol +48 -0
  271. package/contracts/shared/Service.sol +25 -22
  272. package/contracts/shared/Versionable.sol +4 -92
  273. package/contracts/test/TestRegisterable.sol +1 -1
  274. package/contracts/test/TestService.sol +4 -3
  275. package/contracts/types/ClaimId.sol +52 -0
  276. package/contracts/types/DistributorType.sol +2 -2
  277. package/contracts/types/ObjectType.sol +9 -5
  278. package/contracts/types/PayoutId.sol +54 -0
  279. package/contracts/types/RoleId.sol +6 -8
  280. package/package.json +3 -3
  281. package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +0 -4
  282. package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +0 -4
  283. package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
  284. package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +0 -1206
  285. package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.dbg.json +0 -4
  286. package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.json +0 -1082
  287. package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
  288. package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.json +0 -448
  289. package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.dbg.json +0 -4
  290. package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.json +0 -763
  291. package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +0 -4
  292. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
  293. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +0 -113
  294. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +0 -4
  295. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +0 -827
  296. package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +0 -4
  297. package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.dbg.json +0 -4
  298. package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.json +0 -442
  299. package/contracts/components/BaseComponent.sol +0 -132
  300. package/contracts/components/IBaseComponent.sol +0 -31
  301. package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +0 -23
  302. package/contracts/instance/IAccessManagerSimple.sol +0 -391
  303. package/contracts/instance/IInstanceBase.sol +0 -26
  304. package/contracts/instance/InstanceBase.sol +0 -41
  305. package/contracts/instance/base/ComponentServiceBase.sol +0 -72
  306. package/contracts/instance/base/IInstanceBase.sol +0 -23
  307. package/contracts/instance/service/ComponentOwnerService.sol +0 -317
  308. package/contracts/instance/service/IComponentOwnerService.sol +0 -20
  309. package/contracts/shared/RegisterableUpgradable.sol +0 -16
@@ -0,0 +1,100 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "PayoutIdLib",
4
+ "sourceName": "contracts/types/PayoutId.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [
8
+ {
9
+ "internalType": "PayoutId",
10
+ "name": "a",
11
+ "type": "uint24"
12
+ }
13
+ ],
14
+ "name": "eqz",
15
+ "outputs": [
16
+ {
17
+ "internalType": "bool",
18
+ "name": "",
19
+ "type": "bool"
20
+ }
21
+ ],
22
+ "stateMutability": "pure",
23
+ "type": "function"
24
+ },
25
+ {
26
+ "inputs": [
27
+ {
28
+ "internalType": "PayoutId",
29
+ "name": "a",
30
+ "type": "uint24"
31
+ }
32
+ ],
33
+ "name": "gtz",
34
+ "outputs": [
35
+ {
36
+ "internalType": "bool",
37
+ "name": "",
38
+ "type": "bool"
39
+ }
40
+ ],
41
+ "stateMutability": "pure",
42
+ "type": "function"
43
+ },
44
+ {
45
+ "inputs": [
46
+ {
47
+ "internalType": "PayoutId",
48
+ "name": "a",
49
+ "type": "uint24"
50
+ }
51
+ ],
52
+ "name": "toInt",
53
+ "outputs": [
54
+ {
55
+ "internalType": "uint24",
56
+ "name": "",
57
+ "type": "uint24"
58
+ }
59
+ ],
60
+ "stateMutability": "pure",
61
+ "type": "function"
62
+ },
63
+ {
64
+ "inputs": [
65
+ {
66
+ "internalType": "uint256",
67
+ "name": "a",
68
+ "type": "uint256"
69
+ }
70
+ ],
71
+ "name": "toPayoutId",
72
+ "outputs": [
73
+ {
74
+ "internalType": "PayoutId",
75
+ "name": "",
76
+ "type": "uint24"
77
+ }
78
+ ],
79
+ "stateMutability": "pure",
80
+ "type": "function"
81
+ },
82
+ {
83
+ "inputs": [],
84
+ "name": "zero",
85
+ "outputs": [
86
+ {
87
+ "internalType": "PayoutId",
88
+ "name": "",
89
+ "type": "uint24"
90
+ }
91
+ ],
92
+ "stateMutability": "pure",
93
+ "type": "function"
94
+ }
95
+ ],
96
+ "bytecode": "0x61015f61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100615760003560e01c806302985c61146100665780635560100714610093578063691d05ec146100b8578063bc1b392d146100cf578063f43d0be4146100d6575b600080fd5b61007e6100743660046100e4565b62ffffff16151590565b60405190151581526020015b60405180910390f35b6100a46100a13660046100e4565b90565b60405162ffffff909116815260200161008a565b61007e6100c63660046100e4565b62ffffff161590565b60006100a4565b6100a46100a1366004610110565b6000602082840312156100f657600080fd5b813562ffffff8116811461010957600080fd5b9392505050565b60006020828403121561012257600080fd5b503591905056fea26469706673582212207ec57330ef4c4442fd6c82ef8bddeb33653eafa2bd64d4a0d3cd4448c6b536c764736f6c63430008140033",
97
+ "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100615760003560e01c806302985c61146100665780635560100714610093578063691d05ec146100b8578063bc1b392d146100cf578063f43d0be4146100d6575b600080fd5b61007e6100743660046100e4565b62ffffff16151590565b60405190151581526020015b60405180910390f35b6100a46100a13660046100e4565b90565b60405162ffffff909116815260200161008a565b61007e6100c63660046100e4565b62ffffff161590565b60006100a4565b6100a46100a1366004610110565b6000602082840312156100f657600080fd5b813562ffffff8116811461010957600080fd5b9392505050565b60006020828403121561012257600080fd5b503591905056fea26469706673582212207ec57330ef4c4442fd6c82ef8bddeb33653eafa2bd64d4a0d3cd4448c6b536c764736f6c63430008140033",
98
+ "linkReferences": {},
99
+ "deployedLinkReferences": {}
100
+ }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/ef00a858a139e7ac144c67f07a448a56.json"
3
+ "buildInfo": "../../../build-info/671c400d7418b1fe552582ba223238eb.json"
4
4
  }
@@ -98,8 +98,8 @@
98
98
  "type": "function"
99
99
  }
100
100
  ],
101
- "bytecode": "0x6103cf61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100615760003560e01c80632cf96bf9146100665780633f093cd61461009957806355ee6275146100c5578063a420c787146100e6578063bc1b392d14610109575b600080fd5b6100816100743660046101dd565b6001600160c01b03191690565b60405160ff1990911681526020015b60405180910390f35b6100ac6100a7366004610224565b610110565b6040516001600160c01b03199091168152602001610090565b6100d86100d33660046101dd565b610143565b604051908152602001610090565b6100f76100f43660046102f9565b90565b60405160ff9091168152602001610090565b60006100ac565b6000828260405160200161012592919061031c565b60405160208183030381529060405280519060200120905092915050565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce607b6001600160c01b031985166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af41580156101b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d79190610380565b92915050565b6000602082840312156101ef57600080fd5b81356001600160c01b03198116811461020757600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561023757600080fd5b82356bffffffffffffffffffffffff8116811461025357600080fd5b9150602083013567ffffffffffffffff8082111561027057600080fd5b818501915085601f83011261028457600080fd5b8135818111156102965761029661020e565b604051601f8201601f19908116603f011681019083821181831017156102be576102be61020e565b816040528281528860208487010111156102d757600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60006020828403121561030b57600080fd5b813560ff8116811461020757600080fd5b6bffffffffffffffffffffffff8316815260006020604081840152835180604085015260005b8181101561035e57858101830151858201606001528201610342565b506000606082860101526060601f19601f830116850101925050509392505050565b60006020828403121561039257600080fd5b505191905056fea2646970667358221220e3067e33abc10c92bca6b263bfc1f83fba9fd0597a869d4ffec064e06a9d7c1464736f6c63430008140033",
102
- "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100615760003560e01c80632cf96bf9146100665780633f093cd61461009957806355ee6275146100c5578063a420c787146100e6578063bc1b392d14610109575b600080fd5b6100816100743660046101dd565b6001600160c01b03191690565b60405160ff1990911681526020015b60405180910390f35b6100ac6100a7366004610224565b610110565b6040516001600160c01b03199091168152602001610090565b6100d86100d33660046101dd565b610143565b604051908152602001610090565b6100f76100f43660046102f9565b90565b60405160ff9091168152602001610090565b60006100ac565b6000828260405160200161012592919061031c565b60405160208183030381529060405280519060200120905092915050565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce607b6001600160c01b031985166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af41580156101b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d79190610380565b92915050565b6000602082840312156101ef57600080fd5b81356001600160c01b03198116811461020757600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561023757600080fd5b82356bffffffffffffffffffffffff8116811461025357600080fd5b9150602083013567ffffffffffffffff8082111561027057600080fd5b818501915085601f83011261028457600080fd5b8135818111156102965761029661020e565b604051601f8201601f19908116603f011681019083821181831017156102be576102be61020e565b816040528281528860208487010111156102d757600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60006020828403121561030b57600080fd5b813560ff8116811461020757600080fd5b6bffffffffffffffffffffffff8316815260006020604081840152835180604085015260005b8181101561035e57858101830151858201606001528201610342565b506000606082860101526060601f19601f830116850101925050509392505050565b60006020828403121561039257600080fd5b505191905056fea2646970667358221220e3067e33abc10c92bca6b263bfc1f83fba9fd0597a869d4ffec064e06a9d7c1464736f6c63430008140033",
101
+ "bytecode": "0x6103cf61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100615760003560e01c80632cf96bf9146100665780633f093cd61461009957806355ee6275146100c5578063a420c787146100e6578063bc1b392d14610109575b600080fd5b6100816100743660046101dd565b6001600160c01b03191690565b60405160ff1990911681526020015b60405180910390f35b6100ac6100a7366004610224565b610110565b6040516001600160c01b03199091168152602001610090565b6100d86100d33660046101dd565b610143565b604051908152602001610090565b6100f76100f43660046102f9565b90565b60405160ff9091168152602001610090565b60006100ac565b6000828260405160200161012592919061031c565b60405160208183030381529060405280519060200120905092915050565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce607b6001600160c01b031985166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af41580156101b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d79190610380565b92915050565b6000602082840312156101ef57600080fd5b81356001600160c01b03198116811461020757600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561023757600080fd5b82356bffffffffffffffffffffffff8116811461025357600080fd5b9150602083013567ffffffffffffffff8082111561027057600080fd5b818501915085601f83011261028457600080fd5b8135818111156102965761029661020e565b604051601f8201601f19908116603f011681019083821181831017156102be576102be61020e565b816040528281528860208487010111156102d757600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60006020828403121561030b57600080fd5b813560ff8116811461020757600080fd5b6bffffffffffffffffffffffff8316815260006020604081840152835180604085015260005b8181101561035e57858101830151858201606001528201610342565b506000606082860101526060601f19601f830116850101925050509392505050565b60006020828403121561039257600080fd5b505191905056fea26469706673582212203a17215075d8a5001956f0f2bfeba817b6404b3d8755f596baba942df9648c8764736f6c63430008140033",
102
+ "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100615760003560e01c80632cf96bf9146100665780633f093cd61461009957806355ee6275146100c5578063a420c787146100e6578063bc1b392d14610109575b600080fd5b6100816100743660046101dd565b6001600160c01b03191690565b60405160ff1990911681526020015b60405180910390f35b6100ac6100a7366004610224565b610110565b6040516001600160c01b03199091168152602001610090565b6100d86100d33660046101dd565b610143565b604051908152602001610090565b6100f76100f43660046102f9565b90565b60405160ff9091168152602001610090565b60006100ac565b6000828260405160200161012592919061031c565b60405160208183030381529060405280519060200120905092915050565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce607b6001600160c01b031985166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af41580156101b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d79190610380565b92915050565b6000602082840312156101ef57600080fd5b81356001600160c01b03198116811461020757600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561023757600080fd5b82356bffffffffffffffffffffffff8116811461025357600080fd5b9150602083013567ffffffffffffffff8082111561027057600080fd5b818501915085601f83011261028457600080fd5b8135818111156102965761029661020e565b604051601f8201601f19908116603f011681019083821181831017156102be576102be61020e565b816040528281528860208487010111156102d757600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60006020828403121561030b57600080fd5b813560ff8116811461020757600080fd5b6bffffffffffffffffffffffff8316815260006020604081840152835180604085015260005b8181101561035e57858101830151858201606001528201610342565b506000606082860101526060601f19601f830116850101925050509392505050565b60006020828403121561039257600080fd5b505191905056fea26469706673582212203a17215075d8a5001956f0f2bfeba817b6404b3d8755f596baba942df9648c8764736f6c63430008140033",
103
103
  "linkReferences": {
104
104
  "contracts/types/Key32.sol": {
105
105
  "Key32Lib": [
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/ef00a858a139e7ac144c67f07a448a56.json"
3
+ "buildInfo": "../../../build-info/671c400d7418b1fe552582ba223238eb.json"
4
4
  }
@@ -61,8 +61,8 @@
61
61
  "type": "function"
62
62
  }
63
63
  ],
64
- "bytecode": "0x61032f61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061004b5760003560e01c80632cf96bf9146100505780634a7485ba1461008357806355ee6275146100af575b600080fd5b61006b61005e36600461019a565b6001600160c01b03191690565b60405160ff1990911681526020015b60405180910390f35b6100966100913660046101e1565b6100d0565b6040516001600160c01b0319909116815260200161007a565b6100c26100bd36600461019a565b610100565b60405190815260200161007a565b6000816040516020016100e39190610292565b604051602081830303815290604052805190602001209050919050565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce60c86001600160c01b031985166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af4158015610170573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019491906102e0565b92915050565b6000602082840312156101ac57600080fd5b81356001600160c01b0319811681146101c457600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156101f357600080fd5b813567ffffffffffffffff8082111561020b57600080fd5b818401915084601f83011261021f57600080fd5b813581811115610231576102316101cb565b604051601f8201601f19908116603f01168101908382118183101715610259576102596101cb565b8160405282815287602084870101111561027257600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156102bf578581018301518582016040015282016102a3565b506000604082860101526040601f19601f8301168501019250505092915050565b6000602082840312156102f257600080fd5b505191905056fea2646970667358221220acade4fae6a94a3704657aa5558cd7b643bb3131353aefbe2c03a2748459b3c064736f6c63430008140033",
65
- "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361061004b5760003560e01c80632cf96bf9146100505780634a7485ba1461008357806355ee6275146100af575b600080fd5b61006b61005e36600461019a565b6001600160c01b03191690565b60405160ff1990911681526020015b60405180910390f35b6100966100913660046101e1565b6100d0565b6040516001600160c01b0319909116815260200161007a565b6100c26100bd36600461019a565b610100565b60405190815260200161007a565b6000816040516020016100e39190610292565b604051602081830303815290604052805190602001209050919050565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce60c86001600160c01b031985166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af4158015610170573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019491906102e0565b92915050565b6000602082840312156101ac57600080fd5b81356001600160c01b0319811681146101c457600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156101f357600080fd5b813567ffffffffffffffff8082111561020b57600080fd5b818401915084601f83011261021f57600080fd5b813581811115610231576102316101cb565b604051601f8201601f19908116603f01168101908382118183101715610259576102596101cb565b8160405282815287602084870101111561027257600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156102bf578581018301518582016040015282016102a3565b506000604082860101526040601f19601f8301168501019250505092915050565b6000602082840312156102f257600080fd5b505191905056fea2646970667358221220acade4fae6a94a3704657aa5558cd7b643bb3131353aefbe2c03a2748459b3c064736f6c63430008140033",
64
+ "bytecode": "0x61032f61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061004b5760003560e01c80632cf96bf9146100505780634a7485ba1461008357806355ee6275146100af575b600080fd5b61006b61005e36600461019a565b6001600160c01b03191690565b60405160ff1990911681526020015b60405180910390f35b6100966100913660046101e1565b6100d0565b6040516001600160c01b0319909116815260200161007a565b6100c26100bd36600461019a565b610100565b60405190815260200161007a565b6000816040516020016100e39190610292565b604051602081830303815290604052805190602001209050919050565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce60c86001600160c01b031985166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af4158015610170573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019491906102e0565b92915050565b6000602082840312156101ac57600080fd5b81356001600160c01b0319811681146101c457600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156101f357600080fd5b813567ffffffffffffffff8082111561020b57600080fd5b818401915084601f83011261021f57600080fd5b813581811115610231576102316101cb565b604051601f8201601f19908116603f01168101908382118183101715610259576102596101cb565b8160405282815287602084870101111561027257600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156102bf578581018301518582016040015282016102a3565b506000604082860101526040601f19601f8301168501019250505092915050565b6000602082840312156102f257600080fd5b505191905056fea26469706673582212209159fe3208a459e4904359ef92d8cc7cecbb0b142f3caecc8eb34f90da5f931c64736f6c63430008140033",
65
+ "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361061004b5760003560e01c80632cf96bf9146100505780634a7485ba1461008357806355ee6275146100af575b600080fd5b61006b61005e36600461019a565b6001600160c01b03191690565b60405160ff1990911681526020015b60405180910390f35b6100966100913660046101e1565b6100d0565b6040516001600160c01b0319909116815260200161007a565b6100c26100bd36600461019a565b610100565b60405190815260200161007a565b6000816040516020016100e39190610292565b604051602081830303815290604052805190602001209050919050565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce60c86001600160c01b031985166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af4158015610170573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019491906102e0565b92915050565b6000602082840312156101ac57600080fd5b81356001600160c01b0319811681146101c457600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156101f357600080fd5b813567ffffffffffffffff8082111561020b57600080fd5b818401915084601f83011261021f57600080fd5b813581811115610231576102316101cb565b604051601f8201601f19908116603f01168101908382118183101715610259576102596101cb565b8160405282815287602084870101111561027257600080fd5b826020860160208301376000928101602001929092525095945050505050565b600060208083528351808285015260005b818110156102bf578581018301518582016040015282016102a3565b506000604082860101526040601f19601f8301168501019250505092915050565b6000602082840312156102f257600080fd5b505191905056fea26469706673582212209159fe3208a459e4904359ef92d8cc7cecbb0b142f3caecc8eb34f90da5f931c64736f6c63430008140033",
66
66
  "linkReferences": {
67
67
  "contracts/types/Key32.sol": {
68
68
  "Key32Lib": [
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/ef00a858a139e7ac144c67f07a448a56.json"
3
+ "buildInfo": "../../../build-info/671c400d7418b1fe552582ba223238eb.json"
4
4
  }
@@ -131,8 +131,8 @@
131
131
  "type": "function"
132
132
  }
133
133
  ],
134
- "bytecode": "0x6102a461003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100875760003560e01c806368aebf7b1161006557806368aebf7b14610119578063a42e52e914610127578063bc1b392d14610144578063f37f38f01461014b57600080fd5b8063057182b41461008c578063545ce21c146100bd57806367cb8ec1146100e7575b600080fd5b6100a861009a36600461020b565b67ffffffffffffffff161590565b60405190151581526020015b60405180910390f35b6100ce6100cb36600461020b565b90565b60405167ffffffffffffffff90911681526020016100b4565b6101066100f536600461020b565b60081b68ffffffffffffffff001690565b60405160ff1990911681526020016100b4565b6100ce6100cb36600461023c565b6100a861013536600461020b565b67ffffffffffffffff16151590565b60006100ce565b61015e61015936600461020b565b61016c565b6040519081526020016100b4565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce6014600885901b68ffffffffffffffff00166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af41580156101e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102059190610255565b92915050565b60006020828403121561021d57600080fd5b813567ffffffffffffffff8116811461023557600080fd5b9392505050565b60006020828403121561024e57600080fd5b5035919050565b60006020828403121561026757600080fd5b505191905056fea2646970667358221220ed98598e6934ea27b0c3e25952a1c3f9da4b87e1a7beb94f54c122a66f9e733664736f6c63430008140033",
135
- "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100875760003560e01c806368aebf7b1161006557806368aebf7b14610119578063a42e52e914610127578063bc1b392d14610144578063f37f38f01461014b57600080fd5b8063057182b41461008c578063545ce21c146100bd57806367cb8ec1146100e7575b600080fd5b6100a861009a36600461020b565b67ffffffffffffffff161590565b60405190151581526020015b60405180910390f35b6100ce6100cb36600461020b565b90565b60405167ffffffffffffffff90911681526020016100b4565b6101066100f536600461020b565b60081b68ffffffffffffffff001690565b60405160ff1990911681526020016100b4565b6100ce6100cb36600461023c565b6100a861013536600461020b565b67ffffffffffffffff16151590565b60006100ce565b61015e61015936600461020b565b61016c565b6040519081526020016100b4565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce6014600885901b68ffffffffffffffff00166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af41580156101e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102059190610255565b92915050565b60006020828403121561021d57600080fd5b813567ffffffffffffffff8116811461023557600080fd5b9392505050565b60006020828403121561024e57600080fd5b5035919050565b60006020828403121561026757600080fd5b505191905056fea2646970667358221220ed98598e6934ea27b0c3e25952a1c3f9da4b87e1a7beb94f54c122a66f9e733664736f6c63430008140033",
134
+ "bytecode": "0x6102a461003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100875760003560e01c806368aebf7b1161006557806368aebf7b14610119578063a42e52e914610127578063bc1b392d14610144578063f37f38f01461014b57600080fd5b8063057182b41461008c578063545ce21c146100bd57806367cb8ec1146100e7575b600080fd5b6100a861009a36600461020b565b67ffffffffffffffff161590565b60405190151581526020015b60405180910390f35b6100ce6100cb36600461020b565b90565b60405167ffffffffffffffff90911681526020016100b4565b6101066100f536600461020b565b60081b68ffffffffffffffff001690565b60405160ff1990911681526020016100b4565b6100ce6100cb36600461023c565b6100a861013536600461020b565b67ffffffffffffffff16151590565b60006100ce565b61015e61015936600461020b565b61016c565b6040519081526020016100b4565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce6014600885901b68ffffffffffffffff00166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af41580156101e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102059190610255565b92915050565b60006020828403121561021d57600080fd5b813567ffffffffffffffff8116811461023557600080fd5b9392505050565b60006020828403121561024e57600080fd5b5035919050565b60006020828403121561026757600080fd5b505191905056fea2646970667358221220997182d8d3b0262b1cee9aecb1a90ed99a18509d033f0e64eaff42eb90902be764736f6c63430008140033",
135
+ "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100875760003560e01c806368aebf7b1161006557806368aebf7b14610119578063a42e52e914610127578063bc1b392d14610144578063f37f38f01461014b57600080fd5b8063057182b41461008c578063545ce21c146100bd57806367cb8ec1146100e7575b600080fd5b6100a861009a36600461020b565b67ffffffffffffffff161590565b60405190151581526020015b60405180910390f35b6100ce6100cb36600461020b565b90565b60405167ffffffffffffffff90911681526020016100b4565b6101066100f536600461020b565b60081b68ffffffffffffffff001690565b60405160ff1990911681526020016100b4565b6100ce6100cb36600461023c565b6100a861013536600461020b565b67ffffffffffffffff16151590565b60006100ce565b61015e61015936600461020b565b61016c565b6040519081526020016100b4565b600073__$c8f743efd2b4f0c9300f2558c784479d3e$__63f48016ce6014600885901b68ffffffffffffffff00166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af41580156101e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102059190610255565b92915050565b60006020828403121561021d57600080fd5b813567ffffffffffffffff8116811461023557600080fd5b9392505050565b60006020828403121561024e57600080fd5b5035919050565b60006020828403121561026757600080fd5b505191905056fea2646970667358221220997182d8d3b0262b1cee9aecb1a90ed99a18509d033f0e64eaff42eb90902be764736f6c63430008140033",
136
136
  "linkReferences": {
137
137
  "contracts/types/Key32.sol": {
138
138
  "Key32Lib": [
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/ef00a858a139e7ac144c67f07a448a56.json"
3
+ "buildInfo": "../../../build-info/671c400d7418b1fe552582ba223238eb.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/ef00a858a139e7ac144c67f07a448a56.json"
3
+ "buildInfo": "../../../build-info/671c400d7418b1fe552582ba223238eb.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/ef00a858a139e7ac144c67f07a448a56.json"
3
+ "buildInfo": "../../../build-info/671c400d7418b1fe552582ba223238eb.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/ef00a858a139e7ac144c67f07a448a56.json"
3
+ "buildInfo": "../../../build-info/671c400d7418b1fe552582ba223238eb.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/ef00a858a139e7ac144c67f07a448a56.json"
3
+ "buildInfo": "../../../build-info/671c400d7418b1fe552582ba223238eb.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/ef00a858a139e7ac144c67f07a448a56.json"
3
+ "buildInfo": "../../../build-info/671c400d7418b1fe552582ba223238eb.json"
4
4
  }
@@ -0,0 +1,242 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.20;
3
+
4
+ import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
5
+ import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
6
+ import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
7
+
8
+ import {IComponent} from "./IComponent.sol";
9
+ import {IProductService} from "../instance/service/IProductService.sol";
10
+ import {IInstanceService} from "../instance/IInstanceService.sol";
11
+ import {IInstance} from "../instance/IInstance.sol";
12
+ import {InstanceAccessManager} from "../instance/InstanceAccessManager.sol";
13
+ import {InstanceReader} from "../instance/InstanceReader.sol";
14
+ import {IRegistry} from "../registry/IRegistry.sol";
15
+ import {NftId} from "../types/NftId.sol";
16
+ import {ObjectType, INSTANCE, PRODUCT} from "../types/ObjectType.sol";
17
+ import {VersionPart} from "../types/Version.sol";
18
+ import {Registerable} from "../shared/Registerable.sol";
19
+ import {RoleId, RoleIdLib} from "../types/RoleId.sol";
20
+ import {IAccess} from "../instance/module/IAccess.sol";
21
+ import {VersionPart} from "../types/Version.sol";
22
+
23
+ // TODO discuss to inherit from oz accessmanaged
24
+ // then add (Distribution|Pool|Product)Upradeable that also intherit from Versionable
25
+ // same pattern as for Service which is also upgradeable
26
+ abstract contract Component is
27
+ Registerable,
28
+ IComponent,
29
+ AccessManagedUpgradeable
30
+ {
31
+ // keccak256(abi.encode(uint256(keccak256("gif-next.contracts.component.Component.sol")) - 1)) & ~bytes32(uint256(0xff));
32
+ bytes32 public constant CONTRACT_LOCATION_V1 = 0xffe8d4462baed26a47154f4b8f6db497d2f772496965791d25bd456e342b7f00;
33
+
34
+ struct ComponentStorage {
35
+ IInstance _instance; // instance for this component
36
+ InstanceReader _instanceReader; // instance reader for this component
37
+ string _name; // unique (per instance) component name
38
+ IERC20Metadata _token; // token for this component
39
+ address _wallet; // wallet for this component (default = component contract itself)
40
+ bool _isNftInterceptor; // declares if component is involved in nft transfers
41
+ IInstanceService _instanceService; // instance service for this component
42
+
43
+ NftId _productNftId; // only relevant for components that are linked to a aproduct
44
+ IProductService _productService; // product service for component, might not be relevant for some component types (eg oracles)
45
+ }
46
+
47
+
48
+ modifier onlyChainNft() {
49
+ if(msg.sender != getRegistry().getChainNftAddress()) {
50
+ revert ErrorComponentNotChainNft(msg.sender);
51
+ }
52
+ _;
53
+ }
54
+
55
+
56
+ modifier onlyProductService() {
57
+ if(msg.sender != address(_getComponentStorage()._productService)) {
58
+ revert ErrorComponentNotProductService(msg.sender);
59
+ }
60
+ _;
61
+ }
62
+
63
+ function _getComponentStorage() private pure returns (ComponentStorage storage $) {
64
+ assembly {
65
+ $.slot := CONTRACT_LOCATION_V1
66
+ }
67
+ }
68
+
69
+ function initializeComponent(
70
+ address registry,
71
+ NftId instanceNftId,
72
+ string memory name,
73
+ address token,
74
+ ObjectType componentType,
75
+ bool isInterceptor,
76
+ address initialOwner,
77
+ bytes memory data
78
+ )
79
+ public
80
+ virtual
81
+ onlyInitializing()
82
+ {
83
+ ComponentStorage storage $ = _getComponentStorage();
84
+ initializeRegisterable(registry, instanceNftId, componentType, isInterceptor, initialOwner, data);
85
+
86
+ // set unique name of component
87
+ $._name = name;
88
+ $._isNftInterceptor = isInterceptor;
89
+
90
+ // set and check linked instance
91
+ IRegistry.ObjectInfo memory instanceInfo = getRegistry().getObjectInfo(instanceNftId);
92
+ $._instance = IInstance(instanceInfo.objectAddress);
93
+ if(!$._instance.supportsInterface(type(IInstance).interfaceId)) {
94
+ revert ErrorComponentNotInstance(instanceNftId, instanceInfo.objectAddress);
95
+ }
96
+
97
+ // initialize AccessManagedUpgradeable
98
+ __AccessManaged_init($._instance.authority());
99
+
100
+ // set linked services
101
+ VersionPart gifVersion = $._instance.getMajorVersion();
102
+ $._instanceService = IInstanceService(getRegistry().getServiceAddress(INSTANCE(), gifVersion));
103
+ $._instanceReader = $._instance.getInstanceReader();
104
+ $._productService = IProductService(getRegistry().getServiceAddress(PRODUCT(), gifVersion));
105
+
106
+ // set wallet and token
107
+ $._wallet = address(this);
108
+ $._token = IERC20Metadata(token);
109
+
110
+ registerInterface(type(IComponent).interfaceId);
111
+ }
112
+
113
+ /// @dev callback function for nft transfers. may only be called by chain nft contract.
114
+ /// default implementation is empty. overriding functions MUST add onlyChainNft modifier
115
+ function nftTransferFrom(address from, address to, uint256 tokenId)
116
+ external
117
+ virtual override
118
+ onlyChainNft()
119
+ { }
120
+
121
+ // TODO discuss replacement with modifier restricted from accessmanaged
122
+ function lock() external onlyOwner override {
123
+ _getComponentStorage()._instanceService.setTargetLocked(getName(), true);
124
+ }
125
+
126
+ function unlock() external onlyOwner override {
127
+ _getComponentStorage()._instanceService.setTargetLocked(getName(), false);
128
+ }
129
+
130
+ // only product service may set product nft id during registration of product setup
131
+ function setProductNftId(NftId productNftId)
132
+ external
133
+ override
134
+ onlyProductService()
135
+ {
136
+ ComponentStorage storage $ = _getComponentStorage();
137
+
138
+ if($._productNftId.gtz()) {
139
+ revert ErrorComponentProductNftAlreadySet();
140
+ }
141
+
142
+ $._productNftId = productNftId;
143
+ }
144
+
145
+ /// @dev Sets the wallet address for the component.
146
+ /// if the current wallet has tokens, these will be transferred.
147
+ /// if the new wallet address is externally owned, an approval from the
148
+ /// owner of the external wallet for the component to move all tokens must exist.
149
+ function setWallet(address newWallet)
150
+ external
151
+ override
152
+ onlyOwner
153
+ {
154
+ ComponentStorage storage $ = _getComponentStorage();
155
+
156
+ address currentWallet = $._wallet;
157
+ uint256 currentBalance = $._token.balanceOf(currentWallet);
158
+
159
+ // checks
160
+ if (newWallet == address(0)) {
161
+ revert ErrorComponentWalletAddressZero();
162
+ }
163
+ if (newWallet == currentWallet) {
164
+ revert ErrorComponentWalletAddressIsSameAsCurrent(newWallet);
165
+ }
166
+
167
+ if (currentBalance > 0) {
168
+ if (currentWallet == address(this)) {
169
+ // move tokens from component smart contract to external wallet
170
+ } else {
171
+ // move tokens from external wallet to component smart contract or another external wallet
172
+ uint256 allowance = $._token.allowance(currentWallet, address(this));
173
+ if (allowance < currentBalance) {
174
+ revert ErrorComponentWalletAllowanceTooSmall(currentWallet, newWallet, allowance, currentBalance);
175
+ }
176
+ }
177
+ }
178
+
179
+ // effects
180
+ $._wallet = newWallet;
181
+ emit LogComponentWalletAddressChanged(newWallet);
182
+
183
+ // interactions
184
+ if (currentBalance > 0) {
185
+ // transfer tokens from current wallet to new wallet
186
+ if (currentWallet == address(this)) {
187
+ // transferFrom requires self allowance too
188
+ $._token.approve(address(this), currentBalance);
189
+ }
190
+
191
+ SafeERC20.safeTransferFrom($._token, currentWallet, newWallet, currentBalance);
192
+ emit LogComponentWalletTokensTransferred(currentWallet, newWallet, currentBalance);
193
+ }
194
+ }
195
+
196
+ function getWallet()
197
+ public
198
+ view
199
+ override
200
+ returns (address walletAddress)
201
+ {
202
+ return _getComponentStorage()._wallet;
203
+ }
204
+
205
+ function getToken() public view override returns (IERC20Metadata token) {
206
+ return _getComponentStorage()._token;
207
+ }
208
+
209
+ function isNftInterceptor() public view override returns(bool isInterceptor) {
210
+ return _getComponentStorage()._isNftInterceptor;
211
+ }
212
+
213
+ function getInstance() public view override returns (IInstance instance) {
214
+ return _getComponentStorage()._instance;
215
+ }
216
+
217
+ function getInstanceReader() public view returns (InstanceReader reader) {
218
+ return _getComponentStorage()._instanceReader;
219
+ }
220
+
221
+ function getServiceAddress(ObjectType domain) public view returns (address service) {
222
+ VersionPart majorVersion = getInstance().getMajorVersion();
223
+ return getRegistry().getServiceAddress(domain, majorVersion);
224
+ }
225
+
226
+ function getName() public view override returns(string memory name) {
227
+ return _getComponentStorage()._name;
228
+ }
229
+
230
+ function getProductNftId() public view override returns (NftId productNftId) {
231
+ return _getComponentStorage()._productNftId;
232
+ }
233
+
234
+ function getInstanceService() public view returns (IInstanceService) {
235
+ return _getComponentStorage()._instanceService;
236
+ }
237
+
238
+ function getProductService() public view returns (IProductService) {
239
+ return _getComponentStorage()._productService;
240
+ }
241
+
242
+ }