@etherisc/gif-next 0.0.2-7afe9ac-654 → 0.0.2-7b09b39-121

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 (288) hide show
  1. package/README.md +16 -2
  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/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
  5. package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
  6. package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +2 -2
  7. package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
  8. package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
  9. package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
  10. package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +1 -1
  11. package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
  12. package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +1 -1
  13. package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +2 -2
  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 +30 -60
  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 +0 -38
  22. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
  23. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +93 -96
  24. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
  25. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +45 -49
  26. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
  27. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
  28. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
  29. package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
  30. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  31. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
  32. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  33. package/artifacts/contracts/instance/Instance.sol/Instance.json +2 -2
  34. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
  35. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +2 -2
  36. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
  37. package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +2 -2
  38. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
  39. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +80 -122
  40. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
  41. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +2 -2
  42. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
  43. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +2 -2
  44. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
  45. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +72 -194
  46. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
  47. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
  48. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
  49. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
  50. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
  51. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
  52. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
  53. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
  54. package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
  55. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
  56. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
  57. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
  58. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
  59. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
  60. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
  61. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
  62. package/artifacts/contracts/mock/Dip.sol/Dip.json +2 -2
  63. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
  64. package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +18 -48
  65. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
  66. package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +2 -2
  67. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
  68. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
  69. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
  70. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
  71. package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +0 -38
  72. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
  73. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +2 -2
  74. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
  75. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +2 -2
  76. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
  77. package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +11 -99
  78. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
  79. package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +16 -16
  80. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
  81. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +288 -67
  82. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
  83. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +78 -34
  84. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
  85. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +134 -1
  86. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
  87. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +1 -57
  88. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
  89. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +189 -54
  90. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
  91. package/artifacts/contracts/pool/Pool.sol/Pool.json +1 -95
  92. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
  93. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +337 -90
  94. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
  95. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +75 -19
  96. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
  97. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +21 -32
  98. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
  99. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +9 -17
  100. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
  101. package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +0 -38
  102. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
  103. package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +2 -2
  104. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
  105. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +82 -58
  106. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
  107. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +34 -30
  108. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
  109. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +5 -0
  110. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
  111. package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +16 -0
  112. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
  113. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +184 -88
  114. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
  115. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
  116. package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +1 -1
  117. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
  118. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +291 -139
  119. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
  120. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +54 -26
  121. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
  122. package/artifacts/contracts/product/PricingService.sol/PricingService.json +7 -2
  123. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
  124. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +2 -2
  125. package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
  126. package/artifacts/contracts/product/Product.sol/Product.json +0 -38
  127. package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +1 -1
  128. package/artifacts/contracts/product/ProductService.sol/ProductService.json +2 -2
  129. package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
  130. package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +2 -2
  131. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  132. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  133. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
  134. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
  135. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  136. package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
  137. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
  138. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +2 -2
  139. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
  140. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +2 -2
  141. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
  142. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +2 -2
  143. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
  144. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
  145. package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +2 -2
  146. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
  147. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +2 -2
  148. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
  149. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
  150. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
  151. package/artifacts/contracts/shared/Component.sol/Component.json +0 -38
  152. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
  153. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +148 -76
  154. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
  155. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +47 -39
  156. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
  157. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
  158. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
  159. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +56 -0
  160. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
  161. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
  162. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
  163. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
  164. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
  165. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  166. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
  167. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
  168. package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +1 -1
  169. package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +4 -0
  170. package/artifacts/contracts/shared/{ERC165.sol/ERC165.json → InitializableERC165.sol/InitializableERC165.json} +4 -4
  171. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
  172. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +0 -38
  173. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
  174. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
  175. package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
  176. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
  177. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
  178. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
  179. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
  180. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  181. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +2 -2
  182. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
  183. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
  184. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
  185. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
  186. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +53 -6
  187. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
  188. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
  189. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
  190. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +12 -2
  191. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
  192. package/artifacts/contracts/staking/Staking.sol/Staking.json +56 -70
  193. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
  194. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
  195. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +29 -17
  196. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
  197. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
  198. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
  199. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +22 -22
  200. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
  201. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +12 -12
  202. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
  203. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +17 -12
  204. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
  205. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +7 -2
  206. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
  207. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
  208. package/artifacts/contracts/type/Amount.sol/AmountLib.json +13 -8
  209. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
  210. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +2 -2
  211. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
  212. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
  213. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
  214. package/artifacts/contracts/type/Fee.sol/FeeLib.json +7 -2
  215. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
  216. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
  217. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
  218. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
  219. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
  220. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
  221. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
  222. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
  223. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
  224. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
  225. package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +26 -2
  226. package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
  227. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
  228. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
  229. package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
  230. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
  231. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +23 -4
  232. package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
  233. package/artifacts/contracts/type/UFixed.sol/MathLib.json +9 -3
  234. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
  235. package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +39 -2
  236. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
  237. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
  238. package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
  239. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
  240. package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +2 -2
  241. package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
  242. package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
  243. package/contracts/distribution/BasicDistribution.sol +4 -15
  244. package/contracts/distribution/Distribution.sol +3 -9
  245. package/contracts/distribution/DistributionService.sol +11 -13
  246. package/contracts/instance/InstanceReader.sol +10 -7
  247. package/contracts/instance/InstanceStore.sol +2 -1
  248. package/contracts/instance/base/ObjectLifecycle.sol +2 -3
  249. package/contracts/instance/module/IBundle.sol +1 -1
  250. package/contracts/instance/module/IComponents.sol +1 -6
  251. package/contracts/instance/module/IDistribution.sol +0 -1
  252. package/contracts/instance/module/IPolicy.sol +1 -1
  253. package/contracts/mock/Dip.sol +1 -1
  254. package/contracts/oracle/Oracle.sol +2 -6
  255. package/contracts/pool/BasicPool.sol +7 -5
  256. package/contracts/pool/BasicPoolAuthorization.sol +5 -2
  257. package/contracts/pool/BundleService.sol +126 -16
  258. package/contracts/pool/IBundleService.sol +21 -6
  259. package/contracts/pool/IPoolService.sol +15 -16
  260. package/contracts/pool/Pool.sol +14 -14
  261. package/contracts/pool/PoolService.sol +174 -48
  262. package/contracts/product/ApplicationService.sol +35 -15
  263. package/contracts/product/BasicProduct.sol +3 -33
  264. package/contracts/product/ClaimService.sol +16 -8
  265. package/contracts/product/IApplicationService.sol +1 -0
  266. package/contracts/product/IClaimService.sol +1 -0
  267. package/contracts/product/IPolicyService.sol +19 -12
  268. package/contracts/product/PolicyService.sol +189 -108
  269. package/contracts/product/PricingService.sol +5 -1
  270. package/contracts/product/Product.sol +22 -1
  271. package/contracts/registry/ReleaseRegistry.sol +0 -2
  272. package/contracts/shared/Component.sol +8 -7
  273. package/contracts/shared/ComponentService.sol +34 -4
  274. package/contracts/shared/IComponent.sol +4 -3
  275. package/contracts/shared/IComponentService.sol +5 -9
  276. package/contracts/shared/IInstanceLinkedComponent.sol +8 -8
  277. package/contracts/shared/{ERC165.sol → InitializableERC165.sol} +1 -1
  278. package/contracts/shared/NftOwnable.sol +2 -2
  279. package/contracts/shared/PolicyHolder.sol +2 -5
  280. package/contracts/shared/TokenHandler.sol +4 -0
  281. package/contracts/staking/Staking.sol +3 -1
  282. package/contracts/staking/StakingService.sol +8 -12
  283. package/contracts/type/Blocknumber.sol +7 -1
  284. package/contracts/type/Seconds.sol +13 -1
  285. package/contracts/type/Timestamp.sol +11 -1
  286. package/contracts/type/UFixed.sol +26 -8
  287. package/package.json +1 -1
  288. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +0 -4
@@ -128,9 +128,9 @@ contract ComponentService is
128
128
 
129
129
  // transfer amount to component owner
130
130
  address componentOwner = getRegistry().ownerOf(componentNftId);
131
- tokenHandler.transfer(componentWallet, componentOwner, withdrawnAmount);
132
-
133
131
  emit LogComponentServiceComponentFeesWithdrawn(componentNftId, componentOwner, address(token), withdrawnAmount);
132
+ // TODO: centralize token handling (issue #471)
133
+ tokenHandler.transfer(componentWallet, componentOwner, withdrawnAmount);
134
134
  }
135
135
 
136
136
 
@@ -151,7 +151,7 @@ contract ComponentService is
151
151
  contractAddress,
152
152
  PRODUCT(),
153
153
  PRODUCT_OWNER_ROLE());
154
-
154
+
155
155
  // create product info
156
156
  IComponents.ProductInfo memory productInfo = IProductComponent(contractAddress).getInitialProductInfo();
157
157
  instanceStore.createProduct(productNftId, productInfo);
@@ -294,6 +294,36 @@ contract ComponentService is
294
294
  _changeTargetBalance(DECREASE, instanceStore, distributionNftId, amount, feeAmount);
295
295
  }
296
296
 
297
+ //-------- distributor -------------------------------------------------------//
298
+
299
+ function increaseDistributorBalance(
300
+ InstanceStore instanceStore,
301
+ NftId distributorNftId,
302
+ Amount amount,
303
+ Amount feeAmount
304
+ )
305
+ external
306
+ virtual
307
+ // TODO re-enable once role granting is stable and fixed
308
+ // restricted()
309
+ {
310
+ _changeTargetBalance(INCREASE, instanceStore, distributorNftId, amount, feeAmount);
311
+ }
312
+
313
+ function decreaseDistributorBalance(
314
+ InstanceStore instanceStore,
315
+ NftId distributorNftId,
316
+ Amount amount,
317
+ Amount feeAmount
318
+ )
319
+ external
320
+ virtual
321
+ // TODO re-enable once role granting is stable and fixed
322
+ // restricted()
323
+ {
324
+ _changeTargetBalance(DECREASE, instanceStore, distributorNftId, amount, feeAmount);
325
+ }
326
+
297
327
  //-------- oracle -------------------------------------------------------//
298
328
 
299
329
  function registerOracle()
@@ -501,7 +531,7 @@ contract ComponentService is
501
531
  instanceReader = instance.getInstanceReader();
502
532
  instanceStore = instance.getInstanceStore();
503
533
 
504
- IComponents.ComponentInfo memory componentInfo = component.getComponentInfo();
534
+ IComponents.ComponentInfo memory componentInfo = component.getInitialComponentInfo();
505
535
  componentInfo.tokenHandler = new TokenHandler(address(componentInfo.token));
506
536
 
507
537
  instanceStore.createComponent(
@@ -35,10 +35,11 @@ interface IComponent is
35
35
  /// only component owner (nft holder) is authorizes to call this function
36
36
  function approveTokenHandler(Amount spendingLimitAmount) external;
37
37
 
38
- /// @dev sets the wallet address for the component
39
- /// if the current wallet has tokens, these will be transferred
38
+ /// @dev sets the wallet address for the component.
39
+ /// if the current wallet has tokens, these will be transferred.
40
40
  /// if the new wallet address is externally owned, an approval from the
41
- /// owner of the external wallet for the component to move all tokens must exist
41
+ /// owner of the external wallet to the tokenhandler of the component that
42
+ /// covers the current component balance must exist
42
43
  function setWallet(address walletAddress) external;
43
44
 
44
45
  /// @dev returns the name of this component
@@ -1,21 +1,12 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
- import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
5
- import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
6
4
 
7
5
  import {Amount} from "../type/Amount.sol";
8
6
  import {Fee} from "../type/Fee.sol";
9
- import {IComponents} from "../instance/module/IComponents.sol";
10
- import {IInstance} from "../instance/IInstance.sol";
11
- import {IInstanceService} from "../instance/IInstanceService.sol";
12
7
  import {InstanceStore} from "../instance/InstanceStore.sol";
13
- import {IProductService} from "../product/IProductService.sol";
14
- import {IRegisterable} from "../shared/IRegisterable.sol";
15
8
  import {IService} from "../shared/IService.sol";
16
9
  import {NftId} from "../type/NftId.sol";
17
- import {ObjectType} from "../type/ObjectType.sol";
18
- import {TokenHandler} from "../shared/TokenHandler.sol";
19
10
  import {UFixed} from "../type/UFixed.sol";
20
11
 
21
12
  /// @dev component base class
@@ -87,6 +78,10 @@ interface IComponentService is
87
78
  function increaseDistributionBalance(InstanceStore instanceStore, NftId distributionNftId, Amount amount, Amount feeAmount) external;
88
79
  function decreaseDistributionBalance(InstanceStore instanceStore, NftId distributionNftId, Amount amount, Amount feeAmount) external;
89
80
 
81
+ //-------- distributor --------------------------------------------------//
82
+ function increaseDistributorBalance(InstanceStore instanceStore, NftId distributorNftId, Amount amount, Amount feeAmount) external;
83
+ function decreaseDistributorBalance(InstanceStore instanceStore, NftId distributorNftId, Amount amount, Amount feeAmount) external;
84
+
90
85
  //-------- oracle -------------------------------------------------------//
91
86
 
92
87
  /// @dev registers the sending component as an oracle component
@@ -109,4 +104,5 @@ interface IComponentService is
109
104
  //-------- bundle -------------------------------------------------------//
110
105
  function increaseBundleBalance(InstanceStore instanceStore, NftId bundleNftId, Amount amount, Amount feeAmount) external;
111
106
  function decreaseBundleBalance(InstanceStore instanceStore, NftId bundleNftId, Amount amount, Amount feeAmount) external;
107
+
112
108
  }
@@ -38,19 +38,19 @@ interface IInstanceLinkedComponent is
38
38
  /// only component owner (nft holder) is authorizes to call this function
39
39
  function unlock() external;
40
40
 
41
+ /// @dev Withdraw fees from the distribution component. Only component owner is allowed to withdraw fees.
42
+ /// @param amount the amount to withdraw
43
+ /// @return withdrawnAmount the amount that was actually withdrawn
44
+ function withdrawFees(Amount amount) external returns (Amount withdrawnAmount);
45
+
41
46
  /// @dev defines the instance to which this component is linked to
42
47
  function getInstance() external view returns (IInstance instance);
43
48
 
44
- /// @dev defines the product to which this component is linked to
45
- /// this is only relevant for pool and distribution components
46
- function getProductNftId() external view returns (NftId productNftId);
47
-
48
49
  /// @dev returns the initial component authorization specification.
49
50
  function getAuthorization() external view returns (IAuthorization authorization);
50
51
 
51
- /// @dev Withdraw fees from the distribution component. Only component owner is allowed to withdraw fees.
52
- /// @param amount the amount to withdraw
53
- /// @return withdrawnAmount the amount that was actually withdrawn
54
- function withdrawFees(Amount amount) external returns (Amount withdrawnAmount);
52
+ /// @dev defines the product to which this component is linked to
53
+ /// this is only relevant for pool and distribution components
54
+ function getProductNftId() external view returns (NftId productNftId);
55
55
 
56
56
  }
@@ -4,7 +4,7 @@ pragma solidity ^0.8.20;
4
4
  import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
5
5
  import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
6
6
 
7
- contract ERC165 is
7
+ contract InitializableERC165 is
8
8
  Initializable,
9
9
  IERC165
10
10
  {
@@ -1,13 +1,13 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
- import {ERC165} from "./ERC165.sol";
4
+ import {InitializableERC165} from "./InitializableERC165.sol";
5
5
  import {INftOwnable} from "./INftOwnable.sol";
6
6
  import {NftId} from "../type/NftId.sol";
7
7
  import {RegistryLinked} from "./RegistryLinked.sol";
8
8
 
9
9
  contract NftOwnable is
10
- ERC165,
10
+ InitializableERC165,
11
11
  RegistryLinked,
12
12
  INftOwnable
13
13
  {
@@ -1,22 +1,19 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  pragma solidity ^0.8.20;
3
3
 
4
- import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
5
4
  import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
6
- import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
7
5
 
8
6
  import {Amount} from "../type/Amount.sol";
9
7
  import {ClaimId} from "../type/ClaimId.sol";
10
- import {ERC165} from "./ERC165.sol";
8
+ import {InitializableERC165} from "./InitializableERC165.sol";
11
9
  import {IPolicyHolder} from "./IPolicyHolder.sol";
12
10
  import {NftId} from "../type/NftId.sol";
13
11
  import {PayoutId, PayoutIdLib} from "../type/PayoutId.sol";
14
12
  import {RegistryLinked} from "./RegistryLinked.sol";
15
- import {IRegistry} from "../registry/IRegistry.sol";
16
13
 
17
14
  /// @dev template implementation for IPolicyHolder
18
15
  contract PolicyHolder is
19
- ERC165,
16
+ InitializableERC165,
20
17
  RegistryLinked, // TODO need upgradeable version
21
18
  IPolicyHolder
22
19
  {
@@ -10,6 +10,8 @@ import {Amount} from "../type/Amount.sol";
10
10
  /// a default token contract is provided via contract constructor
11
11
  /// relies internally on oz SafeERC20.safeTransferFrom
12
12
  contract TokenHandler {
13
+ event LogTokenHandlerTokenTransfer(address token, address from, address to, uint256 amount);
14
+
13
15
  IERC20Metadata private _token;
14
16
 
15
17
  constructor(address token) {
@@ -24,6 +26,7 @@ contract TokenHandler {
24
26
  )
25
27
  external
26
28
  {
29
+ emit LogTokenHandlerTokenTransfer(address(_token), from, to, amount.toInt());
27
30
  SafeERC20.safeTransferFrom(
28
31
  _token,
29
32
  from,
@@ -40,6 +43,7 @@ contract TokenHandler {
40
43
  )
41
44
  external
42
45
  {
46
+ emit LogTokenHandlerTokenTransfer(token, from, to, amount.toInt());
43
47
  SafeERC20.safeTransferFrom(
44
48
  IERC20Metadata(token),
45
49
  from,
@@ -386,6 +386,7 @@ contract Staking is
386
386
  address(tokenHandler),
387
387
  dipAmount);
388
388
 
389
+ // TODO: centralize token handling (issue #471)
389
390
  tokenHandler.transfer(from, stakingWallet, dipAmount);
390
391
  }
391
392
 
@@ -402,7 +403,8 @@ contract Staking is
402
403
  stakingWallet,
403
404
  address(tokenHandler),
404
405
  dipAmount);
405
-
406
+
407
+ // TODO: centralize token handling (issue #471)
406
408
  tokenHandler.transfer(stakingWallet, to, dipAmount);
407
409
  }
408
410
 
@@ -122,11 +122,10 @@ contract StakingService is
122
122
 
123
123
  // transfer withdrawal amount to target owner
124
124
  address instanceOwner = getRegistry().ownerOf(instanceNftId);
125
+ emit LogStakingServiceRewardReservesDecreased(instanceNftId, instanceOwner, dipAmount, newBalance);
125
126
  $._staking.transferDipAmount(
126
127
  instanceOwner,
127
128
  dipAmount);
128
-
129
- emit LogStakingServiceRewardReservesDecreased(instanceNftId, instanceOwner, dipAmount, newBalance);
130
129
  }
131
130
 
132
131
 
@@ -169,12 +168,12 @@ contract StakingService is
169
168
  targetNftId,
170
169
  dipAmount);
171
170
 
171
+ emit LogStakingServiceStakeCreated(stakeNftId, targetNftId, stakeOwner, dipAmount);
172
+
172
173
  // collect staked dip by staking
173
174
  $._staking.collectDipAmount(
174
175
  stakeOwner,
175
176
  dipAmount);
176
-
177
- emit LogStakingServiceStakeCreated(stakeNftId, targetNftId, stakeOwner, dipAmount);
178
177
  }
179
178
 
180
179
 
@@ -197,12 +196,11 @@ contract StakingService is
197
196
 
198
197
  // collect staked dip by staking
199
198
  if (dipAmount.gtz()) {
199
+ emit LogStakingServiceStakeIncreased(stakeNftId, stakeOwner, dipAmount, stakeBalance);
200
200
  $._staking.collectDipAmount(
201
201
  stakeOwner,
202
202
  dipAmount);
203
203
  }
204
-
205
- emit LogStakingServiceStakeIncreased(stakeNftId, stakeOwner, dipAmount, stakeBalance);
206
204
  }
207
205
 
208
206
 
@@ -247,11 +245,10 @@ contract StakingService is
247
245
  address stakeOwner = msg.sender;
248
246
 
249
247
  Amount rewardsClaimedAmount = $._staking.claimRewards(stakeNftId);
248
+ emit LogStakingServiceRewardsClaimed(stakeNftId, stakeOwner, rewardsClaimedAmount);
250
249
  $._staking.transferDipAmount(
251
250
  stakeOwner,
252
251
  rewardsClaimedAmount);
253
-
254
- emit LogStakingServiceRewardsClaimed(stakeNftId, stakeOwner, rewardsClaimedAmount);
255
252
  }
256
253
 
257
254
 
@@ -270,11 +267,10 @@ contract StakingService is
270
267
  ) = $._staking.unstake(stakeNftId);
271
268
 
272
269
  Amount totalAmount = unstakedAmount + rewardsClaimedAmount;
270
+ emit LogStakingServiceUnstaked(stakeNftId, stakeOwner, totalAmount);
273
271
  $._staking.transferDipAmount(
274
272
  stakeOwner,
275
273
  totalAmount);
276
-
277
- emit LogStakingServiceUnstaked(stakeNftId, stakeOwner, totalAmount);
278
274
  }
279
275
 
280
276
 
@@ -389,12 +385,12 @@ contract StakingService is
389
385
  StakingServiceStorage storage $ = _getStakingServiceStorage();
390
386
  newBalance = $._staking.refillRewardReserves(targetNftId, dipAmount);
391
387
 
388
+ emit LogStakingServiceRewardReservesIncreased(targetNftId, rewardProvider, dipAmount, newBalance);
389
+
392
390
  // collect reward dip from provider
393
391
  $._staking.collectDipAmount(
394
392
  rewardProvider,
395
393
  dipAmount);
396
-
397
- emit LogStakingServiceRewardReservesIncreased(targetNftId, rewardProvider, dipAmount, newBalance);
398
394
  }
399
395
 
400
396
 
@@ -11,8 +11,14 @@ using {
11
11
  eqBlocknumber as ==,
12
12
  neBlocknumber as !=,
13
13
  BlocknumberLib.toInt,
14
+ BlocknumberLib.eq,
15
+ BlocknumberLib.ne,
14
16
  BlocknumberLib.eqz,
15
- BlocknumberLib.gtz
17
+ BlocknumberLib.gtz,
18
+ BlocknumberLib.gt,
19
+ BlocknumberLib.gte,
20
+ BlocknumberLib.lt,
21
+ BlocknumberLib.lte
16
22
  } for Blocknumber global;
17
23
 
18
24
  /// @dev return true if Blocknumber a is greater than Blocknumber b
@@ -6,9 +6,11 @@ type Seconds is uint40;
6
6
  using {
7
7
  SecondsEq as ==,
8
8
  SecondsGt as >,
9
+ SecondsAdd as +,
9
10
  SecondsLib.eqz,
10
11
  SecondsLib.gtz,
11
- SecondsLib.toInt
12
+ SecondsLib.toInt,
13
+ SecondsLib.add
12
14
  } for Seconds global;
13
15
 
14
16
  function SecondsEq(Seconds duration1, Seconds duration2) pure returns (bool) {
@@ -19,6 +21,11 @@ function SecondsGt(Seconds duration1, Seconds duration2) pure returns (bool) {
19
21
  return SecondsLib.gt(duration1, duration2);
20
22
  }
21
23
 
24
+ function SecondsAdd(Seconds duration1, Seconds duration2) pure returns (Seconds) {
25
+ return SecondsLib.add(duration1, duration2);
26
+ }
27
+
28
+
22
29
  library SecondsLib {
23
30
 
24
31
  error ErrorSecondsLibDurationTooBig(uint256 duration);
@@ -70,6 +77,11 @@ library SecondsLib {
70
77
  return Seconds.unwrap(duration1) > Seconds.unwrap(duration2);
71
78
  }
72
79
 
80
+ /// @dev return add duration1 and duration2
81
+ function add(Seconds duration1, Seconds duration2) public pure returns (Seconds) {
82
+ return Seconds.wrap(Seconds.unwrap(duration1) + Seconds.unwrap(duration2));
83
+ }
84
+
73
85
  function toInt(Seconds duration) public pure returns (uint256) {
74
86
  return uint256(uint40(Seconds.unwrap(duration)));
75
87
  }
@@ -12,6 +12,12 @@ using {
12
12
  lteTimestamp as <=,
13
13
  eqTimestamp as ==,
14
14
  neTimestamp as !=,
15
+ TimestampLib.eq,
16
+ TimestampLib.ne,
17
+ TimestampLib.gt,
18
+ TimestampLib.gte,
19
+ TimestampLib.lt,
20
+ TimestampLib.lte,
15
21
  TimestampLib.gtz,
16
22
  TimestampLib.eqz,
17
23
  TimestampLib.addSeconds,
@@ -50,7 +56,7 @@ function neTimestamp(Timestamp a, Timestamp b) pure returns (bool) {
50
56
 
51
57
  /// @dev Converts the uint256 to a Timestamp.
52
58
  function toTimestamp(uint256 timestamp) pure returns (Timestamp) {
53
- return Timestamp.wrap(uint40(timestamp));
59
+ return TimestampLib.toTimestamp(timestamp);
54
60
  }
55
61
 
56
62
  // TODO move to TimestampLib and rename to zero()
@@ -72,6 +78,10 @@ library TimestampLib {
72
78
  function blockTimestamp() public view returns (Timestamp) {
73
79
  return Timestamp.wrap(uint40(block.timestamp));
74
80
  }
81
+
82
+ function toTimestamp(uint256 timestamp) public pure returns (Timestamp) {
83
+ return Timestamp.wrap(uint40(timestamp));
84
+ }
75
85
 
76
86
  /// @dev return true if Timestamp a is after Timestamp b
77
87
  function gt(Timestamp a, Timestamp b) public pure returns (bool isAfter) {
@@ -31,7 +31,9 @@ function addUFixed(UFixed a, UFixed b) pure returns (UFixed) {
31
31
  }
32
32
 
33
33
  function subUFixed(UFixed a, UFixed b) pure returns (UFixed) {
34
- require(a >= b, "ERROR:UFM-010:NEGATIVE_RESULT");
34
+ if (a < b) {
35
+ revert UFixedLib.UFixedLibNegativeResult();
36
+ }
35
37
  return UFixed.wrap(UFixed.unwrap(a) - UFixed.unwrap(b));
36
38
  }
37
39
 
@@ -41,8 +43,10 @@ function mulUFixed(UFixed a, UFixed b) pure returns (UFixed) {
41
43
  }
42
44
 
43
45
  function divUFixed(UFixed a, UFixed b) pure returns (UFixed) {
44
- require(UFixed.unwrap(b) > 0, "ERROR:UFM-020:DIVISOR_ZERO");
45
-
46
+ if (UFixed.unwrap(b) == 0) {
47
+ revert UFixedLib.UFixedLibDivisionByZero();
48
+ }
49
+
46
50
  return
47
51
  UFixed.wrap(MathLib.mulDiv(UFixed.unwrap(a), 10 ** 18, UFixed.unwrap(b)));
48
52
  }
@@ -90,6 +94,8 @@ function deltaUFixed(UFixed a, UFixed b) pure returns (UFixed) {
90
94
  /// @dev copied from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/utils/math/Math.sol
91
95
  library MathLib {
92
96
 
97
+ error MathLigMulDivOverflow();
98
+
93
99
  enum Rounding {
94
100
  Down, // Toward negative infinity
95
101
  Up, // Toward infinity
@@ -123,8 +129,10 @@ library MathLib {
123
129
  }
124
130
 
125
131
  // Make sure the result is less than 2^256. Also prevents denominator == 0.
126
- require(denominator > prod1, "Math: mulDiv overflow");
127
-
132
+ if (denominator <= prod1) {
133
+ revert MathLigMulDivOverflow();
134
+ }
135
+
128
136
  ///////////////////////////////////////////////
129
137
  // 512 by 256 division.
130
138
  ///////////////////////////////////////////////
@@ -196,6 +204,12 @@ library MathLib {
196
204
  }
197
205
 
198
206
  library UFixedLib {
207
+ error UFixedLibNegativeResult();
208
+ error UFixedLibDivisionByZero();
209
+
210
+ error UFixedLibExponentTooSmall(int8 exp);
211
+ error UFixedLibExponentTooLarge(int8 exp);
212
+
199
213
  int8 public constant EXP = 18;
200
214
  uint256 public constant MULTIPLIER = 10 ** uint256(int256(EXP));
201
215
  uint256 public constant MULTIPLIER_HALF = MULTIPLIER / 2;
@@ -222,9 +236,13 @@ library UFixedLib {
222
236
 
223
237
  /// @dev Converts the uint256 to a UFixed with given exponent.
224
238
  function toUFixed(uint256 a, int8 exp) public pure returns (UFixed) {
225
- require(EXP + exp >= 0, "ERROR:FM-010:EXPONENT_TOO_SMALL");
226
- require(EXP + exp <= 64, "ERROR:FM-011:EXPONENT_TOO_LARGE");
227
-
239
+ if (EXP + exp < 0) {
240
+ revert UFixedLibExponentTooSmall(exp);
241
+ }
242
+ if (EXP + exp > 64) {
243
+ revert UFixedLibExponentTooLarge(exp);
244
+ }
245
+
228
246
  return UFixed.wrap(a * 10 ** uint8(EXP + exp));
229
247
  }
230
248
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etherisc/gif-next",
3
- "version": "0.0.2-7afe9ac-654",
3
+ "version": "0.0.2-7b09b39-121",
4
4
  "description": "This is the repository for the next version of the Generic Insurance Framework (GIF) smart contracts. ",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,4 +0,0 @@
1
- {
2
- "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/a81d2ef002ca5cf90d458f79c0c33b1b.json"
4
- }