@etherisc/gif-next 0.0.2-f7eda15-119 → 0.0.2-f831797-539

Sign up to get free protection for your applications and to get access to all the features.
Files changed (340) hide show
  1. package/README.md +73 -1
  2. package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
  3. package/artifacts/contracts/components/Component.sol/Component.json +252 -94
  4. package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
  5. package/artifacts/contracts/components/Distribution.sol/Distribution.json +611 -159
  6. package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
  7. package/artifacts/contracts/components/IComponent.sol/IComponent.json +104 -72
  8. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  9. package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +311 -108
  10. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  11. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +331 -164
  12. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  13. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +108 -144
  14. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
  15. package/artifacts/contracts/components/Pool.sol/Pool.json +553 -185
  16. package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
  17. package/artifacts/contracts/components/Product.sol/Product.json +356 -166
  18. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
  19. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +30 -11
  20. package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
  21. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  22. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +722 -422
  23. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  24. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +94 -171
  25. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  26. package/artifacts/contracts/instance/Instance.sol/Instance.json +911 -779
  27. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
  28. package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +39 -89
  29. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  30. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +119 -216
  31. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  32. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +276 -254
  33. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  34. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +319 -99
  35. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
  36. package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +2 -2
  37. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +1 -1
  38. package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.json +118 -169
  39. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  40. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  41. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  42. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +40 -10
  43. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  44. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +36 -11
  45. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  46. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +13 -13
  47. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  48. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +4 -0
  49. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.json +10 -0
  50. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  51. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  52. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  53. package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
  54. package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
  55. package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.dbg.json +4 -0
  56. package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +968 -0
  57. package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
  58. package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +665 -0
  59. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
  60. package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +306 -315
  61. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  62. package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +305 -93
  63. package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +4 -0
  64. package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +754 -0
  65. package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
  66. package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +637 -0
  67. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
  68. package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +1207 -255
  69. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  70. package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +449 -85
  71. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +4 -0
  72. package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +556 -0
  73. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
  74. package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +155 -240
  75. package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +4 -0
  76. package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.json +409 -0
  77. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  78. package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +711 -139
  79. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  80. package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +60 -286
  81. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
  82. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +81 -147
  83. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
  84. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +22 -169
  85. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
  86. package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +185 -391
  87. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  88. package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +311 -127
  89. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
  90. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +214 -204
  91. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  92. package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +306 -90
  93. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
  94. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +142 -221
  95. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
  96. package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +302 -90
  97. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  98. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  99. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +15 -2
  100. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  101. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +83 -174
  102. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  103. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  104. package/artifacts/contracts/registry/Registry.sol/Registry.json +28 -15
  105. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
  106. package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +2 -2
  107. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  108. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +193 -216
  109. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  110. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +300 -94
  111. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
  112. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +11 -11
  113. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  114. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +141 -37
  115. package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
  116. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  117. package/artifacts/contracts/shared/ERC165.sol/ERC165.json +41 -3
  118. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  119. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +40 -29
  120. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
  121. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +129 -0
  122. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  123. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +21 -29
  124. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
  125. package/artifacts/contracts/{experiment/inheritance/IB.sol/IB.json → shared/IRegistryLinked.sol/IRegistryLinked.json} +18 -20
  126. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  127. package/artifacts/contracts/shared/IService.sol/IService.json +22 -169
  128. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  129. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +2 -152
  130. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  131. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +113 -33
  132. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
  133. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +248 -0
  134. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  135. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +294 -74
  136. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  137. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +125 -55
  138. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
  139. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +84 -0
  140. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  141. package/artifacts/contracts/shared/Service.sol/Service.json +113 -164
  142. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  143. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
  144. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  145. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
  146. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  147. package/artifacts/contracts/shared/Versionable.sol/Versionable.json +2 -152
  148. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
  149. package/artifacts/contracts/test/TestFee.sol/TestFee.json +2 -2
  150. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
  151. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +125 -55
  152. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
  153. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +2 -2
  154. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
  155. package/artifacts/contracts/test/TestService.sol/TestService.json +134 -221
  156. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
  157. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
  158. package/artifacts/contracts/test/TestVersion.sol/TestVersion.json +2 -2
  159. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
  160. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +8 -190
  161. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
  162. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  163. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  164. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.json +2 -2
  165. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
  166. package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.dbg.json +4 -0
  167. package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.json +100 -0
  168. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  169. package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +2 -2
  170. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
  171. package/artifacts/contracts/types/Fee.sol/FeeLib.json +2 -2
  172. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
  173. package/artifacts/contracts/types/Key32.sol/Key32Lib.json +2 -2
  174. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
  175. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +17 -4
  176. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  177. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
  178. package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
  179. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  180. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
  181. package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.dbg.json +4 -0
  182. package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.json +100 -0
  183. package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
  184. package/artifacts/contracts/types/Referral.sol/ReferralLib.json +23 -4
  185. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
  186. package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +2 -2
  187. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
  188. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
  189. package/artifacts/contracts/types/Seconds.sol/SecondsLib.dbg.json +4 -0
  190. package/artifacts/contracts/types/Seconds.sol/SecondsLib.json +124 -0
  191. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
  192. package/artifacts/contracts/types/StateId.sol/StateIdLib.json +2 -2
  193. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
  194. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +25 -7
  195. package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
  196. package/artifacts/contracts/types/UFixed.sol/MathLib.json +2 -2
  197. package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
  198. package/artifacts/contracts/types/UFixed.sol/UFixedLib.json +2 -2
  199. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
  200. package/artifacts/contracts/types/Version.sol/VersionLib.json +2 -2
  201. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
  202. package/artifacts/contracts/types/Version.sol/VersionPartLib.json +2 -2
  203. package/contracts/components/Component.sol +103 -78
  204. package/contracts/components/Distribution.sol +187 -57
  205. package/contracts/components/IComponent.sol +48 -17
  206. package/contracts/components/IDistributionComponent.sol +39 -15
  207. package/contracts/components/IPoolComponent.sol +84 -31
  208. package/contracts/components/IProductComponent.sol +3 -2
  209. package/contracts/components/Pool.sol +217 -145
  210. package/contracts/components/Product.sol +97 -69
  211. package/contracts/instance/BundleManager.sol +7 -5
  212. package/contracts/instance/IInstance.sol +24 -3
  213. package/contracts/instance/IInstanceService.sol +20 -1
  214. package/contracts/instance/Instance.sol +65 -39
  215. package/contracts/instance/InstanceAccessManager.sol +12 -13
  216. package/contracts/instance/InstanceReader.sol +4 -3
  217. package/contracts/instance/InstanceService.sol +111 -57
  218. package/contracts/instance/InstanceServiceManager.sol +1 -1
  219. package/contracts/instance/base/ComponentService.sol +1 -1
  220. package/contracts/instance/base/KeyValueStore.sol +5 -2
  221. package/contracts/instance/base/Lifecycle.sol +11 -2
  222. package/contracts/instance/module/IAccess.sol +3 -4
  223. package/contracts/instance/module/IBundle.sol +2 -1
  224. package/contracts/instance/module/IComponents.sol +35 -0
  225. package/contracts/instance/module/IDistribution.sol +2 -0
  226. package/contracts/instance/module/IPolicy.sol +30 -3
  227. package/contracts/instance/module/ISetup.sol +7 -20
  228. package/contracts/instance/service/ApplicationService.sol +350 -0
  229. package/contracts/instance/service/ApplicationServiceManager.sol +35 -0
  230. package/contracts/instance/service/BundleService.sol +82 -39
  231. package/contracts/instance/service/BundleServiceManager.sol +1 -1
  232. package/contracts/instance/service/ClaimService.sol +151 -0
  233. package/contracts/instance/service/ClaimServiceManager.sol +35 -0
  234. package/contracts/instance/service/DistributionService.sol +360 -16
  235. package/contracts/instance/service/DistributionServiceManager.sol +1 -1
  236. package/contracts/instance/service/IApplicationService.sol +82 -0
  237. package/contracts/instance/service/IBundleService.sol +30 -12
  238. package/contracts/instance/service/IClaimService.sol +61 -0
  239. package/contracts/instance/service/IDistributionService.sol +86 -0
  240. package/contracts/instance/service/IPolicyService.sol +27 -49
  241. package/contracts/instance/service/IPoolService.sol +17 -2
  242. package/contracts/instance/service/PolicyService.sol +148 -283
  243. package/contracts/instance/service/PolicyServiceManager.sol +2 -2
  244. package/contracts/instance/service/PoolService.sol +75 -22
  245. package/contracts/instance/service/PoolServiceManager.sol +1 -1
  246. package/contracts/instance/service/ProductService.sol +10 -11
  247. package/contracts/instance/service/ProductServiceManager.sol +2 -2
  248. package/contracts/registry/IRegistry.sol +3 -2
  249. package/contracts/registry/IRegistryService.sol +10 -8
  250. package/contracts/registry/Registry.sol +20 -8
  251. package/contracts/registry/RegistryService.sol +69 -48
  252. package/contracts/registry/RegistryServiceManager.sol +13 -13
  253. package/contracts/registry/ReleaseManager.sol +18 -28
  254. package/contracts/registry/TokenRegistry.sol +16 -12
  255. package/contracts/shared/ERC165.sol +14 -12
  256. package/contracts/shared/INftOwnable.sol +11 -10
  257. package/contracts/shared/IPolicyHolder.sol +26 -0
  258. package/contracts/shared/IRegisterable.sol +3 -3
  259. package/contracts/shared/IRegistryLinked.sol +12 -0
  260. package/contracts/shared/IService.sol +2 -0
  261. package/contracts/shared/IVersionable.sol +4 -47
  262. package/contracts/shared/NftOwnable.sol +66 -85
  263. package/contracts/shared/PolicyHolder.sol +81 -0
  264. package/contracts/shared/ProxyManager.sol +100 -25
  265. package/contracts/shared/Registerable.sol +7 -19
  266. package/contracts/shared/RegistryLinked.sol +48 -0
  267. package/contracts/shared/Service.sol +15 -17
  268. package/contracts/shared/TokenHandler.sol +11 -5
  269. package/contracts/shared/Versionable.sol +4 -92
  270. package/contracts/test/TestRegisterable.sol +1 -1
  271. package/contracts/test/TestService.sol +1 -1
  272. package/contracts/types/Blocknumber.sol +1 -0
  273. package/contracts/types/ClaimId.sol +52 -0
  274. package/contracts/types/DistributorType.sol +2 -2
  275. package/contracts/types/Fee.sol +1 -0
  276. package/contracts/types/NftId.sol +8 -0
  277. package/contracts/types/ObjectType.sol +10 -5
  278. package/contracts/types/PayoutId.sol +54 -0
  279. package/contracts/types/Referral.sol +4 -0
  280. package/contracts/types/RoleId.sol +10 -5
  281. package/contracts/types/Seconds.sol +54 -0
  282. package/contracts/types/StateId.sol +1 -0
  283. package/contracts/types/Timestamp.sol +13 -13
  284. package/contracts/types/UFixed.sol +1 -0
  285. package/contracts/types/Version.sol +1 -0
  286. package/package.json +3 -3
  287. package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +0 -4
  288. package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.json +0 -66
  289. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +0 -4
  290. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.json +0 -24
  291. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +0 -4
  292. package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.json +0 -42
  293. package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +0 -4
  294. package/artifacts/contracts/experiment/errors/Require.sol/Require.json +0 -105
  295. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +0 -4
  296. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.json +0 -105
  297. package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +0 -4
  298. package/artifacts/contracts/experiment/inheritance/A.sol/A.json +0 -128
  299. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +0 -4
  300. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.json +0 -42
  301. package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +0 -4
  302. package/artifacts/contracts/experiment/inheritance/B.sol/B.json +0 -76
  303. package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +0 -4
  304. package/artifacts/contracts/experiment/inheritance/C.sol/C.json +0 -89
  305. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +0 -4
  306. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.json +0 -128
  307. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +0 -4
  308. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.json +0 -37
  309. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +0 -4
  310. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +0 -4
  311. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.json +0 -63
  312. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +0 -4
  313. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +0 -59
  314. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +0 -4
  315. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.json +0 -124
  316. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +0 -4
  317. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.json +0 -74
  318. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +0 -4
  319. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.json +0 -124
  320. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +0 -4
  321. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +0 -207
  322. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +0 -4
  323. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.json +0 -10
  324. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +0 -4
  325. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.json +0 -10
  326. package/contracts/experiment/cloning/Cloner.sol +0 -47
  327. package/contracts/experiment/errors/Require.sol +0 -38
  328. package/contracts/experiment/errors/Revert.sol +0 -44
  329. package/contracts/experiment/inheritance/A.sol +0 -53
  330. package/contracts/experiment/inheritance/B.sol +0 -28
  331. package/contracts/experiment/inheritance/C.sol +0 -34
  332. package/contracts/experiment/inheritance/IA.sol +0 -13
  333. package/contracts/experiment/inheritance/IB.sol +0 -10
  334. package/contracts/experiment/inheritance/IC.sol +0 -12
  335. package/contracts/experiment/statemachine/Dummy.sol +0 -27
  336. package/contracts/experiment/statemachine/ISM.sol +0 -25
  337. package/contracts/experiment/statemachine/SM.sol +0 -57
  338. package/contracts/experiment/statemachine/SimpleStateMachine.sol +0 -31
  339. package/contracts/experiment/types/TypeA.sol +0 -47
  340. package/contracts/experiment/types/TypeB.sol +0 -29
@@ -41,33 +41,6 @@
41
41
  "name": "AccessManagedUnauthorized",
42
42
  "type": "error"
43
43
  },
44
- {
45
- "inputs": [
46
- {
47
- "internalType": "address",
48
- "name": "registry",
49
- "type": "address"
50
- },
51
- {
52
- "internalType": "NftId",
53
- "name": "nftId",
54
- "type": "uint96"
55
- }
56
- ],
57
- "name": "ErrorAlreadyLinked",
58
- "type": "error"
59
- },
60
- {
61
- "inputs": [
62
- {
63
- "internalType": "address",
64
- "name": "contractAddress",
65
- "type": "address"
66
- }
67
- ],
68
- "name": "ErrorContractNotRegistered",
69
- "type": "error"
70
- },
71
44
  {
72
45
  "inputs": [
73
46
  {
@@ -95,57 +68,63 @@
95
68
  "internalType": "NftId",
96
69
  "name": "nftId",
97
70
  "type": "uint96"
98
- },
99
- {
100
- "internalType": "ObjectType",
101
- "name": "objectType",
102
- "type": "uint8"
103
71
  }
104
72
  ],
105
- "name": "ErrorNoLifecycle",
73
+ "name": "ErrorNftOwnableAlreadyLinked",
106
74
  "type": "error"
107
75
  },
108
76
  {
109
77
  "inputs": [
110
78
  {
111
79
  "internalType": "address",
112
- "name": "account",
80
+ "name": "contractAddress",
113
81
  "type": "address"
114
82
  }
115
83
  ],
116
- "name": "ErrorNotOwner",
84
+ "name": "ErrorNftOwnableContractNotRegistered",
85
+ "type": "error"
86
+ },
87
+ {
88
+ "inputs": [],
89
+ "name": "ErrorNftOwnableInitialOwnerZero",
117
90
  "type": "error"
118
91
  },
119
92
  {
120
93
  "inputs": [
121
94
  {
122
95
  "internalType": "address",
123
- "name": "registryAddress",
96
+ "name": "account",
124
97
  "type": "address"
125
98
  }
126
99
  ],
127
- "name": "ErrorNotRegistry",
100
+ "name": "ErrorNftOwnableNotOwner",
128
101
  "type": "error"
129
102
  },
130
103
  {
131
- "inputs": [],
132
- "name": "ErrorRegistryAddressZero",
104
+ "inputs": [
105
+ {
106
+ "internalType": "NftId",
107
+ "name": "nftId",
108
+ "type": "uint96"
109
+ },
110
+ {
111
+ "internalType": "ObjectType",
112
+ "name": "objectType",
113
+ "type": "uint8"
114
+ }
115
+ ],
116
+ "name": "ErrorNoLifecycle",
133
117
  "type": "error"
134
118
  },
135
119
  {
136
120
  "inputs": [
137
121
  {
138
122
  "internalType": "address",
139
- "name": "registry",
123
+ "name": "registryAddress",
140
124
  "type": "address"
141
125
  }
142
126
  ],
143
- "name": "ErrorRegistryAlreadyInitialized",
144
- "type": "error"
145
- },
146
- {
147
- "inputs": [],
148
- "name": "ErrorRegistryNotInitialized",
127
+ "name": "ErrorNotRegistry",
149
128
  "type": "error"
150
129
  },
151
130
  {
@@ -303,6 +282,106 @@
303
282
  "stateMutability": "view",
304
283
  "type": "function"
305
284
  },
285
+ {
286
+ "inputs": [
287
+ {
288
+ "internalType": "NftId",
289
+ "name": "applicationNftId",
290
+ "type": "uint96"
291
+ },
292
+ {
293
+ "components": [
294
+ {
295
+ "internalType": "NftId",
296
+ "name": "productNftId",
297
+ "type": "uint96"
298
+ },
299
+ {
300
+ "internalType": "NftId",
301
+ "name": "bundleNftId",
302
+ "type": "uint96"
303
+ },
304
+ {
305
+ "internalType": "ReferralId",
306
+ "name": "referralId",
307
+ "type": "bytes8"
308
+ },
309
+ {
310
+ "internalType": "RiskId",
311
+ "name": "riskId",
312
+ "type": "bytes8"
313
+ },
314
+ {
315
+ "internalType": "uint256",
316
+ "name": "sumInsuredAmount",
317
+ "type": "uint256"
318
+ },
319
+ {
320
+ "internalType": "uint256",
321
+ "name": "premiumAmount",
322
+ "type": "uint256"
323
+ },
324
+ {
325
+ "internalType": "uint256",
326
+ "name": "premiumPaidAmount",
327
+ "type": "uint256"
328
+ },
329
+ {
330
+ "internalType": "Seconds",
331
+ "name": "lifetime",
332
+ "type": "uint40"
333
+ },
334
+ {
335
+ "internalType": "bytes",
336
+ "name": "applicationData",
337
+ "type": "bytes"
338
+ },
339
+ {
340
+ "internalType": "bytes",
341
+ "name": "policyData",
342
+ "type": "bytes"
343
+ },
344
+ {
345
+ "internalType": "uint16",
346
+ "name": "claimsCount",
347
+ "type": "uint16"
348
+ },
349
+ {
350
+ "internalType": "uint16",
351
+ "name": "openClaimsCount",
352
+ "type": "uint16"
353
+ },
354
+ {
355
+ "internalType": "uint256",
356
+ "name": "payoutAmount",
357
+ "type": "uint256"
358
+ },
359
+ {
360
+ "internalType": "Timestamp",
361
+ "name": "activatedAt",
362
+ "type": "uint40"
363
+ },
364
+ {
365
+ "internalType": "Timestamp",
366
+ "name": "expiredAt",
367
+ "type": "uint40"
368
+ },
369
+ {
370
+ "internalType": "Timestamp",
371
+ "name": "closedAt",
372
+ "type": "uint40"
373
+ }
374
+ ],
375
+ "internalType": "struct IPolicy.PolicyInfo",
376
+ "name": "policy",
377
+ "type": "tuple"
378
+ }
379
+ ],
380
+ "name": "createApplication",
381
+ "outputs": [],
382
+ "stateMutability": "nonpayable",
383
+ "type": "function"
384
+ },
306
385
  {
307
386
  "inputs": [
308
387
  {
@@ -355,9 +434,9 @@
355
434
  "type": "uint256"
356
435
  },
357
436
  {
358
- "internalType": "uint256",
437
+ "internalType": "Seconds",
359
438
  "name": "lifetime",
360
- "type": "uint256"
439
+ "type": "uint40"
361
440
  },
362
441
  {
363
442
  "internalType": "Timestamp",
@@ -413,18 +492,35 @@
413
492
  }
414
493
  ],
415
494
  "internalType": "struct Fee",
416
- "name": "distributionFee",
495
+ "name": "minDistributionOwnerFee",
417
496
  "type": "tuple"
418
497
  },
419
498
  {
420
- "internalType": "bool",
421
- "name": "isIntercepting",
422
- "type": "bool"
499
+ "components": [
500
+ {
501
+ "internalType": "UFixed",
502
+ "name": "fractionalFee",
503
+ "type": "uint256"
504
+ },
505
+ {
506
+ "internalType": "uint256",
507
+ "name": "fixedFee",
508
+ "type": "uint256"
509
+ }
510
+ ],
511
+ "internalType": "struct Fee",
512
+ "name": "distributionFee",
513
+ "type": "tuple"
423
514
  },
424
515
  {
425
516
  "internalType": "address",
426
517
  "name": "wallet",
427
518
  "type": "address"
519
+ },
520
+ {
521
+ "internalType": "uint256",
522
+ "name": "sumDistributionOwnerFees",
523
+ "type": "uint256"
428
524
  }
429
525
  ],
430
526
  "internalType": "struct ISetup.DistributionSetupInfo",
@@ -441,98 +537,108 @@
441
537
  "inputs": [
442
538
  {
443
539
  "internalType": "NftId",
444
- "name": "policyNftId",
540
+ "name": "nftId",
445
541
  "type": "uint96"
446
542
  },
447
543
  {
448
544
  "components": [
449
545
  {
450
- "internalType": "NftId",
451
- "name": "productNftId",
452
- "type": "uint96"
453
- },
454
- {
455
- "internalType": "NftId",
456
- "name": "bundleNftId",
457
- "type": "uint96"
546
+ "internalType": "DistributorType",
547
+ "name": "distributorType",
548
+ "type": "bytes8"
458
549
  },
459
550
  {
460
- "internalType": "ReferralId",
461
- "name": "referralId",
462
- "type": "bytes8"
551
+ "internalType": "bool",
552
+ "name": "active",
553
+ "type": "bool"
463
554
  },
464
555
  {
465
- "internalType": "RiskId",
466
- "name": "riskId",
467
- "type": "bytes8"
556
+ "internalType": "bytes",
557
+ "name": "data",
558
+ "type": "bytes"
468
559
  },
469
560
  {
470
561
  "internalType": "uint256",
471
- "name": "sumInsuredAmount",
562
+ "name": "sumCommisions",
472
563
  "type": "uint256"
473
564
  },
474
565
  {
475
566
  "internalType": "uint256",
476
- "name": "premiumAmount",
567
+ "name": "numPoliciesSold",
477
568
  "type": "uint256"
569
+ }
570
+ ],
571
+ "internalType": "struct IDistribution.DistributorInfo",
572
+ "name": "info",
573
+ "type": "tuple"
574
+ }
575
+ ],
576
+ "name": "createDistributor",
577
+ "outputs": [],
578
+ "stateMutability": "nonpayable",
579
+ "type": "function"
580
+ },
581
+ {
582
+ "inputs": [
583
+ {
584
+ "internalType": "Key32",
585
+ "name": "distributorKey",
586
+ "type": "bytes32"
587
+ },
588
+ {
589
+ "components": [
590
+ {
591
+ "internalType": "string",
592
+ "name": "name",
593
+ "type": "string"
478
594
  },
479
595
  {
480
- "internalType": "uint256",
481
- "name": "premiumPaidAmount",
596
+ "internalType": "UFixed",
597
+ "name": "minDiscountPercentage",
482
598
  "type": "uint256"
483
599
  },
484
600
  {
485
- "internalType": "uint256",
486
- "name": "lifetime",
601
+ "internalType": "UFixed",
602
+ "name": "maxDiscountPercentage",
487
603
  "type": "uint256"
488
604
  },
489
605
  {
490
- "internalType": "bytes",
491
- "name": "applicationData",
492
- "type": "bytes"
606
+ "internalType": "UFixed",
607
+ "name": "commissionPercentage",
608
+ "type": "uint256"
493
609
  },
494
610
  {
495
- "internalType": "bytes",
496
- "name": "policyData",
497
- "type": "bytes"
611
+ "internalType": "uint32",
612
+ "name": "maxReferralCount",
613
+ "type": "uint32"
498
614
  },
499
615
  {
500
- "internalType": "uint16",
501
- "name": "claimsCount",
502
- "type": "uint16"
616
+ "internalType": "uint32",
617
+ "name": "maxReferralLifetime",
618
+ "type": "uint32"
503
619
  },
504
620
  {
505
- "internalType": "uint16",
506
- "name": "openClaimsCount",
507
- "type": "uint16"
621
+ "internalType": "bool",
622
+ "name": "allowSelfReferrals",
623
+ "type": "bool"
508
624
  },
509
625
  {
510
- "internalType": "uint256",
511
- "name": "payoutAmount",
512
- "type": "uint256"
626
+ "internalType": "bool",
627
+ "name": "allowRenewals",
628
+ "type": "bool"
513
629
  },
514
630
  {
515
- "internalType": "Timestamp",
516
- "name": "activatedAt",
517
- "type": "uint40"
518
- },
519
- {
520
- "internalType": "Timestamp",
521
- "name": "expiredAt",
522
- "type": "uint40"
523
- },
524
- {
525
- "internalType": "Timestamp",
526
- "name": "closedAt",
527
- "type": "uint40"
631
+ "internalType": "bytes",
632
+ "name": "data",
633
+ "type": "bytes"
528
634
  }
529
635
  ],
530
- "internalType": "struct IPolicy.PolicyInfo",
531
- "name": "policy",
636
+ "internalType": "struct IDistribution.DistributorTypeInfo",
637
+ "name": "info",
532
638
  "type": "tuple"
533
639
  }
534
640
  ],
535
- "name": "createPolicy",
641
+ "name": "createDistributorType",
536
642
  "outputs": [],
537
643
  "stateMutability": "nonpayable",
538
644
  "type": "function"
@@ -547,89 +653,33 @@
547
653
  {
548
654
  "components": [
549
655
  {
550
- "internalType": "NftId",
551
- "name": "productNftId",
552
- "type": "uint96"
656
+ "internalType": "string",
657
+ "name": "name",
658
+ "type": "string"
553
659
  },
554
660
  {
555
- "internalType": "contract TokenHandler",
556
- "name": "tokenHandler",
661
+ "internalType": "contract IERC20Metadata",
662
+ "name": "token",
557
663
  "type": "address"
558
664
  },
559
665
  {
560
- "internalType": "UFixed",
561
- "name": "collateralizationLevel",
562
- "type": "uint256"
563
- },
564
- {
565
- "components": [
566
- {
567
- "internalType": "UFixed",
568
- "name": "fractionalFee",
569
- "type": "uint256"
570
- },
571
- {
572
- "internalType": "uint256",
573
- "name": "fixedFee",
574
- "type": "uint256"
575
- }
576
- ],
577
- "internalType": "struct Fee",
578
- "name": "poolFee",
579
- "type": "tuple"
580
- },
581
- {
582
- "components": [
583
- {
584
- "internalType": "UFixed",
585
- "name": "fractionalFee",
586
- "type": "uint256"
587
- },
588
- {
589
- "internalType": "uint256",
590
- "name": "fixedFee",
591
- "type": "uint256"
592
- }
593
- ],
594
- "internalType": "struct Fee",
595
- "name": "stakingFee",
596
- "type": "tuple"
597
- },
598
- {
599
- "components": [
600
- {
601
- "internalType": "UFixed",
602
- "name": "fractionalFee",
603
- "type": "uint256"
604
- },
605
- {
606
- "internalType": "uint256",
607
- "name": "fixedFee",
608
- "type": "uint256"
609
- }
610
- ],
611
- "internalType": "struct Fee",
612
- "name": "performanceFee",
613
- "type": "tuple"
614
- },
615
- {
616
- "internalType": "bool",
617
- "name": "isIntercepting",
618
- "type": "bool"
619
- },
620
- {
621
- "internalType": "bool",
622
- "name": "isConfirmingApplication",
623
- "type": "bool"
666
+ "internalType": "contract TokenHandler",
667
+ "name": "tokenHandler",
668
+ "type": "address"
624
669
  },
625
670
  {
626
671
  "internalType": "address",
627
672
  "name": "wallet",
628
673
  "type": "address"
674
+ },
675
+ {
676
+ "internalType": "bytes",
677
+ "name": "data",
678
+ "type": "bytes"
629
679
  }
630
680
  ],
631
- "internalType": "struct ISetup.PoolSetupInfo",
632
- "name": "setup",
681
+ "internalType": "struct IComponents.ComponentInfo",
682
+ "name": "info",
633
683
  "type": "tuple"
634
684
  }
635
685
  ],
@@ -667,23 +717,6 @@
667
717
  "name": "poolNftId",
668
718
  "type": "uint96"
669
719
  },
670
- {
671
- "components": [
672
- {
673
- "internalType": "UFixed",
674
- "name": "fractionalFee",
675
- "type": "uint256"
676
- },
677
- {
678
- "internalType": "uint256",
679
- "name": "fixedFee",
680
- "type": "uint256"
681
- }
682
- ],
683
- "internalType": "struct Fee",
684
- "name": "distributionFee",
685
- "type": "tuple"
686
- },
687
720
  {
688
721
  "components": [
689
722
  {
@@ -718,57 +751,6 @@
718
751
  "name": "processingFee",
719
752
  "type": "tuple"
720
753
  },
721
- {
722
- "components": [
723
- {
724
- "internalType": "UFixed",
725
- "name": "fractionalFee",
726
- "type": "uint256"
727
- },
728
- {
729
- "internalType": "uint256",
730
- "name": "fixedFee",
731
- "type": "uint256"
732
- }
733
- ],
734
- "internalType": "struct Fee",
735
- "name": "poolFee",
736
- "type": "tuple"
737
- },
738
- {
739
- "components": [
740
- {
741
- "internalType": "UFixed",
742
- "name": "fractionalFee",
743
- "type": "uint256"
744
- },
745
- {
746
- "internalType": "uint256",
747
- "name": "fixedFee",
748
- "type": "uint256"
749
- }
750
- ],
751
- "internalType": "struct Fee",
752
- "name": "stakingFee",
753
- "type": "tuple"
754
- },
755
- {
756
- "components": [
757
- {
758
- "internalType": "UFixed",
759
- "name": "fractionalFee",
760
- "type": "uint256"
761
- },
762
- {
763
- "internalType": "uint256",
764
- "name": "fixedFee",
765
- "type": "uint256"
766
- }
767
- ],
768
- "internalType": "struct Fee",
769
- "name": "performanceFee",
770
- "type": "tuple"
771
- },
772
754
  {
773
755
  "internalType": "bool",
774
756
  "name": "isIntercepting",
@@ -790,6 +772,61 @@
790
772
  "stateMutability": "nonpayable",
791
773
  "type": "function"
792
774
  },
775
+ {
776
+ "inputs": [
777
+ {
778
+ "internalType": "Key32",
779
+ "name": "referralKey",
780
+ "type": "bytes32"
781
+ },
782
+ {
783
+ "components": [
784
+ {
785
+ "internalType": "NftId",
786
+ "name": "distributorNftId",
787
+ "type": "uint96"
788
+ },
789
+ {
790
+ "internalType": "string",
791
+ "name": "referralCode",
792
+ "type": "string"
793
+ },
794
+ {
795
+ "internalType": "UFixed",
796
+ "name": "discountPercentage",
797
+ "type": "uint256"
798
+ },
799
+ {
800
+ "internalType": "uint32",
801
+ "name": "maxReferrals",
802
+ "type": "uint32"
803
+ },
804
+ {
805
+ "internalType": "uint32",
806
+ "name": "usedReferrals",
807
+ "type": "uint32"
808
+ },
809
+ {
810
+ "internalType": "Timestamp",
811
+ "name": "expiryAt",
812
+ "type": "uint40"
813
+ },
814
+ {
815
+ "internalType": "bytes",
816
+ "name": "data",
817
+ "type": "bytes"
818
+ }
819
+ ],
820
+ "internalType": "struct IDistribution.ReferralInfo",
821
+ "name": "referralInfo",
822
+ "type": "tuple"
823
+ }
824
+ ],
825
+ "name": "createReferral",
826
+ "outputs": [],
827
+ "stateMutability": "nonpayable",
828
+ "type": "function"
829
+ },
793
830
  {
794
831
  "inputs": [
795
832
  {
@@ -1174,6 +1211,19 @@
1174
1211
  "stateMutability": "view",
1175
1212
  "type": "function"
1176
1213
  },
1214
+ {
1215
+ "inputs": [],
1216
+ "name": "getRegistryAddress",
1217
+ "outputs": [
1218
+ {
1219
+ "internalType": "address",
1220
+ "name": "",
1221
+ "type": "address"
1222
+ }
1223
+ ],
1224
+ "stateMutability": "view",
1225
+ "type": "function"
1226
+ },
1177
1227
  {
1178
1228
  "inputs": [
1179
1229
  {
@@ -1321,70 +1371,193 @@
1321
1371
  "inputs": [
1322
1372
  {
1323
1373
  "internalType": "NftId",
1324
- "name": "bundleNftId",
1374
+ "name": "applicationNftId",
1325
1375
  "type": "uint96"
1326
1376
  },
1327
1377
  {
1328
1378
  "components": [
1329
1379
  {
1330
1380
  "internalType": "NftId",
1331
- "name": "poolNftId",
1381
+ "name": "productNftId",
1332
1382
  "type": "uint96"
1333
1383
  },
1334
1384
  {
1335
- "components": [
1336
- {
1337
- "internalType": "UFixed",
1338
- "name": "fractionalFee",
1339
- "type": "uint256"
1340
- },
1341
- {
1342
- "internalType": "uint256",
1343
- "name": "fixedFee",
1344
- "type": "uint256"
1345
- }
1346
- ],
1347
- "internalType": "struct Fee",
1348
- "name": "fee",
1349
- "type": "tuple"
1385
+ "internalType": "NftId",
1386
+ "name": "bundleNftId",
1387
+ "type": "uint96"
1350
1388
  },
1351
1389
  {
1352
- "internalType": "bytes",
1353
- "name": "filter",
1354
- "type": "bytes"
1390
+ "internalType": "ReferralId",
1391
+ "name": "referralId",
1392
+ "type": "bytes8"
1355
1393
  },
1356
1394
  {
1357
- "internalType": "uint256",
1358
- "name": "capitalAmount",
1359
- "type": "uint256"
1395
+ "internalType": "RiskId",
1396
+ "name": "riskId",
1397
+ "type": "bytes8"
1360
1398
  },
1361
1399
  {
1362
1400
  "internalType": "uint256",
1363
- "name": "lockedAmount",
1401
+ "name": "sumInsuredAmount",
1364
1402
  "type": "uint256"
1365
1403
  },
1366
1404
  {
1367
1405
  "internalType": "uint256",
1368
- "name": "balanceAmount",
1406
+ "name": "premiumAmount",
1369
1407
  "type": "uint256"
1370
1408
  },
1371
1409
  {
1372
1410
  "internalType": "uint256",
1373
- "name": "lifetime",
1411
+ "name": "premiumPaidAmount",
1374
1412
  "type": "uint256"
1375
1413
  },
1376
1414
  {
1377
- "internalType": "Timestamp",
1378
- "name": "expiredAt",
1415
+ "internalType": "Seconds",
1416
+ "name": "lifetime",
1379
1417
  "type": "uint40"
1380
1418
  },
1381
1419
  {
1382
- "internalType": "Timestamp",
1383
- "name": "closedAt",
1384
- "type": "uint40"
1385
- }
1386
- ],
1387
- "internalType": "struct IBundle.BundleInfo",
1420
+ "internalType": "bytes",
1421
+ "name": "applicationData",
1422
+ "type": "bytes"
1423
+ },
1424
+ {
1425
+ "internalType": "bytes",
1426
+ "name": "policyData",
1427
+ "type": "bytes"
1428
+ },
1429
+ {
1430
+ "internalType": "uint16",
1431
+ "name": "claimsCount",
1432
+ "type": "uint16"
1433
+ },
1434
+ {
1435
+ "internalType": "uint16",
1436
+ "name": "openClaimsCount",
1437
+ "type": "uint16"
1438
+ },
1439
+ {
1440
+ "internalType": "uint256",
1441
+ "name": "payoutAmount",
1442
+ "type": "uint256"
1443
+ },
1444
+ {
1445
+ "internalType": "Timestamp",
1446
+ "name": "activatedAt",
1447
+ "type": "uint40"
1448
+ },
1449
+ {
1450
+ "internalType": "Timestamp",
1451
+ "name": "expiredAt",
1452
+ "type": "uint40"
1453
+ },
1454
+ {
1455
+ "internalType": "Timestamp",
1456
+ "name": "closedAt",
1457
+ "type": "uint40"
1458
+ }
1459
+ ],
1460
+ "internalType": "struct IPolicy.PolicyInfo",
1461
+ "name": "policy",
1462
+ "type": "tuple"
1463
+ },
1464
+ {
1465
+ "internalType": "StateId",
1466
+ "name": "newState",
1467
+ "type": "uint8"
1468
+ }
1469
+ ],
1470
+ "name": "updateApplication",
1471
+ "outputs": [],
1472
+ "stateMutability": "nonpayable",
1473
+ "type": "function"
1474
+ },
1475
+ {
1476
+ "inputs": [
1477
+ {
1478
+ "internalType": "NftId",
1479
+ "name": "applicationNftId",
1480
+ "type": "uint96"
1481
+ },
1482
+ {
1483
+ "internalType": "StateId",
1484
+ "name": "newState",
1485
+ "type": "uint8"
1486
+ }
1487
+ ],
1488
+ "name": "updateApplicationState",
1489
+ "outputs": [],
1490
+ "stateMutability": "nonpayable",
1491
+ "type": "function"
1492
+ },
1493
+ {
1494
+ "inputs": [
1495
+ {
1496
+ "internalType": "NftId",
1497
+ "name": "bundleNftId",
1498
+ "type": "uint96"
1499
+ },
1500
+ {
1501
+ "components": [
1502
+ {
1503
+ "internalType": "NftId",
1504
+ "name": "poolNftId",
1505
+ "type": "uint96"
1506
+ },
1507
+ {
1508
+ "components": [
1509
+ {
1510
+ "internalType": "UFixed",
1511
+ "name": "fractionalFee",
1512
+ "type": "uint256"
1513
+ },
1514
+ {
1515
+ "internalType": "uint256",
1516
+ "name": "fixedFee",
1517
+ "type": "uint256"
1518
+ }
1519
+ ],
1520
+ "internalType": "struct Fee",
1521
+ "name": "fee",
1522
+ "type": "tuple"
1523
+ },
1524
+ {
1525
+ "internalType": "bytes",
1526
+ "name": "filter",
1527
+ "type": "bytes"
1528
+ },
1529
+ {
1530
+ "internalType": "uint256",
1531
+ "name": "capitalAmount",
1532
+ "type": "uint256"
1533
+ },
1534
+ {
1535
+ "internalType": "uint256",
1536
+ "name": "lockedAmount",
1537
+ "type": "uint256"
1538
+ },
1539
+ {
1540
+ "internalType": "uint256",
1541
+ "name": "balanceAmount",
1542
+ "type": "uint256"
1543
+ },
1544
+ {
1545
+ "internalType": "Seconds",
1546
+ "name": "lifetime",
1547
+ "type": "uint40"
1548
+ },
1549
+ {
1550
+ "internalType": "Timestamp",
1551
+ "name": "expiredAt",
1552
+ "type": "uint40"
1553
+ },
1554
+ {
1555
+ "internalType": "Timestamp",
1556
+ "name": "closedAt",
1557
+ "type": "uint40"
1558
+ }
1559
+ ],
1560
+ "internalType": "struct IBundle.BundleInfo",
1388
1561
  "name": "bundle",
1389
1562
  "type": "tuple"
1390
1563
  },
@@ -1450,18 +1623,35 @@
1450
1623
  }
1451
1624
  ],
1452
1625
  "internalType": "struct Fee",
1453
- "name": "distributionFee",
1626
+ "name": "minDistributionOwnerFee",
1454
1627
  "type": "tuple"
1455
1628
  },
1456
1629
  {
1457
- "internalType": "bool",
1458
- "name": "isIntercepting",
1459
- "type": "bool"
1630
+ "components": [
1631
+ {
1632
+ "internalType": "UFixed",
1633
+ "name": "fractionalFee",
1634
+ "type": "uint256"
1635
+ },
1636
+ {
1637
+ "internalType": "uint256",
1638
+ "name": "fixedFee",
1639
+ "type": "uint256"
1640
+ }
1641
+ ],
1642
+ "internalType": "struct Fee",
1643
+ "name": "distributionFee",
1644
+ "type": "tuple"
1460
1645
  },
1461
1646
  {
1462
1647
  "internalType": "address",
1463
1648
  "name": "wallet",
1464
1649
  "type": "address"
1650
+ },
1651
+ {
1652
+ "internalType": "uint256",
1653
+ "name": "sumDistributionOwnerFees",
1654
+ "type": "uint256"
1465
1655
  }
1466
1656
  ],
1467
1657
  "internalType": "struct ISetup.DistributionSetupInfo",
@@ -1497,6 +1687,162 @@
1497
1687
  "stateMutability": "nonpayable",
1498
1688
  "type": "function"
1499
1689
  },
1690
+ {
1691
+ "inputs": [
1692
+ {
1693
+ "internalType": "NftId",
1694
+ "name": "nftId",
1695
+ "type": "uint96"
1696
+ },
1697
+ {
1698
+ "components": [
1699
+ {
1700
+ "internalType": "DistributorType",
1701
+ "name": "distributorType",
1702
+ "type": "bytes8"
1703
+ },
1704
+ {
1705
+ "internalType": "bool",
1706
+ "name": "active",
1707
+ "type": "bool"
1708
+ },
1709
+ {
1710
+ "internalType": "bytes",
1711
+ "name": "data",
1712
+ "type": "bytes"
1713
+ },
1714
+ {
1715
+ "internalType": "uint256",
1716
+ "name": "sumCommisions",
1717
+ "type": "uint256"
1718
+ },
1719
+ {
1720
+ "internalType": "uint256",
1721
+ "name": "numPoliciesSold",
1722
+ "type": "uint256"
1723
+ }
1724
+ ],
1725
+ "internalType": "struct IDistribution.DistributorInfo",
1726
+ "name": "info",
1727
+ "type": "tuple"
1728
+ },
1729
+ {
1730
+ "internalType": "StateId",
1731
+ "name": "newState",
1732
+ "type": "uint8"
1733
+ }
1734
+ ],
1735
+ "name": "updateDistributor",
1736
+ "outputs": [],
1737
+ "stateMutability": "nonpayable",
1738
+ "type": "function"
1739
+ },
1740
+ {
1741
+ "inputs": [
1742
+ {
1743
+ "internalType": "NftId",
1744
+ "name": "nftId",
1745
+ "type": "uint96"
1746
+ },
1747
+ {
1748
+ "internalType": "StateId",
1749
+ "name": "newState",
1750
+ "type": "uint8"
1751
+ }
1752
+ ],
1753
+ "name": "updateDistributorState",
1754
+ "outputs": [],
1755
+ "stateMutability": "nonpayable",
1756
+ "type": "function"
1757
+ },
1758
+ {
1759
+ "inputs": [
1760
+ {
1761
+ "internalType": "Key32",
1762
+ "name": "distributorKey",
1763
+ "type": "bytes32"
1764
+ },
1765
+ {
1766
+ "components": [
1767
+ {
1768
+ "internalType": "string",
1769
+ "name": "name",
1770
+ "type": "string"
1771
+ },
1772
+ {
1773
+ "internalType": "UFixed",
1774
+ "name": "minDiscountPercentage",
1775
+ "type": "uint256"
1776
+ },
1777
+ {
1778
+ "internalType": "UFixed",
1779
+ "name": "maxDiscountPercentage",
1780
+ "type": "uint256"
1781
+ },
1782
+ {
1783
+ "internalType": "UFixed",
1784
+ "name": "commissionPercentage",
1785
+ "type": "uint256"
1786
+ },
1787
+ {
1788
+ "internalType": "uint32",
1789
+ "name": "maxReferralCount",
1790
+ "type": "uint32"
1791
+ },
1792
+ {
1793
+ "internalType": "uint32",
1794
+ "name": "maxReferralLifetime",
1795
+ "type": "uint32"
1796
+ },
1797
+ {
1798
+ "internalType": "bool",
1799
+ "name": "allowSelfReferrals",
1800
+ "type": "bool"
1801
+ },
1802
+ {
1803
+ "internalType": "bool",
1804
+ "name": "allowRenewals",
1805
+ "type": "bool"
1806
+ },
1807
+ {
1808
+ "internalType": "bytes",
1809
+ "name": "data",
1810
+ "type": "bytes"
1811
+ }
1812
+ ],
1813
+ "internalType": "struct IDistribution.DistributorTypeInfo",
1814
+ "name": "info",
1815
+ "type": "tuple"
1816
+ },
1817
+ {
1818
+ "internalType": "StateId",
1819
+ "name": "newState",
1820
+ "type": "uint8"
1821
+ }
1822
+ ],
1823
+ "name": "updateDistributorType",
1824
+ "outputs": [],
1825
+ "stateMutability": "nonpayable",
1826
+ "type": "function"
1827
+ },
1828
+ {
1829
+ "inputs": [
1830
+ {
1831
+ "internalType": "Key32",
1832
+ "name": "distributorKey",
1833
+ "type": "bytes32"
1834
+ },
1835
+ {
1836
+ "internalType": "StateId",
1837
+ "name": "newState",
1838
+ "type": "uint8"
1839
+ }
1840
+ ],
1841
+ "name": "updateDistributorTypeState",
1842
+ "outputs": [],
1843
+ "stateMutability": "nonpayable",
1844
+ "type": "function"
1845
+ },
1500
1846
  {
1501
1847
  "inputs": [
1502
1848
  {
@@ -1542,9 +1888,9 @@
1542
1888
  "type": "uint256"
1543
1889
  },
1544
1890
  {
1545
- "internalType": "uint256",
1891
+ "internalType": "Seconds",
1546
1892
  "name": "lifetime",
1547
- "type": "uint256"
1893
+ "type": "uint40"
1548
1894
  },
1549
1895
  {
1550
1896
  "internalType": "bytes",
@@ -1630,89 +1976,33 @@
1630
1976
  {
1631
1977
  "components": [
1632
1978
  {
1633
- "internalType": "NftId",
1634
- "name": "productNftId",
1635
- "type": "uint96"
1979
+ "internalType": "string",
1980
+ "name": "name",
1981
+ "type": "string"
1636
1982
  },
1637
1983
  {
1638
- "internalType": "contract TokenHandler",
1639
- "name": "tokenHandler",
1984
+ "internalType": "contract IERC20Metadata",
1985
+ "name": "token",
1640
1986
  "type": "address"
1641
1987
  },
1642
1988
  {
1643
- "internalType": "UFixed",
1644
- "name": "collateralizationLevel",
1645
- "type": "uint256"
1646
- },
1647
- {
1648
- "components": [
1649
- {
1650
- "internalType": "UFixed",
1651
- "name": "fractionalFee",
1652
- "type": "uint256"
1653
- },
1654
- {
1655
- "internalType": "uint256",
1656
- "name": "fixedFee",
1657
- "type": "uint256"
1658
- }
1659
- ],
1660
- "internalType": "struct Fee",
1661
- "name": "poolFee",
1662
- "type": "tuple"
1663
- },
1664
- {
1665
- "components": [
1666
- {
1667
- "internalType": "UFixed",
1668
- "name": "fractionalFee",
1669
- "type": "uint256"
1670
- },
1671
- {
1672
- "internalType": "uint256",
1673
- "name": "fixedFee",
1674
- "type": "uint256"
1675
- }
1676
- ],
1677
- "internalType": "struct Fee",
1678
- "name": "stakingFee",
1679
- "type": "tuple"
1680
- },
1681
- {
1682
- "components": [
1683
- {
1684
- "internalType": "UFixed",
1685
- "name": "fractionalFee",
1686
- "type": "uint256"
1687
- },
1688
- {
1689
- "internalType": "uint256",
1690
- "name": "fixedFee",
1691
- "type": "uint256"
1692
- }
1693
- ],
1694
- "internalType": "struct Fee",
1695
- "name": "performanceFee",
1696
- "type": "tuple"
1697
- },
1698
- {
1699
- "internalType": "bool",
1700
- "name": "isIntercepting",
1701
- "type": "bool"
1702
- },
1703
- {
1704
- "internalType": "bool",
1705
- "name": "isConfirmingApplication",
1706
- "type": "bool"
1989
+ "internalType": "contract TokenHandler",
1990
+ "name": "tokenHandler",
1991
+ "type": "address"
1707
1992
  },
1708
1993
  {
1709
1994
  "internalType": "address",
1710
1995
  "name": "wallet",
1711
1996
  "type": "address"
1997
+ },
1998
+ {
1999
+ "internalType": "bytes",
2000
+ "name": "data",
2001
+ "type": "bytes"
1712
2002
  }
1713
2003
  ],
1714
- "internalType": "struct ISetup.PoolSetupInfo",
1715
- "name": "setup",
2004
+ "internalType": "struct IComponents.ComponentInfo",
2005
+ "name": "info",
1716
2006
  "type": "tuple"
1717
2007
  },
1718
2008
  {
@@ -1773,23 +2063,6 @@
1773
2063
  "name": "poolNftId",
1774
2064
  "type": "uint96"
1775
2065
  },
1776
- {
1777
- "components": [
1778
- {
1779
- "internalType": "UFixed",
1780
- "name": "fractionalFee",
1781
- "type": "uint256"
1782
- },
1783
- {
1784
- "internalType": "uint256",
1785
- "name": "fixedFee",
1786
- "type": "uint256"
1787
- }
1788
- ],
1789
- "internalType": "struct Fee",
1790
- "name": "distributionFee",
1791
- "type": "tuple"
1792
- },
1793
2066
  {
1794
2067
  "components": [
1795
2068
  {
@@ -1824,57 +2097,6 @@
1824
2097
  "name": "processingFee",
1825
2098
  "type": "tuple"
1826
2099
  },
1827
- {
1828
- "components": [
1829
- {
1830
- "internalType": "UFixed",
1831
- "name": "fractionalFee",
1832
- "type": "uint256"
1833
- },
1834
- {
1835
- "internalType": "uint256",
1836
- "name": "fixedFee",
1837
- "type": "uint256"
1838
- }
1839
- ],
1840
- "internalType": "struct Fee",
1841
- "name": "poolFee",
1842
- "type": "tuple"
1843
- },
1844
- {
1845
- "components": [
1846
- {
1847
- "internalType": "UFixed",
1848
- "name": "fractionalFee",
1849
- "type": "uint256"
1850
- },
1851
- {
1852
- "internalType": "uint256",
1853
- "name": "fixedFee",
1854
- "type": "uint256"
1855
- }
1856
- ],
1857
- "internalType": "struct Fee",
1858
- "name": "stakingFee",
1859
- "type": "tuple"
1860
- },
1861
- {
1862
- "components": [
1863
- {
1864
- "internalType": "UFixed",
1865
- "name": "fractionalFee",
1866
- "type": "uint256"
1867
- },
1868
- {
1869
- "internalType": "uint256",
1870
- "name": "fixedFee",
1871
- "type": "uint256"
1872
- }
1873
- ],
1874
- "internalType": "struct Fee",
1875
- "name": "performanceFee",
1876
- "type": "tuple"
1877
- },
1878
2100
  {
1879
2101
  "internalType": "bool",
1880
2102
  "name": "isIntercepting",
@@ -1919,6 +2141,84 @@
1919
2141
  "stateMutability": "nonpayable",
1920
2142
  "type": "function"
1921
2143
  },
2144
+ {
2145
+ "inputs": [
2146
+ {
2147
+ "internalType": "Key32",
2148
+ "name": "referralKey",
2149
+ "type": "bytes32"
2150
+ },
2151
+ {
2152
+ "components": [
2153
+ {
2154
+ "internalType": "NftId",
2155
+ "name": "distributorNftId",
2156
+ "type": "uint96"
2157
+ },
2158
+ {
2159
+ "internalType": "string",
2160
+ "name": "referralCode",
2161
+ "type": "string"
2162
+ },
2163
+ {
2164
+ "internalType": "UFixed",
2165
+ "name": "discountPercentage",
2166
+ "type": "uint256"
2167
+ },
2168
+ {
2169
+ "internalType": "uint32",
2170
+ "name": "maxReferrals",
2171
+ "type": "uint32"
2172
+ },
2173
+ {
2174
+ "internalType": "uint32",
2175
+ "name": "usedReferrals",
2176
+ "type": "uint32"
2177
+ },
2178
+ {
2179
+ "internalType": "Timestamp",
2180
+ "name": "expiryAt",
2181
+ "type": "uint40"
2182
+ },
2183
+ {
2184
+ "internalType": "bytes",
2185
+ "name": "data",
2186
+ "type": "bytes"
2187
+ }
2188
+ ],
2189
+ "internalType": "struct IDistribution.ReferralInfo",
2190
+ "name": "referralInfo",
2191
+ "type": "tuple"
2192
+ },
2193
+ {
2194
+ "internalType": "StateId",
2195
+ "name": "newState",
2196
+ "type": "uint8"
2197
+ }
2198
+ ],
2199
+ "name": "updateReferral",
2200
+ "outputs": [],
2201
+ "stateMutability": "nonpayable",
2202
+ "type": "function"
2203
+ },
2204
+ {
2205
+ "inputs": [
2206
+ {
2207
+ "internalType": "Key32",
2208
+ "name": "referralKey",
2209
+ "type": "bytes32"
2210
+ },
2211
+ {
2212
+ "internalType": "StateId",
2213
+ "name": "newState",
2214
+ "type": "uint8"
2215
+ }
2216
+ ],
2217
+ "name": "updateReferralState",
2218
+ "outputs": [],
2219
+ "stateMutability": "nonpayable",
2220
+ "type": "function"
2221
+ },
1922
2222
  {
1923
2223
  "inputs": [
1924
2224
  {