@etherisc/gif-next 0.0.2-0f052b7-423 → 0.0.2-0f514c8-093

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 (468) hide show
  1. package/README.md +6 -83
  2. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +4 -0
  3. package/artifacts/contracts/{components → distribution}/Distribution.sol/Distribution.json +246 -155
  4. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +4 -0
  5. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +1343 -0
  6. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +4 -0
  7. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +760 -0
  8. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +4 -0
  9. package/artifacts/contracts/{components → distribution}/IDistributionComponent.sol/IDistributionComponent.json +195 -95
  10. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +4 -0
  11. package/artifacts/contracts/{instance/service → distribution}/IDistributionService.sol/IDistributionService.json +114 -319
  12. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
  13. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +6 -6
  14. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  15. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +310 -2004
  16. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  17. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +144 -51
  18. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  19. package/artifacts/contracts/instance/Instance.sol/Instance.json +434 -2758
  20. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
  21. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +99 -62
  22. package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +4 -0
  23. package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +132 -0
  24. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  25. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +601 -310
  26. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  27. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +204 -198
  28. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  29. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +48 -85
  30. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +4 -0
  31. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +3500 -0
  32. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +4 -0
  33. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +318 -0
  34. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +4 -0
  35. package/artifacts/contracts/instance/{Cloneable.sol → base/Cloneable.sol}/Cloneable.json +1 -1
  36. package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +4 -0
  37. package/artifacts/contracts/instance/{ObjectManager.sol → base/ObjectManager.sol}/ObjectManager.json +3 -3
  38. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  39. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +6 -6
  40. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  41. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  42. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  43. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  44. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  45. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +4 -0
  46. package/artifacts/contracts/mock/Dip.sol/Dip.json +376 -0
  47. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +4 -0
  48. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +1091 -0
  49. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +4 -0
  50. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +684 -0
  51. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +4 -0
  52. package/artifacts/contracts/{instance/service → pool}/IBundleService.sol/IBundleService.json +206 -152
  53. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +4 -0
  54. package/artifacts/contracts/{components → pool}/IPoolComponent.sol/IPoolComponent.json +281 -87
  55. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +4 -0
  56. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +1044 -0
  57. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +4 -0
  58. package/artifacts/contracts/{components → pool}/Pool.sol/Pool.json +291 -88
  59. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +4 -0
  60. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +1411 -0
  61. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +4 -0
  62. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +680 -0
  63. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +4 -0
  64. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +820 -0
  65. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
  66. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +660 -0
  67. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +4 -0
  68. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +1264 -0
  69. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
  70. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +748 -0
  71. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +4 -0
  72. package/artifacts/contracts/{instance/service/IClaimService.sol/IClaimService.json → product/IApplicationService.sol/IApplicationService.json} +184 -100
  73. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +4 -0
  74. package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +753 -0
  75. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +4 -0
  76. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +701 -0
  77. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +4 -0
  78. package/artifacts/contracts/{instance/service/IApplicationService.sol/IApplicationService.json → product/IPricingService.sol/IPricingService.json} +140 -166
  79. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +4 -0
  80. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +989 -0
  81. package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +4 -0
  82. package/artifacts/contracts/{instance/service → product}/IProductService.sol/IProductService.json +74 -77
  83. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +4 -0
  84. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +1132 -0
  85. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +4 -0
  86. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +692 -0
  87. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +4 -0
  88. package/artifacts/contracts/product/PricingService.sol/PricingService.json +969 -0
  89. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +4 -0
  90. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +716 -0
  91. package/artifacts/contracts/product/Product.sol/Product.dbg.json +4 -0
  92. package/artifacts/contracts/product/Product.sol/Product.json +1391 -0
  93. package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +4 -0
  94. package/artifacts/contracts/product/ProductService.sol/ProductService.json +673 -0
  95. package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +4 -0
  96. package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +636 -0
  97. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  98. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
  99. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  100. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +53 -0
  101. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  102. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +138 -38
  103. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  104. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  105. package/artifacts/contracts/registry/Registry.sol/Registry.json +163 -16
  106. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
  107. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +43 -20
  108. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  109. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +167 -54
  110. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  111. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +31 -40
  112. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
  113. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +169 -23
  114. package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.dbg.json +4 -0
  115. package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.json +137 -0
  116. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  117. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +344 -50
  118. package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +4 -0
  119. package/artifacts/contracts/{instance → shared}/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +3 -3
  120. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +4 -0
  121. package/artifacts/contracts/{components → shared}/Component.sol/Component.json +137 -79
  122. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +4 -0
  123. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +1461 -0
  124. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +4 -0
  125. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +736 -0
  126. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +4 -0
  127. package/artifacts/contracts/{instance/base/ComponentService.sol/ComponentService.json → shared/ComponentVerifyingService.sol/ComponentVerifyingService.json} +88 -120
  128. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  129. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +4 -0
  130. package/artifacts/contracts/{components → shared}/IComponent.sol/IComponent.json +173 -53
  131. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +4 -0
  132. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +854 -0
  133. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +4 -0
  134. package/artifacts/contracts/{components/IProductComponent.sol/IProductComponent.json → shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json} +169 -200
  135. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +4 -0
  136. package/artifacts/contracts/{instance/base → shared}/IKeyValueStore.sol/IKeyValueStore.json +50 -1
  137. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +4 -0
  138. package/artifacts/contracts/{instance/base → shared}/ILifecycle.sol/ILifecycle.json +1 -1
  139. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  140. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +0 -13
  141. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  142. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +69 -9
  143. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  144. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +0 -13
  145. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  146. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.json +0 -13
  147. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  148. package/artifacts/contracts/shared/IService.sol/IService.json +85 -27
  149. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  150. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +4 -0
  151. package/artifacts/contracts/{components/Product.sol/Product.json → shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json} +160 -287
  152. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +4 -0
  153. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +581 -0
  154. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +4 -0
  155. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +194 -0
  156. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  157. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +8 -21
  158. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  159. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +80 -26
  160. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  161. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +20 -33
  162. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  163. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +16 -21
  164. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  165. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
  166. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  167. package/artifacts/contracts/shared/Service.sol/Service.json +91 -28
  168. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  169. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +60 -6
  170. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  171. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
  172. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  173. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +4 -0
  174. package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1856 -0
  175. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +4 -0
  176. package/artifacts/contracts/{instance/service/IPolicyService.sol/IPolicyService.json → staking/IStakingService.sol/IStakingService.json} +208 -190
  177. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +4 -0
  178. package/artifacts/contracts/staking/Staking.sol/Staking.json +2440 -0
  179. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +4 -0
  180. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +719 -0
  181. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +4 -0
  182. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +818 -0
  183. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +4 -0
  184. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +636 -0
  185. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +4 -0
  186. package/artifacts/contracts/{types → type}/AddressSet.sol/LibAddressSet.json +3 -3
  187. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +4 -0
  188. package/artifacts/contracts/type/Amount.sol/AmountLib.json +281 -0
  189. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +4 -0
  190. package/artifacts/contracts/{types → type}/Blocknumber.sol/BlocknumberLib.json +16 -3
  191. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +4 -0
  192. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +179 -0
  193. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +4 -0
  194. package/artifacts/contracts/{types → type}/DistributorType.sol/DistributorTypeLib.json +5 -5
  195. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +4 -0
  196. package/artifacts/contracts/type/Fee.sol/FeeLib.json +312 -0
  197. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +4 -0
  198. package/artifacts/contracts/{types → type}/Key32.sol/Key32Lib.json +3 -3
  199. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +4 -0
  200. package/artifacts/contracts/type/NftId.sol/NftIdLib.json +185 -0
  201. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +4 -0
  202. package/artifacts/contracts/{types → type}/NftIdSet.sol/LibNftIdSet.json +3 -3
  203. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +4 -0
  204. package/artifacts/contracts/{types → type}/ObjectType.sol/ObjectTypeLib.json +3 -3
  205. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +4 -0
  206. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +209 -0
  207. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +4 -0
  208. package/artifacts/contracts/{types → type}/Referral.sol/ReferralLib.json +5 -5
  209. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +4 -0
  210. package/artifacts/contracts/{types → type}/RiskId.sol/RiskIdLib.json +5 -5
  211. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +4 -0
  212. package/artifacts/contracts/{types → type}/RoleId.sol/RoleIdLib.json +5 -5
  213. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +4 -0
  214. package/artifacts/contracts/{types → type}/Seconds.sol/SecondsLib.json +3 -3
  215. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +4 -0
  216. package/artifacts/contracts/{types → type}/StateId.sol/StateIdLib.json +3 -3
  217. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +4 -0
  218. package/artifacts/contracts/{types → type}/Timestamp.sol/TimestampLib.json +20 -7
  219. package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +4 -0
  220. package/artifacts/contracts/{types → type}/UFixed.sol/MathLib.json +3 -3
  221. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +4 -0
  222. package/artifacts/contracts/{types → type}/UFixed.sol/UFixedLib.json +3 -3
  223. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +4 -0
  224. package/artifacts/contracts/{types → type}/Version.sol/VersionLib.json +3 -3
  225. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +4 -0
  226. package/artifacts/contracts/{types → type}/Version.sol/VersionPartLib.json +3 -3
  227. package/contracts/{components → distribution}/Distribution.sol +45 -62
  228. package/contracts/distribution/DistributionService.sol +297 -0
  229. package/contracts/{instance/service → distribution}/DistributionServiceManager.sol +5 -5
  230. package/contracts/{components → distribution}/IDistributionComponent.sol +10 -15
  231. package/contracts/{instance/service → distribution}/IDistributionService.sol +19 -36
  232. package/contracts/instance/BundleManager.sol +8 -9
  233. package/contracts/instance/IInstance.sol +44 -65
  234. package/contracts/instance/IInstanceService.sol +28 -17
  235. package/contracts/instance/Instance.sol +117 -216
  236. package/contracts/instance/InstanceAccessManager.sol +49 -28
  237. package/contracts/instance/InstanceAuthorizationsLib.sol +336 -0
  238. package/contracts/instance/InstanceReader.sol +133 -57
  239. package/contracts/instance/InstanceService.sol +158 -299
  240. package/contracts/instance/InstanceServiceManager.sol +1 -1
  241. package/contracts/instance/InstanceStore.sol +259 -0
  242. package/contracts/instance/base/BalanceStore.sol +118 -0
  243. package/contracts/instance/{Cloneable.sol → base/Cloneable.sol} +1 -1
  244. package/contracts/instance/{ObjectManager.sol → base/ObjectManager.sol} +7 -7
  245. package/contracts/instance/module/IAccess.sol +4 -4
  246. package/contracts/instance/module/IBundle.sol +8 -9
  247. package/contracts/instance/module/IComponents.sol +22 -5
  248. package/contracts/instance/module/IDistribution.sol +7 -6
  249. package/contracts/instance/module/IPolicy.sol +28 -16
  250. package/contracts/instance/module/IRisk.sol +1 -1
  251. package/contracts/{test/TestToken.sol → mock/Dip.sol} +5 -5
  252. package/contracts/pool/BundleService.sol +313 -0
  253. package/contracts/{instance/service → pool}/BundleServiceManager.sol +5 -5
  254. package/contracts/pool/IBundleService.sol +106 -0
  255. package/contracts/{components → pool}/IPoolComponent.sol +17 -18
  256. package/contracts/pool/IPoolService.sol +147 -0
  257. package/contracts/{components → pool}/Pool.sol +57 -57
  258. package/contracts/pool/PoolService.sol +421 -0
  259. package/contracts/{instance/service → pool}/PoolServiceManager.sol +5 -5
  260. package/contracts/product/ApplicationService.sol +253 -0
  261. package/contracts/{instance/service → product}/ApplicationServiceManager.sol +2 -2
  262. package/contracts/product/ClaimService.sol +436 -0
  263. package/contracts/{instance/service → product}/ClaimServiceManager.sol +2 -2
  264. package/contracts/{instance/service → product}/IApplicationService.sol +14 -34
  265. package/contracts/product/IClaimService.sol +93 -0
  266. package/contracts/{instance/service → product}/IPolicyService.sol +36 -30
  267. package/contracts/product/IPricingService.sol +39 -0
  268. package/contracts/product/IProductComponent.sol +42 -0
  269. package/contracts/product/IProductService.sol +33 -0
  270. package/contracts/product/PolicyService.sol +471 -0
  271. package/contracts/{instance/service → product}/PolicyServiceManager.sol +5 -5
  272. package/contracts/product/PricingService.sol +300 -0
  273. package/contracts/product/PricingServiceManager.sol +51 -0
  274. package/contracts/{components → product}/Product.sol +190 -106
  275. package/contracts/product/ProductService.sol +122 -0
  276. package/contracts/{instance/service → product}/ProductServiceManager.sol +5 -5
  277. package/contracts/registry/ChainNft.sol +7 -1
  278. package/contracts/registry/IRegistry.sol +16 -6
  279. package/contracts/registry/IRegistryService.sol +23 -11
  280. package/contracts/registry/Registry.sol +77 -15
  281. package/contracts/registry/RegistryAccessManager.sol +26 -27
  282. package/contracts/registry/RegistryService.sol +90 -45
  283. package/contracts/registry/RegistryServiceManager.sol +0 -2
  284. package/contracts/registry/ReleaseManager.sol +98 -42
  285. package/contracts/registry/ServiceAuthorizationsLib.sol +173 -0
  286. package/contracts/registry/TokenRegistry.sol +255 -52
  287. package/contracts/shared/Component.sol +286 -0
  288. package/contracts/shared/ComponentService.sol +596 -0
  289. package/contracts/shared/ComponentServiceManager.sol +35 -0
  290. package/contracts/shared/ComponentVerifyingService.sol +111 -0
  291. package/contracts/{components → shared}/IComponent.sol +25 -25
  292. package/contracts/shared/IComponentService.sol +91 -0
  293. package/contracts/shared/IInstanceLinkedComponent.sol +46 -0
  294. package/contracts/{instance/base → shared}/IKeyValueStore.sol +14 -10
  295. package/contracts/{instance/base → shared}/ILifecycle.sol +3 -3
  296. package/contracts/shared/INftOwnable.sol +1 -1
  297. package/contracts/shared/IPolicyHolder.sol +24 -10
  298. package/contracts/shared/IRegistryLinked.sol +0 -1
  299. package/contracts/shared/IService.sol +6 -6
  300. package/contracts/shared/IVersionable.sol +1 -1
  301. package/contracts/shared/InstanceLinkedComponent.sol +145 -0
  302. package/contracts/{instance/base → shared}/KeyValueStore.sol +39 -45
  303. package/contracts/{instance/base → shared}/Lifecycle.sol +17 -5
  304. package/contracts/shared/NftOwnable.sol +1 -3
  305. package/contracts/shared/PolicyHolder.sol +31 -18
  306. package/contracts/shared/ProxyManager.sol +3 -3
  307. package/contracts/shared/Registerable.sol +13 -12
  308. package/contracts/shared/RegistryLinked.sol +0 -5
  309. package/contracts/shared/Service.sol +28 -9
  310. package/contracts/shared/TokenHandler.sol +27 -2
  311. package/contracts/shared/Versionable.sol +1 -1
  312. package/contracts/staking/IStaking.sol +96 -0
  313. package/contracts/staking/IStakingService.sol +109 -0
  314. package/contracts/staking/Staking.sol +345 -0
  315. package/contracts/staking/StakingManager.sol +44 -0
  316. package/contracts/staking/StakingService.sol +208 -0
  317. package/contracts/staking/StakingServiceManager.sol +41 -0
  318. package/contracts/type/Amount.sol +114 -0
  319. package/contracts/{types → type}/Blocknumber.sol +6 -1
  320. package/contracts/{types → type}/ClaimId.sol +25 -2
  321. package/contracts/{types → type}/Fee.sol +32 -23
  322. package/contracts/{types → type}/NftId.sol +5 -12
  323. package/contracts/{types → type}/NftIdSet.sol +1 -1
  324. package/contracts/{types → type}/ObjectType.sol +15 -7
  325. package/contracts/{types → type}/PayoutId.sol +33 -5
  326. package/contracts/{types → type}/RoleId.sol +50 -9
  327. package/contracts/{types → type}/StateId.sol +6 -2
  328. package/contracts/{types → type}/Timestamp.sol +5 -0
  329. package/package.json +1 -1
  330. package/artifacts/contracts/components/Component.sol/Component.dbg.json +0 -4
  331. package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +0 -4
  332. package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +0 -4
  333. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +0 -4
  334. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +0 -4
  335. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +0 -4
  336. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +0 -4
  337. package/artifacts/contracts/components/Product.sol/Product.dbg.json +0 -4
  338. package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
  339. package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +0 -4
  340. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +0 -4
  341. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +0 -4
  342. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +0 -4
  343. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +0 -4
  344. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +0 -4
  345. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +0 -532
  346. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +0 -4
  347. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +0 -194
  348. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +0 -4
  349. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.json +0 -10
  350. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +0 -4
  351. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.json +0 -10
  352. package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.dbg.json +0 -4
  353. package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +0 -968
  354. package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +0 -4
  355. package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +0 -665
  356. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +0 -4
  357. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +0 -1093
  358. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +0 -4
  359. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +0 -661
  360. package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +0 -4
  361. package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +0 -754
  362. package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +0 -4
  363. package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +0 -637
  364. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +0 -4
  365. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +0 -1732
  366. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +0 -4
  367. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +0 -805
  368. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +0 -4
  369. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +0 -4
  370. package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +0 -4
  371. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +0 -4
  372. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +0 -4
  373. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +0 -4
  374. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +0 -428
  375. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +0 -4
  376. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +0 -4
  377. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +0 -1021
  378. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +0 -4
  379. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +0 -689
  380. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +0 -4
  381. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +0 -824
  382. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +0 -4
  383. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +0 -657
  384. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +0 -4
  385. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +0 -777
  386. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +0 -4
  387. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +0 -649
  388. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +0 -4
  389. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.json +0 -107
  390. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +0 -4
  391. package/artifacts/contracts/test/TestFee.sol/TestFee.json +0 -119
  392. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +0 -4
  393. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +0 -383
  394. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +0 -4
  395. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +0 -116
  396. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +0 -4
  397. package/artifacts/contracts/test/TestService.sol/TestService.json +0 -521
  398. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +0 -4
  399. package/artifacts/contracts/test/TestToken.sol/TestUsdc.json +0 -376
  400. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +0 -4
  401. package/artifacts/contracts/test/TestVersion.sol/TestVersion.json +0 -218
  402. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +0 -4
  403. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +0 -104
  404. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +0 -4
  405. package/artifacts/contracts/test/Usdc.sol/USDC.json +0 -376
  406. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +0 -4
  407. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +0 -4
  408. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +0 -4
  409. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.json +0 -10
  410. package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.dbg.json +0 -4
  411. package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.json +0 -100
  412. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +0 -4
  413. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +0 -4
  414. package/artifacts/contracts/types/Fee.sol/FeeLib.json +0 -257
  415. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +0 -4
  416. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +0 -4
  417. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +0 -166
  418. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +0 -4
  419. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +0 -4
  420. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.json +0 -100
  421. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +0 -4
  422. package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.dbg.json +0 -4
  423. package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.json +0 -100
  424. package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +0 -4
  425. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +0 -4
  426. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +0 -4
  427. package/artifacts/contracts/types/Seconds.sol/SecondsLib.dbg.json +0 -4
  428. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +0 -4
  429. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +0 -4
  430. package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +0 -4
  431. package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +0 -4
  432. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +0 -4
  433. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +0 -4
  434. package/contracts/components/Component.sol +0 -251
  435. package/contracts/components/IProductComponent.sol +0 -40
  436. package/contracts/instance/base/ComponentService.sol +0 -134
  437. package/contracts/instance/module/ISetup.sol +0 -33
  438. package/contracts/instance/module/ITreasury.sol +0 -23
  439. package/contracts/instance/service/ApplicationService.sol +0 -350
  440. package/contracts/instance/service/BundleService.sol +0 -336
  441. package/contracts/instance/service/ClaimService.sol +0 -151
  442. package/contracts/instance/service/DistributionService.sol +0 -467
  443. package/contracts/instance/service/IBundleService.sol +0 -62
  444. package/contracts/instance/service/IClaimService.sol +0 -61
  445. package/contracts/instance/service/IPoolService.sol +0 -35
  446. package/contracts/instance/service/IProductService.sol +0 -40
  447. package/contracts/instance/service/PolicyService.sol +0 -403
  448. package/contracts/instance/service/PoolService.sol +0 -220
  449. package/contracts/instance/service/ProductService.sol +0 -241
  450. package/contracts/shared/ContractDeployerLib.sol +0 -72
  451. package/contracts/test/TestFee.sol +0 -25
  452. package/contracts/test/TestRegisterable.sol +0 -18
  453. package/contracts/test/TestRoleId.sol +0 -14
  454. package/contracts/test/TestService.sol +0 -25
  455. package/contracts/test/TestVersion.sol +0 -44
  456. package/contracts/test/TestVersionable.sol +0 -17
  457. package/contracts/test/Usdc.sol +0 -26
  458. package/contracts/types/ChainId.sol +0 -38
  459. package/contracts/types/NumberId.sol +0 -52
  460. /package/contracts/{instance → shared}/AccessManagerUpgradeableInitializeable.sol +0 -0
  461. /package/contracts/{types → type}/AddressSet.sol +0 -0
  462. /package/contracts/{types → type}/DistributorType.sol +0 -0
  463. /package/contracts/{types → type}/Key32.sol +0 -0
  464. /package/contracts/{types → type}/Referral.sol +0 -0
  465. /package/contracts/{types → type}/RiskId.sol +0 -0
  466. /package/contracts/{types → type}/Seconds.sol +0 -0
  467. /package/contracts/{types → type}/UFixed.sol +0 -0
  468. /package/contracts/{types → type}/Version.sol +0 -0
package/README.md CHANGED
@@ -1,18 +1,6 @@
1
1
  # GIF-Next (Generic Insurance Framework, next version)
2
2
 
3
3
 
4
- ```mermaid
5
- graph TD
6
- IPoolComponent --> IComponent
7
- IComponent --> IRegisterable
8
- IComponent --> ITransferInterceptor
9
- IRegistryService --> IService
10
- IService-->IRegisterable
11
- IService-->IVersionable
12
- IRegisterable-->INftOwnable
13
- INftOwnable-->IERC165
14
- ```
15
-
16
4
  ## Add OpenZeppelin V5 Dependencies
17
5
 
18
6
  ```shell
@@ -40,6 +28,10 @@ This repository uses submodules. To checkout or update to the latest submodules,
40
28
  git submodule update --recursive
41
29
  ```
42
30
 
31
+ ## Example components
32
+
33
+ A (very early) example of a product and a pool can be found in the [gif-next-sandbox repository](https://github.com/etherisc/gif-next-sandbox).
34
+
43
35
  ## Hardhat
44
36
 
45
37
  ### NPM Commands
@@ -232,17 +224,7 @@ https://book.getfoundry.sh/reference/
232
224
 
233
225
  ## Style Guide
234
226
 
235
- Solidity code is to be written according to the [Solidity Style Guide](https://docs.soliditylang.org/en/latest/style-guide.html).
236
-
237
- Documentation of the code should be written inline using [NatSpec](https://docs.soliditylang.org/en/latest/natspec-format.html).
238
-
239
- ### Naming conventions
240
-
241
- Additionally, we use the following naming conventions:
242
-
243
- - Function arguments and return types: If using custom data types, make the name include the type by appending the Type to the argument name, e.g. `function getInfo(NftId bundleNftId)` instead of `function getInfo(NftId bundleId)`. Background: Custom data types are lost when using the ABI or Typescript binding classes (e.g. instead of `NftID` a `uint96` is used), so the type needs to be included in the name to make it clear what the argument is without having to look at the documentation or checking the solidity source code.
244
- - When naming a field or an attribute `id` and the context is not clear, call it `nftId` instead so its clear what type if id it is as there will be multiple ids for different kind of objects. Example: if you the function has a bundle nft id and a policy nft id as arguments, call them `bundleNftId` and `policyNftId` instead of `id` and `policyId`. In case of doubt, be a bit more verbose for the sake of clarity.
245
- - When naming things, remember that the code will likely be used in Javascript/Typescript as well, so avoid names that are reserved in Javascript/Typescript. A list of reserved words in Javascript can be found [here](https://www.w3schools.com/js/js_reserved.asp) and a list of reserved words in Typescript can be found [here](https://www.tektutorialshub.com/typescript/identifiers-keywords-in-typescript/).
227
+ Please see https://docs.etherisc.com/gif-next/3.x/ for style guide and general coding rules.
246
228
 
247
229
  ### Automatic code formatting
248
230
 
@@ -257,7 +239,7 @@ We use solhint to lint the code.
257
239
  To execute linting run `npm run lint`.
258
240
 
259
241
 
260
- ### Adding Brownie (Legacy)
242
+ ### Adding Brownie (Legacy - don't do that :wink: )
261
243
 
262
244
  python3 is already installed
263
245
 
@@ -405,65 +387,6 @@ Intercepting property
405
387
 
406
388
  ### Product
407
389
 
408
- ### Payout Handling
409
-
410
- Pool specifies **retention level**.
411
- Retention level defines up to which percentage of the sum insured the pool is payout out using its own/current funds.
412
- Depending on the amount of a new payout the poolService decides to either execute the payout directly or to add the payout as a pending payout with a notification of the pool.
413
-
414
- The sequence below sketches the small payout flow (payout < retention amount)
415
- - retention level: 30%
416
- - sum insured: 1000
417
- - payout: 200
418
-
419
- ```mermaid
420
- sequenceDiagram
421
- participant customer
422
- participant product
423
- participant claimService
424
- participant poolService
425
- participant pool
426
- product->>claimService: createPayout()
427
- claimService ->> poolService: requestPayout()
428
- poolService -->> pool: verifyPayout() *
429
- poolService ->> poolService: processPayout()
430
- poolService ->> customer: transfer token for payout
431
- poolService ->> claimService: payoutExecuted()
432
- poolService -->> customer: payoutExecutedCallback() **
433
- ```
434
-
435
- *: if pool is configured to verify payouts before execution
436
-
437
- **: callback only if customer is contract (IPolicyHolder)
438
-
439
- The sequence below sketches the call flow for payouts larger than the retention amount
440
- - retention level: 30%
441
- - sum insured: 1000
442
- - payout: 500
443
- * locally available: 300
444
- * via policy (re-insurance): 200
445
-
446
- ```mermaid
447
- sequenceDiagram
448
- participant customer
449
- participant product
450
- participant claimService
451
- participant poolService
452
- participant pool
453
- pool ->> reinsuranceProduct: applyForPolicy()
454
- product->>claimService: createPayout()
455
- claimService ->> poolService: requestPayout()
456
- poolService ->> pool: pendingPayoutAdded()
457
- pool ->> pool: getReinsurancePolicy()
458
- pool ->> reinsuranceProduct: claim()
459
- reinsuranceProduct -->> reinsurancePool: createPayout
460
- reinsurancePool ->> pool: transfer token for payout
461
- reinsurancePool ->> pool: payoutExecutedCallback()
462
- pool ->> poolService: processPendingPayout()
463
- poolService ->> customer: transfer token for payout
464
- poolService ->> claimService: payoutExecuted()
465
- ```
466
-
467
390
  ### Pool
468
391
 
469
392
  ### Distribution
@@ -0,0 +1,4 @@
1
+ {
2
+ "_format": "hh-sol-dbg-1",
3
+ "buildInfo": "../../../build-info/4cf34eb71913d1c28a84c3b05a48d0f5.json"
4
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "_format": "hh-sol-artifact-1",
3
3
  "contractName": "Distribution",
4
- "sourceName": "contracts/components/Distribution.sol",
4
+ "sourceName": "contracts/distribution/Distribution.sol",
5
5
  "abi": [
6
6
  {
7
7
  "inputs": [
@@ -63,6 +63,11 @@
63
63
  "name": "AddressInsufficientBalance",
64
64
  "type": "error"
65
65
  },
66
+ {
67
+ "inputs": [],
68
+ "name": "ErrorComponentNameLengthZero",
69
+ "type": "error"
70
+ },
66
71
  {
67
72
  "inputs": [
68
73
  {
@@ -101,6 +106,11 @@
101
106
  "name": "ErrorComponentProductNftAlreadySet",
102
107
  "type": "error"
103
108
  },
109
+ {
110
+ "inputs": [],
111
+ "name": "ErrorComponentTokenAddressZero",
112
+ "type": "error"
113
+ },
104
114
  {
105
115
  "inputs": [],
106
116
  "name": "ErrorComponentWalletAddressIsSameAsCurrent",
@@ -137,6 +147,27 @@
137
147
  "name": "ErrorComponentWalletAllowanceTooSmall",
138
148
  "type": "error"
139
149
  },
150
+ {
151
+ "inputs": [],
152
+ "name": "ErrorComponentWalletNotComponent",
153
+ "type": "error"
154
+ },
155
+ {
156
+ "inputs": [
157
+ {
158
+ "internalType": "address",
159
+ "name": "distributor",
160
+ "type": "address"
161
+ },
162
+ {
163
+ "internalType": "NftId",
164
+ "name": "distributorNftId",
165
+ "type": "uint96"
166
+ }
167
+ ],
168
+ "name": "ErrorDistributionAlreadyDistributor",
169
+ "type": "error"
170
+ },
140
171
  {
141
172
  "inputs": [
142
173
  {
@@ -238,6 +269,25 @@
238
269
  "name": "Initialized",
239
270
  "type": "event"
240
271
  },
272
+ {
273
+ "anonymous": false,
274
+ "inputs": [
275
+ {
276
+ "indexed": false,
277
+ "internalType": "address",
278
+ "name": "token",
279
+ "type": "address"
280
+ },
281
+ {
282
+ "indexed": false,
283
+ "internalType": "uint256",
284
+ "name": "limit",
285
+ "type": "uint256"
286
+ }
287
+ ],
288
+ "name": "LogComponentTokenHandlerApproved",
289
+ "type": "event"
290
+ },
241
291
  {
242
292
  "anonymous": false,
243
293
  "inputs": [
@@ -327,6 +377,19 @@
327
377
  "stateMutability": "view",
328
378
  "type": "function"
329
379
  },
380
+ {
381
+ "inputs": [],
382
+ "name": "INSTANCE_LINKED_COMPONENT_LOCATION_V1",
383
+ "outputs": [
384
+ {
385
+ "internalType": "bytes32",
386
+ "name": "",
387
+ "type": "bytes32"
388
+ }
389
+ ],
390
+ "stateMutability": "view",
391
+ "type": "function"
392
+ },
330
393
  {
331
394
  "inputs": [],
332
395
  "name": "NFT_OWNABLE_STORAGE_LOCATION_V1",
@@ -353,6 +416,37 @@
353
416
  "stateMutability": "view",
354
417
  "type": "function"
355
418
  },
419
+ {
420
+ "inputs": [
421
+ {
422
+ "internalType": "uint256",
423
+ "name": "spendingLimitAmount",
424
+ "type": "uint256"
425
+ }
426
+ ],
427
+ "name": "approveTokenHandler",
428
+ "outputs": [],
429
+ "stateMutability": "nonpayable",
430
+ "type": "function"
431
+ },
432
+ {
433
+ "inputs": [
434
+ {
435
+ "internalType": "address",
436
+ "name": "token",
437
+ "type": "address"
438
+ },
439
+ {
440
+ "internalType": "uint256",
441
+ "name": "spendingLimitAmount",
442
+ "type": "uint256"
443
+ }
444
+ ],
445
+ "name": "approveTokenHandler",
446
+ "outputs": [],
447
+ "stateMutability": "nonpayable",
448
+ "type": "function"
449
+ },
356
450
  {
357
451
  "inputs": [],
358
452
  "name": "authority",
@@ -489,6 +583,11 @@
489
583
  "name": "name",
490
584
  "type": "string"
491
585
  },
586
+ {
587
+ "internalType": "NftId",
588
+ "name": "productNftId",
589
+ "type": "uint96"
590
+ },
492
591
  {
493
592
  "internalType": "contract IERC20Metadata",
494
593
  "name": "token",
@@ -542,31 +641,6 @@
542
641
  "stateMutability": "view",
543
642
  "type": "function"
544
643
  },
545
- {
546
- "inputs": [],
547
- "name": "getDistributionFee",
548
- "outputs": [
549
- {
550
- "components": [
551
- {
552
- "internalType": "UFixed",
553
- "name": "fractionalFee",
554
- "type": "uint256"
555
- },
556
- {
557
- "internalType": "uint256",
558
- "name": "fixedFee",
559
- "type": "uint256"
560
- }
561
- ],
562
- "internalType": "struct Fee",
563
- "name": "distributionFee",
564
- "type": "tuple"
565
- }
566
- ],
567
- "stateMutability": "view",
568
- "type": "function"
569
- },
570
644
  {
571
645
  "inputs": [
572
646
  {
@@ -586,6 +660,51 @@
586
660
  "stateMutability": "view",
587
661
  "type": "function"
588
662
  },
663
+ {
664
+ "inputs": [],
665
+ "name": "getInitialComponentInfo",
666
+ "outputs": [
667
+ {
668
+ "components": [
669
+ {
670
+ "internalType": "string",
671
+ "name": "name",
672
+ "type": "string"
673
+ },
674
+ {
675
+ "internalType": "NftId",
676
+ "name": "productNftId",
677
+ "type": "uint96"
678
+ },
679
+ {
680
+ "internalType": "contract IERC20Metadata",
681
+ "name": "token",
682
+ "type": "address"
683
+ },
684
+ {
685
+ "internalType": "contract TokenHandler",
686
+ "name": "tokenHandler",
687
+ "type": "address"
688
+ },
689
+ {
690
+ "internalType": "address",
691
+ "name": "wallet",
692
+ "type": "address"
693
+ },
694
+ {
695
+ "internalType": "bytes",
696
+ "name": "data",
697
+ "type": "bytes"
698
+ }
699
+ ],
700
+ "internalType": "struct IComponents.ComponentInfo",
701
+ "name": "info",
702
+ "type": "tuple"
703
+ }
704
+ ],
705
+ "stateMutability": "view",
706
+ "type": "function"
707
+ },
589
708
  {
590
709
  "inputs": [],
591
710
  "name": "getInitialInfo",
@@ -735,11 +854,11 @@
735
854
  },
736
855
  {
737
856
  "inputs": [],
738
- "name": "getRegistryAddress",
857
+ "name": "getToken",
739
858
  "outputs": [
740
859
  {
741
- "internalType": "address",
742
- "name": "",
860
+ "internalType": "contract IERC20Metadata",
861
+ "name": "token",
743
862
  "type": "address"
744
863
  }
745
864
  ],
@@ -748,80 +867,11 @@
748
867
  },
749
868
  {
750
869
  "inputs": [],
751
- "name": "getSetupInfo",
870
+ "name": "getTokenHandler",
752
871
  "outputs": [
753
872
  {
754
- "components": [
755
- {
756
- "internalType": "NftId",
757
- "name": "productNftId",
758
- "type": "uint96"
759
- },
760
- {
761
- "internalType": "contract TokenHandler",
762
- "name": "tokenHandler",
763
- "type": "address"
764
- },
765
- {
766
- "components": [
767
- {
768
- "internalType": "UFixed",
769
- "name": "fractionalFee",
770
- "type": "uint256"
771
- },
772
- {
773
- "internalType": "uint256",
774
- "name": "fixedFee",
775
- "type": "uint256"
776
- }
777
- ],
778
- "internalType": "struct Fee",
779
- "name": "minDistributionOwnerFee",
780
- "type": "tuple"
781
- },
782
- {
783
- "components": [
784
- {
785
- "internalType": "UFixed",
786
- "name": "fractionalFee",
787
- "type": "uint256"
788
- },
789
- {
790
- "internalType": "uint256",
791
- "name": "fixedFee",
792
- "type": "uint256"
793
- }
794
- ],
795
- "internalType": "struct Fee",
796
- "name": "distributionFee",
797
- "type": "tuple"
798
- },
799
- {
800
- "internalType": "address",
801
- "name": "wallet",
802
- "type": "address"
803
- },
804
- {
805
- "internalType": "uint256",
806
- "name": "sumDistributionOwnerFees",
807
- "type": "uint256"
808
- }
809
- ],
810
- "internalType": "struct ISetup.DistributionSetupInfo",
811
- "name": "setupInfo",
812
- "type": "tuple"
813
- }
814
- ],
815
- "stateMutability": "view",
816
- "type": "function"
817
- },
818
- {
819
- "inputs": [],
820
- "name": "getToken",
821
- "outputs": [
822
- {
823
- "internalType": "contract IERC20Metadata",
824
- "name": "token",
873
+ "internalType": "contract TokenHandler",
874
+ "name": "tokenHandler",
825
875
  "type": "address"
826
876
  }
827
877
  ],
@@ -843,6 +893,11 @@
843
893
  },
844
894
  {
845
895
  "inputs": [
896
+ {
897
+ "internalType": "address",
898
+ "name": "authority",
899
+ "type": "address"
900
+ },
846
901
  {
847
902
  "internalType": "address",
848
903
  "name": "registry",
@@ -850,7 +905,7 @@
850
905
  },
851
906
  {
852
907
  "internalType": "NftId",
853
- "name": "instanceNftId",
908
+ "name": "parentNftId",
854
909
  "type": "uint96"
855
910
  },
856
911
  {
@@ -882,6 +937,11 @@
882
937
  "internalType": "bytes",
883
938
  "name": "registryData",
884
939
  "type": "bytes"
940
+ },
941
+ {
942
+ "internalType": "bytes",
943
+ "name": "componentData",
944
+ "type": "bytes"
885
945
  }
886
946
  ],
887
947
  "name": "initializeComponent",
@@ -901,6 +961,11 @@
901
961
  "name": "instanceNftId",
902
962
  "type": "uint96"
903
963
  },
964
+ {
965
+ "internalType": "address",
966
+ "name": "initialOwner",
967
+ "type": "address"
968
+ },
904
969
  {
905
970
  "internalType": "string",
906
971
  "name": "name",
@@ -912,47 +977,13 @@
912
977
  "type": "address"
913
978
  },
914
979
  {
915
- "components": [
916
- {
917
- "internalType": "UFixed",
918
- "name": "fractionalFee",
919
- "type": "uint256"
920
- },
921
- {
922
- "internalType": "uint256",
923
- "name": "fixedFee",
924
- "type": "uint256"
925
- }
926
- ],
927
- "internalType": "struct Fee",
928
- "name": "minDistributionOwnerFee",
929
- "type": "tuple"
930
- },
931
- {
932
- "components": [
933
- {
934
- "internalType": "UFixed",
935
- "name": "fractionalFee",
936
- "type": "uint256"
937
- },
938
- {
939
- "internalType": "uint256",
940
- "name": "fixedFee",
941
- "type": "uint256"
942
- }
943
- ],
944
- "internalType": "struct Fee",
945
- "name": "distributionFee",
946
- "type": "tuple"
947
- },
948
- {
949
- "internalType": "address",
950
- "name": "initialOwner",
951
- "type": "address"
980
+ "internalType": "bytes",
981
+ "name": "registryData",
982
+ "type": "bytes"
952
983
  },
953
984
  {
954
985
  "internalType": "bytes",
955
- "name": "registryData",
986
+ "name": "componentData",
956
987
  "type": "bytes"
957
988
  }
958
989
  ],
@@ -968,6 +999,59 @@
968
999
  "stateMutability": "nonpayable",
969
1000
  "type": "function"
970
1001
  },
1002
+ {
1003
+ "inputs": [
1004
+ {
1005
+ "internalType": "address",
1006
+ "name": "registry",
1007
+ "type": "address"
1008
+ },
1009
+ {
1010
+ "internalType": "NftId",
1011
+ "name": "instanceNftId",
1012
+ "type": "uint96"
1013
+ },
1014
+ {
1015
+ "internalType": "string",
1016
+ "name": "name",
1017
+ "type": "string"
1018
+ },
1019
+ {
1020
+ "internalType": "address",
1021
+ "name": "token",
1022
+ "type": "address"
1023
+ },
1024
+ {
1025
+ "internalType": "ObjectType",
1026
+ "name": "componentType",
1027
+ "type": "uint8"
1028
+ },
1029
+ {
1030
+ "internalType": "bool",
1031
+ "name": "isInterceptor",
1032
+ "type": "bool"
1033
+ },
1034
+ {
1035
+ "internalType": "address",
1036
+ "name": "initialOwner",
1037
+ "type": "address"
1038
+ },
1039
+ {
1040
+ "internalType": "bytes",
1041
+ "name": "registryData",
1042
+ "type": "bytes"
1043
+ },
1044
+ {
1045
+ "internalType": "bytes",
1046
+ "name": "componentData",
1047
+ "type": "bytes"
1048
+ }
1049
+ ],
1050
+ "name": "initializeInstanceLinkedComponent",
1051
+ "outputs": [],
1052
+ "stateMutability": "nonpayable",
1053
+ "type": "function"
1054
+ },
971
1055
  {
972
1056
  "inputs": [
973
1057
  {
@@ -1082,6 +1166,19 @@
1082
1166
  "stateMutability": "view",
1083
1167
  "type": "function"
1084
1168
  },
1169
+ {
1170
+ "inputs": [],
1171
+ "name": "isRegistered",
1172
+ "outputs": [
1173
+ {
1174
+ "internalType": "bool",
1175
+ "name": "",
1176
+ "type": "bool"
1177
+ }
1178
+ ],
1179
+ "stateMutability": "view",
1180
+ "type": "function"
1181
+ },
1085
1182
  {
1086
1183
  "inputs": [],
1087
1184
  "name": "isVerifying",
@@ -1168,6 +1265,13 @@
1168
1265
  "stateMutability": "nonpayable",
1169
1266
  "type": "function"
1170
1267
  },
1268
+ {
1269
+ "inputs": [],
1270
+ "name": "register",
1271
+ "outputs": [],
1272
+ "stateMutability": "nonpayable",
1273
+ "type": "function"
1274
+ },
1171
1275
  {
1172
1276
  "inputs": [
1173
1277
  {
@@ -1210,7 +1314,7 @@
1210
1314
  }
1211
1315
  ],
1212
1316
  "internalType": "struct Fee",
1213
- "name": "minDistributionOwnerFee",
1317
+ "name": "distributionFee",
1214
1318
  "type": "tuple"
1215
1319
  },
1216
1320
  {
@@ -1227,7 +1331,7 @@
1227
1331
  }
1228
1332
  ],
1229
1333
  "internalType": "struct Fee",
1230
- "name": "distributionFee",
1334
+ "name": "minDistributionOwnerFee",
1231
1335
  "type": "tuple"
1232
1336
  }
1233
1337
  ],
@@ -1236,19 +1340,6 @@
1236
1340
  "stateMutability": "nonpayable",
1237
1341
  "type": "function"
1238
1342
  },
1239
- {
1240
- "inputs": [
1241
- {
1242
- "internalType": "NftId",
1243
- "name": "productNftId",
1244
- "type": "uint96"
1245
- }
1246
- ],
1247
- "name": "setProductNftId",
1248
- "outputs": [],
1249
- "stateMutability": "nonpayable",
1250
- "type": "function"
1251
- },
1252
1343
  {
1253
1344
  "inputs": [
1254
1345
  {
@@ -0,0 +1,4 @@
1
+ {
2
+ "_format": "hh-sol-dbg-1",
3
+ "buildInfo": "../../../build-info/4cf34eb71913d1c28a84c3b05a48d0f5.json"
4
+ }