@etherisc/gif-next 0.0.2-adb0ad8-584 → 0.0.2-ae6744f-037

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 (375) hide show
  1. package/README.md +27 -6
  2. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
  3. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +2 -2
  4. package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +4 -0
  5. package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.json +24 -0
  6. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
  7. package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
  8. package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +2 -2
  9. package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
  10. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
  11. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
  12. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
  13. package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +1 -1
  14. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
  15. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
  16. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
  17. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +53 -163
  18. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
  19. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +2 -2
  20. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
  21. package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +6 -68
  22. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
  23. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +121 -82
  24. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  25. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +72 -48
  26. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  27. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +6 -50
  28. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  29. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +23 -0
  30. package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
  31. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
  32. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +51 -148
  33. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
  34. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +49 -17
  35. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
  36. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +106 -192
  37. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
  38. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +17 -17
  39. package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
  40. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
  41. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +79 -121
  42. package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
  43. package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +470 -0
  44. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
  45. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +31 -117
  46. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
  47. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +168 -155
  48. package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
  49. package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +502 -0
  50. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
  51. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +403 -205
  52. package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
  53. package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +470 -0
  54. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
  55. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +147 -42
  56. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  57. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +64 -18
  58. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  59. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +24 -17
  60. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  61. package/artifacts/contracts/instance/Instance.sol/Instance.json +96 -29
  62. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
  63. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +103 -72
  64. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
  65. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +40 -27
  66. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  67. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +303 -75
  68. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  69. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +71 -48
  70. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  71. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +46 -22
  72. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
  73. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +59 -69
  74. package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
  75. package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +810 -0
  76. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
  77. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
  78. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
  79. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
  80. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
  81. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
  82. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
  83. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
  84. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
  85. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  86. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  87. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  88. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  89. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  90. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  91. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
  92. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
  93. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +20 -130
  94. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
  95. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +2 -2
  96. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
  97. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
  98. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +6 -50
  99. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
  100. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
  101. package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +6 -68
  102. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
  103. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +84 -60
  104. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
  105. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +66 -22
  106. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
  107. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +6 -83
  108. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
  109. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +49 -17
  110. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
  111. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +101 -206
  112. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  113. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +58 -70
  114. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
  115. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +19 -57
  116. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  117. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +6 -89
  118. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
  119. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +77 -75
  120. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
  121. package/artifacts/contracts/pool/Pool.sol/Pool.json +6 -107
  122. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
  123. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +154 -160
  124. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  125. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +61 -33
  126. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  127. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +58 -23
  128. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  129. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +42 -22
  130. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
  131. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +11 -68
  132. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
  133. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +2 -2
  134. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
  135. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +74 -66
  136. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  137. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +67 -47
  138. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  139. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +34 -7
  140. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
  141. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  142. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +38 -19
  143. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
  144. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  145. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +11 -50
  146. package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
  147. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
  148. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +132 -121
  149. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  150. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +70 -42
  151. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
  152. package/artifacts/contracts/product/PricingService.sol/PricingService.json +50 -34
  153. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
  154. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +56 -32
  155. package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
  156. package/artifacts/contracts/product/Product.sol/Product.json +11 -68
  157. package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
  158. package/artifacts/contracts/product/RiskService.sol/RiskService.json +34 -18
  159. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
  160. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +40 -16
  161. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  162. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
  163. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  164. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +24 -0
  165. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  166. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  167. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  168. package/artifacts/contracts/registry/Registry.sol/Registry.json +62 -38
  169. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
  170. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +107 -94
  171. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  172. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +32 -16
  173. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  174. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +39 -15
  175. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
  176. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
  177. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
  178. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +12 -12
  179. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
  180. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
  181. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  182. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
  183. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
  184. package/artifacts/contracts/shared/Component.sol/Component.json +6 -54
  185. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
  186. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +256 -116
  187. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
  188. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +78 -42
  189. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
  190. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
  191. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +402 -6
  192. package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +4 -0
  193. package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.json +24 -0
  194. package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +4 -0
  195. package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.json +30 -0
  196. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
  197. package/artifacts/contracts/shared/IComponent.sol/IComponent.json +6 -36
  198. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
  199. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +146 -14
  200. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
  201. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +6 -50
  202. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  203. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  204. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  205. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  206. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  207. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  208. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  209. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
  210. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
  211. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +6 -68
  212. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  213. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  214. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
  215. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
  216. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  217. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
  218. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  219. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
  220. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  221. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +2 -2
  222. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  223. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
  224. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  225. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  226. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +388 -35
  227. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
  228. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +395 -0
  229. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
  230. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +88 -24
  231. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
  232. package/artifacts/contracts/staking/IStaking.sol/IStaking.json +24 -72
  233. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
  234. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
  235. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +3 -3
  236. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
  237. package/artifacts/contracts/staking/Staking.sol/Staking.json +80 -152
  238. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
  239. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
  240. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
  241. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +50 -46
  242. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
  243. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
  244. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
  245. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +36 -20
  246. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
  247. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +43 -19
  248. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
  249. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +13 -13
  250. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
  251. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +3 -3
  252. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  253. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
  254. package/artifacts/contracts/type/Amount.sol/AmountLib.json +3 -3
  255. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  256. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  257. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
  258. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  259. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
  260. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
  261. package/artifacts/contracts/type/Fee.sol/FeeLib.json +3 -3
  262. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
  263. package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
  264. package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +4 -0
  265. package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +33 -0
  266. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
  267. package/artifacts/contracts/type/NftId.sol/NftIdLib.json +23 -4
  268. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  269. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
  270. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  271. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +2 -2
  272. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  273. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
  274. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
  275. package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
  276. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
  277. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
  278. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
  279. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +43 -5
  280. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
  281. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
  282. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
  283. package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
  284. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
  285. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
  286. package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
  287. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
  288. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
  289. package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +3 -3
  290. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
  291. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
  292. package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
  293. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  294. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +18 -2
  295. package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  296. package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
  297. package/contracts/authorization/AccessAdmin.sol +21 -2
  298. package/contracts/authorization/ReleaseAccessManager.sol +1 -1
  299. package/contracts/distribution/BasicDistribution.sol +6 -6
  300. package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
  301. package/contracts/distribution/Distribution.sol +32 -30
  302. package/contracts/distribution/DistributionService.sol +18 -19
  303. package/contracts/distribution/IDistributionService.sol +5 -6
  304. package/contracts/examples/fire/FirePool.sol +25 -10
  305. package/contracts/examples/fire/FirePoolAuthorization.sol +1 -0
  306. package/contracts/examples/fire/FireProduct.sol +29 -11
  307. package/contracts/examples/fire/FireProductAuthorization.sol +1 -0
  308. package/contracts/examples/unpermissioned/SimpleDistribution.sol +7 -0
  309. package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
  310. package/contracts/examples/unpermissioned/SimplePool.sol +33 -2
  311. package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
  312. package/contracts/examples/unpermissioned/SimpleProduct.sol +22 -21
  313. package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
  314. package/contracts/instance/BundleSet.sol +38 -34
  315. package/contracts/instance/IInstance.sol +7 -2
  316. package/contracts/instance/IInstanceService.sol +7 -9
  317. package/contracts/instance/Instance.sol +16 -9
  318. package/contracts/instance/InstanceAdmin.sol +41 -30
  319. package/contracts/instance/InstanceAuthorizationV3.sol +33 -9
  320. package/contracts/instance/InstanceReader.sol +89 -3
  321. package/contracts/instance/InstanceService.sol +39 -58
  322. package/contracts/instance/RiskSet.sol +119 -0
  323. package/contracts/instance/base/ObjectCounter.sol +1 -2
  324. package/contracts/instance/base/ObjectSet.sol +24 -25
  325. package/contracts/instance/module/IComponents.sol +1 -2
  326. package/contracts/instance/module/IPolicy.sol +2 -1
  327. package/contracts/instance/module/IRisk.sol +1 -0
  328. package/contracts/oracle/OracleService.sol +87 -69
  329. package/contracts/pool/BasicPool.sol +24 -3
  330. package/contracts/pool/BasicPoolAuthorization.sol +12 -1
  331. package/contracts/pool/BundleService.sol +14 -84
  332. package/contracts/pool/IBundleService.sol +2 -23
  333. package/contracts/pool/IPoolComponent.sol +1 -7
  334. package/contracts/pool/IPoolService.sol +12 -26
  335. package/contracts/pool/Pool.sol +112 -102
  336. package/contracts/pool/PoolService.sol +156 -88
  337. package/contracts/product/ApplicationService.sol +12 -12
  338. package/contracts/product/BasicProduct.sol +7 -11
  339. package/contracts/product/BasicProductAuthorization.sol +1 -2
  340. package/contracts/product/ClaimService.sol +3 -1
  341. package/contracts/product/IApplicationService.sol +5 -2
  342. package/contracts/product/IPolicyService.sol +17 -7
  343. package/contracts/product/PolicyService.sol +237 -195
  344. package/contracts/product/Product.sol +12 -40
  345. package/contracts/product/RiskService.sol +14 -3
  346. package/contracts/registry/ChainNft.sol +4 -2
  347. package/contracts/registry/IRegistry.sol +2 -0
  348. package/contracts/registry/Registry.sol +9 -1
  349. package/contracts/registry/RegistryAdmin.sol +22 -13
  350. package/contracts/registry/ReleaseRegistry.sol +5 -20
  351. package/contracts/registry/ServiceAuthorizationV3.sol +13 -31
  352. package/contracts/shared/Component.sol +44 -90
  353. package/contracts/shared/ComponentService.sol +160 -36
  354. package/contracts/shared/ComponentVerifyingService.sol +15 -13
  355. package/contracts/shared/ContractLib.sol +196 -10
  356. package/contracts/shared/IComponent.sol +1 -13
  357. package/contracts/shared/IComponentService.sol +19 -5
  358. package/contracts/shared/IInstanceLinkedComponent.sol +0 -11
  359. package/contracts/shared/InstanceLinkedComponent.sol +2 -18
  360. package/contracts/shared/Registerable.sol +0 -2
  361. package/contracts/shared/RegistryLinked.sol +6 -12
  362. package/contracts/shared/TokenHandler.sol +316 -66
  363. package/contracts/shared/TokenHandlerDeployerLib.sol +10 -2
  364. package/contracts/staking/IStaking.sol +9 -4
  365. package/contracts/staking/Staking.sol +39 -21
  366. package/contracts/staking/StakingService.sol +41 -8
  367. package/contracts/type/Key32.sol +2 -2
  368. package/contracts/type/Key32Set.sol +62 -0
  369. package/contracts/type/NftId.sol +6 -0
  370. package/contracts/type/ObjectType.sol +2 -0
  371. package/contracts/type/RiskId.sol +18 -6
  372. package/contracts/type/UFixed.sol +9 -119
  373. package/package.json +3 -3
  374. package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +0 -4
  375. package/artifacts/contracts/type/UFixed.sol/MathLib.json +0 -16
@@ -44,8 +44,8 @@ contract BasicDistribution is
44
44
  )
45
45
  external
46
46
  virtual
47
- onlyOwner()
48
47
  restricted()
48
+ onlyOwner()
49
49
  returns (DistributorType distributorType)
50
50
  {
51
51
  return _createDistributorType(
@@ -67,25 +67,25 @@ contract BasicDistribution is
67
67
  )
68
68
  external
69
69
  virtual
70
- onlyOwner()
71
70
  restricted()
71
+ onlyOwner()
72
72
  returns(NftId distributorNftId)
73
73
  {
74
74
  return _createDistributor(distributor, distributorType, data);
75
75
  }
76
76
 
77
- function updateDistributorType(
77
+ function changeDistributorType(
78
78
  NftId distributorNftId,
79
79
  DistributorType distributorType,
80
80
  bytes memory data
81
81
  )
82
82
  external
83
83
  virtual
84
+ restricted()
84
85
  onlyOwner()
85
86
  onlyNftOfType(distributorNftId, DISTRIBUTOR())
86
- restricted()
87
87
  {
88
- _updateDistributorType(distributorNftId, distributorType, data);
88
+ _changeDistributorType(distributorNftId, distributorType, data);
89
89
  }
90
90
 
91
91
  /**
@@ -101,8 +101,8 @@ contract BasicDistribution is
101
101
  )
102
102
  external
103
103
  virtual
104
- onlyDistributor()
105
104
  restricted()
105
+ onlyDistributor()
106
106
  returns (ReferralId referralId)
107
107
  {
108
108
  NftId distributorNftId = getDistributorNftId(msg.sender);
@@ -37,7 +37,7 @@ contract BasicDistributionAuthorization
37
37
  _authorize(functions, BasicDistribution.setFees.selector, "setFees");
38
38
  _authorize(functions, BasicDistribution.createDistributorType.selector, "createDistributorType");
39
39
  _authorize(functions, BasicDistribution.createDistributor.selector, "createDistributor");
40
- _authorize(functions, BasicDistribution.updateDistributorType.selector, "updateDistributorType");
40
+ _authorize(functions, BasicDistribution.changeDistributorType.selector, "changeDistributorType");
41
41
  _authorize(functions, BasicDistribution.createReferral.selector, "createReferral");
42
42
 
43
43
  _authorize(functions, IInstanceLinkedComponent.withdrawFees.selector, "withdrawFees");
@@ -37,6 +37,32 @@ abstract contract Distribution is
37
37
  }
38
38
 
39
39
 
40
+ function processRenewal(
41
+ ReferralId referralId,
42
+ uint256 feeAmount
43
+ )
44
+ external
45
+ virtual
46
+ restricted()
47
+ {
48
+ // default is no action
49
+ }
50
+
51
+
52
+ /// @inheritdoc IDistributionComponent
53
+ function withdrawCommission(NftId distributorNftId, Amount amount)
54
+ external
55
+ virtual
56
+ restricted()
57
+ onlyDistributor()
58
+ onlyNftOfType(distributorNftId, DISTRIBUTOR())
59
+ onlyNftOwner(distributorNftId)
60
+ returns (Amount withdrawnAmount)
61
+ {
62
+ return _withdrawCommission(distributorNftId, amount);
63
+ }
64
+
65
+
40
66
  function isDistributor(address candidate)
41
67
  public
42
68
  view
@@ -97,35 +123,12 @@ abstract contract Distribution is
97
123
  }
98
124
 
99
125
 
100
- function processRenewal(
101
- ReferralId referralId,
102
- uint256 feeAmount
103
- )
104
- external
105
- virtual
106
- restricted()
107
- {
108
- // default is no action
109
- }
110
-
111
126
  /// @dev Returns true iff the component needs to be called when selling/renewing policis
112
127
  function isVerifying() external pure returns (bool verifying) {
113
128
  return true;
114
129
  }
115
130
 
116
- /// @inheritdoc IDistributionComponent
117
- function withdrawCommission(NftId distributorNftId, Amount amount)
118
- external
119
- virtual
120
- restricted()
121
- onlyDistributor()
122
- onlyNftOfType(distributorNftId, DISTRIBUTOR())
123
- onlyNftOwner(distributorNftId)
124
- returns (Amount withdrawnAmount)
125
- {
126
- return _withdrawCommission(distributorNftId, amount);
127
- }
128
-
131
+
129
132
  function _initializeDistribution(
130
133
  address registry,
131
134
  NftId productNftId,
@@ -223,7 +226,7 @@ abstract contract Distribution is
223
226
  }
224
227
 
225
228
  /// @dev Uptates the distributor type for the specified distributor.
226
- function _updateDistributorType(
229
+ function _changeDistributorType(
227
230
  NftId distributorNftId,
228
231
  DistributorType distributorType,
229
232
  bytes memory data
@@ -232,11 +235,10 @@ abstract contract Distribution is
232
235
  virtual
233
236
  {
234
237
  DistributionStorage storage $ = _getDistributionStorage();
235
- // TODO re-enable once implemented
236
- // $._distributionService.updateDistributorType(
237
- // distributorNftId,
238
- // distributorType,
239
- // data);
238
+ $._distributionService.changeDistributorType(
239
+ distributorNftId,
240
+ distributorType,
241
+ data);
240
242
  }
241
243
 
242
244
  /// @dev Create a new referral code for the provided distributor.
@@ -136,21 +136,20 @@ contract DistributionService is
136
136
  instance.getInstanceStore().createDistributor(distributorNftId, info);
137
137
  }
138
138
 
139
- // function updateDistributorType(
140
- // NftId distributorNftId,
141
- // DistributorType distributorType,
142
- // bytes memory data
143
- // )
144
- // external
145
- // virtual
146
- // {
147
- // (, IInstance instance) = _getAndVerifyCallingDistribution();
148
- // InstanceReader instanceReader = instance.getInstanceReader();
149
- // IDistribution.DistributorInfo memory distributorInfo = instanceReader.getDistributorInfo(distributorNftId);
150
- // distributorInfo.distributorType = distributorType;
151
- // distributorInfo.data = data;
152
- // instance.updateDistributor(distributorNftId, distributorInfo, KEEP_STATE());
153
- // }
139
+ function changeDistributorType(
140
+ NftId distributorNftId,
141
+ DistributorType distributorType,
142
+ bytes memory data
143
+ )
144
+ external
145
+ virtual
146
+ {
147
+ (,, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
148
+ IDistribution.DistributorInfo memory distributorInfo = instance.getInstanceReader().getDistributorInfo(distributorNftId);
149
+ distributorInfo.distributorType = distributorType;
150
+ distributorInfo.data = data;
151
+ instance.getInstanceStore().updateDistributor(distributorNftId, distributorInfo, KEEP_STATE());
152
+ }
154
153
 
155
154
 
156
155
  function createReferral(
@@ -223,7 +222,7 @@ contract DistributionService is
223
222
  if (referralIsValid(distributionNftId, referralId)) {
224
223
  IRegistry registry = getRegistry();
225
224
  IRegistry.ObjectInfo memory distributionInfo = registry.getObjectInfo(distributionNftId);
226
- IInstance instance = _getInstanceForComponent(registry, distributionInfo);
225
+ IInstance instance = _getInstanceForComponent(registry, distributionInfo.parentNftId);
227
226
 
228
227
  // update book keeping for referral info
229
228
  IDistribution.ReferralInfo memory referralInfo = instance.getInstanceReader().getReferralInfo(referralId);
@@ -244,7 +243,7 @@ contract DistributionService is
244
243
  {
245
244
  IRegistry registry = getRegistry();
246
245
  IRegistry.ObjectInfo memory distributionInfo = registry.getObjectInfo(distributionNftId);
247
- IInstance instance = _getInstanceForComponent(registry, distributionInfo);
246
+ IInstance instance = _getInstanceForComponent(registry, distributionInfo.parentNftId);
248
247
  InstanceReader reader = instance.getInstanceReader();
249
248
  InstanceStore store = instance.getInstanceStore();
250
249
 
@@ -285,7 +284,7 @@ contract DistributionService is
285
284
  InstanceReader reader = instance.getInstanceReader();
286
285
 
287
286
  IComponents.ComponentInfo memory distributionInfo = reader.getComponentInfo(distributionNftId);
288
- address distributionWallet = distributionInfo.wallet;
287
+ address distributionWallet = distributionInfo.tokenHandler.getWallet();
289
288
 
290
289
  Amount commissionAmount = reader.getFeeAmount(distributorNftId);
291
290
 
@@ -328,7 +327,7 @@ contract DistributionService is
328
327
 
329
328
  IRegistry registry = getRegistry();
330
329
  IRegistry.ObjectInfo memory distributionInfo = registry.getObjectInfo(distributionNftId);
331
- IInstance instance = _getInstanceForComponent(registry, distributionInfo);
330
+ IInstance instance = _getInstanceForComponent(registry, distributionInfo.parentNftId);
332
331
  IDistribution.ReferralInfo memory info = instance.getInstanceReader().getReferralInfo(referralId);
333
332
 
334
333
  if (info.distributorNftId.eqz()) {
@@ -56,12 +56,11 @@ interface IDistributionService is IService {
56
56
  bytes memory data
57
57
  ) external returns (NftId distributorNftId);
58
58
 
59
- // TODO re-enable and reorganize (service contract too large)
60
- // function updateDistributorType(
61
- // NftId distributorNftId,
62
- // DistributorType distributorType,
63
- // bytes memory data
64
- // ) external;
59
+ function changeDistributorType(
60
+ NftId distributorNftId,
61
+ DistributorType distributorType,
62
+ bytes memory data
63
+ ) external;
65
64
 
66
65
  function createReferral(
67
66
  NftId distributorNftId,
@@ -1,22 +1,23 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
+ import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
5
+
4
6
  import {Amount, AmountLib} from "../../type/Amount.sol";
5
7
  import {BasicPool} from "../../pool/BasicPool.sol";
6
- import {BasicPoolAuthorization} from "../../pool/BasicPoolAuthorization.sol";
7
8
  import {Fee} from "../../type/Fee.sol";
8
9
  import {IAuthorization} from "../../authorization/IAuthorization.sol";
10
+ import {IComponents} from "../../instance/module/IComponents.sol";
9
11
  import {NftId} from "../../type/NftId.sol";
10
12
  import {Seconds} from "../../type/Timestamp.sol";
11
- import {UFixed} from "../../type/UFixed.sol";
13
+ import {UFixed, UFixedLib} from "../../type/UFixed.sol";
12
14
 
13
15
  contract FirePool is
14
16
  BasicPool
15
- {
16
-
17
+ {
17
18
  constructor(
18
19
  address registry,
19
- NftId instanceNftId,
20
+ NftId fireProductNftId,
20
21
  string memory componentName,
21
22
  address token,
22
23
  IAuthorization authorization
@@ -25,18 +26,28 @@ contract FirePool is
25
26
  address initialOwner = msg.sender;
26
27
  _intialize(
27
28
  registry,
28
- instanceNftId,
29
+ fireProductNftId,
29
30
  componentName,
30
31
  token,
32
+ IComponents.PoolInfo({
33
+ maxBalanceAmount: AmountLib.max(),
34
+ isInterceptingBundleTransfers: false,
35
+ isProcessingConfirmedClaims: false,
36
+ isExternallyManaged: false,
37
+ isVerifyingApplications: false,
38
+ collateralizationLevel: UFixedLib.one(),
39
+ retentionLevel: UFixedLib.one()
40
+ }),
31
41
  authorization,
32
42
  initialOwner);
33
43
  }
34
44
 
35
45
  function _intialize(
36
46
  address registry,
37
- NftId instanceNftId,
47
+ NftId fireProductNftId,
38
48
  string memory componentName,
39
49
  address token,
50
+ IComponents.PoolInfo memory poolInfo,
40
51
  IAuthorization authorization,
41
52
  address initialOwner
42
53
  )
@@ -45,10 +56,11 @@ contract FirePool is
45
56
  {
46
57
  _initializeBasicPool(
47
58
  registry,
48
- instanceNftId,
49
- authorization,
50
- token,
59
+ fireProductNftId,
51
60
  componentName,
61
+ token,
62
+ poolInfo,
63
+ authorization,
52
64
  initialOwner);
53
65
  }
54
66
 
@@ -72,4 +84,7 @@ contract FirePool is
72
84
  netStakedAmount = _stake(bundleNftId, initialAmount);
73
85
  }
74
86
 
87
+ function approveTokenHandler(IERC20Metadata token, Amount amount) external restricted() onlyOwner() { _approveTokenHandler(token, amount); }
88
+ function setLocked(bool locked) external onlyOwner() { _setLocked(locked); }
89
+ function setWallet(address newWallet) external restricted() onlyOwner() { _setWallet(newWallet); }
75
90
  }
@@ -27,6 +27,7 @@ contract FirePoolAuthorization
27
27
  // authorize public role (open access to any account, only allows to lock target)
28
28
  functions = _authorizeForTarget(getTargetName(), PUBLIC_ROLE());
29
29
  // TODO: FirePool.createBundle must require a custom role (e.g. INVESTOR) instead of PUBLIC_ROLE
30
+ _authorize(functions, FirePool.approveTokenHandler.selector, "approveTokenHandler");
30
31
  _authorize(functions, FirePool.createBundle.selector, "createBundle");
31
32
  }
32
33
 
@@ -1,14 +1,18 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
+ import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
5
+
4
6
  import {ACTIVE, PAUSED} from "../../type/StateId.sol";
5
7
  import {Amount, AmountLib} from "../../type/Amount.sol";
6
8
  import {BasicProduct} from "../../product/BasicProduct.sol";
7
9
  import {ClaimId} from "../../type/ClaimId.sol";
8
10
  import {DamageLevel, DAMAGE_SMALL, DAMAGE_MEDIUM, DAMAGE_LARGE} from "./DamageLevel.sol";
11
+ import {FeeLib} from "../../type/Fee.sol";
9
12
  import {IAuthorization} from "../../authorization/IAuthorization.sol";
13
+ import {IComponents} from "../../instance/module/IComponents.sol";
10
14
  import {IPolicy} from "../../instance/module/IPolicy.sol";
11
- import {NftId} from "../../type/NftId.sol";
15
+ import {NftId, NftIdLib} from "../../type/NftId.sol";
12
16
  import {PayoutId} from "../../type/PayoutId.sol";
13
17
  import {POLICY, BUNDLE} from "../../type/ObjectType.sol";
14
18
  import {ReferralLib} from "../../type/Referral.sol";
@@ -65,7 +69,6 @@ contract FireProduct is
65
69
  NftId instanceNftid,
66
70
  string memory componentName,
67
71
  address token,
68
- address pool,
69
72
  IAuthorization authorization
70
73
  )
71
74
  {
@@ -76,17 +79,15 @@ contract FireProduct is
76
79
  instanceNftid,
77
80
  componentName,
78
81
  token,
79
- pool,
80
82
  authorization,
81
83
  initialOwner);
82
84
  }
83
85
 
84
86
  function _initialize(
85
87
  address registry,
86
- NftId instanceNftid,
88
+ NftId instanceNftId,
87
89
  string memory componentName,
88
90
  address token,
89
- address pool,
90
91
  IAuthorization authorization,
91
92
  address initialOwner
92
93
  )
@@ -95,14 +96,28 @@ contract FireProduct is
95
96
  {
96
97
  _initializeBasicProduct(
97
98
  registry,
98
- instanceNftid,
99
- authorization,
100
- initialOwner,
99
+ instanceNftId,
101
100
  componentName,
102
101
  token,
103
- false, // is interceptor
104
- false, // has distribution
105
- 0); // number of oracles
102
+ IComponents.ProductInfo({
103
+ isProcessingFundedClaims: false,
104
+ isInterceptingPolicyTransfers: false,
105
+ hasDistribution: false,
106
+ expectedNumberOfOracles: 0,
107
+ numberOfOracles: 0,
108
+ poolNftId: NftIdLib.zero(),
109
+ distributionNftId: NftIdLib.zero(),
110
+ oracleNftId: new NftId[](0),
111
+ productFee: FeeLib.zero(),
112
+ processingFee: FeeLib.zero(),
113
+ distributionFee: FeeLib.zero(),
114
+ minDistributionOwnerFee: FeeLib.zero(),
115
+ poolFee: FeeLib.zero(),
116
+ stakingFee: FeeLib.zero(),
117
+ performanceFee: FeeLib.zero()
118
+ }),
119
+ authorization,
120
+ initialOwner); // number of oracles
106
121
  }
107
122
 
108
123
  function cities() public view returns (uint256) {
@@ -415,4 +430,7 @@ contract FireProduct is
415
430
  }
416
431
  }
417
432
 
433
+ function approveTokenHandler(IERC20Metadata token, Amount amount) external restricted() onlyOwner() { _approveTokenHandler(token, amount); }
434
+ function setLocked(bool locked) external onlyOwner() { _setLocked(locked); }
435
+ function setWallet(address newWallet) external restricted() onlyOwner() { _setWallet(newWallet); }
418
436
  }
@@ -25,6 +25,7 @@ contract FireProductAuthorization
25
25
  // authorize public role (open access to any account, only allows to lock target)
26
26
  functions = _authorizeForTarget(getTargetName(), PUBLIC_ROLE());
27
27
  // fully public functions
28
+ _authorize(functions, FireProduct.approveTokenHandler.selector, "approveTokenHandler");
28
29
  _authorize(functions, FireProduct.createApplication.selector, "createApplication");
29
30
 
30
31
  // only owner
@@ -1,6 +1,9 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
+ import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
5
+
6
+ import {Amount} from "../../type/Amount.sol";
4
7
  import {BasicDistribution} from "../../distribution/BasicDistribution.sol";
5
8
  import {IAuthorization} from "../../authorization/IAuthorization.sol";
6
9
  import {NftId} from "../../type/NftId.sol";
@@ -47,4 +50,8 @@ contract SimpleDistribution is
47
50
  name,
48
51
  token);
49
52
  }
53
+
54
+ function approveTokenHandler(IERC20Metadata token, Amount amount) external restricted() onlyOwner() { _approveTokenHandler(token, amount); }
55
+ function setLocked(bool locked) external onlyOwner() { _setLocked(locked); }
56
+ function setWallet(address newWallet) external restricted() onlyOwner() { _setWallet(newWallet); }
50
57
  }
@@ -0,0 +1,28 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.20;
3
+
4
+ import {BasicDistributionAuthorization} from "../../distribution/BasicDistributionAuthorization.sol";
5
+ import {IAccess} from "../../authorization/IAccess.sol";
6
+ import {PUBLIC_ROLE} from "../../type/RoleId.sol";
7
+ import {SimpleDistribution} from "./SimpleDistribution.sol";
8
+
9
+ contract SimpleDistributionAuthorization
10
+ is BasicDistributionAuthorization
11
+ {
12
+ constructor(string memory componentName)
13
+ BasicDistributionAuthorization(componentName)
14
+ {}
15
+
16
+ function _setupTargetAuthorizations()
17
+ internal
18
+ virtual override
19
+ {
20
+ super._setupTargetAuthorizations();
21
+
22
+ // authorize public role (open access to any account, only allows to lock target)
23
+ IAccess.FunctionInfo[] storage functions;
24
+ functions = _authorizeForTarget(getTargetName(), PUBLIC_ROLE());
25
+ _authorize(functions, SimpleDistribution.approveTokenHandler.selector, "approveTokenHandler");
26
+ _authorize(functions, SimpleDistribution.setWallet.selector, "setWallet");
27
+ }
28
+ }
@@ -1,11 +1,14 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
+ import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
5
+
4
6
  import {Amount, AmountLib} from "../../type/Amount.sol";
5
7
  import {BasicPool} from "../../pool/BasicPool.sol";
6
8
  import {BasicPoolAuthorization} from "../../pool/BasicPoolAuthorization.sol";
7
9
  import {Fee} from "../../type/Fee.sol";
8
10
  import {IAuthorization} from "../../authorization/IAuthorization.sol";
11
+ import {IComponents} from "../../instance/module/IComponents.sol";
9
12
  import {NftId} from "../../type/NftId.sol";
10
13
  import {Seconds} from "../../type/Timestamp.sol";
11
14
  import {UFixed} from "../../type/UFixed.sol";
@@ -18,6 +21,7 @@ contract SimplePool is
18
21
  address registry,
19
22
  NftId productNftId,
20
23
  address token,
24
+ IComponents.PoolInfo memory poolInfo,
21
25
  IAuthorization authorization,
22
26
  address initialOwner
23
27
  )
@@ -26,15 +30,18 @@ contract SimplePool is
26
30
  registry,
27
31
  productNftId,
28
32
  token,
33
+ poolInfo,
29
34
  authorization,
30
35
  initialOwner
31
36
  );
32
37
  }
33
38
 
39
+
34
40
  function initialize(
35
41
  address registry,
36
42
  NftId productNftId,
37
43
  address token,
44
+ IComponents.PoolInfo memory poolInfo,
38
45
  IAuthorization authorization,
39
46
  address initialOwner
40
47
  )
@@ -45,12 +52,14 @@ contract SimplePool is
45
52
  _initializeBasicPool(
46
53
  registry,
47
54
  productNftId,
48
- authorization,
49
- token,
50
55
  "SimplePool",
56
+ token,
57
+ poolInfo,
58
+ authorization,
51
59
  initialOwner);
52
60
  }
53
61
 
62
+
54
63
  function createBundle(
55
64
  Fee memory fee,
56
65
  uint256 initialAmount,
@@ -73,4 +82,26 @@ contract SimplePool is
73
82
  netStakedAmountInt = netStakedAmount.toInt();
74
83
  }
75
84
 
85
+
86
+ function fundPoolWallet(
87
+ Amount amount
88
+ )
89
+ external
90
+ {
91
+ _fundPoolWallet(amount);
92
+ }
93
+
94
+
95
+ function defundPoolWallet(
96
+ Amount amount
97
+ )
98
+ external
99
+ {
100
+ _defundPoolWallet(amount);
101
+ }
102
+
103
+
104
+ function approveTokenHandler(IERC20Metadata token, Amount amount) external restricted() onlyOwner() { _approveTokenHandler(token, amount); }
105
+ function setLocked(bool locked) external onlyOwner() { _setLocked(locked); }
106
+ function setWallet(address newWallet) external restricted() onlyOwner() { _setWallet(newWallet); }
76
107
  }
@@ -0,0 +1,28 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.20;
3
+
4
+ import {BasicPoolAuthorization} from "../../pool/BasicPoolAuthorization.sol";
5
+ import {IAccess} from "../../authorization/IAccess.sol";
6
+ import {PUBLIC_ROLE} from "../../type/RoleId.sol";
7
+ import {SimplePool} from "./SimplePool.sol";
8
+
9
+ contract SimplePoolAuthorization
10
+ is BasicPoolAuthorization
11
+ {
12
+ constructor(string memory poolName)
13
+ BasicPoolAuthorization(poolName)
14
+ {}
15
+
16
+ function _setupTargetAuthorizations()
17
+ internal
18
+ virtual override
19
+ {
20
+ super._setupTargetAuthorizations();
21
+
22
+ // authorize public role (open access to any account, only allows to lock target)
23
+ IAccess.FunctionInfo[] storage functions;
24
+ functions = _authorizeForTarget(getTargetName(), PUBLIC_ROLE());
25
+ _authorize(functions, SimplePool.approveTokenHandler.selector, "approveTokenHandler");
26
+ _authorize(functions, SimplePool.setWallet.selector, "setWallet");
27
+ }
28
+ }