@etherisc/gif-next 0.0.2-c336201-668 → 0.0.2-c37bcc5-708

Sign up to get free protection for your applications and to get access to all the features.
Files changed (648) hide show
  1. package/README.md +250 -14
  2. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +4 -0
  3. package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +1416 -0
  4. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +4 -0
  5. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +1349 -0
  6. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +4 -0
  7. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +818 -0
  8. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +4 -0
  9. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +975 -0
  10. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +4 -0
  11. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +814 -0
  12. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +4 -0
  13. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +778 -0
  14. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
  15. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +315 -1509
  16. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +4 -0
  17. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +650 -0
  18. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
  19. package/artifacts/contracts/instance/Instance.sol/Instance.json +417 -1641
  20. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
  21. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +708 -0
  22. package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +4 -0
  23. package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +228 -0
  24. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +4 -0
  25. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +1701 -0
  26. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +4 -0
  27. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +1053 -0
  28. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +4 -0
  29. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +734 -0
  30. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +4 -0
  31. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +3642 -0
  32. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +4 -0
  33. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +318 -0
  34. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +4 -0
  35. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.json +190 -0
  36. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +4 -0
  37. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +10 -0
  38. package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +4 -0
  39. package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +256 -0
  40. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +4 -0
  41. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +129 -0
  42. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +4 -0
  43. package/artifacts/contracts/instance/module/{bundle/IBundle.sol → IBundle.sol}/IBundle.json +1 -1
  44. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +4 -0
  45. package/artifacts/contracts/instance/module/{access/IAccess.sol/IAccess.json → IComponents.sol/IComponents.json} +2 -2
  46. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +4 -0
  47. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.json +10 -0
  48. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +4 -0
  49. package/artifacts/contracts/instance/module/{policy/IPolicy.sol → IPolicy.sol}/IPolicy.json +1 -1
  50. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +4 -0
  51. package/artifacts/contracts/instance/module/{risk/IRisk.sol → IRisk.sol}/IRisk.json +1 -1
  52. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +4 -0
  53. package/artifacts/contracts/mock/Dip.sol/Dip.json +376 -0
  54. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +4 -0
  55. package/artifacts/contracts/{instance/base/ModuleBase.sol/ModuleBase.json → oracle/IOracle.sol/IOracle.json} +2 -2
  56. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +4 -0
  57. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +759 -0
  58. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +4 -0
  59. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +662 -0
  60. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +4 -0
  61. package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +1146 -0
  62. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +4 -0
  63. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +997 -0
  64. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +4 -0
  65. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +718 -0
  66. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +4 -0
  67. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +1105 -0
  68. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +4 -0
  69. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +746 -0
  70. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +4 -0
  71. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +690 -0
  72. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +4 -0
  73. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +1154 -0
  74. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +4 -0
  75. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +1065 -0
  76. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +4 -0
  77. package/artifacts/contracts/pool/Pool.sol/Pool.json +1565 -0
  78. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +4 -0
  79. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +1432 -0
  80. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +4 -0
  81. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +738 -0
  82. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +4 -0
  83. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +834 -0
  84. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
  85. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +722 -0
  86. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +4 -0
  87. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +1278 -0
  88. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
  89. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +810 -0
  90. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +4 -0
  91. package/artifacts/contracts/{instance/service/IProductService.sol/IProductService.json → product/IApplicationService.sol/IApplicationService.json} +252 -230
  92. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +4 -0
  93. package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +759 -0
  94. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +4 -0
  95. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +707 -0
  96. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +4 -0
  97. package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +536 -0
  98. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +4 -0
  99. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +995 -0
  100. package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +4 -0
  101. package/artifacts/contracts/{instance/service/IComponentOwnerService.sol/IComponentOwnerService.json → product/IProductService.sol/IProductService.json} +197 -174
  102. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +4 -0
  103. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +1146 -0
  104. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +4 -0
  105. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +754 -0
  106. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +4 -0
  107. package/artifacts/contracts/product/PricingService.sol/PricingService.json +983 -0
  108. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +4 -0
  109. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +778 -0
  110. package/artifacts/contracts/product/Product.sol/Product.dbg.json +4 -0
  111. package/artifacts/contracts/product/Product.sol/Product.json +1397 -0
  112. package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +4 -0
  113. package/artifacts/contracts/product/ProductService.sol/ProductService.json +679 -0
  114. package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +4 -0
  115. package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +694 -0
  116. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
  117. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +199 -12
  118. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
  119. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +678 -77
  120. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +4 -0
  121. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +1110 -0
  122. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +4 -0
  123. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +52 -0
  124. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
  125. package/artifacts/contracts/registry/Registry.sol/Registry.json +865 -107
  126. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +4 -0
  127. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +407 -0
  128. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +4 -0
  129. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +1415 -0
  130. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +4 -0
  131. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +709 -0
  132. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +4 -0
  133. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +1292 -0
  134. package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.dbg.json +4 -0
  135. package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.json +137 -0
  136. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +4 -0
  137. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +661 -0
  138. package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.dbg.json +4 -0
  139. package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.json +1193 -0
  140. package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.dbg.json +4 -0
  141. package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.json +1715 -0
  142. package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.dbg.json +4 -0
  143. package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.json +1728 -0
  144. package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.dbg.json +4 -0
  145. package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.json +1806 -0
  146. package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.dbg.json +4 -0
  147. package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.json +1824 -0
  148. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +4 -0
  149. package/artifacts/contracts/shared/Component.sol/Component.json +896 -0
  150. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +4 -0
  151. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +1490 -0
  152. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +4 -0
  153. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +792 -0
  154. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +4 -0
  155. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +526 -0
  156. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
  157. package/artifacts/contracts/shared/ERC165.sol/ERC165.json +41 -3
  158. package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.dbg.json +4 -0
  159. package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.json +1562 -0
  160. package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.dbg.json +4 -0
  161. package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.json +1600 -0
  162. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +4 -0
  163. package/artifacts/contracts/shared/IComponent.sol/IComponent.json +631 -0
  164. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +4 -0
  165. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +867 -0
  166. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +4 -0
  167. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +705 -0
  168. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +4 -0
  169. package/artifacts/contracts/{instance/base → shared}/IKeyValueStore.sol/IKeyValueStore.json +95 -138
  170. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +4 -0
  171. package/artifacts/contracts/{instance/base → shared}/ILifecycle.sol/ILifecycle.json +1 -1
  172. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +4 -0
  173. package/artifacts/contracts/{components/IBaseComponent.sol/IBaseComponent.json → shared/INftOwnable.sol/INftOwnable.json} +37 -80
  174. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
  175. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +207 -0
  176. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
  177. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +91 -31
  178. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
  179. package/artifacts/contracts/{registry → shared}/IRegistryLinked.sol/IRegistryLinked.json +13 -2
  180. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +4 -0
  181. package/artifacts/contracts/{instance/base/InstanceBase.sol/InstanceBase.json → shared/IService.sol/IService.json} +158 -151
  182. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
  183. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +16 -125
  184. package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +4 -0
  185. package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +39 -0
  186. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +4 -0
  187. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +1036 -0
  188. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +4 -0
  189. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +571 -0
  190. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +4 -0
  191. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +194 -0
  192. package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.dbg.json +4 -0
  193. package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +306 -0
  194. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +4 -0
  195. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +244 -0
  196. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
  197. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +320 -0
  198. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +4 -0
  199. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +617 -0
  200. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
  201. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +255 -23
  202. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
  203. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +71 -0
  204. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +4 -0
  205. package/artifacts/contracts/{registry/IChainNft.sol/IChainNft.json → shared/Service.sol/Service.json} +260 -218
  206. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +4 -0
  207. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +150 -0
  208. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
  209. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +129 -0
  210. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
  211. package/artifacts/contracts/shared/Versionable.sol/Versionable.json +29 -115
  212. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +4 -0
  213. package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1438 -0
  214. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +4 -0
  215. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +993 -0
  216. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +4 -0
  217. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +444 -0
  218. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +4 -0
  219. package/artifacts/contracts/staking/Staking.sol/Staking.json +2045 -0
  220. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +4 -0
  221. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +777 -0
  222. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +4 -0
  223. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +592 -0
  224. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +4 -0
  225. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +1324 -0
  226. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +4 -0
  227. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +726 -0
  228. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +4 -0
  229. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2189 -0
  230. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +4 -0
  231. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +571 -0
  232. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +4 -0
  233. package/artifacts/contracts/{types → type}/AddressSet.sol/LibAddressSet.json +3 -3
  234. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +4 -0
  235. package/artifacts/contracts/type/Amount.sol/AmountLib.json +345 -0
  236. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +4 -0
  237. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +225 -0
  238. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +4 -0
  239. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +179 -0
  240. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +4 -0
  241. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +104 -0
  242. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +4 -0
  243. package/artifacts/contracts/type/Fee.sol/FeeLib.json +312 -0
  244. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +4 -0
  245. package/artifacts/contracts/type/Key32.sol/Key32Lib.json +125 -0
  246. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +4 -0
  247. package/artifacts/contracts/type/NftId.sol/NftIdLib.json +209 -0
  248. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +4 -0
  249. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +33 -0
  250. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +4 -0
  251. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +105 -0
  252. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +4 -0
  253. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +209 -0
  254. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +4 -0
  255. package/artifacts/contracts/type/Referral.sol/ReferralLib.json +142 -0
  256. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +4 -0
  257. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +204 -0
  258. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +4 -0
  259. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +86 -0
  260. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +4 -0
  261. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +156 -0
  262. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +4 -0
  263. package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +198 -0
  264. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +4 -0
  265. package/artifacts/contracts/{types → type}/StateId.sol/StateIdLib.json +3 -3
  266. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +4 -0
  267. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +293 -0
  268. package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +4 -0
  269. package/artifacts/contracts/{types/ChainId.sol/ChainIdLib.json → type/UFixed.sol/MathLib.json} +4 -4
  270. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +4 -0
  271. package/artifacts/contracts/{types/UFixed.sol/UFixedMathLib.json → type/UFixed.sol/UFixedLib.json} +4 -4
  272. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +4 -0
  273. package/artifacts/contracts/type/Version.sol/VersionLib.json +177 -0
  274. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +4 -0
  275. package/artifacts/contracts/type/Version.sol/VersionPartLib.json +49 -0
  276. package/contracts/distribution/Distribution.sol +261 -0
  277. package/contracts/distribution/DistributionService.sol +298 -0
  278. package/contracts/distribution/DistributionServiceManager.sol +42 -0
  279. package/contracts/distribution/IDistributionComponent.sol +66 -0
  280. package/contracts/distribution/IDistributionService.sol +81 -0
  281. package/contracts/instance/BundleManager.sol +126 -0
  282. package/contracts/instance/IInstance.sol +74 -44
  283. package/contracts/instance/IInstanceService.sol +81 -0
  284. package/contracts/instance/Instance.sol +220 -52
  285. package/contracts/instance/InstanceAdmin.sol +331 -0
  286. package/contracts/instance/InstanceAuthorizationsLib.sol +377 -0
  287. package/contracts/instance/InstanceReader.sol +390 -0
  288. package/contracts/instance/InstanceService.sol +362 -0
  289. package/contracts/instance/InstanceServiceManager.sol +44 -0
  290. package/contracts/instance/InstanceStore.sol +281 -0
  291. package/contracts/instance/base/BalanceStore.sol +118 -0
  292. package/contracts/instance/base/Cloneable.sol +51 -0
  293. package/contracts/instance/base/ObjectCounter.sol +21 -0
  294. package/contracts/instance/base/ObjectManager.sol +82 -0
  295. package/contracts/instance/module/IAccess.sol +46 -0
  296. package/contracts/instance/module/IBundle.sol +20 -0
  297. package/contracts/instance/module/IComponents.sol +52 -0
  298. package/contracts/instance/module/IDistribution.sol +42 -0
  299. package/contracts/instance/module/IPolicy.sol +84 -0
  300. package/contracts/instance/module/IRisk.sol +11 -0
  301. package/contracts/{test/Usdc.sol → mock/Dip.sol} +5 -5
  302. package/contracts/oracle/IOracle.sol +20 -0
  303. package/contracts/oracle/IOracleComponent.sol +32 -0
  304. package/contracts/oracle/IOracleService.sol +65 -0
  305. package/contracts/oracle/Oracle.sol +145 -0
  306. package/contracts/oracle/OracleService.sol +277 -0
  307. package/contracts/oracle/OracleServiceManager.sol +42 -0
  308. package/contracts/pool/BundleService.sol +296 -0
  309. package/contracts/pool/BundleServiceManager.sol +42 -0
  310. package/contracts/pool/IBundleService.sol +106 -0
  311. package/contracts/pool/IPoolComponent.sol +112 -0
  312. package/contracts/pool/IPoolService.sol +150 -0
  313. package/contracts/pool/Pool.sol +299 -0
  314. package/contracts/pool/PoolService.sol +453 -0
  315. package/contracts/pool/PoolServiceManager.sol +42 -0
  316. package/contracts/product/ApplicationService.sol +254 -0
  317. package/contracts/product/ApplicationServiceManager.sol +38 -0
  318. package/contracts/product/ClaimService.sol +442 -0
  319. package/contracts/product/ClaimServiceManager.sol +38 -0
  320. package/contracts/product/IApplicationService.sol +62 -0
  321. package/contracts/product/IClaimService.sol +99 -0
  322. package/contracts/product/IPolicyService.sol +78 -0
  323. package/contracts/product/IPricingService.sol +39 -0
  324. package/contracts/product/IProductComponent.sol +42 -0
  325. package/contracts/product/IProductService.sol +33 -0
  326. package/contracts/product/PolicyService.sol +475 -0
  327. package/contracts/product/PolicyServiceManager.sol +42 -0
  328. package/contracts/product/PricingService.sol +301 -0
  329. package/contracts/product/PricingServiceManager.sol +42 -0
  330. package/contracts/product/Product.sol +377 -0
  331. package/contracts/product/ProductService.sol +124 -0
  332. package/contracts/product/ProductServiceManager.sol +42 -0
  333. package/contracts/registry/ChainNft.sol +95 -37
  334. package/contracts/registry/IRegistry.sol +95 -28
  335. package/contracts/registry/IRegistryService.sol +69 -0
  336. package/contracts/registry/ITransferInterceptor.sol +7 -0
  337. package/contracts/registry/Registry.sol +476 -281
  338. package/contracts/registry/RegistryAdmin.sol +237 -0
  339. package/contracts/registry/RegistryService.sol +266 -0
  340. package/contracts/registry/RegistryServiceManager.sol +58 -0
  341. package/contracts/registry/ReleaseManager.sol +600 -0
  342. package/contracts/registry/ServiceAuthorizationsLib.sol +173 -0
  343. package/contracts/registry/TokenRegistry.sol +315 -0
  344. package/contracts/shared/AccessManagerCustom.sol +736 -0
  345. package/contracts/shared/AccessManagerExtended.sol +470 -0
  346. package/contracts/shared/AccessManagerExtendedInitializeable.sol +13 -0
  347. package/contracts/shared/AccessManagerExtendedWithDisable.sol +137 -0
  348. package/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol +14 -0
  349. package/contracts/shared/Component.sol +281 -0
  350. package/contracts/shared/ComponentService.sol +618 -0
  351. package/contracts/shared/ComponentServiceManager.sol +35 -0
  352. package/contracts/shared/ComponentVerifyingService.sol +117 -0
  353. package/contracts/shared/ERC165.sol +15 -9
  354. package/contracts/shared/IAccessManagerExtended.sol +74 -0
  355. package/contracts/shared/IAccessManagerExtendedWithDisable.sol +18 -0
  356. package/contracts/shared/IComponent.sol +70 -0
  357. package/contracts/shared/IComponentService.sol +102 -0
  358. package/contracts/shared/IInstanceLinkedComponent.sol +46 -0
  359. package/contracts/shared/IKeyValueStore.sol +53 -0
  360. package/contracts/{instance/base → shared}/ILifecycle.sol +4 -4
  361. package/contracts/shared/INftOwnable.sol +23 -0
  362. package/contracts/shared/IPolicyHolder.sol +45 -0
  363. package/contracts/shared/IRegisterable.sol +10 -19
  364. package/contracts/shared/IRegistryLinked.sol +11 -0
  365. package/contracts/shared/IService.sol +18 -0
  366. package/contracts/shared/IVersionable.sol +38 -37
  367. package/contracts/shared/InitializableCustom.sol +177 -0
  368. package/contracts/shared/InstanceLinkedComponent.sol +144 -0
  369. package/contracts/shared/KeyValueStore.sol +127 -0
  370. package/contracts/shared/Lifecycle.sol +130 -0
  371. package/contracts/shared/NftIdSetManager.sol +65 -0
  372. package/contracts/shared/NftOwnable.sol +107 -0
  373. package/contracts/shared/PolicyHolder.sol +102 -0
  374. package/contracts/shared/ProxyManager.sol +199 -0
  375. package/contracts/shared/Registerable.sol +54 -65
  376. package/contracts/shared/RegistryLinked.sol +43 -0
  377. package/contracts/shared/Service.sol +77 -0
  378. package/contracts/shared/TokenHandler.sol +58 -0
  379. package/contracts/shared/UpgradableProxyWithAdmin.sol +16 -0
  380. package/contracts/shared/Versionable.sol +38 -68
  381. package/contracts/staking/IStaking.sol +168 -0
  382. package/contracts/staking/IStakingService.sol +149 -0
  383. package/contracts/staking/StakeManagerLib.sol +179 -0
  384. package/contracts/staking/Staking.sol +551 -0
  385. package/contracts/staking/StakingManager.sol +54 -0
  386. package/contracts/staking/StakingReader.sol +187 -0
  387. package/contracts/staking/StakingService.sol +406 -0
  388. package/contracts/staking/StakingServiceManager.sol +45 -0
  389. package/contracts/staking/StakingStore.sol +572 -0
  390. package/contracts/staking/TargetManagerLib.sol +207 -0
  391. package/contracts/{types → type}/AddressSet.sol +1 -1
  392. package/contracts/type/Amount.sol +128 -0
  393. package/contracts/{types → type}/Blocknumber.sol +21 -3
  394. package/contracts/type/ClaimId.sol +75 -0
  395. package/contracts/type/DistributorType.sol +55 -0
  396. package/contracts/type/Fee.sol +66 -0
  397. package/contracts/{types → type}/Key32.sol +8 -3
  398. package/contracts/{types → type}/NftId.sol +21 -15
  399. package/contracts/type/NftIdSet.sol +62 -0
  400. package/contracts/{types → type}/ObjectType.sol +73 -20
  401. package/contracts/type/PayoutId.sol +82 -0
  402. package/contracts/type/Referral.sol +89 -0
  403. package/contracts/type/RequestId.sol +75 -0
  404. package/contracts/type/RiskId.sol +43 -0
  405. package/contracts/type/RoleId.sol +146 -0
  406. package/contracts/type/Seconds.sol +81 -0
  407. package/contracts/{types → type}/StateId.sol +39 -5
  408. package/contracts/{types → type}/Timestamp.sol +27 -14
  409. package/contracts/{types → type}/UFixed.sol +129 -12
  410. package/contracts/{types → type}/Version.sol +15 -2
  411. package/package.json +9 -7
  412. package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +0 -4
  413. package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.json +0 -174
  414. package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +0 -4
  415. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +0 -4
  416. package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +0 -356
  417. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +0 -4
  418. package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +0 -279
  419. package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +0 -4
  420. package/artifacts/contracts/components/Pool.sol/Pool.json +0 -387
  421. package/artifacts/contracts/components/Product.sol/Product.dbg.json +0 -4
  422. package/artifacts/contracts/components/Product.sol/Product.json +0 -305
  423. package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +0 -4
  424. package/artifacts/contracts/experiment/errors/Require.sol/Require.json +0 -105
  425. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +0 -4
  426. package/artifacts/contracts/experiment/errors/Revert.sol/Revert.json +0 -105
  427. package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +0 -4
  428. package/artifacts/contracts/experiment/inheritance/A.sol/A.json +0 -128
  429. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +0 -4
  430. package/artifacts/contracts/experiment/inheritance/A.sol/AShared.json +0 -42
  431. package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +0 -4
  432. package/artifacts/contracts/experiment/inheritance/B.sol/B.json +0 -76
  433. package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +0 -4
  434. package/artifacts/contracts/experiment/inheritance/C.sol/C.json +0 -89
  435. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +0 -4
  436. package/artifacts/contracts/experiment/inheritance/IA.sol/IA.json +0 -128
  437. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +0 -4
  438. package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.json +0 -37
  439. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +0 -4
  440. package/artifacts/contracts/experiment/inheritance/IB.sol/IB.json +0 -50
  441. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +0 -4
  442. package/artifacts/contracts/experiment/inheritance/IC.sol/IC.json +0 -63
  443. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +0 -4
  444. package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +0 -59
  445. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +0 -4
  446. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.json +0 -124
  447. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +0 -4
  448. package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.json +0 -74
  449. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +0 -4
  450. package/artifacts/contracts/experiment/statemachine/SM.sol/SM.json +0 -124
  451. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +0 -4
  452. package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +0 -207
  453. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +0 -4
  454. package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.json +0 -10
  455. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +0 -4
  456. package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.json +0 -10
  457. package/artifacts/contracts/instance/IInstanceLinked.sol/IInstanceLinked.dbg.json +0 -4
  458. package/artifacts/contracts/instance/IInstanceLinked.sol/IInstanceLinked.json +0 -24
  459. package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +0 -4
  460. package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.json +0 -300
  461. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
  462. package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +0 -63
  463. package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +0 -4
  464. package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +0 -4
  465. package/artifacts/contracts/instance/base/IService.sol/IService.dbg.json +0 -4
  466. package/artifacts/contracts/instance/base/IService.sol/IService.json +0 -300
  467. package/artifacts/contracts/instance/base/InstanceBase.sol/InstanceBase.dbg.json +0 -4
  468. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +0 -4
  469. package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +0 -692
  470. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +0 -4
  471. package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +0 -169
  472. package/artifacts/contracts/instance/base/ModuleBase.sol/ModuleBase.dbg.json +0 -4
  473. package/artifacts/contracts/instance/base/ServiceBase.sol/ServiceBase.dbg.json +0 -4
  474. package/artifacts/contracts/instance/base/ServiceBase.sol/ServiceBase.json +0 -300
  475. package/artifacts/contracts/instance/module/access/Access.sol/AccessModule.dbg.json +0 -4
  476. package/artifacts/contracts/instance/module/access/Access.sol/AccessModule.json +0 -333
  477. package/artifacts/contracts/instance/module/access/IAccess.sol/IAccess.dbg.json +0 -4
  478. package/artifacts/contracts/instance/module/access/IAccess.sol/IAccessModule.dbg.json +0 -4
  479. package/artifacts/contracts/instance/module/access/IAccess.sol/IAccessModule.json +0 -333
  480. package/artifacts/contracts/instance/module/bundle/BundleModule.sol/BundleModule.dbg.json +0 -4
  481. package/artifacts/contracts/instance/module/bundle/BundleModule.sol/BundleModule.json +0 -296
  482. package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundle.dbg.json +0 -4
  483. package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundleModule.dbg.json +0 -4
  484. package/artifacts/contracts/instance/module/bundle/IBundle.sol/IBundleModule.json +0 -296
  485. package/artifacts/contracts/instance/module/compensation/CompensationModule.sol/CompensationModule.dbg.json +0 -4
  486. package/artifacts/contracts/instance/module/compensation/CompensationModule.sol/CompensationModule.json +0 -10
  487. package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensation.dbg.json +0 -4
  488. package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensation.json +0 -10
  489. package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensationModule.dbg.json +0 -4
  490. package/artifacts/contracts/instance/module/compensation/ICompensation.sol/ICompensationModule.json +0 -10
  491. package/artifacts/contracts/instance/module/component/ComponentModule.sol/ComponentModule.dbg.json +0 -4
  492. package/artifacts/contracts/instance/module/component/ComponentModule.sol/ComponentModule.json +0 -188
  493. package/artifacts/contracts/instance/module/component/IComponent.sol/IComponent.dbg.json +0 -4
  494. package/artifacts/contracts/instance/module/component/IComponent.sol/IComponent.json +0 -10
  495. package/artifacts/contracts/instance/module/component/IComponent.sol/IComponentModule.dbg.json +0 -4
  496. package/artifacts/contracts/instance/module/component/IComponent.sol/IComponentModule.json +0 -188
  497. package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicy.dbg.json +0 -4
  498. package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicyModule.dbg.json +0 -4
  499. package/artifacts/contracts/instance/module/policy/IPolicy.sol/IPolicyModule.json +0 -261
  500. package/artifacts/contracts/instance/module/policy/PolicyModule.sol/PolicyModule.dbg.json +0 -4
  501. package/artifacts/contracts/instance/module/policy/PolicyModule.sol/PolicyModule.json +0 -261
  502. package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPool.dbg.json +0 -4
  503. package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPool.json +0 -10
  504. package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPoolModule.dbg.json +0 -4
  505. package/artifacts/contracts/instance/module/pool/IPoolModule.sol/IPoolModule.json +0 -149
  506. package/artifacts/contracts/instance/module/pool/PoolModule.sol/PoolModule.dbg.json +0 -4
  507. package/artifacts/contracts/instance/module/pool/PoolModule.sol/PoolModule.json +0 -149
  508. package/artifacts/contracts/instance/module/risk/IRisk.sol/IRisk.dbg.json +0 -4
  509. package/artifacts/contracts/instance/module/risk/IRisk.sol/IRiskModule.dbg.json +0 -4
  510. package/artifacts/contracts/instance/module/risk/IRisk.sol/IRiskModule.json +0 -10
  511. package/artifacts/contracts/instance/module/risk/RiskModule.sol/RiskModule.dbg.json +0 -4
  512. package/artifacts/contracts/instance/module/risk/RiskModule.sol/RiskModule.json +0 -10
  513. package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasury.dbg.json +0 -4
  514. package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasury.json +0 -10
  515. package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasuryModule.dbg.json +0 -4
  516. package/artifacts/contracts/instance/module/treasury/ITreasury.sol/ITreasuryModule.json +0 -533
  517. package/artifacts/contracts/instance/module/treasury/TokenHandler.sol/TokenHandler.dbg.json +0 -4
  518. package/artifacts/contracts/instance/module/treasury/TokenHandler.sol/TokenHandler.json +0 -76
  519. package/artifacts/contracts/instance/module/treasury/TreasuryModule.sol/TreasuryModule.dbg.json +0 -4
  520. package/artifacts/contracts/instance/module/treasury/TreasuryModule.sol/TreasuryModule.json +0 -533
  521. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +0 -4
  522. package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +0 -523
  523. package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +0 -4
  524. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +0 -4
  525. package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +0 -376
  526. package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +0 -4
  527. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +0 -4
  528. package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +0 -471
  529. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +0 -4
  530. package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +0 -673
  531. package/artifacts/contracts/registry/IChainNft.sol/IChainNft.dbg.json +0 -4
  532. package/artifacts/contracts/registry/IRegistryLinked.sol/IRegistryLinked.dbg.json +0 -4
  533. package/artifacts/contracts/shared/IOwnable.sol/IOwnable.dbg.json +0 -4
  534. package/artifacts/contracts/shared/IOwnable.sol/IOwnable.json +0 -24
  535. package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +0 -4
  536. package/artifacts/contracts/test/TestFee.sol/TestFee.json +0 -119
  537. package/artifacts/contracts/test/TestPool.sol/TestPool.dbg.json +0 -4
  538. package/artifacts/contracts/test/TestPool.sol/TestPool.json +0 -387
  539. package/artifacts/contracts/test/TestProduct.sol/TestProduct.dbg.json +0 -4
  540. package/artifacts/contracts/test/TestProduct.sol/TestProduct.json +0 -393
  541. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +0 -4
  542. package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +0 -137
  543. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +0 -4
  544. package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +0 -116
  545. package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +0 -4
  546. package/artifacts/contracts/test/TestService.sol/TestService.json +0 -379
  547. package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +0 -4
  548. package/artifacts/contracts/test/TestToken.sol/TestUsdc.json +0 -338
  549. package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +0 -4
  550. package/artifacts/contracts/test/TestVersion.sol/TestVersion.json +0 -218
  551. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +0 -4
  552. package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +0 -206
  553. package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +0 -4
  554. package/artifacts/contracts/test/Usdc.sol/USDC.json +0 -338
  555. package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +0 -4
  556. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +0 -4
  557. package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.json +0 -174
  558. package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +0 -4
  559. package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +0 -4
  560. package/artifacts/contracts/types/Fee.sol/FeeLib.json +0 -218
  561. package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +0 -4
  562. package/artifacts/contracts/types/Key32.sol/Key32Lib.json +0 -111
  563. package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +0 -4
  564. package/artifacts/contracts/types/NftId.sol/NftIdLib.json +0 -153
  565. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +0 -4
  566. package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +0 -10
  567. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +0 -4
  568. package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +0 -92
  569. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +0 -4
  570. package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +0 -30
  571. package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +0 -4
  572. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +0 -4
  573. package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +0 -236
  574. package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.dbg.json +0 -4
  575. package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +0 -4
  576. package/artifacts/contracts/types/Version.sol/VersionLib.json +0 -139
  577. package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +0 -4
  578. package/artifacts/contracts/types/Version.sol/VersionPartLib.json +0 -30
  579. package/contracts/components/BaseComponent.sol +0 -88
  580. package/contracts/components/IBaseComponent.sol +0 -19
  581. package/contracts/components/IPoolComponent.sol +0 -57
  582. package/contracts/components/IProductComponent.sol +0 -19
  583. package/contracts/components/Pool.sol +0 -174
  584. package/contracts/components/Product.sol +0 -117
  585. package/contracts/experiment/errors/Require.sol +0 -38
  586. package/contracts/experiment/errors/Revert.sol +0 -44
  587. package/contracts/experiment/inheritance/A.sol +0 -53
  588. package/contracts/experiment/inheritance/B.sol +0 -28
  589. package/contracts/experiment/inheritance/C.sol +0 -34
  590. package/contracts/experiment/inheritance/IA.sol +0 -13
  591. package/contracts/experiment/inheritance/IB.sol +0 -10
  592. package/contracts/experiment/inheritance/IC.sol +0 -12
  593. package/contracts/experiment/statemachine/Dummy.sol +0 -27
  594. package/contracts/experiment/statemachine/ISM.sol +0 -25
  595. package/contracts/experiment/statemachine/README.md +0 -112
  596. package/contracts/experiment/statemachine/SM.sol +0 -57
  597. package/contracts/experiment/statemachine/SimpleStateMachine.sol +0 -31
  598. package/contracts/experiment/types/TypeA.sol +0 -47
  599. package/contracts/experiment/types/TypeB.sol +0 -29
  600. package/contracts/instance/IInstanceLinked.sol +0 -8
  601. package/contracts/instance/base/ComponentServiceBase.sol +0 -42
  602. package/contracts/instance/base/IInstanceBase.sol +0 -14
  603. package/contracts/instance/base/IKeyValueStore.sol +0 -49
  604. package/contracts/instance/base/IService.sol +0 -15
  605. package/contracts/instance/base/InstanceBase.sol +0 -80
  606. package/contracts/instance/base/KeyValueStore.sol +0 -156
  607. package/contracts/instance/base/Lifecycle.sol +0 -95
  608. package/contracts/instance/base/ModuleBase.sol +0 -52
  609. package/contracts/instance/base/ServiceBase.sol +0 -37
  610. package/contracts/instance/module/access/Access.sol +0 -149
  611. package/contracts/instance/module/access/IAccess.sol +0 -53
  612. package/contracts/instance/module/bundle/BundleModule.sol +0 -136
  613. package/contracts/instance/module/bundle/IBundle.sol +0 -58
  614. package/contracts/instance/module/compensation/CompensationModule.sol +0 -8
  615. package/contracts/instance/module/compensation/ICompensation.sol +0 -10
  616. package/contracts/instance/module/component/ComponentModule.sol +0 -95
  617. package/contracts/instance/module/component/IComponent.sol +0 -53
  618. package/contracts/instance/module/policy/IPolicy.sol +0 -60
  619. package/contracts/instance/module/policy/PolicyModule.sol +0 -76
  620. package/contracts/instance/module/pool/IPoolModule.sol +0 -41
  621. package/contracts/instance/module/pool/PoolModule.sol +0 -87
  622. package/contracts/instance/module/risk/IRisk.sol +0 -10
  623. package/contracts/instance/module/risk/RiskModule.sol +0 -8
  624. package/contracts/instance/module/treasury/ITreasury.sol +0 -103
  625. package/contracts/instance/module/treasury/TokenHandler.sol +0 -48
  626. package/contracts/instance/module/treasury/TreasuryModule.sol +0 -152
  627. package/contracts/instance/service/ComponentOwnerService.sol +0 -170
  628. package/contracts/instance/service/IComponentOwnerService.sol +0 -22
  629. package/contracts/instance/service/IPoolService.sol +0 -30
  630. package/contracts/instance/service/IProductService.sol +0 -58
  631. package/contracts/instance/service/PoolService.sol +0 -123
  632. package/contracts/instance/service/ProductService.sol +0 -354
  633. package/contracts/registry/IChainNft.sol +0 -21
  634. package/contracts/registry/IRegistryLinked.sol +0 -8
  635. package/contracts/shared/IOwnable.sol +0 -6
  636. package/contracts/test/TestFee.sol +0 -25
  637. package/contracts/test/TestPool.sol +0 -22
  638. package/contracts/test/TestProduct.sol +0 -44
  639. package/contracts/test/TestRegisterable.sol +0 -19
  640. package/contracts/test/TestRoleId.sol +0 -14
  641. package/contracts/test/TestService.sol +0 -32
  642. package/contracts/test/TestToken.sol +0 -26
  643. package/contracts/test/TestVersion.sol +0 -44
  644. package/contracts/test/TestVersionable.sol +0 -17
  645. package/contracts/types/ChainId.sol +0 -38
  646. package/contracts/types/Fee.sol +0 -51
  647. package/contracts/types/NftIdSet.sol +0 -60
  648. package/contracts/types/RoleId.sol +0 -38
@@ -0,0 +1,81 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ pragma solidity ^0.8.20;
3
+
4
+ type Seconds is uint40;
5
+
6
+ using {
7
+ SecondsEq as ==,
8
+ SecondsGt as >,
9
+ SecondsLib.eqz,
10
+ SecondsLib.gtz,
11
+ SecondsLib.toInt
12
+ } for Seconds global;
13
+
14
+ function SecondsEq(Seconds duration1, Seconds duration2) pure returns (bool) {
15
+ return SecondsLib.eq(duration1, duration2);
16
+ }
17
+
18
+ function SecondsGt(Seconds duration1, Seconds duration2) pure returns (bool) {
19
+ return SecondsLib.gt(duration1, duration2);
20
+ }
21
+
22
+ library SecondsLib {
23
+
24
+ error ErrorSecondsLibDurationTooBig(uint256 duration);
25
+
26
+ function zero() public pure returns (Seconds) {
27
+ return Seconds.wrap(0);
28
+ }
29
+
30
+ function max() public pure returns (Seconds) {
31
+ return Seconds.wrap(_max());
32
+ }
33
+
34
+ function oneDay() public pure returns (Seconds duration) {
35
+ return Seconds.wrap(24 * 3600);
36
+ }
37
+
38
+ function oneYear() public pure returns (Seconds duration) {
39
+ return Seconds.wrap(365 * 24 * 3600);
40
+ }
41
+
42
+ /// @dev converts the uint duration into Seconds
43
+ /// function reverts if duration is exceeding max Seconds value
44
+ function toSeconds(uint256 duration) public pure returns (Seconds) {
45
+ // if(duration > type(uint40).max) {
46
+ if(duration > _max()) {
47
+ revert ErrorSecondsLibDurationTooBig(duration);
48
+ }
49
+
50
+ return Seconds.wrap(uint40(duration));
51
+ }
52
+
53
+ /// @dev return true if duration equals 0
54
+ function eqz(Seconds duration) public pure returns (bool) {
55
+ return Seconds.unwrap(duration) == 0;
56
+ }
57
+
58
+ /// @dev return true if duration is larger than 0
59
+ function gtz(Seconds duration) public pure returns (bool) {
60
+ return Seconds.unwrap(duration) > 0;
61
+ }
62
+
63
+ /// @dev return true iff duration1 and duration2 are the same
64
+ function eq(Seconds duration1, Seconds duration2) public pure returns (bool) {
65
+ return Seconds.unwrap(duration1) == Seconds.unwrap(duration2);
66
+ }
67
+
68
+ /// @dev return true if duration1 is larger than duration2
69
+ function gt(Seconds duration1, Seconds duration2) public pure returns (bool) {
70
+ return Seconds.unwrap(duration1) > Seconds.unwrap(duration2);
71
+ }
72
+
73
+ function toInt(Seconds duration) public pure returns (uint256) {
74
+ return uint256(uint40(Seconds.unwrap(duration)));
75
+ }
76
+
77
+ function _max() internal pure returns (uint40) {
78
+ // IMPORTANT: type nees to match with actual definition for Seconds
79
+ return type(uint40).max;
80
+ }
81
+ }
@@ -1,5 +1,5 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
- pragma solidity ^0.8.19;
2
+ pragma solidity ^0.8.20;
3
3
 
4
4
  // uint96 allows for chain ids up to 13 digits
5
5
  type StateId is uint8;
@@ -14,6 +14,23 @@ using {
14
14
  } for StateId global;
15
15
 
16
16
  // general pure free functions
17
+
18
+ function INITIAL() pure returns (StateId) {
19
+ return toStateId(1);
20
+ }
21
+
22
+ function SCHEDULED() pure returns (StateId) {
23
+ return toStateId(2);
24
+ }
25
+
26
+ function DEPLOYING() pure returns (StateId) {
27
+ return toStateId(3);
28
+ }
29
+
30
+ function ACTIVE() pure returns (StateId) {
31
+ return toStateId(4);
32
+ }
33
+
17
34
  function APPLIED() pure returns (StateId) {
18
35
  return toStateId(10);
19
36
  }
@@ -26,20 +43,32 @@ function DECLINED() pure returns (StateId) {
26
43
  return toStateId(30);
27
44
  }
28
45
 
29
- function UNDERWRITTEN() pure returns (StateId) {
46
+ function COLLATERALIZED() pure returns (StateId) {
30
47
  return toStateId(40);
31
48
  }
32
49
 
33
- function CONFIRMED() pure returns (StateId) {
50
+ function SUBMITTED() pure returns (StateId) {
34
51
  return toStateId(50);
35
52
  }
36
53
 
54
+ function CONFIRMED() pure returns (StateId) {
55
+ return toStateId(51);
56
+ }
57
+
37
58
  function EXPECTED() pure returns (StateId) {
38
59
  return toStateId(60);
39
60
  }
40
61
 
41
- function ACTIVE() pure returns (StateId) {
42
- return toStateId(100);
62
+ function FULFILLED() pure returns (StateId) {
63
+ return toStateId(70);
64
+ }
65
+
66
+ function FAILED() pure returns (StateId) {
67
+ return toStateId(7);
68
+ }
69
+
70
+ function CANCELLED() pure returns (StateId) {
71
+ return toStateId(72);
43
72
  }
44
73
 
45
74
  function PAUSED() pure returns (StateId) {
@@ -58,11 +87,16 @@ function PAID() pure returns (StateId) {
58
87
  return toStateId(220);
59
88
  }
60
89
 
90
+ function KEEP_STATE() pure returns (StateId) {
91
+ return toStateId(type(uint8).max);
92
+ }
93
+
61
94
  /// @dev Converts the uint8 to a StateId.
62
95
  function toStateId(uint256 id) pure returns (StateId) {
63
96
  return StateId.wrap(uint8(id));
64
97
  }
65
98
 
99
+ // TODO move to StateIdLib and rename to zero()
66
100
  /// @dev Return the StateId zero (0)
67
101
  function zeroStateId() pure returns (StateId) {
68
102
  return StateId.wrap(0);
@@ -1,5 +1,7 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
- pragma solidity ^0.8.19;
2
+ pragma solidity ^0.8.20;
3
+
4
+ import {Seconds} from "./Seconds.sol";
3
5
 
4
6
  type Timestamp is uint40;
5
7
 
@@ -12,7 +14,8 @@ using {
12
14
  neTimestamp as !=,
13
15
  TimestampLib.gtz,
14
16
  TimestampLib.eqz,
15
- TimestampLib.addSeconds
17
+ TimestampLib.addSeconds,
18
+ TimestampLib.toInt
16
19
  } for Timestamp global;
17
20
 
18
21
  /// @dev return true if Timestamp a is after Timestamp b
@@ -50,16 +53,26 @@ function toTimestamp(uint256 timestamp) pure returns (Timestamp) {
50
53
  return Timestamp.wrap(uint40(timestamp));
51
54
  }
52
55
 
53
- function blockTimestamp() view returns (Timestamp) {
54
- return toTimestamp(block.timestamp);
55
- }
56
-
56
+ // TODO move to TimestampLib and rename to zero()
57
57
  /// @dev Return the Timestamp zero (0)
58
58
  function zeroTimestamp() pure returns (Timestamp) {
59
- return toTimestamp(0);
59
+ return Timestamp.wrap(0);
60
60
  }
61
61
 
62
62
  library TimestampLib {
63
+
64
+ function zero() public pure returns (Timestamp) {
65
+ return Timestamp.wrap(0);
66
+ }
67
+
68
+ function max() public pure returns (Timestamp) {
69
+ return Timestamp.wrap(type(uint40).max);
70
+ }
71
+
72
+ function blockTimestamp() public view returns (Timestamp) {
73
+ return Timestamp.wrap(uint40(block.timestamp));
74
+ }
75
+
63
76
  /// @dev return true if Timestamp a is after Timestamp b
64
77
  function gt(Timestamp a, Timestamp b) public pure returns (bool isAfter) {
65
78
  return gtTimestamp(a, b);
@@ -99,22 +112,22 @@ library TimestampLib {
99
112
  return neTimestamp(a, b);
100
113
  }
101
114
 
102
- /// @dev return true if Timestamp is larger than 0
103
- function gtz(Timestamp timestamp) public pure returns (bool) {
104
- return Timestamp.unwrap(timestamp) > 0;
105
- }
106
-
107
115
  /// @dev return true if Timestamp equals 0
108
116
  function eqz(Timestamp timestamp) public pure returns (bool) {
109
117
  return Timestamp.unwrap(timestamp) == 0;
110
118
  }
111
119
 
120
+ /// @dev return true if Timestamp is larger than 0
121
+ function gtz(Timestamp timestamp) public pure returns (bool) {
122
+ return Timestamp.unwrap(timestamp) > 0;
123
+ }
124
+
112
125
  /// @dev return true if Timestamp a is not equal to Timestamp b
113
126
  function addSeconds(
114
127
  Timestamp timestamp,
115
- uint256 timeDelta
128
+ Seconds duration
116
129
  ) public pure returns (Timestamp) {
117
- return toTimestamp(Timestamp.unwrap(timestamp) + uint40(timeDelta));
130
+ return toTimestamp(Timestamp.unwrap(timestamp) + duration.toInt());
118
131
  }
119
132
 
120
133
  function toInt(Timestamp timestamp) public pure returns (uint256) {
@@ -1,7 +1,5 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
- pragma solidity ^0.8.19;
3
-
4
- import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
2
+ pragma solidity ^0.8.20;
5
3
 
6
4
  /// @dev UFixed is a fixed point number with 18 decimals precision.
7
5
  type UFixed is uint256;
@@ -16,9 +14,16 @@ using {
16
14
  ltUFixed as <,
17
15
  lteUFixed as <=,
18
16
  eqUFixed as ==,
19
- UFixedMathLib.toInt
17
+ neUFixed as !=,
18
+ UFixedLib.toInt,
19
+ UFixedLib.gtz
20
20
  } for UFixed global;
21
21
 
22
+ // TODO move to UFixedLib and rename to zero()
23
+ function zeroUFixed() pure returns (UFixed zero) {
24
+ return UFixed.wrap(0);
25
+ }
26
+
22
27
  function addUFixed(UFixed a, UFixed b) pure returns (UFixed) {
23
28
  return UFixed.wrap(UFixed.unwrap(a) + UFixed.unwrap(b));
24
29
  }
@@ -30,14 +35,14 @@ function subUFixed(UFixed a, UFixed b) pure returns (UFixed) {
30
35
 
31
36
  function mulUFixed(UFixed a, UFixed b) pure returns (UFixed) {
32
37
  return
33
- UFixed.wrap(Math.mulDiv(UFixed.unwrap(a), UFixed.unwrap(b), 10 ** 18));
38
+ UFixed.wrap(MathLib.mulDiv(UFixed.unwrap(a), UFixed.unwrap(b), 10 ** 18));
34
39
  }
35
40
 
36
41
  function divUFixed(UFixed a, UFixed b) pure returns (UFixed) {
37
42
  require(UFixed.unwrap(b) > 0, "ERROR:UFM-020:DIVISOR_ZERO");
38
43
 
39
44
  return
40
- UFixed.wrap(Math.mulDiv(UFixed.unwrap(a), 10 ** 18, UFixed.unwrap(b)));
45
+ UFixed.wrap(MathLib.mulDiv(UFixed.unwrap(a), 10 ** 18, UFixed.unwrap(b)));
41
46
  }
42
47
 
43
48
  function gtUFixed(UFixed a, UFixed b) pure returns (bool isGreaterThan) {
@@ -60,6 +65,10 @@ function eqUFixed(UFixed a, UFixed b) pure returns (bool isEqual) {
60
65
  return UFixed.unwrap(a) == UFixed.unwrap(b);
61
66
  }
62
67
 
68
+ function neUFixed(UFixed a, UFixed b) pure returns (bool isEqual) {
69
+ return UFixed.unwrap(a) != UFixed.unwrap(b);
70
+ }
71
+
63
72
  function gtzUFixed(UFixed a) pure returns (bool isZero) {
64
73
  return UFixed.unwrap(a) > 0;
65
74
  }
@@ -76,7 +85,115 @@ function deltaUFixed(UFixed a, UFixed b) pure returns (UFixed) {
76
85
  return b - a;
77
86
  }
78
87
 
79
- library UFixedMathLib {
88
+ /// @dev copied from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.3/contracts/utils/math/Math.sol
89
+ library MathLib {
90
+
91
+ enum Rounding {
92
+ Down, // Toward negative infinity
93
+ Up, // Toward infinity
94
+ Zero // Toward zero
95
+ }
96
+
97
+ /**
98
+ * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
99
+ * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
100
+ * with further edits by Uniswap Labs also under MIT license.
101
+ */
102
+ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
103
+ unchecked {
104
+ // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
105
+ // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
106
+ // variables such that product = prod1 * 2^256 + prod0.
107
+ uint256 prod0; // Least significant 256 bits of the product
108
+ uint256 prod1; // Most significant 256 bits of the product
109
+ assembly {
110
+ let mm := mulmod(x, y, not(0))
111
+ prod0 := mul(x, y)
112
+ prod1 := sub(sub(mm, prod0), lt(mm, prod0))
113
+ }
114
+
115
+ // Handle non-overflow cases, 256 by 256 division.
116
+ if (prod1 == 0) {
117
+ // Solidity will revert if denominator == 0, unlike the div opcode on its own.
118
+ // The surrounding unchecked block does not change this fact.
119
+ // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
120
+ return prod0 / denominator;
121
+ }
122
+
123
+ // Make sure the result is less than 2^256. Also prevents denominator == 0.
124
+ require(denominator > prod1, "Math: mulDiv overflow");
125
+
126
+ ///////////////////////////////////////////////
127
+ // 512 by 256 division.
128
+ ///////////////////////////////////////////////
129
+
130
+ // Make division exact by subtracting the remainder from [prod1 prod0].
131
+ uint256 remainder;
132
+ assembly {
133
+ // Compute remainder using mulmod.
134
+ remainder := mulmod(x, y, denominator)
135
+
136
+ // Subtract 256 bit number from 512 bit number.
137
+ prod1 := sub(prod1, gt(remainder, prod0))
138
+ prod0 := sub(prod0, remainder)
139
+ }
140
+
141
+ // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
142
+ // See https://cs.stackexchange.com/q/138556/92363.
143
+
144
+ // Does not overflow because the denominator cannot be zero at this stage in the function.
145
+ uint256 twos = denominator & (~denominator + 1);
146
+ assembly {
147
+ // Divide denominator by twos.
148
+ denominator := div(denominator, twos)
149
+
150
+ // Divide [prod1 prod0] by twos.
151
+ prod0 := div(prod0, twos)
152
+
153
+ // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
154
+ twos := add(div(sub(0, twos), twos), 1)
155
+ }
156
+
157
+ // Shift in bits from prod1 into prod0.
158
+ prod0 |= prod1 * twos;
159
+
160
+ // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
161
+ // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
162
+ // four bits. That is, denominator * inv = 1 mod 2^4.
163
+ uint256 inverse = (3 * denominator) ^ 2;
164
+
165
+ // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
166
+ // in modular arithmetic, doubling the correct bits in each step.
167
+ inverse *= 2 - denominator * inverse; // inverse mod 2^8
168
+ inverse *= 2 - denominator * inverse; // inverse mod 2^16
169
+ inverse *= 2 - denominator * inverse; // inverse mod 2^32
170
+ inverse *= 2 - denominator * inverse; // inverse mod 2^64
171
+ inverse *= 2 - denominator * inverse; // inverse mod 2^128
172
+ inverse *= 2 - denominator * inverse; // inverse mod 2^256
173
+
174
+ // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
175
+ // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
176
+ // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
177
+ // is no longer required.
178
+ result = prod0 * inverse;
179
+ return result;
180
+ }
181
+ }
182
+
183
+ /**
184
+ * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
185
+ */
186
+ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
187
+ uint256 result = mulDiv(x, y, denominator);
188
+ if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
189
+ result += 1;
190
+ }
191
+ return result;
192
+ }
193
+
194
+ }
195
+
196
+ library UFixedLib {
80
197
  int8 public constant EXP = 18;
81
198
  uint256 public constant MULTIPLIER = 10 ** uint256(int256(EXP));
82
199
  uint256 public constant MULTIPLIER_HALF = MULTIPLIER / 2;
@@ -123,23 +240,23 @@ library UFixedMathLib {
123
240
  function toIntWithRounding(UFixed a, uint8 rounding) public pure returns (uint256) {
124
241
  if (rounding == ROUNDING_HALF_UP()) {
125
242
  return
126
- Math.mulDiv(
243
+ MathLib.mulDiv(
127
244
  UFixed.unwrap(a) + MULTIPLIER_HALF,
128
245
  1,
129
246
  MULTIPLIER,
130
- Math.Rounding.Down
247
+ MathLib.Rounding.Down
131
248
  );
132
249
  } else if (rounding == ROUNDING_DOWN()) {
133
250
  return
134
- Math.mulDiv(
251
+ MathLib.mulDiv(
135
252
  UFixed.unwrap(a),
136
253
  1,
137
254
  MULTIPLIER,
138
- Math.Rounding.Down
255
+ MathLib.Rounding.Down
139
256
  );
140
257
  } else {
141
258
  return
142
- Math.mulDiv(UFixed.unwrap(a), 1, MULTIPLIER, Math.Rounding.Up);
259
+ MathLib.mulDiv(UFixed.unwrap(a), 1, MULTIPLIER, MathLib.Rounding.Up);
143
260
  }
144
261
  }
145
262
 
@@ -1,20 +1,23 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
- pragma solidity ^0.8.19;
2
+ pragma solidity ^0.8.20;
3
3
 
4
4
  type VersionPart is uint8;
5
5
 
6
6
  using {
7
7
  versionPartGt as >,
8
8
  versionPartEq as ==,
9
+ versionPartNe as !=,
9
10
  VersionPartLib.toInt
10
11
  }
11
12
  for VersionPart global;
12
13
 
13
14
  function versionPartGt(VersionPart a, VersionPart b) pure returns(bool isGreaterThan) { return VersionPart.unwrap(a) > VersionPart.unwrap(b); }
14
15
  function versionPartEq(VersionPart a, VersionPart b) pure returns(bool isSame) { return VersionPart.unwrap(a) == VersionPart.unwrap(b); }
16
+ function versionPartNe(VersionPart a, VersionPart b) pure returns(bool isSame) { return VersionPart.unwrap(a) != VersionPart.unwrap(b); }
15
17
 
16
18
  library VersionPartLib {
17
- function toInt(VersionPart x) external pure returns(uint) { return VersionPart.unwrap(x); }
19
+ function toInt(VersionPart a) external pure returns(uint) { return VersionPart.unwrap(a); }
20
+ function toVersionPart(uint256 a) external pure returns(VersionPart) { return VersionPart.wrap(uint8(a)); }
18
21
  }
19
22
 
20
23
  type Version is uint24; // contains major,minor,patch version parts
@@ -23,6 +26,7 @@ using {
23
26
  versionGt as >,
24
27
  versionEq as ==,
25
28
  VersionLib.toInt,
29
+ VersionLib.toUint64,
26
30
  VersionLib.toMajorPart,
27
31
  VersionLib.toVersionParts
28
32
  }
@@ -34,6 +38,8 @@ function versionEq(Version a, Version b) pure returns(bool isSame) { return Vers
34
38
  library VersionLib {
35
39
  function toInt(Version version) external pure returns(uint) { return Version.unwrap(version); }
36
40
 
41
+ function toUint64(Version version) external pure returns(uint64) { return Version.unwrap(version); }
42
+
37
43
  function toMajorPart(Version version)
38
44
  external
39
45
  pure
@@ -89,6 +95,13 @@ library VersionLib {
89
95
  (major << 16) + (minor << 8) + patch));
90
96
  }
91
97
 
98
+ // TODO check for overflow?
99
+ function toVersion(uint64 versionNumber) external pure returns(Version) {
100
+ //assert(versionNumber <= type(Version).max);
101
+ return Version.wrap(uint24(versionNumber));
102
+ }
103
+
104
+ // TODO rename to zero()
92
105
  function zeroVersion() external pure returns(Version) {
93
106
  return Version.wrap(0);
94
107
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etherisc/gif-next",
3
- "version": "0.0.2-c336201-668",
3
+ "version": "0.0.2-c37bcc5-708",
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": {
@@ -30,10 +30,11 @@
30
30
  "homepage": "https://github.com/etherisc/gif-next#readme",
31
31
  "devDependencies": {
32
32
  "@nomicfoundation/hardhat-foundry": "^1.1.1",
33
- "@nomicfoundation/hardhat-toolbox": "^3.0.0",
34
- "@nomicfoundation/hardhat-verify": "^1.1.1",
35
- "@typescript-eslint/eslint-plugin": "^6.7.2",
36
- "@typescript-eslint/parser": "^6.7.2",
33
+ "@nomicfoundation/hardhat-ignition-ethers": "^0.15.4",
34
+ "@nomicfoundation/hardhat-toolbox": "^5.0.0",
35
+ "@nomicfoundation/hardhat-verify": "^2.0.1",
36
+ "@typescript-eslint/eslint-plugin": "^7.1.0",
37
+ "@typescript-eslint/parser": "^7.1.0",
37
38
  "dotenv": "^16.3.1",
38
39
  "eslint": "^8.50.0",
39
40
  "hardhat": "^2.17.2",
@@ -42,10 +43,11 @@
42
43
  "typescript": "^5"
43
44
  },
44
45
  "dependencies": {
45
- "@openzeppelin/contracts": "^4.9.3",
46
- "@openzeppelin/contracts-upgradeable": "^4.9.3",
46
+ "@openzeppelin/contracts": "5.0.0",
47
+ "@openzeppelin/contracts-upgradeable": "5.0.0",
47
48
  "abi-coder": "^5.0.0",
48
49
  "ethers": "^6.7.1",
50
+ "solidity-docgen": "^0.6.0-beta.36",
49
51
  "winston": "^3.10.0"
50
52
  }
51
53
  }
@@ -1,4 +0,0 @@
1
- {
2
- "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/ac8b1a0ba35c3a8a508882d70043ad3f.json"
4
- }