@etherisc/gif-next 0.0.2-8e4a894-109 → 0.0.2-8e5f0ee-617
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.
- package/README.md +21 -3
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +1253 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +1206 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +358 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/{instance/module/ISetup.sol/ISetup.json → authorization/IAccess.sol/IAccess.json} +2 -2
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +1032 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +258 -0
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.json +290 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +148 -0
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +390 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +190 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +1505 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +410 -0
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +154 -339
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +158 -320
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +127 -81
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +151 -251
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +67 -64
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +33 -108
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +71 -72
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +188 -47
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +87 -120
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1626 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +601 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +500 -334
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +277 -96
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +120 -42
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +1125 -371
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +4 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +318 -0
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.json +0 -53
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +10 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +182 -0
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +3 -78
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +8 -116
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +4 -0
- package/artifacts/contracts/mock/Dip.sol/Dip.json +376 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +1155 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +418 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.json +52 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +772 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +675 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +1063 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +1034 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +730 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +1477 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +410 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +95 -249
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +115 -57
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +19 -51
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +149 -285
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +136 -135
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +197 -335
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +186 -355
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +102 -68
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +97 -152
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +116 -34
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +1299 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +410 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +135 -196
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +130 -56
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +20 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +30 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +94 -25
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +40 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +253 -148
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductService.sol/IProductService.json +13 -55
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +184 -282
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +113 -87
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +167 -159
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +141 -43
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +296 -237
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +47 -203
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +94 -32
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +135 -29
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +317 -52
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +367 -39
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +1746 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +370 -68
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +99 -35
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +164 -0
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +692 -92
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +214 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +314 -138
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +105 -82
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +901 -45
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +784 -0
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +539 -0
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +2 -2
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +76 -81
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +4 -0
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +880 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +4 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +718 -0
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/{instance/base → shared}/IKeyValueStore.sol/IKeyValueStore.json +12 -16
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +4 -0
- package/artifacts/contracts/{instance/base → shared}/ILifecycle.sol/ILifecycle.json +1 -6
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +7 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +21 -3
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +7 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +20 -1
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +4 -0
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +39 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +4 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +996 -0
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +497 -0
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +4 -0
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +133 -0
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.dbg.json +4 -0
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +306 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +13 -7
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +31 -13
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +64 -16
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +21 -7
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +20 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +40 -4
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +4 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1438 -0
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +566 -54
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +460 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +4 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.json +2005 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +164 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +761 -0
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +592 -0
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +661 -85
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +718 -0
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2237 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +571 -0
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.json +2 -2
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +68 -4
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +53 -2
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +4 -4
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +4 -4
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +34 -34
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +47 -4
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +149 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +4 -4
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +4 -4
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +204 -0
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +4 -4
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +219 -6
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +76 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +129 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +10 -0
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +2 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +4 -0
- package/artifacts/contracts/type/String.sol/StrLib.json +132 -0
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +17 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +2 -2
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +21 -2
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -2
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +2 -2
- package/contracts/authorization/AccessAdmin.sol +591 -0
- package/contracts/authorization/AccessManagerCloneable.sol +16 -0
- package/contracts/authorization/Authorization.sol +218 -0
- package/contracts/authorization/IAccess.sol +48 -0
- package/contracts/authorization/IAccessAdmin.sol +136 -0
- package/contracts/authorization/IAuthorization.sol +54 -0
- package/contracts/authorization/IModuleAuthorization.sol +21 -0
- package/contracts/authorization/IServiceAuthorization.sol +38 -0
- package/contracts/authorization/ModuleAuthorization.sol +78 -0
- package/contracts/authorization/ServiceAuthorization.sol +90 -0
- package/contracts/distribution/BasicDistribution.sol +149 -0
- package/contracts/distribution/BasicDistributionAuthorization.sol +43 -0
- package/contracts/distribution/Distribution.sol +144 -146
- package/contracts/distribution/DistributionService.sol +64 -110
- package/contracts/distribution/DistributionServiceManager.sol +9 -18
- package/contracts/distribution/IDistributionComponent.sol +20 -43
- package/contracts/distribution/IDistributionService.sol +7 -9
- package/contracts/instance/IInstance.sol +21 -12
- package/contracts/instance/IInstanceService.sol +41 -22
- package/contracts/instance/Instance.sol +111 -86
- package/contracts/instance/InstanceAdmin.sol +266 -0
- package/contracts/instance/InstanceAuthorizationV3.sol +202 -0
- package/contracts/instance/InstanceReader.sol +84 -47
- package/contracts/instance/InstanceService.sol +259 -124
- package/contracts/instance/InstanceServiceManager.sol +10 -20
- package/contracts/instance/InstanceStore.sol +131 -66
- package/contracts/instance/base/BalanceStore.sol +123 -0
- package/contracts/instance/base/Cloneable.sol +2 -25
- package/contracts/instance/base/ObjectCounter.sol +21 -0
- package/contracts/instance/base/ObjectLifecycle.sol +106 -0
- package/contracts/instance/base/ObjectManager.sol +7 -10
- package/contracts/instance/module/IAccess.sol +2 -10
- package/contracts/instance/module/IBundle.sol +1 -4
- package/contracts/instance/module/IComponents.sol +15 -4
- package/contracts/instance/module/IPolicy.sol +12 -5
- package/contracts/mock/Dip.sol +26 -0
- package/contracts/oracle/BasicOracle.sol +48 -0
- package/contracts/oracle/BasicOracleAuthorization.sol +46 -0
- package/contracts/oracle/IOracle.sol +36 -0
- package/contracts/oracle/IOracleComponent.sol +32 -0
- package/contracts/oracle/IOracleService.sol +65 -0
- package/contracts/oracle/Oracle.sol +157 -0
- package/contracts/oracle/OracleService.sol +278 -0
- package/contracts/oracle/OracleServiceManager.sol +42 -0
- package/contracts/pool/BasicPool.sol +164 -0
- package/contracts/pool/BasicPoolAuthorization.sol +49 -0
- package/contracts/pool/BundleService.sol +76 -162
- package/contracts/pool/BundleServiceManager.sol +9 -18
- package/contracts/pool/IBundleService.sol +4 -16
- package/contracts/pool/IPoolComponent.sol +4 -66
- package/contracts/pool/IPoolService.sol +45 -9
- package/contracts/pool/Pool.sol +150 -141
- package/contracts/pool/PoolService.sol +198 -149
- package/contracts/pool/PoolServiceManager.sol +9 -18
- package/contracts/product/ApplicationService.sol +114 -46
- package/contracts/product/ApplicationServiceManager.sol +9 -6
- package/contracts/product/BasicProduct.sol +82 -0
- package/contracts/product/BasicProductAuthorization.sol +40 -0
- package/contracts/product/ClaimService.sol +33 -28
- package/contracts/product/ClaimServiceManager.sol +9 -6
- package/contracts/product/IApplicationService.sol +1 -1
- package/contracts/product/IClaimService.sol +12 -3
- package/contracts/product/IPolicyService.sol +6 -8
- package/contracts/product/IPricingService.sol +3 -1
- package/contracts/product/IProductComponent.sol +9 -11
- package/contracts/product/IProductService.sol +1 -8
- package/contracts/product/PolicyService.sol +231 -132
- package/contracts/product/PolicyServiceManager.sol +9 -21
- package/contracts/product/PricingService.sol +78 -53
- package/contracts/product/PricingServiceManager.sol +9 -18
- package/contracts/product/Product.sol +126 -109
- package/contracts/product/ProductService.sol +32 -118
- package/contracts/product/ProductServiceManager.sol +9 -21
- package/contracts/registry/ChainNft.sol +8 -1
- package/contracts/registry/IRegistry.sol +37 -17
- package/contracts/registry/IRegistryService.sol +33 -30
- package/contracts/registry/Registry.sol +193 -82
- package/contracts/registry/RegistryAdmin.sol +365 -0
- package/contracts/registry/RegistryService.sol +63 -82
- package/contracts/registry/RegistryServiceManager.sol +21 -28
- package/contracts/registry/ReleaseLifecycle.sol +27 -0
- package/contracts/registry/ReleaseManager.sol +354 -191
- package/contracts/registry/ServiceAuthorizationV3.sol +200 -0
- package/contracts/registry/TokenRegistry.sol +261 -62
- package/contracts/shared/Component.sol +139 -129
- package/contracts/shared/ComponentService.sol +524 -93
- package/contracts/shared/ComponentServiceManager.sol +35 -0
- package/contracts/shared/ComponentVerifyingService.sol +117 -0
- package/contracts/shared/ERC165.sol +1 -1
- package/contracts/shared/IComponent.sol +17 -37
- package/contracts/shared/IComponentService.sol +102 -0
- package/contracts/shared/IInstanceLinkedComponent.sol +50 -0
- package/contracts/{instance/base → shared}/IKeyValueStore.sol +7 -6
- package/contracts/{instance/base → shared}/ILifecycle.sol +3 -4
- package/contracts/shared/INftOwnable.sol +1 -1
- package/contracts/shared/IPolicyHolder.sol +6 -1
- package/contracts/shared/IService.sol +8 -1
- package/contracts/shared/InitializableCustom.sol +177 -0
- package/contracts/shared/InstanceLinkedComponent.sol +151 -0
- package/contracts/{instance/base → shared}/KeyValueStore.sol +36 -73
- package/contracts/shared/Lifecycle.sol +77 -0
- package/contracts/shared/NftIdSetManager.sol +65 -0
- package/contracts/shared/NftOwnable.sol +2 -13
- package/contracts/shared/PolicyHolder.sol +21 -13
- package/contracts/shared/ProxyManager.sol +31 -1
- package/contracts/shared/Registerable.sol +2 -2
- package/contracts/shared/Service.sol +32 -21
- package/contracts/shared/TokenHandler.sol +24 -1
- package/contracts/staking/IStaking.sol +168 -0
- package/contracts/staking/IStakingService.sol +98 -47
- package/contracts/staking/StakeManagerLib.sol +231 -0
- package/contracts/staking/Staking.sol +513 -0
- package/contracts/staking/StakingLifecycle.sol +23 -0
- package/contracts/staking/StakingManager.sol +54 -0
- package/contracts/staking/StakingReader.sol +187 -0
- package/contracts/staking/StakingService.sol +290 -45
- package/contracts/staking/{StakeingServiceManager.sol → StakingServiceManager.sol} +11 -4
- package/contracts/staking/StakingStore.sol +615 -0
- package/contracts/staking/TargetManagerLib.sol +207 -0
- package/contracts/type/AddressSet.sol +1 -1
- package/contracts/type/Amount.sol +20 -1
- package/contracts/type/Blocknumber.sol +20 -3
- package/contracts/type/Fee.sol +17 -16
- package/contracts/type/NftId.sol +14 -16
- package/contracts/type/NftIdSet.sol +1 -1
- package/contracts/type/ObjectType.sol +176 -63
- package/contracts/type/Referral.sol +1 -1
- package/contracts/type/RequestId.sol +75 -0
- package/contracts/type/RiskId.sol +1 -1
- package/contracts/type/RoleId.sol +117 -40
- package/contracts/type/Seconds.sol +27 -0
- package/contracts/type/Selector.sol +102 -0
- package/contracts/type/StateId.sol +27 -2
- package/contracts/type/String.sol +53 -0
- package/contracts/type/Timestamp.sol +6 -2
- package/contracts/type/UFixed.sol +6 -0
- package/contracts/type/Version.sol +1 -1
- package/package.json +8 -5
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +0 -1348
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +0 -124
- package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +0 -4
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +0 -581
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +0 -4
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +0 -194
- package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +0 -4
- package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +0 -4
- package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.json +0 -10
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +0 -4
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +0 -285
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +0 -1206
- package/artifacts/contracts/staking/StakeingServiceManager.sol/StakingServiceManager.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeingServiceManager.sol/StakingServiceManager.json +0 -628
- package/contracts/instance/InstanceAccessManager.sol +0 -541
- package/contracts/instance/InstanceAuthorizationsLib.sol +0 -308
- package/contracts/instance/base/Lifecycle.sol +0 -120
- package/contracts/instance/module/ISetup.sol +0 -33
- package/contracts/instance/module/ITreasury.sol +0 -23
- package/contracts/registry/RegistryAccessManager.sol +0 -216
- package/contracts/shared/AccessManagerUpgradeableInitializeable.sol +0 -13
@@ -1,5 +1,5 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
|
-
pragma solidity ^0.8.
|
2
|
+
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {Seconds} from "../type/Seconds.sol";
|
5
5
|
import {NftId} from "../type/NftId.sol";
|
@@ -12,6 +12,8 @@ import {IPolicy} from "../instance/module/IPolicy.sol";
|
|
12
12
|
|
13
13
|
interface IPricingService is IService
|
14
14
|
{
|
15
|
+
|
16
|
+
error ErrorPricingServiceTargetWalletAmountsMismatch();
|
15
17
|
error ErrorIPricingServiceBundlePoolMismatch(NftId bundleNftId, NftId bundlePoolNftId, NftId poolNftId);
|
16
18
|
error ErrorIPricingServiceFeeCalculationMismatch(
|
17
19
|
uint256 distributionFeeFixAmount,
|
@@ -3,21 +3,16 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {Amount} from "../type/Amount.sol";
|
5
5
|
import {Fee} from "../type/Fee.sol";
|
6
|
-
import {
|
7
|
-
import {
|
6
|
+
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
7
|
+
import {IComponents} from "../instance/module/IComponents.sol";
|
8
8
|
import {NftId} from "../type/NftId.sol";
|
9
9
|
import {ReferralId} from "../type/Referral.sol";
|
10
10
|
import {RiskId} from "../type/RiskId.sol";
|
11
11
|
import {Seconds} from "../type/Seconds.sol";
|
12
12
|
|
13
|
-
interface IProductComponent is
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
function setFees(
|
18
|
-
Fee memory productFee,
|
19
|
-
Fee memory processingFee
|
20
|
-
) external;
|
13
|
+
interface IProductComponent is
|
14
|
+
IInstanceLinkedComponent
|
15
|
+
{
|
21
16
|
|
22
17
|
function calculatePremium(
|
23
18
|
Amount sumInsuredAmount,
|
@@ -35,7 +30,10 @@ interface IProductComponent is IComponent {
|
|
35
30
|
bytes memory applicationData
|
36
31
|
) external view returns (Amount netPremiumAmount);
|
37
32
|
|
38
|
-
|
39
33
|
function getPoolNftId() external view returns (NftId poolNftId);
|
40
34
|
function getDistributionNftId() external view returns (NftId distributionNftId);
|
35
|
+
|
36
|
+
|
37
|
+
/// @dev returns initial pool specific infos for this pool
|
38
|
+
function getInitialProductInfo() external view returns (IComponents.ProductInfo memory info);
|
41
39
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
|
-
pragma solidity ^0.8.
|
2
|
+
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {IRisk} from "../instance/module/IRisk.sol";
|
5
5
|
import {IService} from "../shared/IService.sol";
|
@@ -13,13 +13,6 @@ import {UFixed} from "../type/UFixed.sol";
|
|
13
13
|
import {Fee} from "../type/Fee.sol";
|
14
14
|
|
15
15
|
interface IProductService is IService {
|
16
|
-
|
17
|
-
function register(address productAddress) external returns(NftId);
|
18
|
-
|
19
|
-
function setFees(
|
20
|
-
Fee memory productFee,
|
21
|
-
Fee memory processingFee
|
22
|
-
) external;
|
23
16
|
|
24
17
|
function createRisk(
|
25
18
|
RiskId riskId,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
|
-
pragma solidity ^0.8.
|
2
|
+
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {IRegistry} from "../registry/IRegistry.sol";
|
5
5
|
import {Product} from "./Product.sol";
|
@@ -10,7 +10,6 @@ import {IPolicy} from "../instance/module/IPolicy.sol";
|
|
10
10
|
import {IPoolComponent} from "../pool/IPoolComponent.sol";
|
11
11
|
import {IRisk} from "../instance/module/IRisk.sol";
|
12
12
|
import {IBundle} from "../instance/module/IBundle.sol";
|
13
|
-
import {ISetup} from "../instance/module/ISetup.sol";
|
14
13
|
|
15
14
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
16
15
|
|
@@ -18,19 +17,22 @@ import {Amount, AmountLib} from "../type/Amount.sol";
|
|
18
17
|
import {ClaimId, ClaimIdLib} from "../type/ClaimId.sol";
|
19
18
|
import {Timestamp, TimestampLib, zeroTimestamp} from "../type/Timestamp.sol";
|
20
19
|
import {UFixed, UFixedLib} from "../type/UFixed.sol";
|
21
|
-
import {ObjectType, APPLICATION, DISTRIBUTION, PRODUCT, POOL, POLICY, BUNDLE, CLAIM, PRICE} from "../type/ObjectType.sol";
|
20
|
+
import {ObjectType, APPLICATION, COMPONENT, DISTRIBUTION, PRODUCT, POOL, POLICY, BUNDLE, CLAIM, PRICE} from "../type/ObjectType.sol";
|
22
21
|
import {APPLIED, COLLATERALIZED, ACTIVE, KEEP_STATE, CLOSED, DECLINED, CONFIRMED} from "../type/StateId.sol";
|
23
22
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
24
23
|
import {PayoutId, PayoutIdLib} from "../type/PayoutId.sol";
|
24
|
+
import {ReferralId} from "../type/Referral.sol";
|
25
25
|
import {StateId} from "../type/StateId.sol";
|
26
26
|
import {VersionPart} from "../type/Version.sol";
|
27
27
|
|
28
|
-
import {
|
28
|
+
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
29
29
|
import {IApplicationService} from "./IApplicationService.sol";
|
30
30
|
import {IBundleService} from "../pool/IBundleService.sol";
|
31
31
|
import {IClaimService} from "./IClaimService.sol";
|
32
|
+
import {IComponentService} from "../shared/IComponentService.sol";
|
32
33
|
import {IDistributionService} from "../distribution/IDistributionService.sol";
|
33
34
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
35
|
+
import {InstanceStore} from "../instance/InstanceStore.sol";
|
34
36
|
import {IPolicyService} from "./IPolicyService.sol";
|
35
37
|
import {IPoolService} from "../pool/IPoolService.sol";
|
36
38
|
import {IPricingService} from "./IPricingService.sol";
|
@@ -38,13 +40,14 @@ import {IService} from "../shared/IService.sol";
|
|
38
40
|
import {Service} from "../shared/Service.sol";
|
39
41
|
|
40
42
|
contract PolicyService is
|
41
|
-
|
43
|
+
ComponentVerifyingService,
|
42
44
|
IPolicyService
|
43
45
|
{
|
44
46
|
using NftIdLib for NftId;
|
45
47
|
using TimestampLib for Timestamp;
|
46
48
|
|
47
49
|
IApplicationService internal _applicationService;
|
50
|
+
IComponentService internal _componentService;
|
48
51
|
IBundleService internal _bundleService;
|
49
52
|
IClaimService internal _claimService;
|
50
53
|
IDistributionService internal _distributionService;
|
@@ -61,17 +64,20 @@ contract PolicyService is
|
|
61
64
|
virtual override
|
62
65
|
initializer
|
63
66
|
{
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
+
(
|
68
|
+
address registryAddress,,
|
69
|
+
//address managerAddress
|
70
|
+
address authority
|
71
|
+
) = abi.decode(data, (address, address, address));
|
67
72
|
|
68
|
-
initializeService(registryAddress,
|
73
|
+
initializeService(registryAddress, authority, owner);
|
69
74
|
|
70
75
|
VersionPart majorVersion = getVersion().toMajorPart();
|
71
|
-
|
76
|
+
_applicationService = IApplicationService(getRegistry().getServiceAddress(APPLICATION(), majorVersion));
|
72
77
|
_bundleService = IBundleService(getRegistry().getServiceAddress(BUNDLE(), majorVersion));
|
78
|
+
_componentService = IComponentService(getRegistry().getServiceAddress(COMPONENT(), majorVersion));
|
73
79
|
_claimService = IClaimService(getRegistry().getServiceAddress(CLAIM(), majorVersion));
|
74
|
-
|
80
|
+
_poolService = IPoolService(getRegistry().getServiceAddress(POOL(), majorVersion));
|
75
81
|
_distributionService = IDistributionService(getRegistry().getServiceAddress(DISTRIBUTION(), majorVersion));
|
76
82
|
_pricingService = IPricingService(getRegistry().getServiceAddress(PRICE(), majorVersion));
|
77
83
|
|
@@ -79,14 +85,9 @@ contract PolicyService is
|
|
79
85
|
}
|
80
86
|
|
81
87
|
|
82
|
-
function getDomain() public pure override returns(ObjectType) {
|
83
|
-
return POLICY();
|
84
|
-
}
|
85
|
-
|
86
|
-
|
87
88
|
function _getAndVerifyInstanceAndProduct() internal view returns (Product product) {
|
88
89
|
IRegistry.ObjectInfo memory productInfo;
|
89
|
-
(, productInfo,) =
|
90
|
+
(, productInfo,) = _getAndVerifyActiveComponent(PRODUCT());
|
90
91
|
product = Product(productInfo.objectAddress);
|
91
92
|
}
|
92
93
|
|
@@ -100,6 +101,7 @@ contract PolicyService is
|
|
100
101
|
revert();
|
101
102
|
}
|
102
103
|
|
104
|
+
event LogDebug(uint idx, string message);
|
103
105
|
|
104
106
|
/// @dev underwites application which includes the locking of the required collateral from the pool.
|
105
107
|
function collateralize(
|
@@ -111,9 +113,14 @@ contract PolicyService is
|
|
111
113
|
virtual override
|
112
114
|
{
|
113
115
|
// check caller is registered product
|
114
|
-
(NftId productNftId,, IInstance instance) =
|
116
|
+
(NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
115
117
|
InstanceReader instanceReader = instance.getInstanceReader();
|
116
118
|
|
119
|
+
// check policy is in state applied
|
120
|
+
if (instanceReader.getPolicyState(applicationNftId) != APPLIED()) {
|
121
|
+
revert ErrorPolicyServicePolicyStateNotApplied(applicationNftId);
|
122
|
+
}
|
123
|
+
|
117
124
|
// check policy matches with calling product
|
118
125
|
IPolicy.PolicyInfo memory applicationInfo = instanceReader.getPolicyInfo(applicationNftId);
|
119
126
|
if(applicationInfo.productNftId != productNftId) {
|
@@ -122,14 +129,21 @@ contract PolicyService is
|
|
122
129
|
applicationInfo.productNftId,
|
123
130
|
productNftId);
|
124
131
|
}
|
125
|
-
|
126
|
-
// check policy is in state applied
|
127
|
-
if (instanceReader.getPolicyState(applicationNftId) != APPLIED()) {
|
128
|
-
revert ErrorPolicyServicePolicyStateNotApplied(applicationNftId);
|
129
|
-
}
|
130
132
|
|
131
133
|
StateId newPolicyState = COLLATERALIZED();
|
132
134
|
|
135
|
+
// actual collateralizaion
|
136
|
+
(
|
137
|
+
Amount localCollateralAmount,
|
138
|
+
Amount totalCollateralAmount
|
139
|
+
) = _poolService.lockCollateral(
|
140
|
+
instance,
|
141
|
+
address(instanceReader.getComponentInfo(productNftId).token),
|
142
|
+
productNftId,
|
143
|
+
applicationNftId,
|
144
|
+
applicationInfo.bundleNftId,
|
145
|
+
applicationInfo.sumInsuredAmount);
|
146
|
+
|
133
147
|
// optional activation of policy
|
134
148
|
if(activateAt > zeroTimestamp()) {
|
135
149
|
newPolicyState = ACTIVE();
|
@@ -137,51 +151,28 @@ contract PolicyService is
|
|
137
151
|
applicationInfo.expiredAt = activateAt.addSeconds(applicationInfo.lifetime);
|
138
152
|
}
|
139
153
|
|
140
|
-
// lock bundle collateral
|
141
|
-
Amount netPremiumAmount = AmountLib.zero(); // > 0 if immediate premium payment
|
142
|
-
|
143
154
|
// optional collection of premium
|
144
155
|
if(requirePremiumPayment) {
|
145
|
-
|
146
|
-
instance,
|
147
|
-
applicationNftId,
|
148
|
-
applicationInfo
|
156
|
+
Amount premiumPaidAmount = _calculateAndCollectPremium(
|
157
|
+
instance,
|
158
|
+
applicationNftId,
|
159
|
+
applicationInfo);
|
149
160
|
|
150
|
-
applicationInfo.premiumPaidAmount =
|
161
|
+
applicationInfo.premiumPaidAmount = premiumPaidAmount;
|
151
162
|
}
|
152
163
|
|
153
164
|
// store updated policy info
|
154
|
-
instance.getInstanceStore().updatePolicy(
|
155
|
-
|
156
|
-
// lock collateral and update pool and bundle book keeping
|
157
|
-
// pool retention level: fraction of sum insured that product will cover from pool funds directly
|
158
|
-
// eg retention level 30%, payouts up to 30% of the sum insured will be made from the product's pool directly
|
159
|
-
// for the remaining 70% the pool owns a policy that will cover claims that exceed the 30% of the sum insured
|
160
|
-
// might also call pool component (for isVerifyingApplications pools)
|
161
|
-
_poolService.lockCollateral(
|
162
|
-
instance,
|
163
|
-
productNftId,
|
165
|
+
instance.getInstanceStore().updatePolicy(
|
164
166
|
applicationNftId,
|
165
|
-
applicationInfo,
|
166
|
-
|
167
|
+
applicationInfo,
|
168
|
+
newPolicyState);
|
169
|
+
|
170
|
+
// TODO add calling pool contract if it needs to validate application
|
167
171
|
|
168
172
|
// TODO: add logging
|
169
173
|
}
|
170
174
|
|
171
175
|
|
172
|
-
function calculateRequiredCollateral(
|
173
|
-
UFixed collateralizationLevel,
|
174
|
-
Amount sumInsuredAmount
|
175
|
-
)
|
176
|
-
public
|
177
|
-
pure
|
178
|
-
virtual
|
179
|
-
returns(Amount collateralAmount)
|
180
|
-
{
|
181
|
-
UFixed collateralUFixed = collateralizationLevel * sumInsuredAmount.toUFixed();
|
182
|
-
return AmountLib.toAmount(collateralUFixed.toInt());
|
183
|
-
}
|
184
|
-
|
185
176
|
function collectPremium(
|
186
177
|
NftId policyNftId,
|
187
178
|
Timestamp activateAt
|
@@ -190,24 +181,27 @@ contract PolicyService is
|
|
190
181
|
virtual
|
191
182
|
{
|
192
183
|
// check caller is registered product
|
193
|
-
(
|
184
|
+
(,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
194
185
|
InstanceReader instanceReader = instance.getInstanceReader();
|
195
|
-
|
186
|
+
StateId stateId = instanceReader.getPolicyState(policyNftId);
|
196
187
|
|
197
|
-
|
198
|
-
|
188
|
+
// check policy is in state collateralized or active
|
189
|
+
if (!(stateId == COLLATERALIZED() || stateId == ACTIVE())) {
|
190
|
+
revert ErrorPolicyServicePolicyStateNotCollateralizedOrApplied(policyNftId);
|
199
191
|
}
|
200
192
|
|
201
|
-
|
193
|
+
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
202
194
|
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
195
|
+
// check if premium is already collected
|
196
|
+
if (policyInfo.premiumPaidAmount.gtz()) {
|
197
|
+
revert ErrorPolicyServicePremiumAlreadyPaid(policyNftId, policyInfo.premiumPaidAmount);
|
198
|
+
}
|
207
199
|
|
208
|
-
policyInfo.premiumPaidAmount =
|
200
|
+
policyInfo.premiumPaidAmount = _calculateAndCollectPremium(
|
201
|
+
instance,
|
202
|
+
policyNftId,
|
203
|
+
policyInfo);
|
209
204
|
|
210
|
-
_bundleService.increaseBalance(instance, policyInfo.bundleNftId, netPremiumAmount);
|
211
205
|
instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
|
212
206
|
|
213
207
|
if(activateAt.gtz() && policyInfo.activatedAt.eqz()) {
|
@@ -219,7 +213,7 @@ contract PolicyService is
|
|
219
213
|
|
220
214
|
function activate(NftId policyNftId, Timestamp activateAt) public override {
|
221
215
|
// check caller is registered product
|
222
|
-
(,, IInstance instance) =
|
216
|
+
(,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
223
217
|
InstanceReader instanceReader = instance.getInstanceReader();
|
224
218
|
|
225
219
|
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
@@ -253,7 +247,7 @@ contract PolicyService is
|
|
253
247
|
external
|
254
248
|
override
|
255
249
|
{
|
256
|
-
(,, IInstance instance) =
|
250
|
+
(,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
257
251
|
InstanceReader instanceReader = instance.getInstanceReader();
|
258
252
|
|
259
253
|
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
@@ -284,6 +278,7 @@ contract PolicyService is
|
|
284
278
|
|
285
279
|
_poolService.releaseCollateral(
|
286
280
|
instance,
|
281
|
+
address(instanceReader.getComponentInfo(policyInfo.productNftId).token),
|
287
282
|
policyNftId,
|
288
283
|
policyInfo);
|
289
284
|
|
@@ -291,86 +286,190 @@ contract PolicyService is
|
|
291
286
|
}
|
292
287
|
|
293
288
|
|
294
|
-
function
|
289
|
+
function _calculateAndCollectPremium(
|
295
290
|
IInstance instance,
|
296
|
-
NftId
|
297
|
-
|
291
|
+
NftId applicationNftId,
|
292
|
+
IPolicy.PolicyInfo memory applicationInfo
|
298
293
|
)
|
299
294
|
internal
|
300
|
-
|
295
|
+
virtual
|
296
|
+
returns (
|
297
|
+
Amount premiumPaidAmount
|
298
|
+
)
|
301
299
|
{
|
302
|
-
|
303
|
-
if(premiumExpectedAmount.eqz()) {
|
304
|
-
return AmountLib.zero();
|
305
|
-
}
|
300
|
+
NftId productNftId = applicationInfo.productNftId;
|
306
301
|
|
307
|
-
|
308
|
-
IPolicy.PolicyInfo memory policyInfo = instance.getInstanceReader().getPolicyInfo(policyNftId);
|
302
|
+
// calculate premium details
|
309
303
|
IPolicy.Premium memory premium = _pricingService.calculatePremium(
|
310
304
|
productNftId,
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
305
|
+
applicationInfo.riskId,
|
306
|
+
applicationInfo.sumInsuredAmount,
|
307
|
+
applicationInfo.lifetime,
|
308
|
+
applicationInfo.applicationData,
|
309
|
+
applicationInfo.bundleNftId,
|
310
|
+
applicationInfo.referralId);
|
311
|
+
|
312
|
+
|
313
|
+
// update financials and transfer premium tokens
|
314
|
+
premiumPaidAmount = _processAndCollect(
|
315
|
+
instance,
|
316
|
+
productNftId,
|
317
|
+
applicationNftId,
|
318
|
+
applicationInfo.premiumAmount,
|
319
|
+
applicationInfo.bundleNftId,
|
320
|
+
applicationInfo.referralId,
|
321
|
+
premium);
|
322
|
+
}
|
325
323
|
|
326
|
-
address policyOwner = getRegistry().ownerOf(policyNftId);
|
327
|
-
ISetup.ProductSetupInfo memory productSetupInfo = instance.getInstanceReader().getProductSetupInfo(productNftId);
|
328
|
-
TokenHandler tokenHandler = productSetupInfo.tokenHandler;
|
329
|
-
if (tokenHandler.getToken().allowance(policyOwner, address(tokenHandler)) < premium.premiumAmount) {
|
330
|
-
revert ErrorIPolicyServiceInsufficientAllowance(policyOwner, address(tokenHandler), premium.premiumAmount);
|
331
|
-
}
|
332
324
|
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
Amount
|
325
|
+
function _processAndCollect(
|
326
|
+
IInstance instance,
|
327
|
+
NftId productNftId,
|
328
|
+
NftId policyNftId,
|
329
|
+
Amount premiumExpectedAmount,
|
330
|
+
NftId bundleNftId,
|
331
|
+
ReferralId referralId,
|
332
|
+
IPolicy.Premium memory premium
|
333
|
+
)
|
334
|
+
internal
|
335
|
+
virtual
|
336
|
+
returns (Amount premiumPaidAmount)
|
337
|
+
{
|
338
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
339
|
+
TokenHandler tokenHandler = instanceReader.getComponentInfo(productNftId).tokenHandler;
|
340
|
+
address policyHolder = getRegistry().ownerOf(policyNftId);
|
341
|
+
premiumPaidAmount = AmountLib.toAmount(premium.premiumAmount);
|
342
|
+
|
343
|
+
_checkPremiumBalanceAndAllowance(
|
344
|
+
tokenHandler,
|
345
|
+
policyHolder,
|
346
|
+
premiumExpectedAmount,
|
347
|
+
premiumPaidAmount);
|
348
|
+
|
349
|
+
_processSaleAndTransferFunds(
|
350
|
+
instanceReader,
|
351
|
+
instance.getInstanceStore(),
|
352
|
+
tokenHandler,
|
353
|
+
policyHolder,
|
354
|
+
productNftId,
|
355
|
+
bundleNftId,
|
356
|
+
referralId,
|
357
|
+
premium);
|
358
|
+
}
|
338
359
|
|
339
|
-
netPremiumAmount = AmountLib.toAmount(premium.netPremiumAmount);
|
340
360
|
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
361
|
+
function _checkPremiumBalanceAndAllowance(
|
362
|
+
TokenHandler tokenHandler,
|
363
|
+
address policyHolder,
|
364
|
+
Amount premiumExpectedAmount,
|
365
|
+
Amount premiumPaidAmount
|
366
|
+
)
|
367
|
+
internal
|
368
|
+
virtual
|
369
|
+
view
|
370
|
+
{
|
371
|
+
// TODO decide how to handle this properly
|
372
|
+
// not clear if this is the best way to handle this
|
373
|
+
if (premiumExpectedAmount < premiumPaidAmount) {
|
374
|
+
revert ErrorPolicyServicePremiumHigherThanExpected(premiumExpectedAmount, premiumPaidAmount);
|
345
375
|
}
|
346
376
|
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
377
|
+
uint256 premiumAmount = premiumPaidAmount.toInt();
|
378
|
+
uint256 balance = tokenHandler.getToken().balanceOf(policyHolder);
|
379
|
+
uint256 allowance = tokenHandler.getToken().allowance(policyHolder, address(tokenHandler));
|
380
|
+
|
381
|
+
if (balance < premiumAmount) {
|
382
|
+
revert ErrorPolicyServiceBalanceInsufficient(policyHolder, premiumAmount, balance);
|
353
383
|
}
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
address poolWallet = instance.getInstanceReader().getComponentInfo(productSetupInfo.poolNftId).wallet;
|
358
|
-
tokenHandler.transfer(policyOwner, poolWallet, poolAmountToTransfer);
|
359
|
-
_poolService.processSale(policyInfo.bundleNftId, premium, poolAmountToTransfer);
|
384
|
+
|
385
|
+
if (allowance < premiumAmount) {
|
386
|
+
revert ErrorPolicyServiceAllowanceInsufficient(policyHolder, address(tokenHandler), premiumAmount, allowance);
|
360
387
|
}
|
388
|
+
}
|
361
389
|
|
362
|
-
// validate total amount transferred
|
363
|
-
{
|
364
|
-
Amount totalTransferred = distributionFeeAmountToTransfer + poolAmountToTransfer + productFeeAmountToTransfer;
|
365
390
|
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
391
|
+
function _processSaleAndTransferFunds(
|
392
|
+
InstanceReader instanceReader,
|
393
|
+
InstanceStore instanceStore,
|
394
|
+
TokenHandler tokenHandler,
|
395
|
+
address policyHolder,
|
396
|
+
NftId productNftId,
|
397
|
+
NftId bundleNftId,
|
398
|
+
ReferralId referralId,
|
399
|
+
IPolicy.Premium memory premium
|
400
|
+
)
|
401
|
+
internal
|
402
|
+
virtual
|
403
|
+
{
|
404
|
+
(
|
405
|
+
NftId distributionNftId,
|
406
|
+
address distributionWallet,
|
407
|
+
address poolWallet,
|
408
|
+
address productWallet
|
409
|
+
) = _getDistributionNftAndWallets(
|
410
|
+
instanceReader,
|
411
|
+
productNftId);
|
412
|
+
|
413
|
+
// update product fees, distribution and pool fees
|
414
|
+
_componentService.increaseProductFees(
|
415
|
+
instanceStore,
|
416
|
+
productNftId,
|
417
|
+
AmountLib.toAmount(premium.productFeeVarAmount + premium.productFeeFixAmount));
|
418
|
+
|
419
|
+
// update distribution fees and distributor commission and pool fees
|
420
|
+
_distributionService.processSale(
|
421
|
+
distributionNftId,
|
422
|
+
referralId,
|
423
|
+
premium);
|
424
|
+
|
425
|
+
// update pool and bundle fees
|
426
|
+
_poolService.processSale(
|
427
|
+
bundleNftId,
|
428
|
+
premium);
|
429
|
+
|
430
|
+
// transfer premium amounts to target wallets
|
431
|
+
tokenHandler.transfer(policyHolder, productWallet, premium.productFeeAmount);
|
432
|
+
tokenHandler.transfer(policyHolder, distributionWallet, premium.distributionFeeAndCommissionAmount);
|
433
|
+
tokenHandler.transfer(policyHolder, poolWallet, premium.poolPremiumAndFeeAmount);
|
434
|
+
}
|
373
435
|
|
374
|
-
|
436
|
+
|
437
|
+
function _getTokenHandlerAndProductWallet(
|
438
|
+
InstanceReader instanceReader,
|
439
|
+
NftId productNftId
|
440
|
+
)
|
441
|
+
internal
|
442
|
+
virtual
|
443
|
+
view
|
444
|
+
returns (
|
445
|
+
TokenHandler tokenHandler
|
446
|
+
)
|
447
|
+
{
|
448
|
+
tokenHandler = instanceReader.getComponentInfo(productNftId).tokenHandler;
|
449
|
+
}
|
450
|
+
|
451
|
+
function _getDistributionNftAndWallets(
|
452
|
+
InstanceReader instanceReader,
|
453
|
+
NftId productNftId
|
454
|
+
)
|
455
|
+
internal
|
456
|
+
virtual
|
457
|
+
view returns (
|
458
|
+
NftId distributionNftId,
|
459
|
+
address distributionWallet,
|
460
|
+
address poolWallet,
|
461
|
+
address productWallet
|
462
|
+
)
|
463
|
+
{
|
464
|
+
IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
|
465
|
+
distributionNftId = productInfo.distributionNftId;
|
466
|
+
distributionWallet = instanceReader.getComponentInfo(distributionNftId).wallet;
|
467
|
+
poolWallet = instanceReader.getComponentInfo(productInfo.poolNftId).wallet;
|
468
|
+
productWallet = instanceReader.getComponentInfo(productNftId).wallet;
|
469
|
+
}
|
470
|
+
|
471
|
+
|
472
|
+
function _getDomain() internal pure override returns(ObjectType) {
|
473
|
+
return POLICY();
|
375
474
|
}
|
376
475
|
}
|
@@ -14,32 +14,20 @@ contract PolicyServiceManager is ProxyManager {
|
|
14
14
|
|
15
15
|
/// @dev initializes proxy manager with product service implementation
|
16
16
|
constructor(
|
17
|
-
address
|
18
|
-
|
17
|
+
address authority,
|
18
|
+
address registryAddress,
|
19
|
+
bytes32 salt
|
20
|
+
)
|
19
21
|
ProxyManager(registryAddress)
|
20
22
|
{
|
21
|
-
PolicyService svc = new PolicyService();
|
22
|
-
bytes memory data = abi.encode(registryAddress, address(this));
|
23
|
-
IVersionable versionable =
|
23
|
+
PolicyService svc = new PolicyService{salt: salt}();
|
24
|
+
bytes memory data = abi.encode(registryAddress, address(this), authority);
|
25
|
+
IVersionable versionable = deployDetermenistic(
|
24
26
|
address(svc),
|
25
|
-
data
|
27
|
+
data,
|
28
|
+
salt);
|
26
29
|
|
27
30
|
_policyService = PolicyService(address(versionable));
|
28
|
-
|
29
|
-
// Registry registry = Registry(registryAddress);
|
30
|
-
// address registryServiceAddress = registry.getServiceAddress("RegistryService", VersionLib.toVersion(3, 0, 0).toMajorPart());
|
31
|
-
// RegistryService registryService = RegistryService(registryServiceAddress);
|
32
|
-
// TODO this must have a role or own nft to register service
|
33
|
-
//registryService.registerService(_productService);
|
34
|
-
|
35
|
-
// TODO no nft to link yet
|
36
|
-
// link ownership of instance service manager ot nft owner of instance service
|
37
|
-
//_linkToNftOwnable(
|
38
|
-
// address(registryAddress),
|
39
|
-
// address(_productService));
|
40
|
-
|
41
|
-
// implies that after this constructor call only upgrade functionality is available
|
42
|
-
// _isDeployed = true;
|
43
31
|
}
|
44
32
|
|
45
33
|
//--- view functions ----------------------------------------------------//
|