@etherisc/gif-next 0.0.2-9141c0d → 0.0.2-917cede-703

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 (338) hide show
  1. package/README.md +447 -2
  2. package/artifacts/contracts/components/Component.sol/Component.dbg.json +4 -0
  3. package/artifacts/contracts/components/Component.sol/Component.json +842 -0
  4. package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +4 -0
  5. package/artifacts/contracts/components/Distribution.sol/Distribution.json +1345 -0
  6. package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +4 -0
  7. package/artifacts/contracts/components/IComponent.sol/IComponent.json +605 -0
  8. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +4 -0
  9. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +969 -0
  10. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +4 -0
  11. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +1064 -0
  12. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +4 -0
  13. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +830 -0
  14. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +4 -0
  15. package/artifacts/contracts/components/Pool.sol/Pool.json +1376 -0
  16. package/artifacts/contracts/components/Product.sol/Product.dbg.json +4 -0
  17. package/artifacts/contracts/components/Product.sol/Product.json +1167 -0
  18. package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +4 -0
  19. package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +1206 -0
  20. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +4 -0
  21. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +778 -0
  22. package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +4 -0
  23. package/artifacts/contracts/instance/Cloneable.sol/Cloneable.json +190 -0
  24. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +4 -0
  25. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +2611 -0
  26. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +4 -0
  27. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +633 -0
  28. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +4 -0
  29. package/artifacts/contracts/instance/Instance.sol/Instance.json +3276 -0
  30. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +4 -0
  31. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +1330 -0
  32. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +4 -0
  33. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +1403 -0
  34. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +4 -0
  35. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +1140 -0
  36. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +4 -0
  37. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +741 -0
  38. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +4 -0
  39. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +256 -0
  40. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +4 -0
  41. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.json +607 -0
  42. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +4 -0
  43. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.json +429 -0
  44. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +4 -0
  45. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.json +115 -0
  46. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +4 -0
  47. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +532 -0
  48. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +4 -0
  49. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +194 -0
  50. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +4 -0
  51. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +237 -0
  52. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +4 -0
  53. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.json +10 -0
  54. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +4 -0
  55. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.json +10 -0
  56. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +4 -0
  57. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.json +10 -0
  58. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +4 -0
  59. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.json +10 -0
  60. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +4 -0
  61. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.json +10 -0
  62. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +4 -0
  63. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.json +10 -0
  64. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +4 -0
  65. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.json +10 -0
  66. package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.dbg.json +4 -0
  67. package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +1060 -0
  68. package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
  69. package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +681 -0
  70. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +4 -0
  71. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +1289 -0
  72. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +4 -0
  73. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +725 -0
  74. package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +4 -0
  75. package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +1040 -0
  76. package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
  77. package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +685 -0
  78. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +4 -0
  79. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +1774 -0
  80. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +4 -0
  81. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +793 -0
  82. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +4 -0
  83. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +627 -0
  84. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +4 -0
  85. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +709 -0
  86. package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +4 -0
  87. package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.json +602 -0
  88. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +4 -0
  89. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +1090 -0
  90. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +4 -0
  91. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +937 -0
  92. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +4 -0
  93. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +960 -0
  94. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +4 -0
  95. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +450 -0
  96. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +4 -0
  97. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +1519 -0
  98. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +4 -0
  99. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +745 -0
  100. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +4 -0
  101. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +1433 -0
  102. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +4 -0
  103. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +701 -0
  104. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +4 -0
  105. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +840 -0
  106. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +4 -0
  107. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +653 -0
  108. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +4 -0
  109. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +784 -0
  110. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +4 -0
  111. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +756 -0
  112. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +4 -0
  113. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +866 -0
  114. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +4 -0
  115. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +52 -0
  116. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +4 -0
  117. package/artifacts/contracts/registry/Registry.sol/Registry.json +858 -0
  118. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +4 -0
  119. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +285 -0
  120. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +4 -0
  121. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +1158 -0
  122. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +4 -0
  123. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +670 -0
  124. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +4 -0
  125. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +559 -0
  126. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +4 -0
  127. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +498 -0
  128. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +4 -0
  129. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.json +107 -0
  130. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +4 -0
  131. package/artifacts/contracts/shared/ERC165.sol/ERC165.json +73 -0
  132. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +4 -0
  133. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +138 -0
  134. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
  135. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +129 -0
  136. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +4 -0
  137. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +188 -0
  138. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
  139. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.json +48 -0
  140. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +4 -0
  141. package/artifacts/contracts/shared/IService.sol/IService.json +335 -0
  142. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +4 -0
  143. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +55 -0
  144. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +4 -0
  145. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +251 -0
  146. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
  147. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +248 -0
  148. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +4 -0
  149. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +582 -0
  150. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +4 -0
  151. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +352 -0
  152. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
  153. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +84 -0
  154. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +4 -0
  155. package/artifacts/contracts/shared/Service.sol/Service.json +496 -0
  156. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +4 -0
  157. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +96 -0
  158. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
  159. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +129 -0
  160. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +4 -0
  161. package/artifacts/contracts/shared/Versionable.sol/Versionable.json +78 -0
  162. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +4 -0
  163. package/artifacts/contracts/test/TestFee.sol/TestFee.json +119 -0
  164. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +4 -0
  165. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +383 -0
  166. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +4 -0
  167. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +116 -0
  168. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +4 -0
  169. package/artifacts/contracts/test/TestService.sol/TestService.json +596 -0
  170. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +4 -0
  171. package/artifacts/contracts/test/TestToken.sol/TestUsdc.json +376 -0
  172. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +4 -0
  173. package/artifacts/contracts/test/TestVersion.sol/TestVersion.json +218 -0
  174. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +4 -0
  175. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +104 -0
  176. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +4 -0
  177. package/artifacts/contracts/test/Usdc.sol/USDC.json +376 -0
  178. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +4 -0
  179. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.json +10 -0
  180. package/artifacts/contracts/types/Amount.sol/AmountLib.dbg.json +4 -0
  181. package/artifacts/contracts/types/Amount.sol/AmountLib.json +209 -0
  182. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +4 -0
  183. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.json +174 -0
  184. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +4 -0
  185. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.json +10 -0
  186. package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.dbg.json +4 -0
  187. package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.json +179 -0
  188. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +4 -0
  189. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +104 -0
  190. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +4 -0
  191. package/artifacts/contracts/types/Fee.sol/FeeLib.json +288 -0
  192. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +4 -0
  193. package/artifacts/contracts/types/Key32.sol/Key32Lib.json +125 -0
  194. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +4 -0
  195. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +166 -0
  196. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +4 -0
  197. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +33 -0
  198. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +4 -0
  199. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.json +100 -0
  200. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +4 -0
  201. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +92 -0
  202. package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.dbg.json +4 -0
  203. package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.json +209 -0
  204. package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +4 -0
  205. package/artifacts/contracts/types/Referral.sol/ReferralLib.json +142 -0
  206. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +4 -0
  207. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +86 -0
  208. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +4 -0
  209. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +156 -0
  210. package/artifacts/contracts/types/Seconds.sol/SecondsLib.dbg.json +4 -0
  211. package/artifacts/contracts/types/Seconds.sol/SecondsLib.json +124 -0
  212. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +4 -0
  213. package/artifacts/contracts/types/StateId.sol/StateIdLib.json +92 -0
  214. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +4 -0
  215. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +280 -0
  216. package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +4 -0
  217. package/artifacts/contracts/types/UFixed.sol/MathLib.json +10 -0
  218. package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +4 -0
  219. package/artifacts/contracts/types/UFixed.sol/UFixedLib.json +479 -0
  220. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +4 -0
  221. package/artifacts/contracts/types/Version.sol/VersionLib.json +177 -0
  222. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +4 -0
  223. package/artifacts/contracts/types/Version.sol/VersionPartLib.json +49 -0
  224. package/contracts/components/Component.sol +253 -0
  225. package/contracts/components/Distribution.sol +284 -0
  226. package/contracts/components/IComponent.sol +76 -0
  227. package/contracts/components/IDistributionComponent.sol +71 -0
  228. package/contracts/components/IPoolComponent.sol +113 -0
  229. package/contracts/components/IProductComponent.sol +40 -0
  230. package/contracts/components/Pool.sol +302 -0
  231. package/contracts/components/Product.sol +371 -0
  232. package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +13 -0
  233. package/contracts/instance/BundleManager.sol +126 -0
  234. package/contracts/instance/Cloneable.sol +51 -0
  235. package/contracts/instance/IInstance.sol +102 -0
  236. package/contracts/instance/IInstanceService.sol +68 -0
  237. package/contracts/instance/Instance.sol +310 -0
  238. package/contracts/instance/InstanceAccessManager.sol +527 -0
  239. package/contracts/instance/InstanceReader.sol +317 -0
  240. package/contracts/instance/InstanceService.sol +478 -0
  241. package/contracts/instance/InstanceServiceManager.sol +54 -0
  242. package/contracts/instance/ObjectManager.sol +82 -0
  243. package/contracts/instance/base/ComponentService.sol +121 -0
  244. package/contracts/instance/base/IKeyValueStore.sol +49 -0
  245. package/contracts/instance/base/ILifecycle.sol +30 -0
  246. package/contracts/instance/base/KeyValueStore.sol +180 -0
  247. package/contracts/instance/base/Lifecycle.sol +117 -0
  248. package/contracts/instance/module/IAccess.sol +54 -0
  249. package/contracts/instance/module/IBundle.sol +23 -0
  250. package/contracts/instance/module/IComponents.sol +41 -0
  251. package/contracts/instance/module/IDistribution.sol +41 -0
  252. package/contracts/instance/module/IPolicy.sol +77 -0
  253. package/contracts/instance/module/IRisk.sol +11 -0
  254. package/contracts/instance/module/ISetup.sol +33 -0
  255. package/contracts/instance/module/ITreasury.sol +23 -0
  256. package/contracts/instance/service/ApplicationService.sol +355 -0
  257. package/contracts/instance/service/ApplicationServiceManager.sol +35 -0
  258. package/contracts/instance/service/BundleService.sol +443 -0
  259. package/contracts/instance/service/BundleServiceManager.sol +51 -0
  260. package/contracts/instance/service/ClaimService.sol +239 -0
  261. package/contracts/instance/service/ClaimServiceManager.sol +35 -0
  262. package/contracts/instance/service/DistributionService.sol +431 -0
  263. package/contracts/instance/service/DistributionServiceManager.sol +51 -0
  264. package/contracts/instance/service/IApplicationService.sol +78 -0
  265. package/contracts/instance/service/IBundleService.sol +102 -0
  266. package/contracts/instance/service/IClaimService.sol +92 -0
  267. package/contracts/instance/service/IDistributionService.sol +99 -0
  268. package/contracts/instance/service/IPolicyService.sol +137 -0
  269. package/contracts/instance/service/IPoolService.sol +102 -0
  270. package/contracts/instance/service/IProductService.sol +40 -0
  271. package/contracts/instance/service/PolicyService.sol +545 -0
  272. package/contracts/instance/service/PolicyServiceManager.sol +54 -0
  273. package/contracts/instance/service/PoolService.sol +336 -0
  274. package/contracts/instance/service/PoolServiceManager.sol +51 -0
  275. package/contracts/instance/service/ProductService.sol +210 -0
  276. package/contracts/instance/service/ProductServiceManager.sol +54 -0
  277. package/contracts/registry/ChainNft.sol +210 -0
  278. package/contracts/registry/IRegistry.sol +101 -0
  279. package/contracts/registry/IRegistryService.sol +68 -0
  280. package/contracts/registry/ITransferInterceptor.sol +7 -0
  281. package/contracts/registry/Registry.sol +467 -0
  282. package/contracts/registry/RegistryAccessManager.sol +216 -0
  283. package/contracts/registry/RegistryService.sol +282 -0
  284. package/contracts/registry/RegistryServiceManager.sol +62 -0
  285. package/contracts/registry/ReleaseManager.sol +324 -0
  286. package/contracts/registry/TokenRegistry.sol +116 -0
  287. package/contracts/shared/ContractDeployerLib.sol +72 -0
  288. package/contracts/shared/ERC165.sol +27 -0
  289. package/contracts/shared/INftOwnable.sol +23 -0
  290. package/contracts/shared/IPolicyHolder.sol +26 -0
  291. package/contracts/shared/IRegisterable.sol +15 -0
  292. package/contracts/shared/IRegistryLinked.sol +12 -0
  293. package/contracts/shared/IService.sol +16 -0
  294. package/contracts/shared/IVersionable.sol +53 -0
  295. package/contracts/shared/NftOwnable.sol +120 -0
  296. package/contracts/shared/PolicyHolder.sol +81 -0
  297. package/contracts/shared/ProxyManager.sol +169 -0
  298. package/contracts/shared/Registerable.sol +74 -0
  299. package/contracts/shared/RegistryLinked.sol +48 -0
  300. package/contracts/shared/Service.sol +72 -0
  301. package/contracts/shared/TokenHandler.sol +33 -0
  302. package/contracts/shared/UpgradableProxyWithAdmin.sol +16 -0
  303. package/contracts/shared/Versionable.sol +59 -0
  304. package/contracts/test/TestFee.sol +25 -0
  305. package/contracts/test/TestRegisterable.sol +18 -0
  306. package/contracts/test/TestRoleId.sol +14 -0
  307. package/contracts/test/TestService.sol +25 -0
  308. package/contracts/{Dip.sol → test/TestToken.sol} +5 -5
  309. package/contracts/test/TestVersion.sol +44 -0
  310. package/contracts/test/TestVersionable.sol +17 -0
  311. package/contracts/test/Usdc.sol +26 -0
  312. package/contracts/types/AddressSet.sol +58 -0
  313. package/contracts/types/Amount.sol +70 -0
  314. package/contracts/types/Blocknumber.sol +119 -0
  315. package/contracts/types/ChainId.sol +38 -0
  316. package/contracts/types/ClaimId.sol +75 -0
  317. package/contracts/types/DistributorType.sol +55 -0
  318. package/contracts/types/Fee.sol +64 -0
  319. package/contracts/types/Key32.sol +50 -0
  320. package/contracts/types/NftId.sol +80 -0
  321. package/contracts/types/NftIdSet.sol +62 -0
  322. package/contracts/types/NumberId.sol +52 -0
  323. package/contracts/types/ObjectType.sol +157 -0
  324. package/contracts/types/PayoutId.sol +82 -0
  325. package/contracts/types/Referral.sol +89 -0
  326. package/contracts/types/RiskId.sol +43 -0
  327. package/contracts/types/RoleId.sol +97 -0
  328. package/contracts/types/Seconds.sol +54 -0
  329. package/contracts/types/StateId.sol +110 -0
  330. package/contracts/types/Timestamp.sol +132 -0
  331. package/contracts/types/UFixed.sol +326 -0
  332. package/contracts/types/Version.sol +108 -0
  333. package/package.json +26 -10
  334. package/artifacts/contracts/Dip.sol/DIP.dbg.json +0 -4
  335. package/artifacts/contracts/Dip.sol/DIP.json +0 -338
  336. package/artifacts/contracts/Lock.sol/Lock.dbg.json +0 -4
  337. package/artifacts/contracts/Lock.sol/Lock.json +0 -74
  338. package/contracts/Lock.sol +0 -34
@@ -0,0 +1,317 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.20;
3
+
4
+ import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
5
+
6
+ import {ClaimId} from "../types/ClaimId.sol";
7
+ import {DistributorType} from "../types/DistributorType.sol";
8
+ import {Fee, FeeLib} from "../types/Fee.sol";
9
+ import {Key32} from "../types/Key32.sol";
10
+ import {NftId} from "../types/NftId.sol";
11
+ import {ObjectType, DISTRIBUTOR, DISTRIBUTION, INSTANCE, PRODUCT, POLICY, POOL, TREASURY, BUNDLE} from "../types/ObjectType.sol";
12
+ import {ReferralId, ReferralStatus, ReferralLib, REFERRAL_OK, REFERRAL_ERROR_UNKNOWN, REFERRAL_ERROR_EXPIRED, REFERRAL_ERROR_EXHAUSTED} from "../types/Referral.sol";
13
+ import {Registerable} from "../shared/Registerable.sol";
14
+ import {RiskId} from "../types/RiskId.sol";
15
+ import {UFixed, MathLib, UFixedLib} from "../types/UFixed.sol";
16
+ import {Version} from "../types/Version.sol";
17
+ import {StateId} from "../types/StateId.sol";
18
+
19
+ import {IRegistry} from "../registry/IRegistry.sol";
20
+ import {IBundle} from "../instance/module/IBundle.sol";
21
+ import {IComponents} from "../instance/module/IComponents.sol";
22
+ import {IDistribution} from "../instance/module/IDistribution.sol";
23
+ import {IInstance} from "./IInstance.sol";
24
+ import {IKeyValueStore} from "../instance/base/IKeyValueStore.sol";
25
+ import {IPolicy} from "../instance/module/IPolicy.sol";
26
+ import {IRisk} from "../instance/module/IRisk.sol";
27
+ import {ISetup} from "../instance/module/ISetup.sol";
28
+ import {ITreasury} from "../instance/module/ITreasury.sol";
29
+ import {TimestampLib} from "../types/Timestamp.sol";
30
+
31
+
32
+ contract InstanceReader {
33
+
34
+ error ErrorInstanceReaderAlreadyInitialized();
35
+ error ErrorInstanceReaderInstanceAddressZero();
36
+
37
+ bool private _initialized;
38
+
39
+ IInstance internal _instance;
40
+ IKeyValueStore internal _store;
41
+
42
+ function initialize(address instance) public {
43
+ if(_initialized) {
44
+ revert ErrorInstanceReaderAlreadyInitialized();
45
+ }
46
+
47
+ if(address(instance) == address(0)) {
48
+ revert ErrorInstanceReaderInstanceAddressZero();
49
+ }
50
+
51
+ _instance = IInstance(instance);
52
+ _store = IKeyValueStore(instance);
53
+
54
+ _initialized = true;
55
+ }
56
+
57
+
58
+ // module specific functions
59
+
60
+ function getPolicyInfo(NftId policyNftId)
61
+ public
62
+ view
63
+ returns (IPolicy.PolicyInfo memory info)
64
+ {
65
+ bytes memory data = _store.getData(toPolicyKey(policyNftId));
66
+ if (data.length > 0) {
67
+ return abi.decode(data, (IPolicy.PolicyInfo));
68
+ }
69
+ }
70
+
71
+ function getPolicyState(NftId policyNftId)
72
+ public
73
+ view
74
+ returns (StateId state)
75
+ {
76
+ return _instance.getState(toPolicyKey(policyNftId));
77
+ }
78
+
79
+ function getClaimInfo(NftId policyNftId, ClaimId claimId)
80
+ public
81
+ view
82
+ returns (IPolicy.ClaimInfo memory info)
83
+ {
84
+ bytes memory data = _store.getData(claimId.toKey32(policyNftId));
85
+ if (data.length > 0) {
86
+ return abi.decode(data, (IPolicy.ClaimInfo));
87
+ }
88
+ }
89
+
90
+ function getClaimState(NftId policyNftId, ClaimId claimId)
91
+ public
92
+ view
93
+ returns (StateId state)
94
+ {
95
+ return _instance.getState(claimId.toKey32(policyNftId));
96
+ }
97
+
98
+ function getRiskInfo(RiskId riskId)
99
+ public
100
+ view
101
+ returns (IRisk.RiskInfo memory info)
102
+ {
103
+ bytes memory data = _store.getData(riskId.toKey32());
104
+ if (data.length > 0) {
105
+ return abi.decode(data, (IRisk.RiskInfo));
106
+ }
107
+ }
108
+
109
+ function getTokenHandler(NftId productNftId)
110
+ public
111
+ view
112
+ returns (address tokenHandler)
113
+ {
114
+ bytes memory data = _store.getData(toTreasuryKey(productNftId));
115
+
116
+ if (data.length > 0) {
117
+ ITreasury.TreasuryInfo memory info = abi.decode(data, (ITreasury.TreasuryInfo));
118
+ return address(info.tokenHandler);
119
+ }
120
+ }
121
+
122
+ function getTreasuryInfo(NftId productNftId)
123
+ public
124
+ view
125
+ returns (ITreasury.TreasuryInfo memory info)
126
+ {
127
+ bytes memory data = _store.getData(toTreasuryKey(productNftId));
128
+ if (data.length > 0) {
129
+ return abi.decode(data, (ITreasury.TreasuryInfo));
130
+ }
131
+ }
132
+
133
+ function getBundleInfo(NftId bundleNftId)
134
+ public
135
+ view
136
+ returns (IBundle.BundleInfo memory info)
137
+ {
138
+ bytes memory data = _store.getData(toBundleKey(bundleNftId));
139
+ if (data.length > 0) {
140
+ return abi.decode(data, (IBundle.BundleInfo));
141
+ }
142
+ }
143
+
144
+ function getDistributorTypeInfo(DistributorType distributorType)
145
+ public
146
+ view
147
+ returns (IDistribution.DistributorTypeInfo memory info)
148
+ {
149
+ bytes memory data = _store.getData(distributorType.toKey32());
150
+ if (data.length > 0) {
151
+ return abi.decode(data, (IDistribution.DistributorTypeInfo));
152
+ }
153
+ }
154
+
155
+ function getDistributorInfo(NftId distributorNftId)
156
+ public
157
+ view
158
+ returns (IDistribution.DistributorInfo memory info)
159
+ {
160
+ bytes memory data = _store.getData(toDistributorKey(distributorNftId));
161
+ if (data.length > 0) {
162
+ return abi.decode(data, (IDistribution.DistributorInfo));
163
+ }
164
+ }
165
+
166
+ function getDistributionSetupInfo(NftId distributionNftId)
167
+ public
168
+ view
169
+ returns (ISetup.DistributionSetupInfo memory info)
170
+ {
171
+ bytes memory data = _store.getData(toDistributionKey(distributionNftId));
172
+ if (data.length > 0) {
173
+ return abi.decode(data, (ISetup.DistributionSetupInfo));
174
+ }
175
+ }
176
+
177
+ // TODO consider to replace by component type specific getXyzInfo
178
+ function getComponentInfo(NftId poolNftId)
179
+ public
180
+ view
181
+ returns (IComponents.ComponentInfo memory info)
182
+ {
183
+ bytes memory data = _store.getData(toPoolKey(poolNftId));
184
+ if (data.length > 0) {
185
+ return abi.decode(data, (IComponents.ComponentInfo));
186
+ }
187
+ }
188
+
189
+ function getProductSetupInfo(NftId productNftId)
190
+ public
191
+ view
192
+ returns (ISetup.ProductSetupInfo memory info)
193
+ {
194
+ bytes memory data = _store.getData(toProductKey(productNftId));
195
+ if (data.length > 0) {
196
+ return abi.decode(data, (ISetup.ProductSetupInfo));
197
+ }
198
+ }
199
+
200
+ function getReferralInfo(ReferralId referralId)
201
+ public
202
+ view
203
+ returns (IDistribution.ReferralInfo memory info)
204
+ {
205
+ bytes memory data = _store.getData(referralId.toKey32());
206
+ if (data.length > 0) {
207
+ return abi.decode(data, (IDistribution.ReferralInfo));
208
+ }
209
+ }
210
+
211
+
212
+ function getMetadata(Key32 key)
213
+ public
214
+ view
215
+ returns (IKeyValueStore.Metadata memory metadata)
216
+ {
217
+ return _store.getMetadata(key);
218
+ }
219
+
220
+
221
+ function toReferralId(
222
+ NftId distributionNftId,
223
+ string memory referralCode
224
+ )
225
+ public
226
+ pure
227
+ returns (ReferralId referralId)
228
+ {
229
+ return ReferralLib.toReferralId(
230
+ distributionNftId,
231
+ referralCode);
232
+ }
233
+
234
+
235
+ function getDiscountPercentage(ReferralId referralId)
236
+ public
237
+ view
238
+ returns (
239
+ UFixed discountPercentage,
240
+ ReferralStatus status
241
+ )
242
+ {
243
+ IDistribution.ReferralInfo memory info = getReferralInfo(
244
+ referralId);
245
+
246
+ if (info.expiryAt.eqz()) {
247
+ return (
248
+ UFixedLib.zero(),
249
+ REFERRAL_ERROR_UNKNOWN());
250
+ }
251
+
252
+ if (info.expiryAt < TimestampLib.blockTimestamp()) {
253
+ return (
254
+ UFixedLib.zero(),
255
+ REFERRAL_ERROR_EXPIRED());
256
+ }
257
+
258
+ if (info.usedReferrals >= info.maxReferrals) {
259
+ return (
260
+ UFixedLib.zero(),
261
+ REFERRAL_ERROR_EXHAUSTED());
262
+ }
263
+
264
+ return (
265
+ info.discountPercentage,
266
+ REFERRAL_OK()
267
+ );
268
+ }
269
+
270
+
271
+ function toTreasuryKey(NftId productNftId) public pure returns (Key32) {
272
+ return productNftId.toKey32(TREASURY());
273
+ }
274
+
275
+
276
+ function toPolicyKey(NftId policyNftId) public pure returns (Key32) {
277
+ return policyNftId.toKey32(POLICY());
278
+ }
279
+
280
+
281
+ function toDistributorKey(NftId distributorNftId) public pure returns (Key32) {
282
+ return distributorNftId.toKey32(DISTRIBUTOR());
283
+ }
284
+
285
+ function toDistributionKey(NftId distributionNftId) public pure returns (Key32) {
286
+ return distributionNftId.toKey32(DISTRIBUTION());
287
+ }
288
+
289
+ function toBundleKey(NftId poolNftId) public pure returns (Key32) {
290
+ return poolNftId.toKey32(BUNDLE());
291
+ }
292
+
293
+ function toPoolKey(NftId poolNftId) public pure returns (Key32) {
294
+ return poolNftId.toKey32(POOL());
295
+ }
296
+
297
+ function toProductKey(NftId productNftId) public pure returns (Key32) {
298
+ return productNftId.toKey32(PRODUCT());
299
+ }
300
+
301
+ // low level function
302
+ function getInstance() external view returns (IInstance instance) {
303
+ return _instance;
304
+ }
305
+
306
+ function getInstanceStore() external view returns (IKeyValueStore store) {
307
+ return _store;
308
+ }
309
+
310
+ function toUFixed(uint256 value, int8 exp) public pure returns (UFixed) {
311
+ return UFixedLib.toUFixed(value, exp);
312
+ }
313
+
314
+ function toInt(UFixed value) public pure returns (uint256) {
315
+ return UFixedLib.toInt(value);
316
+ }
317
+ }