@etherisc/gif-next 0.0.2-00080dc-272

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 (441) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +495 -0
  3. package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +4 -0
  4. package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +1416 -0
  5. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +4 -0
  6. package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +1378 -0
  7. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +4 -0
  8. package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +826 -0
  9. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +4 -0
  10. package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +975 -0
  11. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +4 -0
  12. package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +827 -0
  13. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +4 -0
  14. package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +709 -0
  15. package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +4 -0
  16. package/artifacts/contracts/instance/IInstance.sol/IInstance.json +665 -0
  17. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +4 -0
  18. package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +769 -0
  19. package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +4 -0
  20. package/artifacts/contracts/instance/Instance.sol/Instance.json +965 -0
  21. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
  22. package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +708 -0
  23. package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +4 -0
  24. package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +228 -0
  25. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +4 -0
  26. package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +1701 -0
  27. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +4 -0
  28. package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +1220 -0
  29. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +4 -0
  30. package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +758 -0
  31. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +4 -0
  32. package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +3597 -0
  33. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +4 -0
  34. package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +318 -0
  35. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +4 -0
  36. package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.json +137 -0
  37. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +4 -0
  38. package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +10 -0
  39. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +4 -0
  40. package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +182 -0
  41. package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +4 -0
  42. package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +187 -0
  43. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +4 -0
  44. package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +129 -0
  45. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +4 -0
  46. package/artifacts/contracts/instance/module/IBundle.sol/IBundle.json +10 -0
  47. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +4 -0
  48. package/artifacts/contracts/instance/module/IComponents.sol/IComponents.json +10 -0
  49. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +4 -0
  50. package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.json +10 -0
  51. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +4 -0
  52. package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.json +10 -0
  53. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +4 -0
  54. package/artifacts/contracts/instance/module/IRisk.sol/IRisk.json +10 -0
  55. package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +4 -0
  56. package/artifacts/contracts/mock/Dip.sol/Dip.json +376 -0
  57. package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +4 -0
  58. package/artifacts/contracts/oracle/IOracle.sol/IOracle.json +10 -0
  59. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +4 -0
  60. package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +759 -0
  61. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +4 -0
  62. package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +675 -0
  63. package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +4 -0
  64. package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +1146 -0
  65. package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +4 -0
  66. package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +1034 -0
  67. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +4 -0
  68. package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +730 -0
  69. package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +4 -0
  70. package/artifacts/contracts/pool/BundleService.sol/BundleService.json +1134 -0
  71. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +4 -0
  72. package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +754 -0
  73. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +4 -0
  74. package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +703 -0
  75. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +4 -0
  76. package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +1154 -0
  77. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +4 -0
  78. package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +1078 -0
  79. package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +4 -0
  80. package/artifacts/contracts/pool/Pool.sol/Pool.json +1565 -0
  81. package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +4 -0
  82. package/artifacts/contracts/pool/PoolService.sol/PoolService.json +1453 -0
  83. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +4 -0
  84. package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +742 -0
  85. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +4 -0
  86. package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +863 -0
  87. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
  88. package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +730 -0
  89. package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +4 -0
  90. package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +1315 -0
  91. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
  92. package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +822 -0
  93. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +4 -0
  94. package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +512 -0
  95. package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +4 -0
  96. package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +772 -0
  97. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +4 -0
  98. package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +720 -0
  99. package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +4 -0
  100. package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +549 -0
  101. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +4 -0
  102. package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +995 -0
  103. package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +4 -0
  104. package/artifacts/contracts/product/IProductService.sol/IProductService.json +400 -0
  105. package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +4 -0
  106. package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +1183 -0
  107. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +4 -0
  108. package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +766 -0
  109. package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +4 -0
  110. package/artifacts/contracts/product/PricingService.sol/PricingService.json +1012 -0
  111. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +4 -0
  112. package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +786 -0
  113. package/artifacts/contracts/product/Product.sol/Product.dbg.json +4 -0
  114. package/artifacts/contracts/product/Product.sol/Product.json +1397 -0
  115. package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +4 -0
  116. package/artifacts/contracts/product/ProductService.sol/ProductService.json +708 -0
  117. package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +4 -0
  118. package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +702 -0
  119. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +4 -0
  120. package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +784 -0
  121. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +4 -0
  122. package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +906 -0
  123. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +4 -0
  124. package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +1123 -0
  125. package/artifacts/contracts/registry/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
  126. package/artifacts/contracts/registry/IServiceAuthorization.sol/IServiceAuthorization.json +148 -0
  127. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +4 -0
  128. package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +52 -0
  129. package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +4 -0
  130. package/artifacts/contracts/registry/Registry.sol/Registry.json +1230 -0
  131. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +4 -0
  132. package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +1901 -0
  133. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +4 -0
  134. package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +1452 -0
  135. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +4 -0
  136. package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +721 -0
  137. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +4 -0
  138. package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +187 -0
  139. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +4 -0
  140. package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +1234 -0
  141. package/artifacts/contracts/registry/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
  142. package/artifacts/contracts/registry/ServiceAuthorization.sol/ServiceAuthorization.json +190 -0
  143. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
  144. package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +206 -0
  145. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +4 -0
  146. package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +661 -0
  147. package/artifacts/contracts/shared/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
  148. package/artifacts/contracts/shared/AccessAdmin.sol/AccessAdmin.json +1559 -0
  149. package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.dbg.json +4 -0
  150. package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.json +1193 -0
  151. package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.dbg.json +4 -0
  152. package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.json +1747 -0
  153. package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.dbg.json +4 -0
  154. package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.json +1760 -0
  155. package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.dbg.json +4 -0
  156. package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.json +1838 -0
  157. package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.dbg.json +4 -0
  158. package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.json +1856 -0
  159. package/artifacts/contracts/shared/Component.sol/Component.dbg.json +4 -0
  160. package/artifacts/contracts/shared/Component.sol/Component.json +896 -0
  161. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +4 -0
  162. package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +1511 -0
  163. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +4 -0
  164. package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +796 -0
  165. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +4 -0
  166. package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +539 -0
  167. package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +4 -0
  168. package/artifacts/contracts/shared/ERC165.sol/ERC165.json +73 -0
  169. package/artifacts/contracts/shared/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
  170. package/artifacts/contracts/shared/IAccessAdmin.sol/IAccessAdmin.json +1189 -0
  171. package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.dbg.json +4 -0
  172. package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.json +1562 -0
  173. package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.dbg.json +4 -0
  174. package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.json +1600 -0
  175. package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +4 -0
  176. package/artifacts/contracts/shared/IComponent.sol/IComponent.json +631 -0
  177. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +4 -0
  178. package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +880 -0
  179. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +4 -0
  180. package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +705 -0
  181. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +4 -0
  182. package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +474 -0
  183. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +4 -0
  184. package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +110 -0
  185. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +4 -0
  186. package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +131 -0
  187. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
  188. package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +207 -0
  189. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +4 -0
  190. package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +181 -0
  191. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
  192. package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.json +35 -0
  193. package/artifacts/contracts/shared/IService.sol/IService.dbg.json +4 -0
  194. package/artifacts/contracts/shared/IService.sol/IService.json +346 -0
  195. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +4 -0
  196. package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +55 -0
  197. package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +4 -0
  198. package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +39 -0
  199. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +4 -0
  200. package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +1036 -0
  201. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +4 -0
  202. package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +570 -0
  203. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +4 -0
  204. package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +156 -0
  205. package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.dbg.json +4 -0
  206. package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +306 -0
  207. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +4 -0
  208. package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +244 -0
  209. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
  210. package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +320 -0
  211. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +4 -0
  212. package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +617 -0
  213. package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +4 -0
  214. package/artifacts/contracts/shared/Registerable.sol/Registerable.json +353 -0
  215. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
  216. package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +71 -0
  217. package/artifacts/contracts/shared/Service.sol/Service.dbg.json +4 -0
  218. package/artifacts/contracts/shared/Service.sol/Service.json +507 -0
  219. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +4 -0
  220. package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +150 -0
  221. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
  222. package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +129 -0
  223. package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +4 -0
  224. package/artifacts/contracts/shared/Versionable.sol/Versionable.json +78 -0
  225. package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +4 -0
  226. package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1438 -0
  227. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +4 -0
  228. package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +1035 -0
  229. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +4 -0
  230. package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +460 -0
  231. package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +4 -0
  232. package/artifacts/contracts/staking/Staking.sol/Staking.json +2005 -0
  233. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +4 -0
  234. package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +187 -0
  235. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +4 -0
  236. package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +761 -0
  237. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +4 -0
  238. package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +592 -0
  239. package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +4 -0
  240. package/artifacts/contracts/staking/StakingService.sol/StakingService.json +1343 -0
  241. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +4 -0
  242. package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +718 -0
  243. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +4 -0
  244. package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2260 -0
  245. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +4 -0
  246. package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +571 -0
  247. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +4 -0
  248. package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.json +10 -0
  249. package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +4 -0
  250. package/artifacts/contracts/type/Amount.sol/AmountLib.json +345 -0
  251. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +4 -0
  252. package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +225 -0
  253. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +4 -0
  254. package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +179 -0
  255. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +4 -0
  256. package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +104 -0
  257. package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +4 -0
  258. package/artifacts/contracts/type/Fee.sol/FeeLib.json +312 -0
  259. package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +4 -0
  260. package/artifacts/contracts/type/Key32.sol/Key32Lib.json +125 -0
  261. package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +4 -0
  262. package/artifacts/contracts/type/NftId.sol/NftIdLib.json +209 -0
  263. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +4 -0
  264. package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +33 -0
  265. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +4 -0
  266. package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +186 -0
  267. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +4 -0
  268. package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +209 -0
  269. package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +4 -0
  270. package/artifacts/contracts/type/Referral.sol/ReferralLib.json +142 -0
  271. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +4 -0
  272. package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +204 -0
  273. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +4 -0
  274. package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +86 -0
  275. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +4 -0
  276. package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +266 -0
  277. package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +4 -0
  278. package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +198 -0
  279. package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +4 -0
  280. package/artifacts/contracts/type/Selector.sol/SelectorLib.json +129 -0
  281. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +4 -0
  282. package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +10 -0
  283. package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +4 -0
  284. package/artifacts/contracts/type/StateId.sol/StateIdLib.json +92 -0
  285. package/artifacts/contracts/type/String.sol/StrLib.dbg.json +4 -0
  286. package/artifacts/contracts/type/String.sol/StrLib.json +132 -0
  287. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +4 -0
  288. package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +293 -0
  289. package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +4 -0
  290. package/artifacts/contracts/type/UFixed.sol/MathLib.json +10 -0
  291. package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +4 -0
  292. package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +479 -0
  293. package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +4 -0
  294. package/artifacts/contracts/type/Version.sol/VersionLib.json +177 -0
  295. package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +4 -0
  296. package/artifacts/contracts/type/Version.sol/VersionPartLib.json +49 -0
  297. package/contracts/distribution/Distribution.sol +261 -0
  298. package/contracts/distribution/DistributionService.sol +297 -0
  299. package/contracts/distribution/DistributionServiceManager.sol +42 -0
  300. package/contracts/distribution/IDistributionComponent.sol +66 -0
  301. package/contracts/distribution/IDistributionService.sol +81 -0
  302. package/contracts/instance/BundleManager.sol +126 -0
  303. package/contracts/instance/IInstance.sol +87 -0
  304. package/contracts/instance/IInstanceService.sol +97 -0
  305. package/contracts/instance/Instance.sol +263 -0
  306. package/contracts/instance/InstanceAdmin.sol +331 -0
  307. package/contracts/instance/InstanceAuthorizationsLib.sol +377 -0
  308. package/contracts/instance/InstanceReader.sol +392 -0
  309. package/contracts/instance/InstanceService.sol +439 -0
  310. package/contracts/instance/InstanceServiceManager.sol +44 -0
  311. package/contracts/instance/InstanceStore.sol +272 -0
  312. package/contracts/instance/base/BalanceStore.sol +123 -0
  313. package/contracts/instance/base/Cloneable.sol +28 -0
  314. package/contracts/instance/base/ObjectCounter.sol +21 -0
  315. package/contracts/instance/base/ObjectLifecycle.sol +96 -0
  316. package/contracts/instance/base/ObjectManager.sol +80 -0
  317. package/contracts/instance/module/IAccess.sol +46 -0
  318. package/contracts/instance/module/IBundle.sol +20 -0
  319. package/contracts/instance/module/IComponents.sol +52 -0
  320. package/contracts/instance/module/IDistribution.sol +42 -0
  321. package/contracts/instance/module/IPolicy.sol +84 -0
  322. package/contracts/instance/module/IRisk.sol +11 -0
  323. package/contracts/mock/Dip.sol +26 -0
  324. package/contracts/oracle/IOracle.sol +20 -0
  325. package/contracts/oracle/IOracleComponent.sol +32 -0
  326. package/contracts/oracle/IOracleService.sol +65 -0
  327. package/contracts/oracle/Oracle.sol +145 -0
  328. package/contracts/oracle/OracleService.sol +278 -0
  329. package/contracts/oracle/OracleServiceManager.sol +42 -0
  330. package/contracts/pool/BundleService.sol +296 -0
  331. package/contracts/pool/BundleServiceManager.sol +42 -0
  332. package/contracts/pool/IBundleService.sol +106 -0
  333. package/contracts/pool/IPoolComponent.sol +112 -0
  334. package/contracts/pool/IPoolService.sol +150 -0
  335. package/contracts/pool/Pool.sol +299 -0
  336. package/contracts/pool/PoolService.sol +452 -0
  337. package/contracts/pool/PoolServiceManager.sol +42 -0
  338. package/contracts/product/ApplicationService.sol +254 -0
  339. package/contracts/product/ApplicationServiceManager.sol +38 -0
  340. package/contracts/product/ClaimService.sol +442 -0
  341. package/contracts/product/ClaimServiceManager.sol +38 -0
  342. package/contracts/product/IApplicationService.sol +62 -0
  343. package/contracts/product/IClaimService.sol +99 -0
  344. package/contracts/product/IPolicyService.sol +78 -0
  345. package/contracts/product/IPricingService.sol +39 -0
  346. package/contracts/product/IProductComponent.sol +42 -0
  347. package/contracts/product/IProductService.sol +33 -0
  348. package/contracts/product/PolicyService.sol +475 -0
  349. package/contracts/product/PolicyServiceManager.sol +42 -0
  350. package/contracts/product/PricingService.sol +300 -0
  351. package/contracts/product/PricingServiceManager.sol +42 -0
  352. package/contracts/product/Product.sol +377 -0
  353. package/contracts/product/ProductService.sol +124 -0
  354. package/contracts/product/ProductServiceManager.sol +42 -0
  355. package/contracts/registry/ChainNft.sol +217 -0
  356. package/contracts/registry/IRegistry.sol +124 -0
  357. package/contracts/registry/IRegistryService.sol +69 -0
  358. package/contracts/registry/IServiceAuthorization.sol +38 -0
  359. package/contracts/registry/ITransferInterceptor.sol +7 -0
  360. package/contracts/registry/Registry.sol +582 -0
  361. package/contracts/registry/RegistryAdmin.sol +333 -0
  362. package/contracts/registry/RegistryService.sol +266 -0
  363. package/contracts/registry/RegistryServiceManager.sol +53 -0
  364. package/contracts/registry/ReleaseLifecycle.sol +28 -0
  365. package/contracts/registry/ReleaseManager.sol +523 -0
  366. package/contracts/registry/ServiceAuthorization.sol +90 -0
  367. package/contracts/registry/ServiceAuthorizationV3.sol +200 -0
  368. package/contracts/registry/TokenRegistry.sol +315 -0
  369. package/contracts/shared/AccessAdmin.sol +759 -0
  370. package/contracts/shared/AccessManagerCustom.sol +741 -0
  371. package/contracts/shared/AccessManagerExtended.sol +481 -0
  372. package/contracts/shared/AccessManagerExtendedInitializeable.sol +13 -0
  373. package/contracts/shared/AccessManagerExtendedWithDisable.sol +137 -0
  374. package/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol +14 -0
  375. package/contracts/shared/Component.sol +281 -0
  376. package/contracts/shared/ComponentService.sol +620 -0
  377. package/contracts/shared/ComponentServiceManager.sol +35 -0
  378. package/contracts/shared/ComponentVerifyingService.sol +117 -0
  379. package/contracts/shared/ERC165.sol +27 -0
  380. package/contracts/shared/IAccessAdmin.sol +168 -0
  381. package/contracts/shared/IAccessManagerExtended.sol +74 -0
  382. package/contracts/shared/IAccessManagerExtendedWithDisable.sol +18 -0
  383. package/contracts/shared/IComponent.sol +70 -0
  384. package/contracts/shared/IComponentService.sol +102 -0
  385. package/contracts/shared/IInstanceLinkedComponent.sol +46 -0
  386. package/contracts/shared/IKeyValueStore.sol +54 -0
  387. package/contracts/shared/ILifecycle.sol +29 -0
  388. package/contracts/shared/INftOwnable.sol +23 -0
  389. package/contracts/shared/IPolicyHolder.sol +45 -0
  390. package/contracts/shared/IRegisterable.sol +15 -0
  391. package/contracts/shared/IRegistryLinked.sol +11 -0
  392. package/contracts/shared/IService.sol +25 -0
  393. package/contracts/shared/IVersionable.sol +53 -0
  394. package/contracts/shared/InitializableCustom.sol +177 -0
  395. package/contracts/shared/InstanceLinkedComponent.sol +144 -0
  396. package/contracts/shared/KeyValueStore.sol +131 -0
  397. package/contracts/shared/Lifecycle.sol +71 -0
  398. package/contracts/shared/NftIdSetManager.sol +65 -0
  399. package/contracts/shared/NftOwnable.sol +107 -0
  400. package/contracts/shared/PolicyHolder.sol +102 -0
  401. package/contracts/shared/ProxyManager.sol +199 -0
  402. package/contracts/shared/Registerable.sol +75 -0
  403. package/contracts/shared/RegistryLinked.sol +43 -0
  404. package/contracts/shared/Service.sol +83 -0
  405. package/contracts/shared/TokenHandler.sol +58 -0
  406. package/contracts/shared/UpgradableProxyWithAdmin.sol +16 -0
  407. package/contracts/shared/Versionable.sol +59 -0
  408. package/contracts/staking/IStaking.sol +168 -0
  409. package/contracts/staking/IStakingService.sol +153 -0
  410. package/contracts/staking/StakeManagerLib.sol +231 -0
  411. package/contracts/staking/Staking.sol +513 -0
  412. package/contracts/staking/StakingLifecycle.sol +24 -0
  413. package/contracts/staking/StakingManager.sol +54 -0
  414. package/contracts/staking/StakingReader.sol +187 -0
  415. package/contracts/staking/StakingService.sol +411 -0
  416. package/contracts/staking/StakingServiceManager.sol +44 -0
  417. package/contracts/staking/StakingStore.sol +615 -0
  418. package/contracts/staking/TargetManagerLib.sol +207 -0
  419. package/contracts/type/AddressSet.sol +58 -0
  420. package/contracts/type/Amount.sol +128 -0
  421. package/contracts/type/Blocknumber.sol +136 -0
  422. package/contracts/type/ClaimId.sol +75 -0
  423. package/contracts/type/DistributorType.sol +55 -0
  424. package/contracts/type/Fee.sol +66 -0
  425. package/contracts/type/Key32.sol +50 -0
  426. package/contracts/type/NftId.sol +78 -0
  427. package/contracts/type/NftIdSet.sol +62 -0
  428. package/contracts/type/ObjectType.sol +241 -0
  429. package/contracts/type/PayoutId.sol +82 -0
  430. package/contracts/type/Referral.sol +89 -0
  431. package/contracts/type/RequestId.sol +75 -0
  432. package/contracts/type/RiskId.sol +43 -0
  433. package/contracts/type/RoleId.sol +201 -0
  434. package/contracts/type/Seconds.sol +81 -0
  435. package/contracts/type/Selector.sol +102 -0
  436. package/contracts/type/StateId.sol +135 -0
  437. package/contracts/type/String.sol +53 -0
  438. package/contracts/type/Timestamp.sol +136 -0
  439. package/contracts/type/UFixed.sol +326 -0
  440. package/contracts/type/Version.sol +108 -0
  441. package/package.json +55 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2023 Etherisc Gmbh
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,495 @@
1
+ # GIF-Next (Generic Insurance Framework, next version)
2
+
3
+
4
+ ## Add OpenZeppelin V5 Dependencies
5
+
6
+ ```shell
7
+ forge install openzeppelin-contracts-500=OpenZeppelin/openzeppelin-contracts@v5.0.0
8
+ cd cd lib/openzeppelin-contracts-500
9
+ git checkout tags/v5.0.0
10
+ cd ../..
11
+ ```
12
+
13
+ See `remappings.txt` to see how to work with different OpenZeppelin versions in parallel
14
+
15
+ ```
16
+ cat remappings.txt
17
+ @openzeppelin5/contracts/=lib/openzeppelin-contracts-500/contracts/
18
+ @openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/
19
+ @openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/
20
+ ```
21
+
22
+
23
+ ## Submodules checkout
24
+
25
+ This repository uses submodules. To checkout or update to the latest submodules, run the following command after updating to any revision (or checking out the repository)
26
+
27
+ ```shell
28
+ git submodule update --recursive
29
+ ```
30
+
31
+ ## Example components
32
+
33
+ A (very early) example of a product and a pool can be found in the [gif-next-sandbox repository](https://github.com/etherisc/gif-next-sandbox).
34
+
35
+ ## Hardhat
36
+
37
+ ### NPM Commands
38
+
39
+ ```shell
40
+ npm run build
41
+
42
+ npm run test
43
+ npm run ptest
44
+ npm run test-with-gas
45
+ npm run coverage
46
+ ```
47
+
48
+ ### Docgen
49
+
50
+ Produce `solidty-docgen` documentation using the command below.
51
+
52
+ ```shell
53
+ hh docgen
54
+ ```
55
+
56
+ The resulting markdown files are written to `docs`
57
+
58
+
59
+ ### Full protocol deployment
60
+
61
+ Install the dependencies before running the script below for the first time.
62
+
63
+ ```bash
64
+ npm install
65
+ ```
66
+
67
+ The deploy script will deploy all required contracts and create a test instance with a test product and a test pool.
68
+
69
+ ```bash
70
+ # run deployment on a locally created ganache instance
71
+ hh run scripts/deploy_all.ts
72
+ ```
73
+
74
+ ```bash
75
+ # set appropriate values vor env variables (see below)
76
+
77
+ # run deployment on another network
78
+ hh run --network <networkname> scripts/deploy_all.ts
79
+ ```
80
+
81
+ The deployment will persist deployment information into the files `deployment_state_<chainid>.json`, `libraries_<chainid>.json` and `verification_log_<chainid>.json`.
82
+ This data can then be used for verification of the deployed contracts on etherscan/polygonscan.
83
+
84
+ For the verification of the contracts on etherscan/polygonscan the above files (created by previous deployment) are required and then the following command can be used:
85
+
86
+ ```bash
87
+ hh run --network <networkname> scripts/verify_deployment.ts
88
+ ```
89
+
90
+ Environment variables:
91
+
92
+ - `WEB3_INFURA_PROJECT_ID` set to infura project id (required for mumbai and mainnet)
93
+ - `WALLET_MNEMONIC` the mnemonic of the wallet to use for deployment (required for mumbai and mainnet)
94
+ - `ETHERSCAN_API_KEY` `POLYGONSCAN_API_KEY` the api key for etherscan/polygonscan (required for mumbai and mainnet)
95
+
96
+ ### Create a new instance
97
+
98
+ Requires previous step to be completed.
99
+
100
+ ```bash
101
+ # set appropriate values vor env variables (see below)
102
+
103
+ hh run --network <networkname> scripts/new_instance.ts
104
+ ```
105
+
106
+ Currently an HD wallet is expected to be used for the deployment. The mnemonic of the wallet needs to be provided via the `WALLET_MNEMONIC` environment variable.
107
+ The instance owner will be the 11th address of the wallet.
108
+
109
+ Environment variables:
110
+
111
+ - `WEB3_INFURA_PROJECT_ID` set to infura project id (required for mumbai and mainnet)
112
+ - `WALLET_MNEMONIC` the mnemonic of the wallet to use for deployment (required for mumbai and mainnet)
113
+ - `REGISTRY_ADDRESS` the address of the registry that is already deployed and configured and has a valid master instance
114
+
115
+
116
+ ### Console
117
+
118
+ ```
119
+ hh console --network <networkname>
120
+
121
+ me = hre.ethers.Wallet.fromPhrase('...')
122
+ provider = hre.ethers.provider
123
+ await provider.getBalance(me)
124
+ ```
125
+
126
+
127
+ ### Documentation
128
+
129
+ https://hardhat.org/hardhat-runner/docs/guides/compile-contracts
130
+
131
+ ### ANTLR based checker to find methods that should be restricted but are not
132
+
133
+ ```bash
134
+ hh run scripts/find_unrestricted_methods.ts.ts
135
+ ```
136
+
137
+ The script `find_unrestricted_methods.ts` is based on the ANTLR grammar `Solidity.g4` (from https://github.com/solidity-parser/antlr) and uses the antlr4ng runtime (https://github.com/mike-lischke/antlr4ng).
138
+ To compile grammar to ts classes run `antlr4ng -Dlanguage=TypeScript -o antlr/generated/ -visitor -listener antlr/Solidity.g4` (requires openjdk to be installed `sudo apt install openjdk-17-jre-headless`).
139
+
140
+ ## Forge
141
+
142
+ ### Commands
143
+
144
+ ```shell
145
+ forge build
146
+
147
+ # contract sizes
148
+ forge build --sizes | grep Instance
149
+
150
+ forge test
151
+
152
+ # run single test case
153
+ forge test --mt test_decimals
154
+
155
+ # run single test case with substantial logginglogging
156
+ # to include logs as well use -vvvvv
157
+ forge test -vvvv --mt test_decimals
158
+
159
+ # provide gas report for a single test
160
+ forge test --mt test_decimals --gas-report
161
+
162
+ # provide code coverage report
163
+ forge coverage
164
+ forge coverage --report lcov
165
+
166
+
167
+ ```
168
+
169
+ Chisel session
170
+ ```typescript
171
+ import "./contracts/components/Component.sol";
172
+ import "./contracts/components/IPool.sol";
173
+ import "./contracts/components/IProduct.sol";
174
+ import "./contracts/components/Pool.sol";
175
+ import "./contracts/components/Product.sol";
176
+ import "./contracts/instance/access/Access.sol";
177
+ import "./contracts/instance/access/IAccess.sol";
178
+ import "./contracts/instance/component/ComponentModule.sol";
179
+ import "./contracts/instance/component/IComponent.sol";
180
+ import "./contracts/instance/IInstance.sol";
181
+ import "./contracts/instance/policy/IPolicy.sol";
182
+ import "./contracts/instance/policy/PolicyModule.sol";
183
+ import "./contracts/instance/product/IProductService.sol";
184
+ import "./contracts/instance/product/ProductService.sol";
185
+ import "./contracts/registry/IRegistry.sol";
186
+
187
+ import {Instance} from "./contracts/instance/Instance.sol";
188
+ import {Registry} from "./contracts/registry/Registry.sol";
189
+ import {DeployAll} from "./scripts/DeployAll.s.sol";
190
+ import {TestPool} from "./test_forge/mock/TestPool.sol";
191
+ import {TestProduct} from "./test_forge/mock/TestProduct.sol";
192
+
193
+ string memory instanceOwnerName = "instanceOwner";
194
+ address instanceOwner = vm.addr(uint256(keccak256(abi.encodePacked(instanceOwnerName))));
195
+
196
+ string memory productOwnerName = "productOwner";
197
+ address productOwner = vm.addr(uint256(keccak256(abi.encodePacked(productOwnerName))));
198
+
199
+ string memory poolOwnerName = "poolOwner";
200
+ address poolOwner = vm.addr(uint256(keccak256(abi.encodePacked(poolOwnerName))));
201
+
202
+ string memory customerName = "customer";
203
+ address customer = vm.addr(uint256(keccak256(abi.encodePacked(customerName))));
204
+
205
+ DeployAll deployer = new DeployAll();
206
+ (
207
+ Registry registry,
208
+ Instance instance,
209
+ TestProduct product,
210
+ TestPool pool
211
+ ) = deployer.run(
212
+ instanceOwner,
213
+ productOwner,
214
+ poolOwner);
215
+
216
+ ProductService ps = ProductService(address(registry));
217
+
218
+ uint256 bundleNftId = 99;
219
+ uint256 sumInsuredAmount = 1000*10**6;
220
+ uint256 premiumAmount = 110*10**6;
221
+ uint256 lifetime =365*24*3600;
222
+ uint256 policyNftId = ps.createApplicationForBundle(customer, bundleNftId, sumInsuredAmount, premiumAmount, lifetime);
223
+
224
+ ```
225
+ ### Library Linking
226
+
227
+ https://ethereum.stackexchange.com/questions/153411/does-foundry-support-dynamical-library-linking-in-solidity
228
+
229
+ ```toml
230
+ # foundry.toml
231
+
232
+ [profile.default]
233
+ # expected format(example below): libraries = ["<path>:<lib name>:<address>"]
234
+ libraries = ["src/libraries/MyLibrary.sol:MyLibrary:0x..."]
235
+ ```
236
+
237
+ ### Documentation
238
+
239
+ https://book.getfoundry.sh/reference/
240
+
241
+ ## Style Guide
242
+
243
+ Please see https://docs.etherisc.com/gif-next/3.x/ for style guide and general coding rules.
244
+
245
+ ### Automatic code formatting
246
+
247
+ We use prettier and the solidity plugin to format the code automatically.
248
+ The plugin is configured to use the style guide mentioned above.
249
+ To execute format checks run `npm run styleCheck`.
250
+ To execute formatting run `npm run styleFix`.
251
+
252
+ ### Linting
253
+
254
+ We use solhint to lint the code.
255
+ To execute linting run `npm run lint`.
256
+
257
+
258
+ ### Adding Brownie (Legacy - don't do that :wink: )
259
+
260
+ python3 is already installed
261
+
262
+ ```bash
263
+ npm install -g ganache
264
+ sudo apt update
265
+ sudo apt install python3-pip
266
+ pip install eth-brownie
267
+ brownie pm install OpenZeppelin/openzeppelin-contracts@4.9.3
268
+ brownie pm install OpenZeppelin/openzeppelin-contracts@5.0.0
269
+ ```
270
+
271
+ ```bash
272
+ brownie compile --all
273
+ brownie console
274
+ ```
275
+
276
+ ```python
277
+ registry_owner = accounts[0]
278
+ instance_owner = accounts[1]
279
+ product_owner = accounts[2]
280
+
281
+ # deploy libs and helper contracts
282
+ nft_id_lib = NftIdLib.deploy({'from': registry_owner})
283
+ ufixed_math_lib = UFixedMathLib.deploy({'from': registry_owner})
284
+ test_fee = TestFee.deploy({'from': registry_owner})
285
+
286
+ # deploy registry and a token
287
+ registry = Registry.deploy({'from': registry_owner})
288
+ nft = ChainNft.deploy(registry, {'from': registry_owner})
289
+ registry.initialize(nft, {'from': registry_owner})
290
+ token = TestUsdc.deploy({'from': registry_owner})
291
+
292
+ # deploy services
293
+ component_owner_service = ComponentOwnerService.deploy(registry, {'from': registry_owner})
294
+ product_service = ProductService.deploy(registry, {'from': registry_owner})
295
+
296
+ # deploy an instance
297
+ instance = Instance.deploy(registry, component_owner_service, product_service, {'from': instance_owner})
298
+
299
+ # deploy product
300
+ pool = TestPool.deploy(registry, instance, token, {'from': product_owner})
301
+ policy_fee = test_fee.createFee(1, -1, 0)
302
+ product = TestProduct.deploy(registry, instance, token, pool, policy_fee, {'from': product_owner})
303
+
304
+ # grant roles
305
+ pool_owner_role = instance.getRoleForName("PoolOwner")
306
+ product_owner_role = instance.getRoleForName("ProductOwner")
307
+ instance.grantRole(pool_owner_role, product_owner, {'from': instance_owner})
308
+ instance.grantRole(product_owner_role, product_owner, {'from': instance_owner})
309
+
310
+ # register objects
311
+ instance.register()
312
+ component_owner_service.register(pool, {'from': product_owner})
313
+ component_owner_service.register(product, {'from': product_owner})
314
+
315
+ instance_id = instance.getNftId()
316
+ pool_id = pool.getNftId()
317
+ product_id = product.getNftId()
318
+ ```
319
+
320
+ ## Objects
321
+
322
+ ### Registry
323
+
324
+ Mandatory properties
325
+
326
+ * One registry per chain
327
+ * Global registry: the registry on mainnet
328
+ * One entry per protocol object
329
+ * Once registered object properties are immutable
330
+ * Globally unique NFT minted per protocol object (chain id is embedded in NFT id)
331
+ * Object ownership defined by NFT ownernship
332
+ * Typed objects (instance, product, policy, ...)
333
+ * Each object has parent object (only one exception: protocol object does not have parent object)
334
+ * Parent object type is defined by type of child object
335
+
336
+ Object properties (for smart contracts)
337
+ * Objects that represent a smart contract record its contract address
338
+ * With one exception (see next point) smart contract addresses refer to the address on the same chain as the registry
339
+ * The global registry also holds entries for all the registries on different chains than mainnet, in these cases the addresses refer to the chains of these chain specific registries (this is the only case where registered addresses do not refer to the same chain)
340
+
341
+ Optional properties
342
+
343
+ * Objects can have names
344
+ * Object names are unique per chain
345
+ * Objects may define an intercepting property, in which case a predefined smart contract is involved in NFT transfers of the objects NFT (transfer may trigger actions, transfer may be blocked etc)
346
+ *
347
+
348
+ Ownership property
349
+
350
+ * Object ownership defined by ownership of NFT representing the object
351
+ * Protocol
352
+ * Fixed/predefined owner (address without private key)
353
+ * Registry
354
+ * Allows registration of token and services (per major release)
355
+ * May transfer ownership
356
+ * Token
357
+ * Fixed/predefined owner (address without private key)
358
+ * TODO add whitelisting for token per major release
359
+ * Service
360
+ * Allows upgrades of services as long as major version is same
361
+ * Until further notice the same entity as the registry owner
362
+ * May transfer ownership
363
+ * Instance
364
+ * Granting/revoking of roles (both default + custom)
365
+ * Management of custom roles and targets
366
+ * May lock instance and/or components
367
+ * May transfer ownership
368
+ * Component (Product, Pool, Distribution, Oracle)
369
+ * Register component
370
+ * Set component wallet (which receives fees, holds funds)
371
+ * May lock component
372
+ * May transfer ownership
373
+ * Additional use case specific features
374
+ * Policy
375
+ * Represents policy holder
376
+ * Receive payouts (GIF default behaviour)
377
+ * May transfer ownership
378
+ * Bundle
379
+ * Represents funds owner
380
+ * May withdraw funds not locked by active policies
381
+ * May transfer ownership
382
+ * Distributor
383
+ * Receives commissions from sales (GIF default behaviour)
384
+ * May transfer ownership
385
+
386
+ Intercepting property
387
+ * Service owner is indirectly owner of service manager contract
388
+
389
+ * Instance
390
+ * intercepts transfer of instance owner (new owner needs access manager admin rights for custom roles and targets)
391
+ * intercepts transfer of components, to do what? check that new owner has necessary roles?
392
+ * Product
393
+ * intercepts transfer of policies (use case specific: eg. limit/disallow transfers)
394
+ * Pool:
395
+ * intercepts transfer of bundles (use case specific: eg. limit/disallow transfers)
396
+ * Distribution
397
+ * intercepts transfer of distributors (bookkeeping: only one distributor per address allowed)
398
+ * Oracle
399
+ * likely meaningless
400
+
401
+
402
+ ### Instance
403
+
404
+ ### Product
405
+
406
+ ### Pool
407
+
408
+ ### Distribution
409
+
410
+ ### Oracle
411
+
412
+ ## Registry and Services
413
+
414
+ ### Principles
415
+
416
+ - 1 service per object type and major version
417
+ - registry service guards write access to registry
418
+ - all other objects registered via registry service
419
+ - root object for the complete tree is the protocol object
420
+ - under the root object a single registry object is registered (= global registry/ethereum mainnet)
421
+
422
+
423
+ ### Service Responsibilities
424
+
425
+ Registry Service
426
+
427
+ - deployed and registered during bootstrapping of registry
428
+ - used to register tokens and other services by registry owner
429
+ - an object may only be registered by the service designated by the type of the object
430
+ - to register an object the parent object needs already be registered
431
+ - the type of the object to be registered needs to match a valid child type/parent type combination
432
+
433
+ Instance Service
434
+
435
+ - deploys master instance during its own bootstrapping (if allowed by contract size)
436
+ - registered via registry service by registry owner
437
+ - registeres master instance during its own registration by regsitry owner
438
+ - deploys and registeres new instances (= instance factory) by instance owner (instance owner is a permissionless role, anybody may creates a new instance)
439
+ - provides upgrade functionality to instance owners
440
+
441
+ Product Service
442
+
443
+ - registered via registry service by registry owner
444
+ - registers products for registered instances via registry service by product owner (product owner role is permissend by the product's instance)
445
+ - registers applications/policies for registered products via registry service
446
+
447
+ Distribution Service
448
+
449
+ - registered via registry service by registry owner
450
+ - registers distribution components for registered products via registry service by distribution owner (distribution owner role is permissend by the product's instance)
451
+ - registers distributors for registered distribution components via registry service
452
+
453
+ ## Contract Organisation
454
+
455
+ now
456
+
457
+ contracts
458
+ components
459
+ instance
460
+ registry
461
+ shared
462
+ types
463
+
464
+
465
+ contracts
466
+ component
467
+ pool
468
+ Pool.sol
469
+ PoolService.sol
470
+ oracle
471
+ distribution
472
+ product
473
+ Product.sol
474
+ ProductService.sol
475
+ Component.sol
476
+ ComponentService.sol
477
+ instance
478
+ Instance.sol
479
+ InstanceAdmin.sol
480
+ InstanceReader.sol
481
+ InstanceService.sol
482
+ InstanceServiceManager.sol
483
+ registry
484
+ ChainNft.sol
485
+ Registry.sol
486
+ RegistryAdmin.sol
487
+ RegistryService.sol
488
+ RegistryServiceManager.sol
489
+ shared
490
+ Registerable.sol
491
+ RegisterableUpgradable.sol
492
+ type
493
+ NftId.sol
494
+ ObjectType.sol
495
+
@@ -0,0 +1,4 @@
1
+ {
2
+ "_format": "hh-sol-dbg-1",
3
+ "buildInfo": "../../../build-info/0f06c2950e1562d6947350101a7677fe.json"
4
+ }