@etherisc/gif-next 0.0.2-f13fd28-503 → 0.0.2-f15b559-661

Sign up to get free protection for your applications and to get access to all the features.
Files changed (274) hide show
  1. package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
  2. package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +2 -2
  3. package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
  4. package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +2 -2
  5. package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
  6. package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
  7. package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +1 -1
  8. package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
  9. package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
  10. package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
  11. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
  12. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
  13. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
  14. package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
  15. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
  16. package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +4 -4
  17. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
  18. package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +2 -2
  19. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
  20. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
  21. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +126 -118
  22. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  23. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +26 -22
  24. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  25. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  26. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +76 -76
  27. package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
  28. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
  29. package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +2 -2
  30. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
  31. package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +2 -2
  32. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
  33. package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +42 -50
  34. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
  35. package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +2 -2
  36. package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
  37. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
  38. package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +4 -4
  39. package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
  40. package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +2 -2
  41. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
  42. package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +2 -2
  43. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
  44. package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +2 -2
  45. package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
  46. package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +2 -2
  47. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
  48. package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +35 -29
  49. package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
  50. package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +589 -0
  51. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
  52. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
  53. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  54. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +1 -1
  55. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  56. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  57. package/artifacts/contracts/instance/Instance.sol/Instance.json +3 -3
  58. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
  59. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +99 -86
  60. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
  61. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +2 -2
  62. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  63. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +117 -72
  64. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  65. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +2 -2
  66. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  67. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +2 -2
  68. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
  69. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +18 -18
  70. package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
  71. package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +2 -2
  72. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
  73. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
  74. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
  75. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
  76. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
  77. package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +1 -1
  78. package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +2 -2
  79. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  80. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  81. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  82. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  83. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  84. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
  85. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
  86. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +2 -2
  87. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
  88. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +2 -2
  89. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
  90. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
  91. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
  92. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
  93. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
  94. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +2 -2
  95. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
  96. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +2 -2
  97. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
  98. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
  99. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +2 -2
  100. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
  101. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +2 -2
  102. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  103. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +2 -2
  104. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
  105. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  106. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
  107. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
  108. package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
  109. package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +2 -2
  110. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
  111. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +2 -2
  112. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  113. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +2 -2
  114. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  115. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +2 -2
  116. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  117. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +2 -2
  118. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
  119. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
  120. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +2 -2
  121. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
  122. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +2 -2
  123. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  124. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +2 -2
  125. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  126. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
  127. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  128. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
  129. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  130. package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
  131. package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +10 -4
  132. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
  133. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +2 -2
  134. package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
  135. package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +2 -2
  136. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  137. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +2 -2
  138. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
  139. package/artifacts/contracts/product/PricingService.sol/PricingService.json +2 -2
  140. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
  141. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +2 -2
  142. package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
  143. package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
  144. package/artifacts/contracts/product/RiskService.sol/RiskService.json +50 -28
  145. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
  146. package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +21 -13
  147. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  148. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  149. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  150. package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +1 -1
  151. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  152. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  153. package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
  154. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
  155. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +2 -2
  156. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  157. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +2 -2
  158. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  159. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +2 -2
  160. package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
  161. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
  162. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
  163. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +2 -2
  164. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
  165. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +2 -2
  166. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  167. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
  168. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
  169. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
  170. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +2 -2
  171. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
  172. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +2 -2
  173. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
  174. package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
  175. package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
  176. package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
  177. package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +1 -1
  178. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
  179. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
  180. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
  181. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  182. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  183. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  184. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  185. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  186. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  187. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  188. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
  189. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
  190. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  191. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  192. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
  193. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  194. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  195. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  196. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  197. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  198. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  199. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
  200. package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
  201. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
  202. package/artifacts/contracts/staking/IStaking.sol/IStaking.json +3 -3
  203. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
  204. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +0 -42
  205. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
  206. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +32 -48
  207. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
  208. package/artifacts/contracts/staking/Staking.sol/Staking.json +31 -39
  209. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
  210. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
  211. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +15 -19
  212. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
  213. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
  214. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
  215. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +26 -76
  216. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
  217. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +14 -18
  218. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
  219. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2 -2
  220. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
  221. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +2 -2
  222. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  223. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
  224. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  225. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  226. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  227. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
  228. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
  229. package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +1 -1
  230. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
  231. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  232. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  233. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  234. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
  235. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
  236. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
  237. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +9 -4
  238. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
  239. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
  240. package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
  241. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
  242. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
  243. package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
  244. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
  245. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
  246. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
  247. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
  248. package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
  249. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  250. package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  251. package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
  252. package/contracts/distribution/BasicDistribution.sol +7 -5
  253. package/contracts/distribution/Distribution.sol +10 -8
  254. package/contracts/distribution/DistributionService.sol +18 -17
  255. package/contracts/distribution/IDistributionService.sol +14 -13
  256. package/contracts/examples/fire/FireProduct.sol +1 -2
  257. package/contracts/examples/unpermissioned/SimpleProduct.sol +4 -4
  258. package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
  259. package/contracts/instance/IInstance.sol +1 -1
  260. package/contracts/instance/Instance.sol +1 -1
  261. package/contracts/instance/InstanceAdmin.sol +9 -14
  262. package/contracts/instance/InstanceReader.sol +12 -0
  263. package/contracts/instance/module/IDistribution.sol +2 -1
  264. package/contracts/product/IRiskService.sol +5 -8
  265. package/contracts/product/PolicyService.sol +16 -41
  266. package/contracts/product/Product.sol +6 -15
  267. package/contracts/product/RiskService.sol +6 -7
  268. package/contracts/staking/IStaking.sol +1 -1
  269. package/contracts/staking/IStakingService.sol +1 -3
  270. package/contracts/staking/StakeManagerLib.sol +6 -62
  271. package/contracts/staking/Staking.sol +7 -11
  272. package/contracts/staking/StakingService.sol +2 -21
  273. package/contracts/type/RiskId.sol +4 -3
  274. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b6c3e721e77d8e820800264aa4641b8c.json"
3
+ "buildInfo": "../../../build-info/fe6349146d06341fb21f060b157460cc.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b6c3e721e77d8e820800264aa4641b8c.json"
3
+ "buildInfo": "../../../build-info/fe6349146d06341fb21f060b157460cc.json"
4
4
  }
@@ -144,9 +144,14 @@
144
144
  {
145
145
  "inputs": [
146
146
  {
147
- "internalType": "string",
147
+ "internalType": "NftId",
148
+ "name": "productNftId",
149
+ "type": "uint96"
150
+ },
151
+ {
152
+ "internalType": "bytes32",
148
153
  "name": "risk",
149
- "type": "string"
154
+ "type": "bytes32"
150
155
  }
151
156
  ],
152
157
  "name": "toRiskId",
@@ -174,8 +179,8 @@
174
179
  "type": "function"
175
180
  }
176
181
  ],
177
- "bytecode": "0x61048a610034600b8282823980515f1a607314602857634e487b7160e01b5f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061009b575f3560e01c806370a021ec1161006e57806370a021ec146101325780637bc32ecf146101555780638b0d9ff014610175578063b2e508a614610189578063bc1b392d1461019f575f80fd5b806301809eea1461009f5780632cf96bf9146100d05780634a7485ba146100fe57806355ee627514610111575b5f80fd5b6100b26100ad3660046102ab565b6101a5565b6040516001600160c01b031990911681526020015b60405180910390f35b6100eb6100de3660046102e3565b6001600160c01b03191690565b60405160ff1990911681526020016100c7565b6100b261010c366004610310565b6101cc565b61012461011f3660046102e3565b6101fb565b6040519081526020016100c7565b6101456101403660046103c3565b610292565b60405190151581526020016100c7565b6101456101633660046102e3565b5f6001600160c01b031982161561028c565b6101246101833660046102e3565b60c01c90565b6101456101973660046102e3565b60c01c151590565b5f6100b2565b80680100000000000000006101ba8260c01c90565b106101c7576101c76103f4565b919050565b5f816040516020016101de9190610408565b604051602081830303815290604052805190602001209050919050565b5f73__$4b9aaffa8d044614668dad578b824b8eee$__63f48016ce602c6001600160c01b031985166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af4158015610268573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061028c919061043d565b92915050565b5f6001600160c01b0319808416908316145b9392505050565b5f602082840312156102bb575f80fd5b813560ff19811681146102a4575f80fd5b80356001600160c01b0319811681146101c7575f80fd5b5f602082840312156102f3575f80fd5b6102a4826102cc565b634e487b7160e01b5f52604160045260245ffd5b5f60208284031215610320575f80fd5b813567ffffffffffffffff811115610336575f80fd5b8201601f81018413610346575f80fd5b803567ffffffffffffffff811115610360576103606102fc565b604051601f8201601f19908116603f0116810167ffffffffffffffff8111828210171561038f5761038f6102fc565b6040528181528282016020018610156103a6575f80fd5b816020840160208301375f91810160200191909152949350505050565b5f80604083850312156103d4575f80fd5b6103dd836102cc565b91506103eb602084016102cc565b90509250929050565b634e487b7160e01b5f52600160045260245ffd5b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b5f6020828403121561044d575f80fd5b505191905056fea264697066735822122016c3a32f1eedf661caad27d57c5fd00e7e042a4d2c576c00dde60814aa418e3a64736f6c634300081a0033",
178
- "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361061009b575f3560e01c806370a021ec1161006e57806370a021ec146101325780637bc32ecf146101555780638b0d9ff014610175578063b2e508a614610189578063bc1b392d1461019f575f80fd5b806301809eea1461009f5780632cf96bf9146100d05780634a7485ba146100fe57806355ee627514610111575b5f80fd5b6100b26100ad3660046102ab565b6101a5565b6040516001600160c01b031990911681526020015b60405180910390f35b6100eb6100de3660046102e3565b6001600160c01b03191690565b60405160ff1990911681526020016100c7565b6100b261010c366004610310565b6101cc565b61012461011f3660046102e3565b6101fb565b6040519081526020016100c7565b6101456101403660046103c3565b610292565b60405190151581526020016100c7565b6101456101633660046102e3565b5f6001600160c01b031982161561028c565b6101246101833660046102e3565b60c01c90565b6101456101973660046102e3565b60c01c151590565b5f6100b2565b80680100000000000000006101ba8260c01c90565b106101c7576101c76103f4565b919050565b5f816040516020016101de9190610408565b604051602081830303815290604052805190602001209050919050565b5f73__$4b9aaffa8d044614668dad578b824b8eee$__63f48016ce602c6001600160c01b031985166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af4158015610268573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061028c919061043d565b92915050565b5f6001600160c01b0319808416908316145b9392505050565b5f602082840312156102bb575f80fd5b813560ff19811681146102a4575f80fd5b80356001600160c01b0319811681146101c7575f80fd5b5f602082840312156102f3575f80fd5b6102a4826102cc565b634e487b7160e01b5f52604160045260245ffd5b5f60208284031215610320575f80fd5b813567ffffffffffffffff811115610336575f80fd5b8201601f81018413610346575f80fd5b803567ffffffffffffffff811115610360576103606102fc565b604051601f8201601f19908116603f0116810167ffffffffffffffff8111828210171561038f5761038f6102fc565b6040528181528282016020018610156103a6575f80fd5b816020840160208301375f91810160200191909152949350505050565b5f80604083850312156103d4575f80fd5b6103dd836102cc565b91506103eb602084016102cc565b90509250929050565b634e487b7160e01b5f52600160045260245ffd5b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b5f6020828403121561044d575f80fd5b505191905056fea264697066735822122016c3a32f1eedf661caad27d57c5fd00e7e042a4d2c576c00dde60814aa418e3a64736f6c634300081a0033",
182
+ "bytecode": "0x6103da610034600b8282823980515f1a607314602857634e487b7160e01b5f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061009b575f3560e01c80637bc32ecf1161006e5780637bc32ecf146101425780638a3065c1146101555780638b0d9ff0146101a4578063b2e508a6146101b8578063bc1b392d146101ce575f80fd5b806301809eea1461009f5780632cf96bf9146100d057806355ee6275146100fe57806370a021ec1461011f575b5f80fd5b6100b26100ad3660046102bd565b6101d4565b6040516001600160c01b031990911681526020015b60405180910390f35b6100eb6100de3660046102f5565b6001600160c01b03191690565b60405160ff1990911681526020016100c7565b61011161010c3660046102f5565b6101fb565b6040519081526020016100c7565b61013261012d36600461030e565b610292565b60405190151581526020016100c7565b6101326101503660046102f5565b6102ab565b6100b261016336600461033f565b604080516bffffffffffffffffffffffff841660208201529081018290525f9060600160405160208183030381529060405280519060200120905092915050565b6101116101b23660046102f5565b60c01c90565b6101326101c63660046102f5565b60c01c151590565b5f6100b2565b80680100000000000000006101e98260c01c90565b106101f6576101f6610379565b919050565b5f73__$4b9aaffa8d044614668dad578b824b8eee$__63f48016ce602c6001600160c01b031985166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af4158015610268573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061028c919061038d565b92915050565b5f6001600160c01b0319808416908316145b9392505050565b5f6001600160c01b031982161561028c565b5f602082840312156102cd575f80fd5b813560ff19811681146102a4575f80fd5b80356001600160c01b0319811681146101f6575f80fd5b5f60208284031215610305575f80fd5b6102a4826102de565b5f806040838503121561031f575f80fd5b610328836102de565b9150610336602084016102de565b90509250929050565b5f8060408385031215610350575f80fd5b82356bffffffffffffffffffffffff8116811461036b575f80fd5b946020939093013593505050565b634e487b7160e01b5f52600160045260245ffd5b5f6020828403121561039d575f80fd5b505191905056fea2646970667358221220675dcb6c26090d8eed37201a05cb7130d14f0592ea21ac450da0c215cc4dba6364736f6c634300081a0033",
183
+ "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040526004361061009b575f3560e01c80637bc32ecf1161006e5780637bc32ecf146101425780638a3065c1146101555780638b0d9ff0146101a4578063b2e508a6146101b8578063bc1b392d146101ce575f80fd5b806301809eea1461009f5780632cf96bf9146100d057806355ee6275146100fe57806370a021ec1461011f575b5f80fd5b6100b26100ad3660046102bd565b6101d4565b6040516001600160c01b031990911681526020015b60405180910390f35b6100eb6100de3660046102f5565b6001600160c01b03191690565b60405160ff1990911681526020016100c7565b61011161010c3660046102f5565b6101fb565b6040519081526020016100c7565b61013261012d36600461030e565b610292565b60405190151581526020016100c7565b6101326101503660046102f5565b6102ab565b6100b261016336600461033f565b604080516bffffffffffffffffffffffff841660208201529081018290525f9060600160405160208183030381529060405280519060200120905092915050565b6101116101b23660046102f5565b60c01c90565b6101326101c63660046102f5565b60c01c151590565b5f6100b2565b80680100000000000000006101e98260c01c90565b106101f6576101f6610379565b919050565b5f73__$4b9aaffa8d044614668dad578b824b8eee$__63f48016ce602c6001600160c01b031985166040516001600160e01b031960e085901b16815260ff909216600483015260ff19166024820152604401602060405180830381865af4158015610268573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061028c919061038d565b92915050565b5f6001600160c01b0319808416908316145b9392505050565b5f6001600160c01b031982161561028c565b5f602082840312156102cd575f80fd5b813560ff19811681146102a4575f80fd5b80356001600160c01b0319811681146101f6575f80fd5b5f60208284031215610305575f80fd5b6102a4826102de565b5f806040838503121561031f575f80fd5b610328836102de565b9150610336602084016102de565b90509250929050565b5f8060408385031215610350575f80fd5b82356bffffffffffffffffffffffff8116811461036b575f80fd5b946020939093013593505050565b634e487b7160e01b5f52600160045260245ffd5b5f6020828403121561039d575f80fd5b505191905056fea2646970667358221220675dcb6c26090d8eed37201a05cb7130d14f0592ea21ac450da0c215cc4dba6364736f6c634300081a0033",
179
184
  "linkReferences": {
180
185
  "contracts/type/Key32.sol": {
181
186
  "Key32Lib": [
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b6c3e721e77d8e820800264aa4641b8c.json"
3
+ "buildInfo": "../../../build-info/fe6349146d06341fb21f060b157460cc.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b6c3e721e77d8e820800264aa4641b8c.json"
3
+ "buildInfo": "../../../build-info/fe6349146d06341fb21f060b157460cc.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b6c3e721e77d8e820800264aa4641b8c.json"
3
+ "buildInfo": "../../../build-info/fe6349146d06341fb21f060b157460cc.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b6c3e721e77d8e820800264aa4641b8c.json"
3
+ "buildInfo": "../../../build-info/fe6349146d06341fb21f060b157460cc.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b6c3e721e77d8e820800264aa4641b8c.json"
3
+ "buildInfo": "../../../build-info/fe6349146d06341fb21f060b157460cc.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b6c3e721e77d8e820800264aa4641b8c.json"
3
+ "buildInfo": "../../../build-info/fe6349146d06341fb21f060b157460cc.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b6c3e721e77d8e820800264aa4641b8c.json"
3
+ "buildInfo": "../../../build-info/fe6349146d06341fb21f060b157460cc.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b6c3e721e77d8e820800264aa4641b8c.json"
3
+ "buildInfo": "../../../build-info/fe6349146d06341fb21f060b157460cc.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b6c3e721e77d8e820800264aa4641b8c.json"
3
+ "buildInfo": "../../../build-info/fe6349146d06341fb21f060b157460cc.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b6c3e721e77d8e820800264aa4641b8c.json"
3
+ "buildInfo": "../../../build-info/fe6349146d06341fb21f060b157460cc.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b6c3e721e77d8e820800264aa4641b8c.json"
3
+ "buildInfo": "../../../build-info/fe6349146d06341fb21f060b157460cc.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b6c3e721e77d8e820800264aa4641b8c.json"
3
+ "buildInfo": "../../../build-info/fe6349146d06341fb21f060b157460cc.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b6c3e721e77d8e820800264aa4641b8c.json"
3
+ "buildInfo": "../../../build-info/fe6349146d06341fb21f060b157460cc.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/b6c3e721e77d8e820800264aa4641b8c.json"
3
+ "buildInfo": "../../../build-info/fe6349146d06341fb21f060b157460cc.json"
4
4
  }
@@ -1,15 +1,17 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
+ import {IAuthorization} from "../authorization/IAuthorization.sol";
5
+
4
6
  import {Distribution} from "./Distribution.sol";
7
+ import {DistributorType} from "../type/DistributorType.sol";
5
8
  import {DISTRIBUTOR} from "../type/ObjectType.sol";
6
- import {IAuthorization} from "../authorization/IAuthorization.sol";
9
+ import {Fee} from "../type/Fee.sol";
7
10
  import {NftId} from "../type/NftId.sol";
8
11
  import {ReferralId} from "../type/Referral.sol";
9
- import {Fee} from "../type/Fee.sol";
10
- import {UFixed} from "../type/UFixed.sol";
11
- import {DistributorType} from "../type/DistributorType.sol";
12
+ import {Seconds} from "../type/Seconds.sol";
12
13
  import {Timestamp} from "../type/Timestamp.sol";
14
+ import {UFixed} from "../type/UFixed.sol";
13
15
 
14
16
 
15
17
  contract BasicDistribution is
@@ -37,7 +39,7 @@ contract BasicDistribution is
37
39
  UFixed maxDiscountPercentage,
38
40
  UFixed commissionPercentage,
39
41
  uint32 maxReferralCount,
40
- uint32 maxReferralLifetime,
42
+ Seconds maxReferralLifetime,
41
43
  bool allowSelfReferrals,
42
44
  bool allowRenewals,
43
45
  bytes memory data
@@ -1,19 +1,21 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
- import {Amount} from "../type/Amount.sol";
5
- import {COMPONENT, DISTRIBUTION, DISTRIBUTOR} from "../type/ObjectType.sol";
6
4
  import {IAuthorization} from "../authorization/IAuthorization.sol";
5
+ import {IComponentService} from "../shared/IComponentService.sol";
6
+ import {IDistributionComponent} from "./IDistributionComponent.sol";
7
7
  import {IDistributionService} from "./IDistributionService.sol";
8
+
9
+ import {Amount} from "../type/Amount.sol";
10
+ import {COMPONENT, DISTRIBUTION, DISTRIBUTOR} from "../type/ObjectType.sol";
11
+ import {DistributorType} from "../type/DistributorType.sol";
12
+ import {Fee} from "../type/Fee.sol";
8
13
  import {NftId, NftIdLib} from "../type/NftId.sol";
9
14
  import {ReferralId, ReferralStatus, ReferralLib} from "../type/Referral.sol";
10
- import {Fee} from "../type/Fee.sol";
11
15
  import {InstanceLinkedComponent} from "../shared/InstanceLinkedComponent.sol";
12
- import {IComponentService} from "../shared/IComponentService.sol";
13
- import {IDistributionComponent} from "./IDistributionComponent.sol";
14
- import {UFixed} from "../type/UFixed.sol";
15
- import {DistributorType} from "../type/DistributorType.sol";
16
+ import {Seconds} from "../type/Seconds.sol";
16
17
  import {Timestamp} from "../type/Timestamp.sol";
18
+ import {UFixed} from "../type/UFixed.sol";
17
19
 
18
20
 
19
21
  abstract contract Distribution is
@@ -180,7 +182,7 @@ abstract contract Distribution is
180
182
  UFixed maxDiscountPercentage,
181
183
  UFixed commissionPercentage,
182
184
  uint32 maxReferralCount,
183
- uint32 maxReferralLifetime,
185
+ Seconds maxReferralLifetime,
184
186
  bool allowSelfReferrals,
185
187
  bool allowRenewals,
186
188
  bytes memory data
@@ -2,27 +2,28 @@
2
2
  pragma solidity ^0.8.20;
3
3
 
4
4
  import {IAccountingService} from "../accounting/IAccountingService.sol";
5
- import {IRegistry} from "../registry/IRegistry.sol";
6
- import {IInstance} from "../instance/IInstance.sol";
7
5
  import {IComponentService} from "../shared/IComponentService.sol";
6
+ import {IDistribution} from "../instance/module/IDistribution.sol";
7
+ import {IDistributionService} from "./IDistributionService.sol";
8
+ import {IInstance} from "../instance/IInstance.sol";
8
9
  import {IInstanceService} from "../instance/IInstanceService.sol";
10
+ import {IRegistry} from "../registry/IRegistry.sol";
9
11
  import {IRegistryService} from "../registry/IRegistryService.sol";
10
- import {InstanceReader} from "../instance/InstanceReader.sol";
11
12
  import {IComponents} from "../instance/module/IComponents.sol";
12
13
  import {IPolicy} from "../instance/module/IPolicy.sol";
13
14
 
14
15
  import {Amount, AmountLib} from "../type/Amount.sol";
16
+ import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
17
+ import {DistributorType, DistributorTypeLib} from "../type/DistributorType.sol";
15
18
  import {NftId, NftIdLib} from "../type/NftId.sol";
16
19
  import {KEEP_STATE} from "../type/StateId.sol";
17
20
  import {ObjectType, ACCOUNTING, COMPONENT, DISTRIBUTION, INSTANCE, DISTRIBUTION, DISTRIBUTOR, REGISTRY} from "../type/ObjectType.sol";
18
- import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
19
- import {IDistributionService} from "./IDistributionService.sol";
20
- import {UFixed} from "../type/UFixed.sol";
21
- import {DistributorType, DistributorTypeLib} from "../type/DistributorType.sol";
21
+ import {InstanceReader} from "../instance/InstanceReader.sol";
22
+ import {InstanceStore} from "../instance/InstanceStore.sol";
22
23
  import {ReferralId, ReferralLib} from "../type/Referral.sol";
24
+ import {Seconds} from "../type/Seconds.sol";
23
25
  import {Timestamp, TimestampLib} from "../type/Timestamp.sol";
24
- import {IDistribution} from "../instance/module/IDistribution.sol";
25
- import {InstanceStore} from "../instance/InstanceStore.sol";
26
+ import {UFixed} from "../type/UFixed.sol";
26
27
 
27
28
 
28
29
  contract DistributionService is
@@ -64,7 +65,7 @@ contract DistributionService is
64
65
  UFixed maxDiscountPercentage,
65
66
  UFixed commissionPercentage,
66
67
  uint32 maxReferralCount,
67
- uint32 maxReferralLifetime,
68
+ Seconds maxReferralLifetime,
68
69
  bool allowSelfReferrals,
69
70
  bool allowRenewals,
70
71
  bytes memory data
@@ -171,10 +172,10 @@ contract DistributionService is
171
172
  (NftId distributionNftId,, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
172
173
 
173
174
  if (bytes(code).length == 0) {
174
- revert ErrorIDistributionServiceInvalidReferral(code);
175
+ revert ErrorDistributionServiceInvalidReferral(code);
175
176
  }
176
177
  if (expiryAt.eqz() || expiryAt.lte(TimestampLib.blockTimestamp())) {
177
- revert ErrorIDistributionServiceExpirationInvalid(expiryAt);
178
+ revert ErrorDistributionServiceExpirationInvalid(expiryAt);
178
179
  }
179
180
 
180
181
  {
@@ -183,16 +184,16 @@ contract DistributionService is
183
184
  IDistribution.DistributorTypeInfo memory distributorTypeData = instanceReader.getDistributorTypeInfo(distributorType);
184
185
 
185
186
  if (distributorTypeData.maxReferralCount < maxReferrals) {
186
- revert ErrorIDistributionServiceMaxReferralsExceeded(distributorTypeData.maxReferralCount);
187
+ revert ErrorDistributionServiceMaxReferralsExceeded(distributorTypeData.maxReferralCount);
187
188
  }
188
189
  if (distributorTypeData.minDiscountPercentage > discountPercentage) {
189
- revert ErrorIDistributionServiceDiscountTooLow(distributorTypeData.minDiscountPercentage.toInt(), discountPercentage.toInt());
190
+ revert ErrorDistributionServiceDiscountTooLow(distributorTypeData.minDiscountPercentage.toInt(), discountPercentage.toInt());
190
191
  }
191
192
  if (distributorTypeData.maxDiscountPercentage < discountPercentage) {
192
- revert ErrorIDistributionServiceDiscountTooHigh(distributorTypeData.maxDiscountPercentage.toInt(), discountPercentage.toInt());
193
+ revert ErrorDistributionServiceDiscountTooHigh(distributorTypeData.maxDiscountPercentage.toInt(), discountPercentage.toInt());
193
194
  }
194
- if (expiryAt.toInt() - TimestampLib.blockTimestamp().toInt() > distributorTypeData.maxReferralLifetime) {
195
- revert ErrorIDistributionServiceExpiryTooLong(distributorTypeData.maxReferralLifetime, expiryAt.toInt());
195
+ if (expiryAt.toInt() - TimestampLib.blockTimestamp().toInt() > distributorTypeData.maxReferralLifetime.toInt()) {
196
+ revert ErrorDistributionServiceExpiryTooLong(distributorTypeData.maxReferralLifetime, expiryAt);
196
197
  }
197
198
  }
198
199
 
@@ -8,30 +8,31 @@ import {IService} from "../shared/IService.sol";
8
8
  import {UFixed} from "../type/UFixed.sol";
9
9
  import {DistributorType} from "../type/DistributorType.sol";
10
10
  import {ReferralId} from "../type/Referral.sol";
11
+ import {Seconds} from "../type/Seconds.sol";
11
12
  import {Timestamp} from "../type/Timestamp.sol";
12
13
 
13
14
 
14
15
  interface IDistributionService is IService {
15
16
 
16
17
  error ErrorDistributionServiceCallerNotRegistered(address caller);
17
- error ErrorIDistributionServiceParentNftIdNotInstance(NftId nftId, NftId parentNftId);
18
- error ErrorIDistributionServiceCallerNotDistributor(address caller);
19
- error ErrorIDistributionServiceInvalidReferralId(ReferralId referralId);
20
- error ErrorIDistributionServiceMaxReferralsExceeded(uint256 maxReferrals);
21
- error ErrorIDistributionServiceDiscountTooLow(uint256 minDiscountPercentage, uint256 discountPercentage);
22
- error ErrorIDistributionServiceDiscountTooHigh(uint256 maxDiscountPercentage, uint256 discountPercentage);
23
- error ErrorIDistributionServiceExpiryTooLong(uint256 maxReferralLifetime, uint256 expiryAt);
24
- error ErrorIDistributionServiceInvalidReferral(string code);
25
- error ErrorIDistributionServiceExpirationInvalid(Timestamp expiryAt);
26
- error ErrorIDistributionServiceCommissionTooHigh(uint256 commissionPercentage, uint256 maxCommissionPercentage);
27
- error ErrorIDistributionServiceMinFeeTooHigh(uint256 minFee, uint256 limit);
18
+ error ErrorDistributionServiceParentNftIdNotInstance(NftId nftId, NftId parentNftId);
19
+ error ErrorDistributionServiceCallerNotDistributor(address caller);
20
+ error ErrorDistributionServiceInvalidReferralId(ReferralId referralId);
21
+ error ErrorDistributionServiceMaxReferralsExceeded(uint256 maxReferrals);
22
+ error ErrorDistributionServiceDiscountTooLow(uint256 minDiscountPercentage, uint256 discountPercentage);
23
+ error ErrorDistributionServiceDiscountTooHigh(uint256 maxDiscountPercentage, uint256 discountPercentage);
24
+ error ErrorDistributionServiceExpiryTooLong(Seconds maxReferralLifetime, Timestamp expiryAt);
25
+ error ErrorDistributionServiceInvalidReferral(string code);
26
+ error ErrorDistributionServiceExpirationInvalid(Timestamp expiryAt);
27
+ error ErrorDistributionServiceCommissionTooHigh(uint256 commissionPercentage, uint256 maxCommissionPercentage);
28
+ error ErrorDistributionServiceMinFeeTooHigh(uint256 minFee, uint256 limit);
28
29
 
29
30
  error ErrorDistributionServiceCommissionWithdrawAmountExceedsLimit(Amount amount, Amount limit);
30
31
 
31
32
  error ErrorDistributionServiceVariableFeesTooHight(uint256 maxDiscountPercentage, uint256 limit);
32
33
  error ErrorDistributionServiceMaxDiscountTooHigh(uint256 maxDiscountPercentage, uint256 limit);
33
34
 
34
- error ErrorIDistributionServiceReferralInvalid(NftId distributionNftId, ReferralId referralId);
35
+ error ErrorDistributionServiceReferralInvalid(NftId distributionNftId, ReferralId referralId);
35
36
  error ErrorDistributionServiceInvalidFeeTransferred(Amount transferredDistributionFeeAmount, Amount expectedDistributionFeeAmount);
36
37
 
37
38
  event LogDistributionServiceCommissionWithdrawn(NftId distributorNftId, address recipient, address tokenAddress, Amount amount);
@@ -42,7 +43,7 @@ interface IDistributionService is IService {
42
43
  UFixed maxDiscountPercentage,
43
44
  UFixed commissionPercentage,
44
45
  uint32 maxReferralCount,
45
- uint32 maxReferralLifetime,
46
+ Seconds maxReferralLifetime,
46
47
  bool allowSelfReferrals,
47
48
  bool allowRenewals,
48
49
  bytes memory data
@@ -252,8 +252,7 @@ contract FireProduct is
252
252
  return _riskMapping[cityName];
253
253
  }
254
254
  _cities.push(cityName);
255
- risk = RiskIdLib.toRiskId(cityName);
256
- _createRisk(risk, "");
255
+ risk = _createRisk(bytes32(abi.encodePacked(cityName)), "");
257
256
  _riskMapping[cityName] = risk;
258
257
  }
259
258
 
@@ -85,11 +85,11 @@ contract SimpleProduct is
85
85
 
86
86
 
87
87
  function createRisk(
88
- RiskId id,
88
+ string memory id,
89
89
  bytes memory data
90
- ) public {
91
- _createRisk(
92
- id,
90
+ ) public returns (RiskId) {
91
+ return _createRisk(
92
+ bytes32(abi.encodePacked(id)),
93
93
  data
94
94
  );
95
95
  }
@@ -0,0 +1,28 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.20;
3
+
4
+ import {BasicProductAuthorization} from "../../product/BasicProductAuthorization.sol";
5
+ import {IAccess} from "../../authorization/IAccess.sol";
6
+ import {PUBLIC_ROLE} from "../../type/RoleId.sol";
7
+ import {SimpleProduct} from "./SimpleProduct.sol";
8
+
9
+ contract SimpleProductAuthorization
10
+ is BasicProductAuthorization
11
+ {
12
+ constructor(string memory componentName)
13
+ BasicProductAuthorization(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(getMainTargetName(), PUBLIC_ROLE());
25
+ _authorize(functions, SimpleProduct.approveTokenHandler.selector, "approveTokenHandler");
26
+ _authorize(functions, SimpleProduct.setWallet.selector, "setWallet");
27
+ }
28
+ }
@@ -59,7 +59,7 @@ interface IInstance is
59
59
 
60
60
  // get products
61
61
  function products() external view returns (uint256 productCount);
62
- function getProductNftid(uint256 idx) external view returns (NftId productNftId);
62
+ function getProductNftId(uint256 idx) external view returns (NftId productNftId);
63
63
 
64
64
  // get supporting contracts
65
65
  function getInstanceReader() external view returns (InstanceReader);
@@ -219,7 +219,7 @@ contract Instance is
219
219
  return _products.length;
220
220
  }
221
221
 
222
- function getProductNftid(uint256 idx) external view returns (NftId productNftId) {
222
+ function getProductNftId(uint256 idx) external view returns (NftId productNftId) {
223
223
  return _products[idx];
224
224
  }
225
225
 
@@ -137,19 +137,7 @@ contract InstanceAdmin is
137
137
 
138
138
  // create other roles
139
139
  IAuthorization authorization = component.getAuthorization();
140
- _createRoles(authorization);
141
-
142
- // TODO cleanup
143
- // FunctionInfo[] memory functions = new FunctionInfo[](2);
144
- // functions[0] = toFunction(TokenHandler.pullToken.selector, "pullToken");
145
- // functions[1] = toFunction(TokenHandler.pushToken.selector, "pushToken");
146
-
147
- // // FIXME: make this a bit nicer and work with IAuthorization. Use a specific role, not public - access to TokenHandler must be restricted
148
- // _authorizeTargetFunctions(
149
- // address(component.getTokenHandler()),
150
- // getPublicRole(),
151
- // functions);
152
-
140
+ _createRoles(authorization);
153
141
  _createTargetAuthorizations(authorization);
154
142
  }
155
143
 
@@ -215,7 +203,14 @@ contract InstanceAdmin is
215
203
  _setTargetClosed(target, locked);
216
204
  }
217
205
 
218
-
206
+ /// @dev Returns the number of components that have been registered with this instance.
207
+ function components()
208
+ external
209
+ view
210
+ returns (uint64)
211
+ {
212
+ return _components;
213
+ }
219
214
 
220
215
  /// @dev Returns the instance authorization specification used to set up this instance admin.
221
216
  function getInstanceAuthorization()
@@ -88,6 +88,18 @@ contract InstanceReader {
88
88
  return _instance;
89
89
  }
90
90
 
91
+ function components() public view returns (uint256 componentCount) {
92
+ return _instance.getInstanceAdmin().components();
93
+ }
94
+
95
+ function products() public view returns (uint256 productCount) {
96
+ return _instance.products();
97
+ }
98
+
99
+ function getProductNftId(uint256 idx) public view returns (NftId productNftId) {
100
+ return _instance.getProductNftId(idx);
101
+ }
102
+
91
103
  // module specific functions
92
104
 
93
105
  function getPolicyInfo(NftId policyNftId)
@@ -4,6 +4,7 @@ pragma solidity ^0.8.20;
4
4
  import {Amount} from "../../type/Amount.sol";
5
5
  import {DistributorType} from "../../type/DistributorType.sol";
6
6
  import {NftId} from "../../type/NftId.sol";
7
+ import {Seconds} from "../../type/Seconds.sol";
7
8
  import {Timestamp} from "../../type/Timestamp.sol";
8
9
  import {UFixed} from "../../type/UFixed.sol";
9
10
 
@@ -15,7 +16,7 @@ interface IDistribution {
15
16
  UFixed maxDiscountPercentage;
16
17
  UFixed commissionPercentage;
17
18
  uint32 maxReferralCount;
18
- uint32 maxReferralLifetime;
19
+ Seconds maxReferralLifetime;
19
20
  bool allowSelfReferrals;
20
21
  bool allowRenewals;
21
22
  bytes data;
@@ -1,23 +1,20 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
- import {IRisk} from "../instance/module/IRisk.sol";
5
4
  import {IService} from "../shared/IService.sol";
6
5
 
7
- import {NftId} from "../type/NftId.sol";
8
- import {ReferralId} from "../type/Referral.sol";
9
6
  import {RiskId} from "../type/RiskId.sol";
10
7
  import {StateId} from "../type/StateId.sol";
11
- import {Timestamp} from "../type/Timestamp.sol";
12
- import {UFixed} from "../type/UFixed.sol";
13
- import {Fee} from "../type/Fee.sol";
14
8
 
15
9
  interface IRiskService is IService {
16
10
 
11
+ /// @dev Create a new risk with the given id and provided data.
12
+ /// The key of the risk derived from the risk id in comination with the product NftId.
13
+ /// Risk data is stored in the instance store.
17
14
  function createRisk(
18
- RiskId riskId,
15
+ bytes32 id,
19
16
  bytes memory data
20
- ) external;
17
+ ) external returns (RiskId riskId);
21
18
 
22
19
 
23
20
  function updateRisk(
@@ -545,30 +545,21 @@ contract PolicyService is
545
545
  }
546
546
  }
547
547
 
548
- // TODO cleanup
549
- /// @dev checks the balance and allowance of the policy holder
550
- // function _checkPremiumBalanceAndAllowance(
551
- // IERC20Metadata token,
552
- // address tokenHandlerAddress,
553
- // address policyHolder,
554
- // Amount premiumAmount
555
- // )
556
- // internal
557
- // virtual
558
- // view
559
- // {
560
- // uint256 premium = premiumAmount.toInt();
561
- // uint256 balance = token.balanceOf(policyHolder);
562
- // uint256 allowance = token.allowance(policyHolder, tokenHandlerAddress);
563
-
564
- // if (balance < premium) {
565
- // revert ErrorPolicyServiceBalanceInsufficient(policyHolder, premium, balance);
566
- // }
567
-
568
- // if (allowance < premium) {
569
- // revert ErrorPolicyServiceAllowanceInsufficient(policyHolder, tokenHandlerAddress, premium, allowance);
570
- // }
571
- // }
548
+
549
+ /// @dev checks that policy has been collateralized and has been activated.
550
+ /// does not check if policy has been expired or closed.
551
+ function _policyHasBeenActivated(
552
+ StateId policyState,
553
+ IPolicy.PolicyInfo memory policyInfo
554
+ )
555
+ internal
556
+ view
557
+ returns (bool)
558
+ {
559
+ if (policyState != COLLATERALIZED()) { return false; }
560
+ if (TimestampLib.blockTimestamp() < policyInfo.activatedAt) { return false; }
561
+ return true;
562
+ }
572
563
 
573
564
 
574
565
  function _policyHolderPolicyActivated(
@@ -629,22 +620,6 @@ contract PolicyService is
629
620
  }
630
621
 
631
622
 
632
- // TODO cleanup
633
- // function _getTokenHandler(
634
- // InstanceReader instanceReader,
635
- // NftId productNftId
636
- // )
637
- // internal
638
- // virtual
639
- // view
640
- // returns (
641
- // TokenHandler tokenHandler
642
- // )
643
- // {
644
- // tokenHandler = instanceReader.getTokenHandler(productNftId).tokenHandler;
645
- // }
646
-
647
-
648
623
  function _getDistributionNftAndWallets(
649
624
  InstanceReader instanceReader,
650
625
  NftId productNftId
@@ -688,7 +663,7 @@ contract PolicyService is
688
663
  PRODUCT(), // caller must be product
689
664
  true); // only active caller
690
665
 
691
- productNftId = productInfo.nftId;
666
+ productNftId = productInfo.nftId; // calling product nft id
692
667
  instance = IInstance(instanceAddress);
693
668
  policyInfo = instance.getInstanceReader().getPolicyInfo(policyNftId);
694
669