@etherisc/gif-next 0.0.2-de7c770-422 → 0.0.2-df73b56-462
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 +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +26 -45
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +0 -19
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +2 -2
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +2 -2
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +9 -4
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +92 -61
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +2 -2
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +2 -2
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +60 -32
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +33 -28
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +2 -2
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +88 -91
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +2 -2
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +70 -60
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +11 -6
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +69 -38
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +32 -12
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
- 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 +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +2 -2
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +2 -2
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +9 -4
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +68 -37
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +28 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +2 -2
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +15 -10
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +90 -59
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +28 -0
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +28 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +35 -30
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +71 -40
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +17 -12
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +65 -34
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +5 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +2 -2
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +91 -70
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +97 -58
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +82 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +5 -0
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +167 -48
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +92 -45
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +39 -34
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +76 -45
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +5 -0
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +11 -6
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +62 -31
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- 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 +2 -2
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +108 -111
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +9 -4
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +60 -29
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +2 -2
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +2 -2
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +39 -34
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +97 -56
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +5 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +92 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +15 -5
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -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/InitializableCustom.sol/InitializableCustom.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +17 -7
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +5 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +2 -2
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +2 -2
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +78 -42
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +11 -6
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +64 -33
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2 -2
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +2 -2
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- 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/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +47 -27
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/authorization/AccessAdmin.sol +24 -21
- package/contracts/authorization/IAccessAdmin.sol +0 -1
- package/contracts/distribution/DistributionService.sol +6 -6
- package/contracts/distribution/DistributionServiceManager.sol +6 -6
- package/contracts/instance/InstanceService.sol +2 -3
- package/contracts/instance/InstanceServiceManager.sol +6 -7
- package/contracts/instance/module/IComponents.sol +3 -1
- package/contracts/oracle/OracleService.sol +6 -4
- package/contracts/oracle/OracleServiceManager.sol +6 -6
- package/contracts/pool/BundleService.sol +6 -6
- package/contracts/pool/BundleServiceManager.sol +6 -6
- package/contracts/pool/IPoolComponent.sol +18 -8
- package/contracts/pool/Pool.sol +26 -10
- package/contracts/pool/PoolService.sol +2 -3
- package/contracts/pool/PoolServiceManager.sol +4 -4
- package/contracts/product/ApplicationService.sol +3 -4
- package/contracts/product/ApplicationServiceManager.sol +4 -4
- package/contracts/product/ClaimService.sol +147 -61
- package/contracts/product/ClaimServiceManager.sol +4 -4
- package/contracts/product/IPolicyService.sol +7 -3
- package/contracts/product/PolicyService.sol +93 -20
- package/contracts/product/PolicyServiceManager.sol +4 -4
- package/contracts/product/PricingService.sol +2 -3
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +1 -0
- package/contracts/product/RiskService.sol +2 -3
- package/contracts/product/RiskServiceManager.sol +4 -4
- package/contracts/registry/RegistryServiceManager.sol +2 -2
- package/contracts/shared/ComponentService.sol +5 -5
- package/contracts/shared/ComponentServiceManager.sol +8 -5
- package/contracts/shared/ContractLib.sol +38 -0
- package/contracts/shared/IPolicyHolder.sol +12 -13
- package/contracts/shared/PolicyHolder.sol +7 -5
- package/contracts/shared/Service.sol +12 -7
- package/contracts/staking/Staking.sol +1 -1
- package/contracts/staking/StakingManager.sol +8 -6
- package/contracts/staking/StakingServiceManager.sol +2 -2
- package/contracts/upgradeability/ProxyManager.sol +67 -34
- package/contracts/upgradeability/Versionable.sol +2 -2
- package/package.json +1 -1
@@ -10,6 +10,13 @@ import {Timestamp} from "../type/Timestamp.sol";
|
|
10
10
|
|
11
11
|
interface IPolicyService is IService {
|
12
12
|
|
13
|
+
event LogPolicyServicePolicyCreated(NftId policyNftId, Amount premiumAmount, Timestamp activatedAt);
|
14
|
+
event LogPolicyServicePolicyDeclined(NftId policyNftId);
|
15
|
+
event LogPolicyServicePolicyPremiumCollected(NftId policyNftId, Amount premiumAmount);
|
16
|
+
event LogPolicyServicePolicyActivated(NftId policyNftId, Timestamp activatedAt);
|
17
|
+
event LogPolicyServicePolicyExpirationUpdated(NftId policyNftId, Timestamp originalExpiredAt, Timestamp expiredAt);
|
18
|
+
event LogPolicyServicePolicyClosed(NftId policyNftId);
|
19
|
+
|
13
20
|
error ErrorPolicyServicePolicyProductMismatch(NftId applicationNftId, NftId expectedProductNftId, NftId actualProductNftId);
|
14
21
|
error ErrorPolicyServicePolicyStateNotApplied(NftId applicationNftId);
|
15
22
|
error ErrorPolicyServicePolicyStateNotCollateralized(NftId applicationNftId);
|
@@ -32,9 +39,6 @@ interface IPolicyService is IService {
|
|
32
39
|
error ErrorPolicyServicePremiumMismatch(NftId policyNftId, Amount expectedPremiumAmount, Amount recalculatedPremiumAmount);
|
33
40
|
error ErrorPolicyServiceTransferredPremiumMismatch(NftId policyNftId, Amount expectedPremiumAmount, Amount transferredPremiumAmount);
|
34
41
|
|
35
|
-
event LogPolicyServicePolicyDeclined(NftId policyNftId);
|
36
|
-
event LogPolicyServicePolicyExpirationUpdated(NftId policyNftId, Timestamp expiredAt);
|
37
|
-
|
38
42
|
/// @dev creates the policy from {applicationNftId}.
|
39
43
|
/// After successful completion of the function the policy can be referenced using the application NftId.
|
40
44
|
/// Locks the sum insured amount in the pool, but does not transfer tokens. Call collectPremium to transfer tokens.
|
@@ -21,6 +21,7 @@ import {StateId} from "../type/StateId.sol";
|
|
21
21
|
import {VersionPart} from "../type/Version.sol";
|
22
22
|
|
23
23
|
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
24
|
+
import {ContractLib} from "../shared/ContractLib.sol";
|
24
25
|
import {IApplicationService} from "./IApplicationService.sol";
|
25
26
|
import {IBundleService} from "../pool/IBundleService.sol";
|
26
27
|
import {IClaimService} from "./IClaimService.sol";
|
@@ -28,6 +29,7 @@ import {IComponentService} from "../shared/IComponentService.sol";
|
|
28
29
|
import {IDistributionService} from "../distribution/IDistributionService.sol";
|
29
30
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
30
31
|
import {InstanceStore} from "../instance/InstanceStore.sol";
|
32
|
+
import {IPolicyHolder} from "../shared/IPolicyHolder.sol";
|
31
33
|
import {IPolicyService} from "./IPolicyService.sol";
|
32
34
|
import {IPoolService} from "../pool/IPoolService.sol";
|
33
35
|
import {IPricingService} from "./IPricingService.sol";
|
@@ -56,10 +58,9 @@ contract PolicyService is
|
|
56
58
|
initializer
|
57
59
|
{
|
58
60
|
(
|
59
|
-
address registryAddress
|
60
|
-
//address managerAddress
|
61
|
+
address registryAddress,
|
61
62
|
address authority
|
62
|
-
) = abi.decode(data, (address, address
|
63
|
+
) = abi.decode(data, (address, address));
|
63
64
|
|
64
65
|
_initializeService(registryAddress, authority, owner);
|
65
66
|
|
@@ -80,7 +81,8 @@ contract PolicyService is
|
|
80
81
|
NftId applicationNftId // = policyNftId
|
81
82
|
)
|
82
83
|
external
|
83
|
-
virtual
|
84
|
+
virtual
|
85
|
+
nonReentrant()
|
84
86
|
{
|
85
87
|
(NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
86
88
|
InstanceReader instanceReader = instance.getInstanceReader();
|
@@ -115,7 +117,8 @@ contract PolicyService is
|
|
115
117
|
Timestamp activateAt
|
116
118
|
)
|
117
119
|
external
|
118
|
-
virtual
|
120
|
+
virtual
|
121
|
+
nonReentrant()
|
119
122
|
{
|
120
123
|
// check caller is registered product
|
121
124
|
(NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
@@ -179,12 +182,14 @@ contract PolicyService is
|
|
179
182
|
productInfo.distributionNftId,
|
180
183
|
applicationInfo.referralId);
|
181
184
|
}
|
182
|
-
|
183
|
-
// TODO add calling pool contract if it needs to validate application
|
184
185
|
|
185
|
-
//
|
186
|
+
// log policy creation before interactions with token and policy holder
|
187
|
+
emit LogPolicyServicePolicyCreated(applicationNftId, premium.premiumAmount, activateAt);
|
186
188
|
|
187
|
-
// TODO
|
189
|
+
// TODO add calling pool contract if it needs to validate application
|
190
|
+
|
191
|
+
// callback to policy holder if applicable
|
192
|
+
_policyHolderPolicyActivated(applicationNftId, activateAt);
|
188
193
|
}
|
189
194
|
|
190
195
|
|
@@ -195,6 +200,7 @@ contract PolicyService is
|
|
195
200
|
)
|
196
201
|
external
|
197
202
|
virtual
|
203
|
+
nonReentrant()
|
198
204
|
{
|
199
205
|
// check caller is registered product
|
200
206
|
(,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
@@ -228,15 +234,18 @@ contract PolicyService is
|
|
228
234
|
instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
|
229
235
|
instance.getInstanceStore().updatePremiumState(policyNftId, PAID());
|
230
236
|
|
231
|
-
//
|
237
|
+
// log premium collection before interactions with token
|
238
|
+
emit LogPolicyServicePolicyPremiumCollected(policyNftId, premium.premiumAmount);
|
232
239
|
|
233
240
|
_transferFunds(instanceReader, policyNftId, policyInfo.productNftId, premium);
|
234
|
-
|
235
|
-
// TODO: add callback IPolicyHolder.policyActivated() if applicable
|
236
241
|
}
|
237
242
|
|
238
243
|
/// @inheritdoc IPolicyService
|
239
|
-
function activate(NftId policyNftId, Timestamp activateAt)
|
244
|
+
function activate(NftId policyNftId, Timestamp activateAt)
|
245
|
+
external
|
246
|
+
virtual
|
247
|
+
nonReentrant()
|
248
|
+
{
|
240
249
|
// check caller is registered product
|
241
250
|
(,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
242
251
|
InstanceReader instanceReader = instance.getInstanceReader();
|
@@ -246,9 +255,11 @@ contract PolicyService is
|
|
246
255
|
|
247
256
|
instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
|
248
257
|
|
249
|
-
//
|
258
|
+
// log policy activation before interactions with policy holder
|
259
|
+
emit LogPolicyServicePolicyActivated(policyNftId, activateAt);
|
250
260
|
|
251
|
-
//
|
261
|
+
// callback to policy holder if applicable
|
262
|
+
_policyHolderPolicyActivated(policyNftId, activateAt);
|
252
263
|
}
|
253
264
|
|
254
265
|
|
@@ -258,8 +269,8 @@ contract PolicyService is
|
|
258
269
|
Timestamp expireAt
|
259
270
|
)
|
260
271
|
external
|
261
|
-
override
|
262
272
|
virtual
|
273
|
+
nonReentrant()
|
263
274
|
returns (Timestamp expiredAt)
|
264
275
|
{
|
265
276
|
(NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
@@ -297,12 +308,14 @@ contract PolicyService is
|
|
297
308
|
}
|
298
309
|
|
299
310
|
// update policyInfo with new expiredAt timestamp
|
311
|
+
Timestamp originalExpiredAt = policyInfo.expiredAt;
|
300
312
|
policyInfo.expiredAt = expiredAt;
|
301
313
|
instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
|
302
314
|
|
303
|
-
emit LogPolicyServicePolicyExpirationUpdated(policyNftId, expiredAt);
|
315
|
+
emit LogPolicyServicePolicyExpirationUpdated(policyNftId, originalExpiredAt, expiredAt);
|
304
316
|
|
305
|
-
//
|
317
|
+
// callback to policy holder if applicable
|
318
|
+
_policyHolderPolicyExpired(policyNftId, expiredAt);
|
306
319
|
}
|
307
320
|
|
308
321
|
|
@@ -310,7 +323,8 @@ contract PolicyService is
|
|
310
323
|
NftId policyNftId
|
311
324
|
)
|
312
325
|
external
|
313
|
-
|
326
|
+
virtual
|
327
|
+
nonReentrant()
|
314
328
|
{
|
315
329
|
(,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
316
330
|
InstanceReader instanceReader = instance.getInstanceReader();
|
@@ -351,7 +365,7 @@ contract PolicyService is
|
|
351
365
|
policyInfo.closedAt = TimestampLib.blockTimestamp();
|
352
366
|
instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, CLOSED());
|
353
367
|
|
354
|
-
|
368
|
+
emit LogPolicyServicePolicyClosed(policyNftId);
|
355
369
|
}
|
356
370
|
|
357
371
|
|
@@ -525,6 +539,64 @@ contract PolicyService is
|
|
525
539
|
}
|
526
540
|
|
527
541
|
|
542
|
+
function _policyHolderPolicyActivated(
|
543
|
+
NftId policyNftId,
|
544
|
+
Timestamp activateAt
|
545
|
+
)
|
546
|
+
internal
|
547
|
+
virtual
|
548
|
+
{
|
549
|
+
// immediately return if policy is not activated
|
550
|
+
if (activateAt.eqz()) {
|
551
|
+
return;
|
552
|
+
}
|
553
|
+
|
554
|
+
// get policy holder address
|
555
|
+
IPolicyHolder policyHolder = _getPolicyHolder(policyNftId);
|
556
|
+
|
557
|
+
// execute callback if policy holder implements IPolicyHolder
|
558
|
+
if (address(policyHolder) != address(0)) {
|
559
|
+
policyHolder.policyActivated(policyNftId, activateAt);
|
560
|
+
}
|
561
|
+
}
|
562
|
+
|
563
|
+
|
564
|
+
function _policyHolderPolicyExpired(
|
565
|
+
NftId policyNftId,
|
566
|
+
Timestamp expiredAt
|
567
|
+
)
|
568
|
+
internal
|
569
|
+
virtual
|
570
|
+
{
|
571
|
+
// immediately return if policy is not activated
|
572
|
+
if (expiredAt.eqz()) {
|
573
|
+
return;
|
574
|
+
}
|
575
|
+
|
576
|
+
// get policy holder address
|
577
|
+
IPolicyHolder policyHolder = _getPolicyHolder(policyNftId);
|
578
|
+
|
579
|
+
// execute callback if policy holder implements IPolicyHolder
|
580
|
+
if (address(policyHolder) != address(0)) {
|
581
|
+
policyHolder.policyExpired(policyNftId, expiredAt);
|
582
|
+
}
|
583
|
+
}
|
584
|
+
|
585
|
+
|
586
|
+
function _getPolicyHolder(NftId policyNftId)
|
587
|
+
internal
|
588
|
+
view
|
589
|
+
returns (IPolicyHolder policyHolder)
|
590
|
+
{
|
591
|
+
address policyHolderAddress = getRegistry().ownerOf(policyNftId);
|
592
|
+
policyHolder = IPolicyHolder(policyHolderAddress);
|
593
|
+
|
594
|
+
if (!ContractLib.isPolicyHolder(policyHolderAddress)) {
|
595
|
+
policyHolder = IPolicyHolder(address(0));
|
596
|
+
}
|
597
|
+
}
|
598
|
+
|
599
|
+
|
528
600
|
function _getTokenHandler(
|
529
601
|
InstanceReader instanceReader,
|
530
602
|
NftId productNftId
|
@@ -539,6 +611,7 @@ contract PolicyService is
|
|
539
611
|
tokenHandler = instanceReader.getComponentInfo(productNftId).tokenHandler;
|
540
612
|
}
|
541
613
|
|
614
|
+
|
542
615
|
function _getDistributionNftAndWallets(
|
543
616
|
InstanceReader instanceReader,
|
544
617
|
NftId productNftId
|
@@ -12,14 +12,14 @@ contract PolicyServiceManager is ProxyManager {
|
|
12
12
|
/// @dev initializes proxy manager with product service implementation
|
13
13
|
constructor(
|
14
14
|
address authority,
|
15
|
-
address
|
15
|
+
address registry,
|
16
16
|
bytes32 salt
|
17
17
|
)
|
18
|
-
ProxyManager(registryAddress)
|
19
18
|
{
|
20
19
|
PolicyService svc = new PolicyService{salt: salt}();
|
21
|
-
bytes memory data = abi.encode(
|
22
|
-
IVersionable versionable =
|
20
|
+
bytes memory data = abi.encode(registry, authority);
|
21
|
+
IVersionable versionable = initialize(
|
22
|
+
registry,
|
23
23
|
address(svc),
|
24
24
|
data,
|
25
25
|
salt);
|
@@ -45,10 +45,9 @@ contract PricingService is
|
|
45
45
|
initializer()
|
46
46
|
{
|
47
47
|
(
|
48
|
-
address registryAddress
|
49
|
-
//address managerAddress
|
48
|
+
address registryAddress,
|
50
49
|
address authority
|
51
|
-
) = abi.decode(data, (address, address
|
50
|
+
) = abi.decode(data, (address, address));
|
52
51
|
|
53
52
|
_initializeService(registryAddress, authority, owner);
|
54
53
|
_registerInterface(type(IPricingService).interfaceId);
|
@@ -15,11 +15,11 @@ contract PricingServiceManager is ProxyManager {
|
|
15
15
|
address registryAddress,
|
16
16
|
bytes32 salt
|
17
17
|
)
|
18
|
-
ProxyManager(registryAddress)
|
19
18
|
{
|
20
19
|
PricingService pricingSrv = new PricingService{salt: salt}();
|
21
|
-
bytes memory data = abi.encode(registryAddress,
|
22
|
-
IVersionable versionable =
|
20
|
+
bytes memory data = abi.encode(registryAddress, authority);
|
21
|
+
IVersionable versionable = initialize(
|
22
|
+
registryAddress,
|
23
23
|
address(pricingSrv),
|
24
24
|
data,
|
25
25
|
salt);
|
@@ -112,6 +112,7 @@ abstract contract Product is
|
|
112
112
|
return IComponents.ProductInfo({
|
113
113
|
distributionNftId: $._distributionNftId,
|
114
114
|
poolNftId: $._poolNftId,
|
115
|
+
isProcessingFundedClaims: false,
|
115
116
|
productFee: FeeLib.zero(),
|
116
117
|
processingFee: FeeLib.zero(),
|
117
118
|
distributionFee: FeeLib.zero(),
|
@@ -33,10 +33,9 @@ contract RiskService is
|
|
33
33
|
virtual override
|
34
34
|
{
|
35
35
|
(
|
36
|
-
address registryAddress
|
37
|
-
//address managerAddress
|
36
|
+
address registryAddress,
|
38
37
|
address authority
|
39
|
-
) = abi.decode(data, (address, address
|
38
|
+
) = abi.decode(data, (address, address));
|
40
39
|
|
41
40
|
_initializeService(registryAddress, authority, owner);
|
42
41
|
|
@@ -12,14 +12,14 @@ contract RiskServiceManager is ProxyManager {
|
|
12
12
|
/// @dev initializes proxy manager with product service implementation
|
13
13
|
constructor(
|
14
14
|
address authority,
|
15
|
-
address
|
15
|
+
address registry,
|
16
16
|
bytes32 salt
|
17
17
|
)
|
18
|
-
ProxyManager(registryAddress)
|
19
18
|
{
|
20
19
|
RiskService svc = new RiskService{salt: salt}();
|
21
|
-
bytes memory data = abi.encode(
|
22
|
-
IVersionable versionable =
|
20
|
+
bytes memory data = abi.encode(registry, authority);
|
21
|
+
IVersionable versionable = initialize(
|
22
|
+
registry,
|
23
23
|
address(svc),
|
24
24
|
data,
|
25
25
|
salt);
|
@@ -21,7 +21,6 @@ contract RegistryServiceManager is
|
|
21
21
|
address registry, // used by implementation
|
22
22
|
bytes32 salt
|
23
23
|
)
|
24
|
-
ProxyManager(registry)
|
25
24
|
{
|
26
25
|
if(authority == address(0)) {
|
27
26
|
revert ErrorRegistryAccessManagerAuthorityZero();
|
@@ -33,7 +32,8 @@ contract RegistryServiceManager is
|
|
33
32
|
|
34
33
|
RegistryService srv = new RegistryService{ salt: salt }();
|
35
34
|
bytes memory data = abi.encode(registry, authority);
|
36
|
-
IVersionable versionable =
|
35
|
+
IVersionable versionable = initialize(
|
36
|
+
registry,
|
37
37
|
address(srv),
|
38
38
|
data,
|
39
39
|
salt);
|
@@ -48,12 +48,12 @@ contract ComponentService is
|
|
48
48
|
virtual override
|
49
49
|
initializer()
|
50
50
|
{
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
51
|
+
(
|
52
|
+
address registryAddress,
|
53
|
+
address authority
|
54
|
+
) = abi.decode(data, (address, address));
|
55
55
|
|
56
|
-
_initializeService(registryAddress,
|
56
|
+
_initializeService(registryAddress, authority, owner);
|
57
57
|
|
58
58
|
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
59
59
|
_instanceService = IInstanceService(_getServiceAddress(INSTANCE()));
|
@@ -11,15 +11,18 @@ contract ComponentServiceManager is ProxyManager {
|
|
11
11
|
|
12
12
|
/// @dev initializes proxy manager with service implementation
|
13
13
|
constructor(
|
14
|
-
address
|
14
|
+
address authority,
|
15
|
+
address registry,
|
16
|
+
bytes32 salt
|
15
17
|
)
|
16
|
-
ProxyManager(registryAddress)
|
17
18
|
{
|
18
19
|
ComponentService svc = new ComponentService();
|
19
|
-
bytes memory data = abi.encode(
|
20
|
-
IVersionable versionable =
|
20
|
+
bytes memory data = abi.encode(registry, authority);
|
21
|
+
IVersionable versionable = initialize(
|
22
|
+
registry,
|
21
23
|
address(svc),
|
22
|
-
data
|
24
|
+
data,
|
25
|
+
salt);
|
23
26
|
|
24
27
|
_componentService = ComponentService(address(versionable));
|
25
28
|
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
|
5
|
+
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
6
|
+
|
7
|
+
import {IPolicyHolder} from "./IPolicyHolder.sol";
|
8
|
+
|
9
|
+
library ContractLib {
|
10
|
+
|
11
|
+
function isPolicyHolder(address target) external view returns (bool) {
|
12
|
+
return ERC165Checker.supportsInterface(target, type(IPolicyHolder).interfaceId);
|
13
|
+
}
|
14
|
+
|
15
|
+
function isAccessManaged(address target) external view returns (bool) {
|
16
|
+
if (!isContract(target)) {
|
17
|
+
return false;
|
18
|
+
}
|
19
|
+
|
20
|
+
(bool success, ) = target.staticcall(
|
21
|
+
abi.encodeWithSelector(
|
22
|
+
IAccessManaged.authority.selector));
|
23
|
+
|
24
|
+
return success;
|
25
|
+
}
|
26
|
+
|
27
|
+
function isContract(address target) public view returns (bool) {
|
28
|
+
uint256 size;
|
29
|
+
assembly {
|
30
|
+
size := extcodesize(target)
|
31
|
+
}
|
32
|
+
return size > 0;
|
33
|
+
}
|
34
|
+
|
35
|
+
function supportsInterface(address target, bytes4 interfaceId) external view returns (bool) {
|
36
|
+
return ERC165Checker.supportsInterface(target, interfaceId);
|
37
|
+
}
|
38
|
+
}
|
@@ -9,28 +9,27 @@ import {ClaimId} from "../type/ClaimId.sol";
|
|
9
9
|
import {IRegistryLinked} from "../shared/IRegistryLinked.sol";
|
10
10
|
import {NftId} from "../type/NftId.sol";
|
11
11
|
import {PayoutId} from "../type/PayoutId.sol";
|
12
|
+
import {Timestamp} from "../type/Timestamp.sol";
|
12
13
|
|
13
|
-
/// @dev
|
14
|
-
///
|
14
|
+
/// @dev Generic interface for contracts that need to hold policies and receive payouts.
|
15
|
+
/// The framework notifies policy holder contracts for policy creation/expiry, claim confirmation and payout execution
|
15
16
|
interface IPolicyHolder is
|
16
17
|
IERC165,
|
17
18
|
IERC721Receiver,
|
18
19
|
IRegistryLinked
|
19
20
|
{
|
20
21
|
|
21
|
-
/// @dev
|
22
|
-
///
|
23
|
-
function policyActivated(NftId policyNftId) external;
|
22
|
+
/// @dev Callback function that will be called after successful policy activation.
|
23
|
+
/// Active policies may open claims under the activated policy.
|
24
|
+
function policyActivated(NftId policyNftId, Timestamp activatedAt) external;
|
24
25
|
|
25
|
-
/// @dev
|
26
|
-
/// expired policies
|
27
|
-
|
28
|
-
function policyExpired(NftId policyNftId) external;
|
26
|
+
/// @dev Callback function to indicate the specified policy has expired.
|
27
|
+
/// expired policies no longer accept new claims.
|
28
|
+
function policyExpired(NftId policyNftId, Timestamp expiredAt) external;
|
29
29
|
|
30
|
-
/// @dev
|
31
|
-
/// active policies may open claims under the activated policy
|
30
|
+
/// @dev Callback function to notify the confirmation of the specified claim.
|
32
31
|
function claimConfirmed(NftId policyNftId, ClaimId claimId, Amount amount) external;
|
33
32
|
|
34
|
-
/// @dev
|
35
|
-
function payoutExecuted(NftId policyNftId, PayoutId payoutId,
|
33
|
+
/// @dev Callback function to notify the successful payout.
|
34
|
+
function payoutExecuted(NftId policyNftId, PayoutId payoutId, Amount amount, address beneficiary) external;
|
36
35
|
}
|
@@ -10,11 +10,12 @@ import {IPolicyHolder} from "./IPolicyHolder.sol";
|
|
10
10
|
import {NftId} from "../type/NftId.sol";
|
11
11
|
import {PayoutId, PayoutIdLib} from "../type/PayoutId.sol";
|
12
12
|
import {RegistryLinked} from "./RegistryLinked.sol";
|
13
|
+
import {Timestamp} from "../type/Timestamp.sol";
|
13
14
|
|
14
15
|
/// @dev template implementation for IPolicyHolder
|
15
16
|
contract PolicyHolder is
|
16
17
|
InitializableERC165,
|
17
|
-
RegistryLinked,
|
18
|
+
RegistryLinked,
|
18
19
|
IPolicyHolder
|
19
20
|
{
|
20
21
|
function _initializePolicyHolder(
|
@@ -25,20 +26,21 @@ contract PolicyHolder is
|
|
25
26
|
onlyInitializing()
|
26
27
|
{
|
27
28
|
_initializeRegistryLinked(registryAddress);
|
29
|
+
_initializeERC165();
|
28
30
|
_registerInterface(type(IPolicyHolder).interfaceId);
|
29
31
|
}
|
30
32
|
|
31
33
|
/// @dev empty default implementation
|
32
|
-
function policyActivated(NftId policyNftId) external {}
|
34
|
+
function policyActivated(NftId policyNftId, Timestamp activatedAt) external virtual {}
|
33
35
|
|
34
36
|
/// @dev empty default implementation
|
35
|
-
function policyExpired(NftId policyNftId) external {}
|
37
|
+
function policyExpired(NftId policyNftId, Timestamp expiredAt) external virtual {}
|
36
38
|
|
37
39
|
/// @dev empty default implementation
|
38
|
-
function claimConfirmed(NftId policyNftId, ClaimId claimId, Amount amount) external {}
|
40
|
+
function claimConfirmed(NftId policyNftId, ClaimId claimId, Amount amount) external virtual {}
|
39
41
|
|
40
42
|
/// @dev empty default implementation
|
41
|
-
function payoutExecuted(NftId policyNftId, PayoutId payoutId,
|
43
|
+
function payoutExecuted(NftId policyNftId, PayoutId payoutId, Amount amount, address beneficiary) external virtual {}
|
42
44
|
|
43
45
|
//--- IERC165 functions ---------------//
|
44
46
|
function onERC721Received(
|
@@ -3,6 +3,7 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
5
5
|
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
6
|
+
import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
|
6
7
|
|
7
8
|
import {IRegistry} from "../registry/IRegistry.sol";
|
8
9
|
import {IService} from "./IService.sol";
|
@@ -19,6 +20,7 @@ abstract contract Service is
|
|
19
20
|
Registerable,
|
20
21
|
Versionable,
|
21
22
|
AccessManagedUpgradeable,
|
23
|
+
ReentrancyGuardUpgradeable,
|
22
24
|
IService
|
23
25
|
{
|
24
26
|
|
@@ -34,13 +36,7 @@ abstract contract Service is
|
|
34
36
|
virtual
|
35
37
|
onlyInitializing()
|
36
38
|
{
|
37
|
-
|
38
|
-
registry,
|
39
|
-
IRegistry(registry).getNftId(),
|
40
|
-
SERVICE(),
|
41
|
-
false, // is interceptor
|
42
|
-
initialOwner,
|
43
|
-
""); // data
|
39
|
+
__ReentrancyGuard_init();
|
44
40
|
|
45
41
|
// externally provided authority
|
46
42
|
if(authority != address(0)) {
|
@@ -52,6 +48,15 @@ abstract contract Service is
|
|
52
48
|
__AccessManaged_init(IAccessManaged(registryServiceAddress).authority());
|
53
49
|
}
|
54
50
|
|
51
|
+
_initializeRegisterable(
|
52
|
+
registry,
|
53
|
+
IRegistry(registry).getNftId(),
|
54
|
+
SERVICE(),
|
55
|
+
false, // is interceptor
|
56
|
+
initialOwner,
|
57
|
+
""); // data
|
58
|
+
|
59
|
+
|
55
60
|
_registerInterface(type(IAccessManaged).interfaceId);
|
56
61
|
_registerInterface(type(IService).interfaceId);
|
57
62
|
}
|
@@ -18,9 +18,9 @@ contract StakingManager is
|
|
18
18
|
address registry,
|
19
19
|
address tokenRegistry,
|
20
20
|
address stakingStore,
|
21
|
-
address initialOwner
|
21
|
+
address initialOwner,
|
22
|
+
bytes32 salt
|
22
23
|
)
|
23
|
-
ProxyManager(registry)
|
24
24
|
{
|
25
25
|
Staking stakingImplementation = new Staking();
|
26
26
|
|
@@ -30,10 +30,12 @@ contract StakingManager is
|
|
30
30
|
tokenRegistry,
|
31
31
|
stakingStore,
|
32
32
|
initialOwner);
|
33
|
-
|
34
|
-
IVersionable versionable =
|
35
|
-
|
36
|
-
|
33
|
+
|
34
|
+
IVersionable versionable = initialize(
|
35
|
+
registry,
|
36
|
+
_initialImplementation,
|
37
|
+
_initializationData,
|
38
|
+
salt);
|
37
39
|
|
38
40
|
_staking = Staking(address(versionable));
|
39
41
|
}
|
@@ -18,14 +18,14 @@ contract StakingServiceManager is
|
|
18
18
|
address registryAddress,
|
19
19
|
bytes32 salt
|
20
20
|
)
|
21
|
-
ProxyManager(registryAddress)
|
22
21
|
{
|
23
22
|
StakingService svc = new StakingService();
|
24
23
|
bytes memory data = abi.encode(
|
25
24
|
authority,
|
26
25
|
registryAddress,
|
27
26
|
IRegistry(registryAddress).getStakingAddress());
|
28
|
-
IVersionable versionable =
|
27
|
+
IVersionable versionable = initialize(
|
28
|
+
registryAddress,
|
29
29
|
address(svc),
|
30
30
|
data,
|
31
31
|
salt);
|