@etherisc/gif-next 0.0.2-c00cf5d-513 → 0.0.2-c0457ac-280
Sign up to get free protection for your applications and to get access to all the features.
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +198 -177
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +130 -335
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +67 -96
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +83 -108
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +35 -48
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +32 -101
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +65 -66
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +163 -10
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +81 -93
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +56 -40
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +84 -44
- 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 +268 -46
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +74 -43
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +1095 -344
- 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/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +2 -71
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- 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 +675 -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 +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/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +91 -264
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +56 -69
- 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 +145 -86
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +134 -133
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +242 -103
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +180 -376
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +42 -83
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +93 -167
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +56 -45
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +121 -211
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +64 -61
- 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 +20 -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 +241 -107
- 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 +180 -297
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +54 -99
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +163 -174
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +81 -54
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +337 -157
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +47 -230
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +34 -47
- 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 +65 -0
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +153 -1
- package/artifacts/contracts/registry/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/IServiceAuthorization.sol/IServiceAuthorization.json +129 -0
- 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 +294 -15
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +1712 -103
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +198 -28
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +45 -42
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +321 -161
- package/artifacts/contracts/registry/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorization.sol/ServiceAuthorization.json +171 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +187 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +314 -136
- package/artifacts/contracts/shared/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/shared/AccessAdmin.sol/AccessAdmin.json +1559 -0
- package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.dbg.json +1 -1
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.dbg.json +1 -1
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.json +42 -10
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.dbg.json +1 -1
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.json +42 -10
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.dbg.json +1 -1
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.json +52 -20
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.dbg.json +1 -1
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.json +52 -20
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +100 -96
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +916 -55
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +796 -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/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/shared/IAccessAdmin.sol/IAccessAdmin.json +1189 -0
- package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.dbg.json +1 -1
- package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.dbg.json +1 -1
- 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 +705 -0
- 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 +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 +1036 -0
- 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 +33 -20
- 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 +19 -32
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +17 -22
- 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 +16 -16
- 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/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 +657 -100
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +65 -46
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2261 -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 +96 -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 +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 +2 -2
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +114 -4
- 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/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 +29 -53
- package/contracts/distribution/DistributionService.sol +61 -115
- package/contracts/distribution/IDistributionComponent.sol +5 -10
- package/contracts/distribution/IDistributionService.sol +2 -8
- package/contracts/instance/IInstance.sol +15 -7
- package/contracts/instance/IInstanceService.sol +35 -10
- package/contracts/instance/Instance.sol +63 -34
- package/contracts/instance/InstanceAdmin.sol +3 -2
- package/contracts/instance/InstanceAuthorizationsLib.sol +84 -27
- package/contracts/instance/InstanceReader.sol +64 -40
- package/contracts/instance/InstanceService.sol +185 -45
- package/contracts/instance/InstanceStore.sol +122 -64
- 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/ObjectManager.sol +1 -3
- 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 +278 -0
- package/contracts/oracle/OracleServiceManager.sol +42 -0
- package/contracts/pool/BundleService.sol +79 -167
- package/contracts/pool/IBundleService.sol +4 -16
- package/contracts/pool/IPoolComponent.sol +4 -6
- package/contracts/pool/IPoolService.sol +45 -9
- package/contracts/pool/Pool.sol +39 -42
- package/contracts/pool/PoolService.sol +190 -142
- package/contracts/product/ApplicationService.sol +109 -42
- package/contracts/product/ClaimService.sol +18 -19
- 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 +7 -6
- package/contracts/product/IProductService.sol +1 -8
- package/contracts/product/PolicyService.sol +225 -128
- package/contracts/product/PricingService.sol +72 -48
- package/contracts/product/Product.sol +47 -49
- package/contracts/product/ProductService.sol +26 -114
- package/contracts/registry/ChainNft.sol +8 -1
- package/contracts/registry/IRegistry.sol +15 -4
- package/contracts/registry/IRegistryService.sol +10 -0
- package/contracts/registry/IServiceAuthorization.sol +35 -0
- package/contracts/registry/Registry.sol +164 -47
- package/contracts/registry/RegistryAdmin.sol +264 -72
- package/contracts/registry/RegistryService.sol +48 -14
- package/contracts/registry/RegistryServiceManager.sol +2 -9
- package/contracts/registry/ReleaseManager.sol +242 -177
- package/contracts/registry/ServiceAuthorization.sol +86 -0
- package/contracts/registry/ServiceAuthorizationV3.sol +200 -0
- package/contracts/registry/TokenRegistry.sol +261 -64
- package/contracts/shared/AccessAdmin.sol +759 -0
- package/contracts/shared/AccessManagerCustom.sol +6 -1
- package/contracts/shared/AccessManagerExtended.sol +19 -7
- package/contracts/shared/Component.sol +139 -129
- package/contracts/shared/ComponentService.sol +563 -88
- package/contracts/shared/ComponentServiceManager.sol +35 -0
- package/contracts/shared/ComponentVerifyingService.sol +117 -0
- package/contracts/shared/ERC165.sol +1 -1
- package/contracts/shared/IAccessAdmin.sol +168 -0
- package/contracts/shared/IComponent.sol +17 -37
- package/contracts/shared/IComponentService.sol +102 -0
- package/contracts/shared/IInstanceLinkedComponent.sol +46 -0
- 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 +8 -1
- package/contracts/shared/InitializableCustom.sol +177 -0
- package/contracts/shared/InstanceLinkedComponent.sol +144 -0
- 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 +3 -13
- package/contracts/shared/PolicyHolder.sol +21 -13
- package/contracts/shared/ProxyManager.sol +2 -3
- 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/StakingManager.sol +54 -0
- package/contracts/staking/StakingReader.sol +187 -0
- package/contracts/staking/StakingService.sol +286 -44
- package/contracts/staking/StakingServiceManager.sol +7 -3
- package/contracts/staking/StakingStore.sol +613 -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 +142 -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 +82 -20
- 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/Version.sol +1 -1
- package/package.json +3 -3
- 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/contracts/instance/module/ISetup.sol +0 -33
- package/contracts/instance/module/ITreasury.sol +0 -23
@@ -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,
|
@@ -70,16 +70,81 @@ contract ApplicationService is
|
|
70
70
|
address authority
|
71
71
|
) = abi.decode(data, (address, address, address));
|
72
72
|
|
73
|
-
initializeService(registryAddress,
|
74
|
-
registerInterface(type(IApplicationService).interfaceId);
|
73
|
+
initializeService(registryAddress, address(0), owner);
|
75
74
|
|
76
75
|
_distributionService = IDistributionService(_getServiceAddress(DISTRIBUTION()));
|
77
76
|
_pricingService = IPricingService(_getServiceAddress(PRICE()));
|
77
|
+
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
78
|
+
|
79
|
+
registerInterface(type(IApplicationService).interfaceId);
|
78
80
|
}
|
79
81
|
|
80
82
|
|
81
|
-
function
|
82
|
-
|
83
|
+
function _checkLinkedpplicationParameters(
|
84
|
+
InstanceReader instanceReader,
|
85
|
+
NftId productNftId,
|
86
|
+
RiskId rirskId,
|
87
|
+
ReferralId referralId,
|
88
|
+
NftId bundleNftId
|
89
|
+
)
|
90
|
+
internal
|
91
|
+
virtual
|
92
|
+
view
|
93
|
+
{
|
94
|
+
IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
|
95
|
+
|
96
|
+
// TODO check riskId with product
|
97
|
+
|
98
|
+
// TODO check referral with distribution
|
99
|
+
|
100
|
+
// check bundle with pool
|
101
|
+
NftId productPoolNftId = productInfo.poolNftId;
|
102
|
+
NftId bundlePoolNftId = instanceReader.getBundleInfo(bundleNftId).poolNftId;
|
103
|
+
if(bundlePoolNftId != productPoolNftId) {
|
104
|
+
revert ErrorApplicationServiceBundlePoolMismatch(bundleNftId, productPoolNftId, bundlePoolNftId);
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
|
109
|
+
function _registerApplication(
|
110
|
+
NftId productNftId,
|
111
|
+
address applicationOwner
|
112
|
+
)
|
113
|
+
internal
|
114
|
+
virtual
|
115
|
+
returns (NftId applicationNftId)
|
116
|
+
{
|
117
|
+
IRegistry.ObjectInfo memory objectInfo = IRegistry.ObjectInfo(
|
118
|
+
NftIdLib.zero(),
|
119
|
+
productNftId,
|
120
|
+
POLICY(),
|
121
|
+
false, // intercepting property for policies is defined on product
|
122
|
+
address(0),
|
123
|
+
applicationOwner,
|
124
|
+
"");
|
125
|
+
|
126
|
+
applicationNftId = _registryService.registerPolicy(objectInfo);
|
127
|
+
}
|
128
|
+
|
129
|
+
|
130
|
+
function _calculatePremiumAmount(
|
131
|
+
IPolicy.PolicyInfo memory info
|
132
|
+
)
|
133
|
+
internal
|
134
|
+
virtual
|
135
|
+
view
|
136
|
+
returns (Amount premiumAmount)
|
137
|
+
{
|
138
|
+
return AmountLib.toAmount(
|
139
|
+
_pricingService.calculatePremium(
|
140
|
+
info.productNftId,
|
141
|
+
info.riskId,
|
142
|
+
info.sumInsuredAmount,
|
143
|
+
info.lifetime,
|
144
|
+
info.applicationData,
|
145
|
+
info.bundleNftId,
|
146
|
+
info.referralId
|
147
|
+
).premiumAmount);
|
83
148
|
}
|
84
149
|
|
85
150
|
|
@@ -96,39 +161,28 @@ contract ApplicationService is
|
|
96
161
|
virtual
|
97
162
|
returns (NftId applicationNftId)
|
98
163
|
{
|
99
|
-
(NftId productNftId,, IInstance instance) =
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
productNftId,
|
106
|
-
POLICY(),
|
107
|
-
false, // intercepting property for policies is defined on product
|
108
|
-
address(0),
|
109
|
-
applicationOwner,
|
110
|
-
""
|
111
|
-
)
|
112
|
-
);
|
113
|
-
|
114
|
-
// (uint256 premiumAmount,,,,,) = calculatePremium(
|
115
|
-
IPolicy.Premium memory premium = _pricingService.calculatePremium(
|
164
|
+
(NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
165
|
+
|
166
|
+
// check if provided references are valid and linked to calling product contract
|
167
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
168
|
+
_checkLinkedpplicationParameters(
|
169
|
+
instanceReader,
|
116
170
|
productNftId,
|
117
171
|
riskId,
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
IPolicy.PolicyInfo memory
|
172
|
+
referralId,
|
173
|
+
bundleNftId);
|
174
|
+
|
175
|
+
// register application with registry
|
176
|
+
applicationNftId = _registerApplication(productNftId, applicationOwner);
|
177
|
+
|
178
|
+
// create policy info for application
|
179
|
+
IPolicy.PolicyInfo memory applicationInfo = IPolicy.PolicyInfo({
|
126
180
|
productNftId: productNftId,
|
127
181
|
bundleNftId: bundleNftId,
|
128
182
|
referralId: referralId,
|
129
183
|
riskId: riskId,
|
130
184
|
sumInsuredAmount: sumInsuredAmount,
|
131
|
-
premiumAmount: AmountLib.
|
185
|
+
premiumAmount: AmountLib.zero(),
|
132
186
|
premiumPaidAmount: AmountLib.zero(),
|
133
187
|
lifetime: lifetime,
|
134
188
|
applicationData: applicationData,
|
@@ -141,8 +195,16 @@ contract ApplicationService is
|
|
141
195
|
expiredAt: zeroTimestamp(),
|
142
196
|
closedAt: zeroTimestamp()
|
143
197
|
});
|
144
|
-
|
145
|
-
|
198
|
+
|
199
|
+
// TODO consider to provide this amount externally
|
200
|
+
// actual calculation is done 2nd time anyway for premium collection
|
201
|
+
// calculate premium amount
|
202
|
+
applicationInfo.premiumAmount = _calculatePremiumAmount(applicationInfo);
|
203
|
+
|
204
|
+
// register application with instance
|
205
|
+
instance.getInstanceStore().createApplication(
|
206
|
+
applicationNftId,
|
207
|
+
applicationInfo);
|
146
208
|
|
147
209
|
// TODO: add logging
|
148
210
|
}
|
@@ -179,9 +241,14 @@ contract ApplicationService is
|
|
179
241
|
external
|
180
242
|
virtual override
|
181
243
|
{
|
182
|
-
(,, IInstance instance) =
|
244
|
+
(,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
183
245
|
instance.getInstanceStore().updateApplicationState(applicationNftId, REVOKED());
|
184
246
|
}
|
185
247
|
|
186
248
|
// internal functions
|
249
|
+
|
250
|
+
|
251
|
+
function _getDomain() internal pure override returns(ObjectType) {
|
252
|
+
return APPLICATION();
|
253
|
+
}
|
187
254
|
}
|
@@ -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
|
|
@@ -75,11 +73,6 @@ contract ClaimService is
|
|
75
73
|
registerInterface(type(IClaimService).interfaceId);
|
76
74
|
}
|
77
75
|
|
78
|
-
|
79
|
-
function getDomain() public pure override returns(ObjectType) {
|
80
|
-
return CLAIM();
|
81
|
-
}
|
82
|
-
|
83
76
|
function submit(
|
84
77
|
NftId policyNftId,
|
85
78
|
Amount claimAmount,
|
@@ -316,7 +309,12 @@ contract ClaimService is
|
|
316
309
|
instance.getInstanceStore().updatePolicyClaims(policyNftId, policyInfo, KEEP_STATE());
|
317
310
|
|
318
311
|
// inform pool about payout
|
319
|
-
_poolService.reduceCollateral(
|
312
|
+
_poolService.reduceCollateral(
|
313
|
+
instance,
|
314
|
+
address(instanceReader.getComponentInfo(policyInfo.productNftId).token),
|
315
|
+
policyNftId,
|
316
|
+
policyInfo,
|
317
|
+
payoutAmount);
|
320
318
|
|
321
319
|
// transfer payout token and fee
|
322
320
|
(
|
@@ -350,7 +348,6 @@ contract ClaimService is
|
|
350
348
|
|
351
349
|
if(payoutAmount.gtz()) {
|
352
350
|
NftId productNftId = policyInfo.productNftId;
|
353
|
-
ISetup.ProductSetupInfo memory setupInfo = instanceReader.getProductSetupInfo(productNftId);
|
354
351
|
|
355
352
|
// get pool component info from policy or product
|
356
353
|
NftId poolNftId = getRegistry().getObjectInfo(policyInfo.bundleNftId).parentNftId;
|
@@ -359,7 +356,8 @@ contract ClaimService is
|
|
359
356
|
netPayoutAmount = payoutAmount;
|
360
357
|
beneficiary = _getBeneficiary(policyNftId, payoutInfo.claimId);
|
361
358
|
|
362
|
-
|
359
|
+
IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
|
360
|
+
if(FeeLib.gtz(productInfo.processingFee)) {
|
363
361
|
// TODO calculate net payout and processing fees
|
364
362
|
// TODO transfer processing fees to product wallet
|
365
363
|
// TODO inform product to update fee book keeping
|
@@ -393,6 +391,8 @@ contract ClaimService is
|
|
393
391
|
NftId policyNftId
|
394
392
|
)
|
395
393
|
internal
|
394
|
+
view
|
395
|
+
virtual
|
396
396
|
returns (
|
397
397
|
IInstance instance,
|
398
398
|
InstanceReader instanceReader,
|
@@ -400,7 +400,7 @@ contract ClaimService is
|
|
400
400
|
)
|
401
401
|
{
|
402
402
|
NftId productNftId;
|
403
|
-
(productNftId,, instance) =
|
403
|
+
(productNftId,, instance) = _getAndVerifyActiveComponent(PRODUCT());
|
404
404
|
instanceReader = instance.getInstanceReader();
|
405
405
|
|
406
406
|
// check caller(product) policy match
|
@@ -435,9 +435,8 @@ contract ClaimService is
|
|
435
435
|
claimInfo = instanceReader.getClaimInfo(policyNftId, claimId);
|
436
436
|
}
|
437
437
|
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
product = Product(productInfo.objectAddress);
|
438
|
+
|
439
|
+
function _getDomain() internal pure override returns(ObjectType) {
|
440
|
+
return CLAIM();
|
442
441
|
}
|
443
442
|
}
|
@@ -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,
|
@@ -3,16 +3,14 @@ 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
|
-
function getSetupInfo() external view returns (ISetup.ProductSetupInfo memory setupInfo);
|
13
|
+
interface IProductComponent is IInstanceLinkedComponent {
|
16
14
|
|
17
15
|
function setFees(
|
18
16
|
Fee memory productFee,
|
@@ -35,7 +33,10 @@ interface IProductComponent is IComponent {
|
|
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,
|