@etherisc/gif-next 0.0.2-7c8d286-020 → 0.0.2-7d488b3-675
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/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +32 -48
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +26 -34
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +246 -361
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +39 -8
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +23 -96
- 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 +184 -278
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +0 -32
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +109 -33
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +41 -96
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +65 -0
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +106 -142
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +53 -61
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +65 -0
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +20 -40
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +17 -33
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +41 -96
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +59 -75
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +41 -96
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.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 +118 -42
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +41 -96
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +23 -23
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +27 -43
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +41 -96
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +29 -45
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +41 -96
- 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/IInstance.sol/IInstance.json +7 -85
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +11 -54
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +25 -95
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +405 -512
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +41 -96
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +2 -2
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +63 -86
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +36 -26
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +2 -2
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +2 -2
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- 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/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
- 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/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +2 -2
- 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 +14 -14
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +30 -93
- 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 +42 -58
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +31 -39
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +41 -96
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +58 -74
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +39 -47
- 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/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +22 -38
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +74 -106
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +47 -63
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +26 -71
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +23 -35
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +41 -96
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +80 -96
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +50 -58
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +0 -21
- 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/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +0 -21
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +0 -21
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +86 -94
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +18 -452
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +53 -57
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +52 -89
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +36 -44
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +26 -55
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +23 -27
- 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/IRelease.sol/IRelease.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 +350 -440
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +18 -18
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +19 -19
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +368 -473
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +124 -128
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
- 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 +102 -63
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +49 -41
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +4 -60
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +1 -1
- 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/IComponentService.sol/IComponentService.json +24 -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/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/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -2
- 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/NftIdSet.sol/NftIdSet.json +2 -2
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- 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/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +2 -2
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +9 -74
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +3 -74
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +440 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +57 -141
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +34 -50
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +57 -30
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +29 -124
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +23 -35
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +128 -142
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +14 -24
- 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/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/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +1 -1
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- 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 +31 -33
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +2 -2
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/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/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 -56
- 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 +4 -4
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/accounting/AccountingService.sol +3 -2
- package/contracts/authorization/AccessAdmin.sol +186 -201
- package/contracts/authorization/AccessManagerCloneable.sol +31 -40
- package/contracts/authorization/Authorization.sol +33 -61
- package/contracts/authorization/IAccessAdmin.sol +36 -63
- package/contracts/authorization/IAuthorization.sol +0 -6
- package/contracts/distribution/BasicDistribution.sol +3 -5
- package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
- package/contracts/distribution/Distribution.sol +47 -4
- package/contracts/distribution/DistributionService.sol +6 -10
- package/contracts/distribution/IDistributionComponent.sol +9 -0
- package/contracts/distribution/IDistributionService.sol +5 -3
- package/contracts/instance/IInstance.sol +8 -43
- package/contracts/instance/IInstanceService.sol +2 -14
- package/contracts/instance/Instance.sol +13 -62
- package/contracts/instance/InstanceAdmin.sol +107 -120
- package/contracts/instance/InstanceAuthorizationV3.sol +21 -43
- package/contracts/instance/InstanceReader.sol +1 -1
- package/contracts/instance/InstanceService.sol +60 -118
- package/contracts/oracle/BasicOracleAuthorization.sol +1 -1
- package/contracts/oracle/OracleService.sol +4 -4
- package/contracts/pool/BasicPoolAuthorization.sol +1 -1
- package/contracts/pool/PoolLib.sol +1 -94
- package/contracts/pool/PoolService.sol +89 -91
- package/contracts/product/ApplicationService.sol +1 -10
- package/contracts/product/BasicProductAuthorization.sol +1 -1
- package/contracts/product/ClaimService.sol +0 -8
- package/contracts/product/IApplicationService.sol +0 -2
- package/contracts/product/IPricingService.sol +0 -1
- package/contracts/product/IRiskService.sol +0 -3
- package/contracts/product/PolicyService.sol +53 -35
- package/contracts/product/PolicyServiceLib.sol +1 -55
- package/contracts/product/PricingService.sol +0 -5
- package/contracts/product/RiskService.sol +0 -10
- package/contracts/registry/RegistryAdmin.sol +229 -133
- package/contracts/registry/ReleaseAdmin.sol +22 -30
- package/contracts/registry/ReleaseRegistry.sol +33 -39
- package/contracts/registry/ServiceAuthorizationV3.sol +3 -88
- package/contracts/shared/Component.sol +6 -6
- package/contracts/shared/ComponentService.sol +29 -33
- package/contracts/shared/ContractLib.sol +0 -28
- package/contracts/shared/IComponentService.sol +6 -4
- package/contracts/shared/InitializableERC165.sol +1 -9
- package/contracts/shared/NftOwnable.sol +1 -2
- package/contracts/shared/Registerable.sol +4 -1
- package/contracts/shared/TokenHandler.sol +4 -5
- package/contracts/staking/IStaking.sol +2 -12
- package/contracts/staking/IStakingService.sol +1 -11
- package/contracts/staking/{StakingLib.sol → StakeManagerLib.sol} +22 -79
- package/contracts/staking/Staking.sol +13 -33
- package/contracts/staking/StakingReader.sol +15 -5
- package/contracts/staking/StakingService.sol +2 -39
- package/contracts/staking/StakingStore.sol +1 -2
- package/contracts/type/ObjectType.sol +14 -5
- package/contracts/type/Version.sol +0 -39
- package/package.json +1 -1
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +0 -4
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +0 -673
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +0 -4
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +0 -878
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +0 -469
- package/contracts/authorization/AccessAdminLib.sol +0 -183
- package/contracts/registry/RegistryAuthorization.sol +0 -267
@@ -69,7 +69,6 @@ contract PoolService is
|
|
69
69
|
function setMaxBalanceAmount(Amount maxBalanceAmount)
|
70
70
|
external
|
71
71
|
virtual
|
72
|
-
restricted()
|
73
72
|
{
|
74
73
|
(NftId poolNftId, IInstance instance) = _getAndVerifyActivePool();
|
75
74
|
InstanceReader instanceReader = instance.getInstanceReader();
|
@@ -85,7 +84,6 @@ contract PoolService is
|
|
85
84
|
|
86
85
|
function closeBundle(NftId bundleNftId)
|
87
86
|
external
|
88
|
-
restricted()
|
89
87
|
virtual
|
90
88
|
{
|
91
89
|
_checkNftType(bundleNftId, BUNDLE());
|
@@ -121,7 +119,6 @@ contract PoolService is
|
|
121
119
|
Amount availableAmount
|
122
120
|
)
|
123
121
|
external
|
124
|
-
restricted()
|
125
122
|
virtual
|
126
123
|
{
|
127
124
|
_checkNftType(policyNftId, POLICY());
|
@@ -178,7 +175,7 @@ contract PoolService is
|
|
178
175
|
function stake(NftId bundleNftId, Amount amount)
|
179
176
|
external
|
180
177
|
virtual
|
181
|
-
restricted()
|
178
|
+
// TODO: restricted() (once #462 is done)
|
182
179
|
returns(
|
183
180
|
Amount netAmount
|
184
181
|
)
|
@@ -225,7 +222,7 @@ contract PoolService is
|
|
225
222
|
|
226
223
|
// collect tokens from bundle owner
|
227
224
|
address bundleOwner = getRegistry().ownerOf(bundleNftId);
|
228
|
-
|
225
|
+
_pullStakingAmount(
|
229
226
|
instanceReader,
|
230
227
|
poolNftId,
|
231
228
|
bundleOwner,
|
@@ -238,7 +235,7 @@ contract PoolService is
|
|
238
235
|
function unstake(NftId bundleNftId, Amount amount)
|
239
236
|
external
|
240
237
|
virtual
|
241
|
-
restricted()
|
238
|
+
// TODO: restricted() (once #462 is done)
|
242
239
|
returns(Amount netAmount)
|
243
240
|
{
|
244
241
|
(
|
@@ -272,7 +269,7 @@ contract PoolService is
|
|
272
269
|
|
273
270
|
// transfer amount to bundle owner
|
274
271
|
address bundleOwner = getRegistry().ownerOf(bundleNftId);
|
275
|
-
|
272
|
+
_pushUnstakingAmount(
|
276
273
|
instanceReader,
|
277
274
|
poolNftId,
|
278
275
|
bundleOwner,
|
@@ -284,7 +281,7 @@ contract PoolService is
|
|
284
281
|
function fundPoolWallet(Amount amount)
|
285
282
|
external
|
286
283
|
virtual
|
287
|
-
restricted()
|
284
|
+
// restricted()
|
288
285
|
{
|
289
286
|
(
|
290
287
|
NftId poolNftId,
|
@@ -300,7 +297,7 @@ contract PoolService is
|
|
300
297
|
address poolOwner = getRegistry().ownerOf(poolNftId);
|
301
298
|
emit LogPoolServiceWalletFunded(poolNftId, poolOwner, amount);
|
302
299
|
|
303
|
-
|
300
|
+
_pullStakingAmount(
|
304
301
|
reader,
|
305
302
|
poolNftId,
|
306
303
|
poolOwner,
|
@@ -311,7 +308,7 @@ contract PoolService is
|
|
311
308
|
function defundPoolWallet(Amount amount)
|
312
309
|
external
|
313
310
|
virtual
|
314
|
-
restricted()
|
311
|
+
// restricted()
|
315
312
|
{
|
316
313
|
(
|
317
314
|
NftId poolNftId,
|
@@ -327,7 +324,7 @@ contract PoolService is
|
|
327
324
|
address poolOwner = getRegistry().ownerOf(poolNftId);
|
328
325
|
emit LogPoolServiceWalletDefunded(poolNftId, poolOwner, amount);
|
329
326
|
|
330
|
-
|
327
|
+
_pushUnstakingAmount(
|
331
328
|
reader,
|
332
329
|
poolNftId,
|
333
330
|
poolOwner,
|
@@ -479,8 +476,7 @@ contract PoolService is
|
|
479
476
|
payoutAmount);
|
480
477
|
|
481
478
|
// interactions
|
482
|
-
|
483
|
-
getRegistry(),
|
479
|
+
_transferTokenAndNotifyPolicyHolder(
|
484
480
|
instanceReader,
|
485
481
|
poolTokenHandler,
|
486
482
|
productNftId,
|
@@ -490,49 +486,49 @@ contract PoolService is
|
|
490
486
|
payoutBeneficiary);
|
491
487
|
}
|
492
488
|
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
489
|
+
function _transferTokenAndNotifyPolicyHolder(
|
490
|
+
InstanceReader instanceReader,
|
491
|
+
TokenHandler poolTokenHandler,
|
492
|
+
NftId productNftId,
|
493
|
+
NftId policyNftId,
|
494
|
+
PayoutId payoutId,
|
495
|
+
Amount payoutAmount,
|
496
|
+
address payoutBeneficiary
|
497
|
+
)
|
498
|
+
internal
|
499
|
+
{
|
500
|
+
(
|
501
|
+
Amount netPayoutAmount,
|
502
|
+
Amount processingFeeAmount,
|
503
|
+
address beneficiary
|
504
|
+
) = PoolLib.calculatePayoutAmounts(
|
505
|
+
getRegistry(),
|
506
|
+
instanceReader,
|
507
|
+
productNftId,
|
508
|
+
policyNftId,
|
509
|
+
payoutAmount,
|
510
|
+
payoutBeneficiary);
|
515
511
|
|
516
512
|
// 1st token tx to payout to beneficiary
|
517
|
-
|
518
|
-
|
519
|
-
|
513
|
+
poolTokenHandler.pushToken(
|
514
|
+
beneficiary,
|
515
|
+
netPayoutAmount);
|
520
516
|
|
521
517
|
// 2nd token tx to transfer processing fees to product wallet
|
522
518
|
// if processingFeeAmount > 0
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
519
|
+
if (processingFeeAmount.gtz()) {
|
520
|
+
poolTokenHandler.pushToken(
|
521
|
+
instanceReader.getWallet(productNftId),
|
522
|
+
processingFeeAmount);
|
523
|
+
}
|
528
524
|
|
529
525
|
// callback to policy holder if applicable
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
526
|
+
_policyHolderPayoutExecuted(
|
527
|
+
policyNftId,
|
528
|
+
payoutId,
|
529
|
+
beneficiary,
|
530
|
+
netPayoutAmount);
|
531
|
+
}
|
536
532
|
|
537
533
|
|
538
534
|
/// @inheritdoc IPoolService
|
@@ -674,48 +670,50 @@ contract PoolService is
|
|
674
670
|
|
675
671
|
|
676
672
|
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
673
|
+
function _policyHolderPayoutExecuted(
|
674
|
+
NftId policyNftId,
|
675
|
+
PayoutId payoutId,
|
676
|
+
address beneficiary,
|
677
|
+
Amount payoutAmount
|
678
|
+
)
|
679
|
+
internal
|
680
|
+
{
|
681
|
+
IPolicyHolder policyHolder = PoolLib.getPolicyHolder(getRegistry(), policyNftId);
|
682
|
+
if(address(policyHolder) != address(0)) {
|
683
|
+
policyHolder.payoutExecuted(policyNftId, payoutId, payoutAmount, beneficiary);
|
684
|
+
}
|
685
|
+
}
|
686
|
+
|
687
|
+
|
688
|
+
/// @dev Transfers the specified amount from the "from account" to the pool's wallet
|
689
|
+
function _pullStakingAmount(
|
690
|
+
InstanceReader reader,
|
691
|
+
NftId poolNftId,
|
692
|
+
address from,
|
693
|
+
Amount amount
|
694
|
+
)
|
695
|
+
internal
|
696
|
+
{
|
697
|
+
IComponents.ComponentInfo memory info = reader.getComponentInfo(poolNftId);
|
698
|
+
info.tokenHandler.pullToken(
|
699
|
+
from,
|
700
|
+
amount);
|
701
|
+
}
|
702
|
+
|
703
|
+
/// @dev Transfers the specified amount from the pool's wallet to the "to account"
|
704
|
+
function _pushUnstakingAmount(
|
705
|
+
InstanceReader reader,
|
706
|
+
NftId poolNftId,
|
707
|
+
address to,
|
708
|
+
Amount amount
|
709
|
+
)
|
710
|
+
internal
|
711
|
+
{
|
712
|
+
IComponents.ComponentInfo memory info = reader.getComponentInfo(poolNftId);
|
713
|
+
info.tokenHandler.pushToken(
|
714
|
+
to,
|
715
|
+
amount);
|
716
|
+
}
|
719
717
|
|
720
718
|
|
721
719
|
function _getAndVerifyActivePool()
|
@@ -71,11 +71,6 @@ contract ApplicationService is
|
|
71
71
|
if (!exists) { revert ErrorApplicationServiceRiskUnknown(riskId, productNftId); }
|
72
72
|
if (!active) { revert ErrorApplicationServiceRiskPaused(riskId, productNftId); }
|
73
73
|
|
74
|
-
NftId riskProductNftId = instanceReader.getRiskInfo(riskId).productNftId;
|
75
|
-
if (productNftId != riskProductNftId) {
|
76
|
-
revert ErrorApplicationServiceRiskProductMismatch(riskId, riskProductNftId, productNftId);
|
77
|
-
}
|
78
|
-
|
79
74
|
// check bundle with pool
|
80
75
|
IComponents.ProductInfo memory productInfo = instanceReader.getProductInfo(productNftId);
|
81
76
|
{
|
@@ -88,7 +83,7 @@ contract ApplicationService is
|
|
88
83
|
// check referral with distribution
|
89
84
|
{
|
90
85
|
if (productInfo.hasDistribution && ! referralId.eqz()) {
|
91
|
-
if (!
|
86
|
+
if (!instanceReader.isReferralValid(productInfo.distributionNftId, referralId)) {
|
92
87
|
revert ErrorApplicationServiceReferralInvalid(productNftId, productInfo.distributionNftId, referralId);
|
93
88
|
}
|
94
89
|
}
|
@@ -149,7 +144,6 @@ contract ApplicationService is
|
|
149
144
|
)
|
150
145
|
external
|
151
146
|
virtual
|
152
|
-
restricted()
|
153
147
|
nonReentrant()
|
154
148
|
returns (NftId applicationNftId)
|
155
149
|
{
|
@@ -228,7 +222,6 @@ contract ApplicationService is
|
|
228
222
|
)
|
229
223
|
external
|
230
224
|
virtual
|
231
|
-
restricted()
|
232
225
|
nonReentrant()
|
233
226
|
returns (NftId applicationNftId)
|
234
227
|
{
|
@@ -249,7 +242,6 @@ contract ApplicationService is
|
|
249
242
|
)
|
250
243
|
external
|
251
244
|
virtual
|
252
|
-
restricted()
|
253
245
|
nonReentrant()
|
254
246
|
{
|
255
247
|
_checkNftType(applicationNftId, POLICY());
|
@@ -260,7 +252,6 @@ contract ApplicationService is
|
|
260
252
|
function revoke(NftId applicationNftId)
|
261
253
|
external
|
262
254
|
virtual
|
263
|
-
restricted()
|
264
255
|
nonReentrant()
|
265
256
|
{
|
266
257
|
_checkNftType(applicationNftId, POLICY());
|
@@ -114,7 +114,6 @@ contract ClaimService is
|
|
114
114
|
)
|
115
115
|
external
|
116
116
|
virtual
|
117
|
-
restricted()
|
118
117
|
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
119
118
|
{
|
120
119
|
// checks
|
@@ -164,7 +163,6 @@ contract ClaimService is
|
|
164
163
|
)
|
165
164
|
external
|
166
165
|
virtual
|
167
|
-
restricted()
|
168
166
|
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
169
167
|
{
|
170
168
|
_checkNftType(policyNftId, POLICY());
|
@@ -197,7 +195,6 @@ contract ClaimService is
|
|
197
195
|
)
|
198
196
|
external
|
199
197
|
virtual
|
200
|
-
restricted()
|
201
198
|
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
202
199
|
{
|
203
200
|
(
|
@@ -227,7 +224,6 @@ contract ClaimService is
|
|
227
224
|
)
|
228
225
|
external
|
229
226
|
virtual
|
230
|
-
restricted()
|
231
227
|
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
232
228
|
{
|
233
229
|
_checkNftType(policyNftId, POLICY());
|
@@ -274,7 +270,6 @@ contract ClaimService is
|
|
274
270
|
)
|
275
271
|
external
|
276
272
|
virtual
|
277
|
-
restricted()
|
278
273
|
// nonReentrant() // prevents creating a reinsurance claim in a single tx
|
279
274
|
returns (PayoutId payoutId)
|
280
275
|
{
|
@@ -299,7 +294,6 @@ contract ClaimService is
|
|
299
294
|
)
|
300
295
|
external
|
301
296
|
virtual
|
302
|
-
restricted()
|
303
297
|
// nonReentrant() // prevents creating a reinsurance payout in a single tx
|
304
298
|
returns (PayoutId payoutId)
|
305
299
|
{
|
@@ -320,7 +314,6 @@ contract ClaimService is
|
|
320
314
|
)
|
321
315
|
external
|
322
316
|
virtual
|
323
|
-
restricted()
|
324
317
|
// nonReentrant() // prevents creating a reinsurance payout in a single tx
|
325
318
|
{
|
326
319
|
// checks
|
@@ -399,7 +392,6 @@ contract ClaimService is
|
|
399
392
|
)
|
400
393
|
external
|
401
394
|
virtual
|
402
|
-
restricted()
|
403
395
|
{
|
404
396
|
// checks
|
405
397
|
(
|
@@ -16,13 +16,11 @@ import {Seconds} from "../type/Seconds.sol";
|
|
16
16
|
interface IApplicationService is IService {
|
17
17
|
|
18
18
|
// _checkLinkedApplicationParameters
|
19
|
-
error ErrorApplicationServiceRiskProductMismatch(RiskId riskId, NftId riskProductNftId, NftId productNftId);
|
20
19
|
error ErrorApplicationServiceRiskUnknown(RiskId riskId, NftId productNftId);
|
21
20
|
error ErrorApplicationServiceRiskPaused(RiskId riskId, NftId productNftId);
|
22
21
|
error ErrorApplicationServiceBundleUnknown(NftId bundleNftId, NftId poolNftId);
|
23
22
|
error ErrorApplicationServiceBundleLocked(NftId bundleNftId, NftId poolNftId);
|
24
23
|
error ErrorApplicationServiceReferralInvalid(NftId productNftId, NftId distributionNftId, ReferralId referralId);
|
25
|
-
|
26
24
|
|
27
25
|
/// @dev creates a new application based on the specified attributes
|
28
26
|
/// may only be called by a product component
|
@@ -14,7 +14,6 @@ interface IPricingService is IService
|
|
14
14
|
{
|
15
15
|
|
16
16
|
error ErrorPricingServiceTargetWalletAmountsMismatch();
|
17
|
-
error ErrorPricingServiceRiskProductMismatch(RiskId riskId, NftId riskProductNftId, NftId productNftId);
|
18
17
|
error ErrorPricingServiceBundlePoolMismatch(NftId bundleNftId, NftId bundlePoolNftId, NftId poolNftId);
|
19
18
|
error ErrorPricingServiceFeeCalculationMismatch(
|
20
19
|
Amount distributionFeeFixAmount,
|
@@ -3,14 +3,11 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IService} from "../shared/IService.sol";
|
5
5
|
|
6
|
-
import {NftId} from "../type/NftId.sol";
|
7
6
|
import {RiskId} from "../type/RiskId.sol";
|
8
7
|
import {StateId} from "../type/StateId.sol";
|
9
8
|
|
10
9
|
interface IRiskService is IService {
|
11
10
|
|
12
|
-
error ErrorRiskServiceRiskProductMismatch(RiskId riskId, NftId riskProductNftId, NftId productNftId);
|
13
|
-
|
14
11
|
/// @dev Create a new risk with the given id and provided data.
|
15
12
|
/// The key of the risk derived from the risk id in comination with the product NftId.
|
16
13
|
/// Risk data is stored in the instance store.
|
@@ -73,7 +73,6 @@ contract PolicyService is
|
|
73
73
|
)
|
74
74
|
external
|
75
75
|
virtual
|
76
|
-
restricted()
|
77
76
|
nonReentrant()
|
78
77
|
{
|
79
78
|
// checks
|
@@ -101,7 +100,6 @@ contract PolicyService is
|
|
101
100
|
)
|
102
101
|
external
|
103
102
|
virtual
|
104
|
-
restricted()
|
105
103
|
nonReentrant()
|
106
104
|
returns (Amount premiumAmount)
|
107
105
|
{
|
@@ -130,7 +128,7 @@ contract PolicyService is
|
|
130
128
|
|
131
129
|
// optional activation of policy
|
132
130
|
if(activateAt.gtz()) {
|
133
|
-
applicationInfo =
|
131
|
+
applicationInfo = _activate(applicationNftId, applicationInfo, activateAt);
|
134
132
|
}
|
135
133
|
|
136
134
|
// update policy and set state to collateralized
|
@@ -188,7 +186,6 @@ contract PolicyService is
|
|
188
186
|
)
|
189
187
|
external
|
190
188
|
virtual
|
191
|
-
restricted()
|
192
189
|
nonReentrant()
|
193
190
|
{
|
194
191
|
// checks
|
@@ -235,7 +232,7 @@ contract PolicyService is
|
|
235
232
|
|
236
233
|
// optionally activate policy
|
237
234
|
if(activateAt.gtz()) {
|
238
|
-
policyInfo =
|
235
|
+
policyInfo = _activate(policyNftId, policyInfo, activateAt);
|
239
236
|
}
|
240
237
|
|
241
238
|
instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
|
@@ -253,7 +250,6 @@ contract PolicyService is
|
|
253
250
|
function activate(NftId policyNftId, Timestamp activateAt)
|
254
251
|
external
|
255
252
|
virtual
|
256
|
-
restricted()
|
257
253
|
nonReentrant()
|
258
254
|
{
|
259
255
|
// checks
|
@@ -263,7 +259,7 @@ contract PolicyService is
|
|
263
259
|
) = _getAndVerifyCallerForPolicy(policyNftId);
|
264
260
|
|
265
261
|
// effects
|
266
|
-
policyInfo =
|
262
|
+
policyInfo = _activate(policyNftId, policyInfo, activateAt);
|
267
263
|
instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
|
268
264
|
|
269
265
|
// log policy activation before interactions with policy holder
|
@@ -281,7 +277,6 @@ contract PolicyService is
|
|
281
277
|
)
|
282
278
|
external
|
283
279
|
virtual
|
284
|
-
restricted()
|
285
280
|
nonReentrant()
|
286
281
|
{
|
287
282
|
// checks
|
@@ -322,7 +317,6 @@ contract PolicyService is
|
|
322
317
|
)
|
323
318
|
external
|
324
319
|
virtual
|
325
|
-
restricted()
|
326
320
|
nonReentrant()
|
327
321
|
returns (Timestamp expiredAt)
|
328
322
|
{
|
@@ -350,7 +344,6 @@ contract PolicyService is
|
|
350
344
|
)
|
351
345
|
external
|
352
346
|
virtual
|
353
|
-
restricted()
|
354
347
|
nonReentrant()
|
355
348
|
returns (Timestamp expiredAt)
|
356
349
|
{
|
@@ -375,7 +368,6 @@ contract PolicyService is
|
|
375
368
|
)
|
376
369
|
external
|
377
370
|
virtual
|
378
|
-
restricted()
|
379
371
|
nonReentrant()
|
380
372
|
{
|
381
373
|
// checks
|
@@ -430,12 +422,19 @@ contract PolicyService is
|
|
430
422
|
internal
|
431
423
|
returns (Timestamp)
|
432
424
|
{
|
433
|
-
|
434
|
-
|
425
|
+
PolicyServiceLib.checkExpiration(
|
426
|
+
expireAt,
|
435
427
|
policyNftId,
|
436
|
-
|
437
|
-
|
428
|
+
instance.getInstanceReader().getPolicyState(policyNftId),
|
429
|
+
policyInfo);
|
438
430
|
|
431
|
+
// effects
|
432
|
+
// update policyInfo with new expiredAt timestamp
|
433
|
+
if (expireAt.gtz()) {
|
434
|
+
policyInfo.expiredAt = expireAt;
|
435
|
+
} else {
|
436
|
+
policyInfo.expiredAt = TimestampLib.blockTimestamp();
|
437
|
+
}
|
439
438
|
instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
|
440
439
|
|
441
440
|
emit LogPolicyServicePolicyExpirationUpdated(policyNftId, policyInfo.expiredAt);
|
@@ -446,31 +445,32 @@ contract PolicyService is
|
|
446
445
|
return policyInfo.expiredAt;
|
447
446
|
}
|
448
447
|
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
448
|
+
|
449
|
+
function _activate(
|
450
|
+
NftId policyNftId,
|
451
|
+
IPolicy.PolicyInfo memory policyInfo,
|
452
|
+
Timestamp activateAt
|
453
|
+
)
|
454
|
+
internal
|
455
|
+
virtual
|
456
|
+
view
|
457
|
+
returns (IPolicy.PolicyInfo memory)
|
458
|
+
{
|
459
459
|
// fail if policy has already been activated and activateAt is different
|
460
|
-
|
461
|
-
|
462
|
-
|
460
|
+
if(! policyInfo.activatedAt.eqz() && activateAt != policyInfo.activatedAt) {
|
461
|
+
revert ErrorPolicyServicePolicyAlreadyActivated(policyNftId);
|
462
|
+
}
|
463
463
|
|
464
464
|
// ignore if policy has already been activated and activateAt is the same
|
465
|
-
|
466
|
-
|
467
|
-
|
465
|
+
if (policyInfo.activatedAt == activateAt) {
|
466
|
+
return policyInfo;
|
467
|
+
}
|
468
468
|
|
469
|
-
|
470
|
-
|
469
|
+
policyInfo.activatedAt = activateAt;
|
470
|
+
policyInfo.expiredAt = activateAt.addSeconds(policyInfo.lifetime);
|
471
471
|
|
472
|
-
|
473
|
-
|
472
|
+
return policyInfo;
|
473
|
+
}
|
474
474
|
|
475
475
|
/// @dev update counters by calling the involved services
|
476
476
|
function _processSale(
|
@@ -544,6 +544,24 @@ contract PolicyService is
|
|
544
544
|
tokenHandler.pushToken(poolWallet, premium.poolPremiumAndFeeAmount);
|
545
545
|
}
|
546
546
|
}
|
547
|
+
|
548
|
+
|
549
|
+
/// @dev checks that policy has been collateralized and has been activated.
|
550
|
+
/// does not check if policy has been expired or closed.
|
551
|
+
function _policyHasBeenActivated(
|
552
|
+
StateId policyState,
|
553
|
+
IPolicy.PolicyInfo memory policyInfo
|
554
|
+
)
|
555
|
+
internal
|
556
|
+
view
|
557
|
+
returns (bool)
|
558
|
+
{
|
559
|
+
if (policyState != COLLATERALIZED()) { return false; }
|
560
|
+
if (TimestampLib.blockTimestamp() < policyInfo.activatedAt) { return false; }
|
561
|
+
return true;
|
562
|
+
}
|
563
|
+
|
564
|
+
|
547
565
|
function _policyHolderPolicyActivated(
|
548
566
|
NftId policyNftId,
|
549
567
|
Timestamp activateAt
|