@etherisc/gif-next 0.0.2-96b5b72-170 → 0.0.2-97aac30-275
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 +2 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +193 -164
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +114 -321
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +120 -82
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +72 -108
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +22 -48
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +2 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +25 -6
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +56 -22
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +53 -18
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +708 -0
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +132 -28
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +458 -331
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +133 -59
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +110 -32
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +1103 -308
- 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/ObjectCounter.sol/ObjectCounter.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +10 -0
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +2 -2
- 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/IOracle.sol/IOracle.dbg.json +4 -0
- package/artifacts/contracts/{instance/module/ISetup.sol/ISetup.json → oracle/IOracle.sol/IOracle.json} +2 -2
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +759 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +662 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +1146 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +997 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +718 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +69 -252
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +105 -55
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +8 -53
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +134 -86
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +121 -133
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +239 -92
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +170 -368
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +98 -72
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +69 -153
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +105 -31
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +95 -203
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +118 -56
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +7 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +7 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +81 -25
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +27 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +230 -107
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductService.sol/IProductService.json +0 -55
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +164 -299
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +106 -92
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +139 -160
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +130 -40
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +334 -146
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +29 -214
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +88 -34
- 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 +163 -61
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +256 -65
- 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 +378 -67
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +407 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +272 -68
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +87 -35
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +799 -127
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.json +137 -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/AccessManagerCustom.sol/AccessManagerCustom.dbg.json +4 -0
- package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.json +1193 -0
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.dbg.json +4 -0
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.json +1715 -0
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.dbg.json +4 -0
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.json +1728 -0
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.dbg.json +4 -0
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.json +1806 -0
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.dbg.json +4 -0
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.json +1824 -0
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +184 -11
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +908 -49
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +792 -0
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +526 -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/IAccessManagerExtended.sol/IAccessManagerExtended.dbg.json +4 -0
- package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.json +1562 -0
- package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.dbg.json +4 -0
- package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.json +1600 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +172 -4
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +4 -0
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +867 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +80 -22
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/{instance/base → shared}/IKeyValueStore.sol/IKeyValueStore.json +1 -11
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +4 -0
- package/artifacts/contracts/{instance/base → shared}/ILifecycle.sol/ILifecycle.json +1 -1
- 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 +7 -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 +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +176 -24
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +571 -0
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +4 -0
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +194 -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 +7 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
- 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 +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1103 -172
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +497 -49
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +444 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +1247 -56
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +167 -30
- 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 +605 -78
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +122 -28
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2189 -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 +2 -2
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- 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 +15 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
- 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 +2 -2
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
- 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/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +2 -2
- 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/UFixedLib.dbg.json +1 -1
- 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/distribution/Distribution.sol +27 -51
- package/contracts/distribution/DistributionService.sol +55 -106
- package/contracts/distribution/DistributionServiceManager.sol +9 -18
- package/contracts/distribution/IDistributionComponent.sol +3 -8
- package/contracts/distribution/IDistributionService.sol +2 -8
- package/contracts/instance/IInstance.sol +12 -7
- package/contracts/instance/IInstanceService.sol +13 -5
- package/contracts/instance/Instance.sol +30 -23
- package/contracts/instance/InstanceAdmin.sol +331 -0
- package/contracts/instance/InstanceAuthorizationsLib.sol +210 -141
- package/contracts/instance/InstanceReader.sol +64 -42
- package/contracts/instance/InstanceService.sol +141 -87
- package/contracts/instance/InstanceServiceManager.sol +10 -20
- package/contracts/instance/InstanceStore.sol +125 -55
- package/contracts/instance/base/BalanceStore.sol +118 -0
- package/contracts/instance/base/ObjectCounter.sol +21 -0
- 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 +8 -2
- package/contracts/mock/Dip.sol +26 -0
- package/contracts/oracle/IOracle.sol +20 -0
- package/contracts/oracle/IOracleComponent.sol +32 -0
- package/contracts/oracle/IOracleService.sol +65 -0
- package/contracts/oracle/Oracle.sol +145 -0
- package/contracts/oracle/OracleService.sol +277 -0
- package/contracts/oracle/OracleServiceManager.sol +42 -0
- package/contracts/pool/BundleService.sol +63 -149
- package/contracts/pool/BundleServiceManager.sol +9 -18
- package/contracts/pool/IBundleService.sol +4 -16
- package/contracts/pool/IPoolComponent.sol +2 -4
- package/contracts/pool/IPoolService.sol +45 -9
- package/contracts/pool/Pool.sol +37 -40
- package/contracts/pool/PoolService.sol +195 -145
- package/contracts/pool/PoolServiceManager.sol +9 -18
- package/contracts/product/ApplicationService.sol +111 -43
- package/contracts/product/ApplicationServiceManager.sol +9 -6
- package/contracts/product/ClaimService.sol +21 -21
- package/contracts/product/ClaimServiceManager.sol +9 -6
- package/contracts/product/IApplicationService.sol +1 -1
- package/contracts/product/IClaimService.sol +7 -1
- package/contracts/product/IPolicyService.sol +6 -8
- package/contracts/product/IPricingService.sol +3 -1
- package/contracts/product/IProductComponent.sol +5 -4
- package/contracts/product/IProductService.sol +1 -8
- package/contracts/product/PolicyService.sol +226 -127
- package/contracts/product/PolicyServiceManager.sol +9 -21
- package/contracts/product/PricingService.sol +74 -48
- package/contracts/product/PricingServiceManager.sol +9 -18
- package/contracts/product/Product.sol +45 -47
- package/contracts/product/ProductService.sol +26 -112
- package/contracts/product/ProductServiceManager.sol +9 -21
- package/contracts/registry/ChainNft.sol +1 -0
- package/contracts/registry/IRegistry.sol +38 -24
- package/contracts/registry/IRegistryService.sol +31 -31
- package/contracts/registry/Registry.sol +176 -105
- package/contracts/registry/RegistryAdmin.sol +237 -0
- package/contracts/registry/RegistryService.sol +44 -82
- package/contracts/registry/RegistryServiceManager.sol +21 -23
- package/contracts/registry/ReleaseManager.sol +450 -210
- package/contracts/registry/ServiceAuthorizationsLib.sol +173 -0
- package/contracts/registry/TokenRegistry.sol +261 -62
- package/contracts/shared/AccessManagerCustom.sol +736 -0
- package/contracts/shared/AccessManagerExtended.sol +470 -0
- package/contracts/shared/AccessManagerExtendedInitializeable.sol +13 -0
- package/contracts/shared/AccessManagerExtendedWithDisable.sol +137 -0
- package/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol +14 -0
- package/contracts/shared/Component.sol +153 -49
- package/contracts/shared/ComponentService.sol +561 -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/IAccessManagerExtended.sol +74 -0
- package/contracts/shared/IAccessManagerExtendedWithDisable.sol +18 -0
- package/contracts/shared/IComponent.sol +20 -8
- package/contracts/shared/IComponentService.sol +102 -0
- package/contracts/shared/IInstanceLinkedComponent.sol +5 -11
- package/contracts/{instance/base → shared}/IKeyValueStore.sol +6 -6
- package/contracts/{instance/base → shared}/ILifecycle.sol +3 -3
- package/contracts/shared/INftOwnable.sol +1 -1
- package/contracts/shared/IPolicyHolder.sol +6 -1
- package/contracts/shared/IService.sol +1 -1
- package/contracts/shared/InitializableCustom.sol +177 -0
- package/contracts/shared/InstanceLinkedComponent.sol +51 -178
- package/contracts/{instance/base → shared}/KeyValueStore.sol +30 -72
- package/contracts/{instance/base → shared}/Lifecycle.sol +12 -3
- 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 +7 -2
- package/contracts/staking/IStaking.sol +146 -8
- package/contracts/staking/IStakingService.sol +83 -39
- package/contracts/staking/StakeManagerLib.sol +179 -0
- package/contracts/staking/Staking.sol +503 -17
- package/contracts/staking/StakingManager.sol +22 -14
- package/contracts/staking/StakingReader.sol +187 -0
- package/contracts/staking/StakingService.sol +246 -44
- package/contracts/staking/StakingServiceManager.sol +8 -4
- package/contracts/staking/StakingStore.sol +572 -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 +12 -10
- 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 +18 -4
- package/contracts/type/Seconds.sol +27 -0
- package/contracts/type/StateId.sol +27 -2
- package/contracts/type/Timestamp.sol +6 -2
- package/contracts/type/Version.sol +1 -1
- package/package.json +4 -3
- 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/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/contracts/instance/InstanceAccessManager.sol +0 -543
- package/contracts/instance/module/ISetup.sol +0 -33
- package/contracts/instance/module/ITreasury.sol +0 -23
- package/contracts/registry/RegistryAccessManager.sol +0 -207
- package/contracts/shared/AccessManagerUpgradeableInitializeable.sol +0 -13
@@ -1,14 +1,14 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
|
-
pragma solidity ^0.8.
|
2
|
+
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {AmountLib} from "../type/Amount.sol";
|
5
5
|
import {Seconds} from "../type/Seconds.sol";
|
6
6
|
import {Timestamp, TimestampLib, zeroTimestamp} from "../type/Timestamp.sol";
|
7
7
|
import {UFixed, UFixedLib} from "../type/UFixed.sol";
|
8
8
|
import {Blocknumber, blockNumber} from "../type/Blocknumber.sol";
|
9
|
-
import {ObjectType, DISTRIBUTION, INSTANCE, PRODUCT, POOL, APPLICATION, POLICY, BUNDLE, PRICE} from "../type/ObjectType.sol";
|
9
|
+
import {ObjectType, DISTRIBUTION, INSTANCE, PRODUCT, POOL, REGISTRY, APPLICATION, POLICY, BUNDLE, PRICE} from "../type/ObjectType.sol";
|
10
10
|
import {APPLIED, REVOKED, ACTIVE, KEEP_STATE} from "../type/StateId.sol";
|
11
|
-
import {NftId, NftIdLib
|
11
|
+
import {NftId, NftIdLib} from "../type/NftId.sol";
|
12
12
|
import {Fee, FeeLib} from "../type/Fee.sol";
|
13
13
|
import {ReferralId} from "../type/Referral.sol";
|
14
14
|
import {RiskId} from "../type/RiskId.sol";
|
@@ -34,10 +34,8 @@ import {IPolicy} from "../instance/module/IPolicy.sol";
|
|
34
34
|
import {IRisk} from "../instance/module/IRisk.sol";
|
35
35
|
import {IBundle} from "../instance/module/IBundle.sol";
|
36
36
|
import {IProductService} from "./IProductService.sol";
|
37
|
-
import {ITreasury} from "../instance/module/ITreasury.sol";
|
38
|
-
import {ISetup} from "../instance/module/ISetup.sol";
|
39
37
|
|
40
|
-
import {
|
38
|
+
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
41
39
|
|
42
40
|
import {IInstance} from "../instance/IInstance.sol";
|
43
41
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
@@ -47,14 +45,16 @@ import {IBundleService} from "../pool/IBundleService.sol";
|
|
47
45
|
import {IDistributionService} from "../distribution/IDistributionService.sol";
|
48
46
|
import {IPoolService} from "../pool/IPoolService.sol";
|
49
47
|
import {IPricingService} from "./IPricingService.sol";
|
48
|
+
import {IRegistryService} from "../registry/IRegistryService.sol";
|
50
49
|
|
51
50
|
|
52
51
|
contract ApplicationService is
|
53
|
-
|
52
|
+
ComponentVerifyingService,
|
54
53
|
IApplicationService
|
55
54
|
{
|
56
|
-
IDistributionService
|
57
|
-
IPricingService
|
55
|
+
IDistributionService private _distributionService;
|
56
|
+
IPricingService private _pricingService;
|
57
|
+
IRegistryService private _registryService;
|
58
58
|
|
59
59
|
function _initialize(
|
60
60
|
address owner,
|
@@ -64,16 +64,19 @@ contract ApplicationService is
|
|
64
64
|
virtual override
|
65
65
|
initializer()
|
66
66
|
{
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
67
|
+
(
|
68
|
+
address registryAddress,,
|
69
|
+
//address managerAddress
|
70
|
+
address authority
|
71
|
+
) = abi.decode(data, (address, address, address));
|
71
72
|
|
72
73
|
initializeService(registryAddress, address(0), owner);
|
73
|
-
registerInterface(type(IApplicationService).interfaceId);
|
74
74
|
|
75
75
|
_distributionService = IDistributionService(_getServiceAddress(DISTRIBUTION()));
|
76
76
|
_pricingService = IPricingService(_getServiceAddress(PRICE()));
|
77
|
+
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
78
|
+
|
79
|
+
registerInterface(type(IApplicationService).interfaceId);
|
77
80
|
}
|
78
81
|
|
79
82
|
|
@@ -82,6 +85,74 @@ contract ApplicationService is
|
|
82
85
|
}
|
83
86
|
|
84
87
|
|
88
|
+
function _checkLinkedpplicationParameters(
|
89
|
+
InstanceReader instanceReader,
|
90
|
+
NftId productNftId,
|
91
|
+
RiskId rirskId,
|
92
|
+
ReferralId referralId,
|
93
|
+
NftId bundleNftId
|
94
|
+
)
|
95
|
+
internal
|
96
|
+
virtual
|
97
|
+
view
|
98
|
+
{
|
99
|
+
IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
|
100
|
+
|
101
|
+
// TODO check riskId with product
|
102
|
+
|
103
|
+
// TODO check referral with distribution
|
104
|
+
|
105
|
+
// check bundle with pool
|
106
|
+
NftId productPoolNftId = productInfo.poolNftId;
|
107
|
+
NftId bundlePoolNftId = instanceReader.getBundleInfo(bundleNftId).poolNftId;
|
108
|
+
if(bundlePoolNftId != productPoolNftId) {
|
109
|
+
revert ErrorApplicationServiceBundlePoolMismatch(bundleNftId, productPoolNftId, bundlePoolNftId);
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
|
114
|
+
function _registerApplication(
|
115
|
+
NftId productNftId,
|
116
|
+
address applicationOwner
|
117
|
+
)
|
118
|
+
internal
|
119
|
+
virtual
|
120
|
+
returns (NftId applicationNftId)
|
121
|
+
{
|
122
|
+
IRegistry.ObjectInfo memory objectInfo = IRegistry.ObjectInfo(
|
123
|
+
NftIdLib.zero(),
|
124
|
+
productNftId,
|
125
|
+
POLICY(),
|
126
|
+
false, // intercepting property for policies is defined on product
|
127
|
+
address(0),
|
128
|
+
applicationOwner,
|
129
|
+
"");
|
130
|
+
|
131
|
+
applicationNftId = _registryService.registerPolicy(objectInfo);
|
132
|
+
}
|
133
|
+
|
134
|
+
|
135
|
+
function _calculatePremiumAmount(
|
136
|
+
IPolicy.PolicyInfo memory info
|
137
|
+
)
|
138
|
+
internal
|
139
|
+
virtual
|
140
|
+
view
|
141
|
+
returns (Amount premiumAmount)
|
142
|
+
{
|
143
|
+
return AmountLib.toAmount(
|
144
|
+
_pricingService.calculatePremium(
|
145
|
+
info.productNftId,
|
146
|
+
info.riskId,
|
147
|
+
info.sumInsuredAmount,
|
148
|
+
info.lifetime,
|
149
|
+
info.applicationData,
|
150
|
+
info.bundleNftId,
|
151
|
+
info.referralId
|
152
|
+
).premiumAmount);
|
153
|
+
}
|
154
|
+
|
155
|
+
|
85
156
|
function create(
|
86
157
|
address applicationOwner,
|
87
158
|
RiskId riskId,
|
@@ -95,39 +166,28 @@ contract ApplicationService is
|
|
95
166
|
virtual
|
96
167
|
returns (NftId applicationNftId)
|
97
168
|
{
|
98
|
-
(NftId productNftId,, IInstance instance) =
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
productNftId,
|
105
|
-
POLICY(),
|
106
|
-
false, // intercepting property for policies is defined on product
|
107
|
-
address(0),
|
108
|
-
applicationOwner,
|
109
|
-
""
|
110
|
-
)
|
111
|
-
);
|
112
|
-
|
113
|
-
// (uint256 premiumAmount,,,,,) = calculatePremium(
|
114
|
-
IPolicy.Premium memory premium = _pricingService.calculatePremium(
|
169
|
+
(NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
170
|
+
|
171
|
+
// check if provided references are valid and linked to calling product contract
|
172
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
173
|
+
_checkLinkedpplicationParameters(
|
174
|
+
instanceReader,
|
115
175
|
productNftId,
|
116
176
|
riskId,
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
IPolicy.PolicyInfo memory
|
177
|
+
referralId,
|
178
|
+
bundleNftId);
|
179
|
+
|
180
|
+
// register application with registry
|
181
|
+
applicationNftId = _registerApplication(productNftId, applicationOwner);
|
182
|
+
|
183
|
+
// create policy info for application
|
184
|
+
IPolicy.PolicyInfo memory applicationInfo = IPolicy.PolicyInfo({
|
125
185
|
productNftId: productNftId,
|
126
186
|
bundleNftId: bundleNftId,
|
127
187
|
referralId: referralId,
|
128
188
|
riskId: riskId,
|
129
189
|
sumInsuredAmount: sumInsuredAmount,
|
130
|
-
premiumAmount: AmountLib.
|
190
|
+
premiumAmount: AmountLib.zero(),
|
131
191
|
premiumPaidAmount: AmountLib.zero(),
|
132
192
|
lifetime: lifetime,
|
133
193
|
applicationData: applicationData,
|
@@ -140,8 +200,16 @@ contract ApplicationService is
|
|
140
200
|
expiredAt: zeroTimestamp(),
|
141
201
|
closedAt: zeroTimestamp()
|
142
202
|
});
|
143
|
-
|
144
|
-
|
203
|
+
|
204
|
+
// TODO consider to provide this amount externally
|
205
|
+
// actual calculation is done 2nd time anyway for premium collection
|
206
|
+
// calculate premium amount
|
207
|
+
applicationInfo.premiumAmount = _calculatePremiumAmount(applicationInfo);
|
208
|
+
|
209
|
+
// register application with instance
|
210
|
+
instance.getInstanceStore().createApplication(
|
211
|
+
applicationNftId,
|
212
|
+
applicationInfo);
|
145
213
|
|
146
214
|
// TODO: add logging
|
147
215
|
}
|
@@ -178,7 +246,7 @@ contract ApplicationService is
|
|
178
246
|
external
|
179
247
|
virtual override
|
180
248
|
{
|
181
|
-
(,, IInstance instance) =
|
249
|
+
(,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
182
250
|
instance.getInstanceStore().updateApplicationState(applicationNftId, REVOKED());
|
183
251
|
}
|
184
252
|
|
@@ -11,15 +11,18 @@ contract ApplicationServiceManager is ProxyManager {
|
|
11
11
|
|
12
12
|
/// @dev initializes proxy manager with service implementation
|
13
13
|
constructor(
|
14
|
-
address
|
15
|
-
|
14
|
+
address authority,
|
15
|
+
address registryAddress,
|
16
|
+
bytes32 salt
|
17
|
+
)
|
16
18
|
ProxyManager(registryAddress)
|
17
19
|
{
|
18
|
-
ApplicationService svc = new ApplicationService();
|
19
|
-
bytes memory data = abi.encode(registryAddress, address(this));
|
20
|
-
IVersionable versionable =
|
20
|
+
ApplicationService svc = new ApplicationService{salt: salt}();
|
21
|
+
bytes memory data = abi.encode(registryAddress, address(this), authority);
|
22
|
+
IVersionable versionable = deployDetermenistic(
|
21
23
|
address(svc),
|
22
|
-
data
|
24
|
+
data,
|
25
|
+
salt);
|
23
26
|
|
24
27
|
_applicationService = ApplicationService(address(versionable));
|
25
28
|
}
|
@@ -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 "./IApplicationService.sol";
|
@@ -15,8 +15,6 @@ import {IPolicy} from "../instance/module/IPolicy.sol";
|
|
15
15
|
import {IRisk} from "../instance/module/IRisk.sol";
|
16
16
|
import {IBundle} from "../instance/module/IBundle.sol";
|
17
17
|
import {IProductService} from "./IProductService.sol";
|
18
|
-
import {ITreasury} from "../instance/module/ITreasury.sol";
|
19
|
-
import {ISetup} from "../instance/module/ISetup.sol";
|
20
18
|
|
21
19
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
22
20
|
|
@@ -29,7 +27,7 @@ import {UFixed, UFixedLib} from "../type/UFixed.sol";
|
|
29
27
|
import {Blocknumber, blockNumber} from "../type/Blocknumber.sol";
|
30
28
|
import {ObjectType, INSTANCE, PRODUCT, POOL, APPLICATION, POLICY, CLAIM, BUNDLE} from "../type/ObjectType.sol";
|
31
29
|
import {SUBMITTED, ACTIVE, KEEP_STATE, DECLINED, CONFIRMED, CLOSED, PAID} from "../type/StateId.sol";
|
32
|
-
import {NftId, NftIdLib
|
30
|
+
import {NftId, NftIdLib} from "../type/NftId.sol";
|
33
31
|
import {Fee, FeeLib} from "../type/Fee.sol";
|
34
32
|
import {ReferralId} from "../type/Referral.sol";
|
35
33
|
import {RiskId} from "../type/RiskId.sol";
|
@@ -38,7 +36,7 @@ import {ClaimId, ClaimIdLib} from "../type/ClaimId.sol";
|
|
38
36
|
import {PayoutId, PayoutIdLib} from "../type/PayoutId.sol";
|
39
37
|
import {Version, VersionLib} from "../type/Version.sol";
|
40
38
|
|
41
|
-
import {
|
39
|
+
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
42
40
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
43
41
|
import {IBundleService} from "../pool/IBundleService.sol";
|
44
42
|
import {IClaimService} from "./IClaimService.sol";
|
@@ -48,7 +46,7 @@ import {Service} from "../shared/Service.sol";
|
|
48
46
|
|
49
47
|
|
50
48
|
contract ClaimService is
|
51
|
-
|
49
|
+
ComponentVerifyingService,
|
52
50
|
IClaimService
|
53
51
|
{
|
54
52
|
|
@@ -62,12 +60,13 @@ contract ClaimService is
|
|
62
60
|
virtual override
|
63
61
|
initializer()
|
64
62
|
{
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
63
|
+
(
|
64
|
+
address registryAddress,,
|
65
|
+
//address managerAddress
|
66
|
+
address authority
|
67
|
+
) = abi.decode(data, (address, address, address));
|
69
68
|
|
70
|
-
initializeService(registryAddress,
|
69
|
+
initializeService(registryAddress, authority, owner);
|
71
70
|
|
72
71
|
_poolService = IPoolService(getRegistry().getServiceAddress(POOL(), getVersion().toMajorPart()));
|
73
72
|
|
@@ -315,7 +314,12 @@ contract ClaimService is
|
|
315
314
|
instance.getInstanceStore().updatePolicyClaims(policyNftId, policyInfo, KEEP_STATE());
|
316
315
|
|
317
316
|
// inform pool about payout
|
318
|
-
_poolService.reduceCollateral(
|
317
|
+
_poolService.reduceCollateral(
|
318
|
+
instance,
|
319
|
+
address(instanceReader.getComponentInfo(policyInfo.productNftId).token),
|
320
|
+
policyNftId,
|
321
|
+
policyInfo,
|
322
|
+
payoutAmount);
|
319
323
|
|
320
324
|
// transfer payout token and fee
|
321
325
|
(
|
@@ -349,7 +353,6 @@ contract ClaimService is
|
|
349
353
|
|
350
354
|
if(payoutAmount.gtz()) {
|
351
355
|
NftId productNftId = policyInfo.productNftId;
|
352
|
-
ISetup.ProductSetupInfo memory setupInfo = instanceReader.getProductSetupInfo(productNftId);
|
353
356
|
|
354
357
|
// get pool component info from policy or product
|
355
358
|
NftId poolNftId = getRegistry().getObjectInfo(policyInfo.bundleNftId).parentNftId;
|
@@ -358,7 +361,8 @@ contract ClaimService is
|
|
358
361
|
netPayoutAmount = payoutAmount;
|
359
362
|
beneficiary = _getBeneficiary(policyNftId, payoutInfo.claimId);
|
360
363
|
|
361
|
-
|
364
|
+
IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
|
365
|
+
if(FeeLib.gtz(productInfo.processingFee)) {
|
362
366
|
// TODO calculate net payout and processing fees
|
363
367
|
// TODO transfer processing fees to product wallet
|
364
368
|
// TODO inform product to update fee book keeping
|
@@ -392,6 +396,8 @@ contract ClaimService is
|
|
392
396
|
NftId policyNftId
|
393
397
|
)
|
394
398
|
internal
|
399
|
+
view
|
400
|
+
virtual
|
395
401
|
returns (
|
396
402
|
IInstance instance,
|
397
403
|
InstanceReader instanceReader,
|
@@ -399,7 +405,7 @@ contract ClaimService is
|
|
399
405
|
)
|
400
406
|
{
|
401
407
|
NftId productNftId;
|
402
|
-
(productNftId,, instance) =
|
408
|
+
(productNftId,, instance) = _getAndVerifyActiveComponent(PRODUCT());
|
403
409
|
instanceReader = instance.getInstanceReader();
|
404
410
|
|
405
411
|
// check caller(product) policy match
|
@@ -433,10 +439,4 @@ contract ClaimService is
|
|
433
439
|
// get claim info
|
434
440
|
claimInfo = instanceReader.getClaimInfo(policyNftId, claimId);
|
435
441
|
}
|
436
|
-
|
437
|
-
function _getAndVerifyInstanceAndProduct() internal view returns (Product product) {
|
438
|
-
IRegistry.ObjectInfo memory productInfo;
|
439
|
-
(, productInfo,) = _getAndVerifyCallingComponentAndInstance(PRODUCT());
|
440
|
-
product = Product(productInfo.objectAddress);
|
441
|
-
}
|
442
442
|
}
|
@@ -11,15 +11,18 @@ contract ClaimServiceManager is ProxyManager {
|
|
11
11
|
|
12
12
|
/// @dev initializes proxy manager with service implementation
|
13
13
|
constructor(
|
14
|
-
address
|
15
|
-
|
14
|
+
address authority,
|
15
|
+
address registryAddress,
|
16
|
+
bytes32 salt
|
17
|
+
)
|
16
18
|
ProxyManager(registryAddress)
|
17
19
|
{
|
18
|
-
ClaimService svc = new ClaimService();
|
19
|
-
bytes memory data = abi.encode(registryAddress, address(this));
|
20
|
-
IVersionable versionable =
|
20
|
+
ClaimService svc = new ClaimService{salt: salt}();
|
21
|
+
bytes memory data = abi.encode(registryAddress, address(this), authority);
|
22
|
+
IVersionable versionable = deployDetermenistic(
|
21
23
|
address(svc),
|
22
|
-
data
|
24
|
+
data,
|
25
|
+
salt);
|
23
26
|
|
24
27
|
_claimService = ClaimService(address(versionable));
|
25
28
|
}
|
@@ -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 {IInstance} from "../instance/IInstance.sol";
|
5
5
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
@@ -45,6 +45,10 @@ interface IClaimService is
|
|
45
45
|
bytes memory claimData
|
46
46
|
) external returns (ClaimId claimId);
|
47
47
|
|
48
|
+
|
49
|
+
// TODO add claim revoke functionality
|
50
|
+
|
51
|
+
|
48
52
|
/// @dev declines the specified claim
|
49
53
|
/// function can only be called by product, policy needs to match with calling product
|
50
54
|
function decline(
|
@@ -53,6 +57,7 @@ interface IClaimService is
|
|
53
57
|
bytes memory data // claim processing data
|
54
58
|
) external;
|
55
59
|
|
60
|
+
|
56
61
|
/// @dev confirms the specified claim and specifies the payout amount
|
57
62
|
/// function can only be called by product, policy needs to match with calling product
|
58
63
|
function confirm(
|
@@ -62,6 +67,7 @@ interface IClaimService is
|
|
62
67
|
bytes memory data // claim processing data
|
63
68
|
) external;
|
64
69
|
|
70
|
+
|
65
71
|
/// @dev closes the specified claim
|
66
72
|
/// function can only be called by product, policy needs to match with calling product
|
67
73
|
function close(
|
@@ -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";
|
@@ -20,6 +20,11 @@ interface IPolicyService is IService {
|
|
20
20
|
|
21
21
|
error ErrorPolicyServicePolicyProductMismatch(NftId applicationNftId, NftId expectedProductNftId, NftId actualProductNftId);
|
22
22
|
error ErrorPolicyServicePolicyStateNotApplied(NftId applicationNftId);
|
23
|
+
error ErrorPolicyServicePolicyStateNotCollateralizedOrApplied(NftId applicationNftId);
|
24
|
+
|
25
|
+
error ErrorPolicyServicePremiumHigherThanExpected(Amount premiumExpectedAmount, Amount premiumToBePaidAmount);
|
26
|
+
error ErrorPolicyServiceBalanceInsufficient(address policyOwner, uint256 premiumAmount, uint256 balance);
|
27
|
+
error ErrorPolicyServiceAllowanceInsufficient(address policyOwner, address tokenHandler, uint256 premiumAmount, uint256 allowance);
|
23
28
|
|
24
29
|
error ErrorIPolicyServiceInsufficientAllowance(address customer, address tokenHandlerAddress, uint256 amount);
|
25
30
|
error ErrorPolicyServicePremiumAlreadyPaid(NftId policyNftId, Amount premiumPaidAmount);
|
@@ -70,11 +75,4 @@ interface IPolicyService is IService {
|
|
70
75
|
/// this function can only be called by a product. the policy needs to match with the calling product
|
71
76
|
function close(NftId policyNftId) external;
|
72
77
|
|
73
|
-
|
74
|
-
// TODO move function to pool service
|
75
|
-
function calculateRequiredCollateral(
|
76
|
-
UFixed collateralizationLevel,
|
77
|
-
Amount sumInsuredAmount
|
78
|
-
) external pure returns(Amount collateralAmount);
|
79
|
-
|
80
78
|
}
|
@@ -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,
|
@@ -4,7 +4,7 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {Amount} from "../type/Amount.sol";
|
5
5
|
import {Fee} from "../type/Fee.sol";
|
6
6
|
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
7
|
-
import {
|
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";
|
@@ -12,8 +12,6 @@ import {Seconds} from "../type/Seconds.sol";
|
|
12
12
|
|
13
13
|
interface IProductComponent is IInstanceLinkedComponent {
|
14
14
|
|
15
|
-
function getSetupInfo() external view returns (ISetup.ProductSetupInfo memory setupInfo);
|
16
|
-
|
17
15
|
function setFees(
|
18
16
|
Fee memory productFee,
|
19
17
|
Fee memory processingFee
|
@@ -35,7 +33,10 @@ interface IProductComponent is IInstanceLinkedComponent {
|
|
35
33
|
bytes memory applicationData
|
36
34
|
) external view returns (Amount netPremiumAmount);
|
37
35
|
|
38
|
-
|
36
|
+
|
37
|
+
/// @dev returns initial pool specific infos for this pool
|
38
|
+
function getInitialProductInfo() external view returns (IComponents.ProductInfo memory info);
|
39
|
+
|
39
40
|
function getPoolNftId() external view returns (NftId poolNftId);
|
40
41
|
function getDistributionNftId() external view returns (NftId distributionNftId);
|
41
42
|
}
|
@@ -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,
|