@etherisc/gif-next 0.0.2-7aa572b-366 → 0.0.2-7ac2b66-931
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/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +86 -34
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +70 -32
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +52 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +2 -2
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +2 -2
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +2 -2
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +2 -2
- 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/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- 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 +37 -18
- 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/Distribution.sol/Distribution.json +19 -0
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +39 -10
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +105 -67
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +19 -0
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +29 -0
- 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 +25 -6
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +2 -2
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +61 -34
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +2 -2
- 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 +41 -22
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +2 -2
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +27 -8
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +29 -10
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +2 -2
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +93 -27
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +2 -2
- 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 +19 -0
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +87 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +25 -6
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +2 -2
- 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 +2 -2
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +109 -23
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +66 -28
- 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/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/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 +23 -4
- 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/IOracleComponent.sol/IOracleComponent.json +19 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +29 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +19 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +49 -20
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +75 -37
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +19 -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 +220 -59
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +88 -50
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +162 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +19 -0
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +220 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +19 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +20 -12
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +292 -65
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +91 -49
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +191 -26
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +69 -31
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +19 -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 +123 -83
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +94 -56
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +165 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +41 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +55 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +29 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +19 -0
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +92 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +109 -46
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +2 -2
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +88 -46
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +61 -32
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +76 -38
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +19 -0
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +112 -20
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +67 -29
- 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/IRegistry.sol/IRegistry.json +15 -4
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +29 -0
- 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 +47 -36
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +2 -2
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +2 -2
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +41 -12
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +62 -24
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +2 -2
- 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 +17 -17
- 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/Component.sol/Component.json +19 -0
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +104 -56
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +85 -47
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +2 -2
- 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/IComponent.sol/IComponent.json +19 -0
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +48 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +19 -0
- 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/INftOwnable.sol/INftOwnable.json +19 -0
- 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/IRegisterable.sol/IRegisterable.json +19 -0
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +29 -0
- 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/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +19 -0
- 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/NftOwnable.sol/NftOwnable.json +21 -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/Registerable.sol/Registerable.json +19 -0
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +29 -0
- 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 +29 -0
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +29 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +39 -10
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.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 -40
- 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 +39 -10
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +68 -30
- 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/Key32Set.sol/LibKey32Set.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/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/IVersionable.sol/IVersionable.json +10 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +54 -16
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.json +10 -0
- package/contracts/accounting/AccountingService.sol +13 -0
- package/contracts/accounting/IAccountingService.sol +2 -0
- package/contracts/authorization/Authorization.sol +2 -7
- package/contracts/examples/fire/FireProduct.sol +1 -1
- package/contracts/examples/unpermissioned/SimpleProduct.sol +15 -3
- package/contracts/instance/IInstanceService.sol +4 -1
- package/contracts/instance/InstanceService.sol +13 -1
- package/contracts/pool/BundleService.sol +14 -2
- package/contracts/pool/IBundleService.sol +10 -4
- package/contracts/pool/IPoolService.sol +7 -2
- package/contracts/pool/PoolLib.sol +10 -4
- package/contracts/pool/PoolService.sol +35 -3
- package/contracts/product/ApplicationService.sol +31 -3
- package/contracts/product/ClaimService.sol +32 -22
- package/contracts/product/IApplicationService.sol +20 -1
- package/contracts/product/IClaimService.sol +1 -1
- package/contracts/product/IPolicyService.sol +9 -1
- package/contracts/product/IRiskService.sol +4 -0
- package/contracts/product/PolicyService.sol +10 -2
- package/contracts/product/Product.sol +7 -4
- package/contracts/product/RiskService.sol +6 -0
- package/contracts/registry/IRegistry.sol +9 -4
- package/contracts/registry/Registry.sol +12 -6
- package/contracts/registry/RegistryService.sol +1 -1
- package/contracts/registry/ServiceAuthorizationV3.sol +1 -0
- package/contracts/shared/ComponentService.sol +1 -0
- package/contracts/shared/IComponentService.sol +1 -0
- package/contracts/shared/INftOwnable.sol +2 -0
- package/contracts/shared/NftOwnable.sol +2 -0
- package/contracts/upgradeability/IVersionable.sol +3 -0
- package/contracts/upgradeability/ProxyManager.sol +12 -0
- package/contracts/upgradeability/Versionable.sol +2 -2
- package/package.json +1 -1
@@ -171,6 +171,10 @@ contract InstanceService is
|
|
171
171
|
{
|
172
172
|
address instanceAddress = msg.sender;
|
173
173
|
IInstance(instanceAddress).getInstanceAdmin().setInstanceLocked(locked);
|
174
|
+
|
175
|
+
emit LogInstanceServiceInstanceLocked(
|
176
|
+
getRegistry().getNftIdForAddress(instanceAddress),
|
177
|
+
locked);
|
174
178
|
}
|
175
179
|
|
176
180
|
|
@@ -213,7 +217,7 @@ contract InstanceService is
|
|
213
217
|
TargetManagerLib.getDefaultLockingPeriod(),
|
214
218
|
TargetManagerLib.getDefaultRewardRate());
|
215
219
|
|
216
|
-
emit
|
220
|
+
emit LogInstanceServiceInstanceCreated(
|
217
221
|
instanceNftId,
|
218
222
|
address(instance));
|
219
223
|
}
|
@@ -299,6 +303,10 @@ contract InstanceService is
|
|
299
303
|
|
300
304
|
upgradedInstanceReaderClone.initializeWithInstance(instanceAddress);
|
301
305
|
instance.setInstanceReader(upgradedInstanceReaderClone);
|
306
|
+
|
307
|
+
emit LogInstanceServiceInstanceReaderUpgraded(
|
308
|
+
getRegistry().getNftIdForAddress(instanceAddress),
|
309
|
+
address(upgradedInstanceReaderClone));
|
302
310
|
}
|
303
311
|
|
304
312
|
|
@@ -369,6 +377,10 @@ contract InstanceService is
|
|
369
377
|
if(instanceReader.getInstance() != IInstance(_masterInstance)) { revert ErrorInstanceServiceInstanceReaderInstanceMismatch(); }
|
370
378
|
|
371
379
|
_masterInstanceReader = instanceReaderAddress;
|
380
|
+
|
381
|
+
emit LogInstanceServiceMasterInstanceReaderUpgraded(
|
382
|
+
getRegistry().getNftIdForAddress(_masterInstance),
|
383
|
+
instanceReaderAddress);
|
372
384
|
}
|
373
385
|
|
374
386
|
function getMasterInstanceReader() external virtual view returns (address) {
|
@@ -81,6 +81,8 @@ contract BundleService is
|
|
81
81
|
|
82
82
|
bundleInfo.fee = fee;
|
83
83
|
instance.getInstanceStore().updateBundle(bundleNftId, bundleInfo, KEEP_STATE());
|
84
|
+
|
85
|
+
emit LogBundleServiceBundleFeeUpdated(bundleNftId, fee.fixedFee, fee.fractionalFee);
|
84
86
|
}
|
85
87
|
|
86
88
|
|
@@ -128,7 +130,7 @@ contract BundleService is
|
|
128
130
|
BundleSet bundleManager = instance.getBundleSet();
|
129
131
|
bundleManager.add(bundleNftId);
|
130
132
|
|
131
|
-
emit LogBundleServiceBundleCreated(bundleNftId, poolNftId);
|
133
|
+
emit LogBundleServiceBundleCreated(bundleNftId, poolNftId, lifetime);
|
132
134
|
}
|
133
135
|
|
134
136
|
|
@@ -178,6 +180,8 @@ contract BundleService is
|
|
178
180
|
// effects
|
179
181
|
// updated locked amount
|
180
182
|
instanceStore.increaseLocked(bundleNftId, collateralAmount);
|
183
|
+
|
184
|
+
emit LogBundleServiceCollateralLocked(bundleNftId, policyNftId, collateralAmount);
|
181
185
|
}
|
182
186
|
|
183
187
|
|
@@ -221,7 +225,7 @@ contract BundleService is
|
|
221
225
|
BundleSet bundleManager = instance.getBundleSet();
|
222
226
|
bundleManager.unlock(bundleNftId);
|
223
227
|
|
224
|
-
emit
|
228
|
+
emit LogBundleServiceBundleUnlocked(bundleNftId);
|
225
229
|
}
|
226
230
|
|
227
231
|
|
@@ -259,6 +263,8 @@ contract BundleService is
|
|
259
263
|
unstakedAmount = balanceAmountWithFees - feeAmount;
|
260
264
|
_accountingService.decreaseBundleBalance(instanceStore, bundleNftId, unstakedAmount, feeAmount);
|
261
265
|
}
|
266
|
+
|
267
|
+
emit LogBundleServiceBundleClosed(bundleNftId);
|
262
268
|
}
|
263
269
|
|
264
270
|
/// @inheritdoc IBundleService
|
@@ -290,6 +296,8 @@ contract BundleService is
|
|
290
296
|
bundleNftId,
|
291
297
|
amount,
|
292
298
|
AmountLib.zero());
|
299
|
+
|
300
|
+
emit LogBundleServiceBundleStaked(bundleNftId, amount);
|
293
301
|
}
|
294
302
|
|
295
303
|
/// @inheritdoc IBundleService
|
@@ -331,6 +339,8 @@ contract BundleService is
|
|
331
339
|
bundleNftId,
|
332
340
|
unstakedAmount,
|
333
341
|
AmountLib.zero());
|
342
|
+
|
343
|
+
emit LogBundleServiceBundleUnstaked(bundleNftId, unstakedAmount);
|
334
344
|
}
|
335
345
|
|
336
346
|
/// @inheritdoc IBundleService
|
@@ -385,6 +395,8 @@ contract BundleService is
|
|
385
395
|
_checkNftType(bundleNftId, BUNDLE());
|
386
396
|
|
387
397
|
instanceStore.decreaseLocked(bundleNftId, collateralAmount);
|
398
|
+
|
399
|
+
emit LogBundleServiceCollateralReleased(bundleNftId, policyNftId, collateralAmount);
|
388
400
|
}
|
389
401
|
|
390
402
|
|
@@ -12,13 +12,10 @@ import {InstanceStore} from "../instance/InstanceStore.sol";
|
|
12
12
|
import {Seconds} from "../type/Seconds.sol";
|
13
13
|
import {StateId} from "../type/StateId.sol";
|
14
14
|
import {Timestamp} from "../type/Timestamp.sol";
|
15
|
+
import {UFixed} from "../type/UFixed.sol";
|
15
16
|
|
16
17
|
interface IBundleService is IService {
|
17
18
|
|
18
|
-
event LogBundleServiceBundleCreated(NftId bundleNftId, NftId poolNftId);
|
19
|
-
event LogBundleServiceBundleActivated(NftId bundleNftId);
|
20
|
-
event LogBundleServiceBundleLocked(NftId bundleNftId);
|
21
|
-
|
22
19
|
error ErrorBundleServiceInsufficientAllowance(address bundleOwner, address tokenHandlerAddress, Amount amount);
|
23
20
|
error ErrorBundleServiceBundleNotOpen(NftId bundleNftId, StateId state, Timestamp expiredAt);
|
24
21
|
error ErrorBundleServiceCapacityInsufficient(NftId bundleNftId, Amount capacityAmount, Amount collateralAmount);
|
@@ -33,7 +30,16 @@ interface IBundleService is IService {
|
|
33
30
|
|
34
31
|
error ErrorBundleServiceExtensionLifetimeIsZero();
|
35
32
|
|
33
|
+
event LogBundleServiceBundleCreated(NftId bundleNftId, NftId poolNftId, Seconds lifetime);
|
34
|
+
event LogBundleServiceBundleClosed(NftId bundleNftId);
|
35
|
+
event LogBundleServiceBundleLocked(NftId bundleNftId);
|
36
|
+
event LogBundleServiceBundleUnlocked(NftId bundleNftId);
|
36
37
|
event LogBundleServiceBundleExtended(NftId bundleNftId, Seconds lifetimeExtension, Timestamp extendedExpiredAt);
|
38
|
+
event LogBundleServiceBundleFeeUpdated(NftId bundleNftId, Amount fixedFee, UFixed fractionalFee);
|
39
|
+
event LogBundleServiceCollateralLocked(NftId bundleNftId, NftId policyNftId, Amount collateralAmount);
|
40
|
+
event LogBundleServiceCollateralReleased(NftId bundleNftId, NftId policyNftId, Amount collateralAmount);
|
41
|
+
event LogBundleServiceBundleStaked(NftId bundleNftId, Amount amount);
|
42
|
+
event LogBundleServiceBundleUnstaked(NftId bundleNftId, Amount amount);
|
37
43
|
|
38
44
|
/// @dev Create a new bundle for the specified attributes.
|
39
45
|
function create(
|
@@ -11,7 +11,6 @@ import {InstanceReader} from "../instance/InstanceReader.sol";
|
|
11
11
|
import {InstanceStore} from "../instance/InstanceStore.sol";
|
12
12
|
import {NftId} from "../type/NftId.sol";
|
13
13
|
import {PayoutId} from "../type/PayoutId.sol";
|
14
|
-
import {UFixed} from "../type/UFixed.sol";
|
15
14
|
|
16
15
|
interface IPoolService is IService {
|
17
16
|
|
@@ -29,6 +28,12 @@ interface IPoolService is IService {
|
|
29
28
|
|
30
29
|
event LogPoolServiceProcessFundedClaim(NftId policyNftId, ClaimId claimId, Amount availableAmount);
|
31
30
|
|
31
|
+
event LogPoolServiceApplicationVerified(NftId poolNftId, NftId bundleNftId, NftId applicationNftId, Amount totalCollateralAmount);
|
32
|
+
event LogPoolServiceCollateralLocked(NftId poolNftId, NftId bundleNftId, NftId applicationNftId, Amount totalCollateralAmount, Amount lockedCollateralAmount);
|
33
|
+
event LogPoolServiceCollateralReleased(NftId bundleNftId, NftId policyNftId, Amount remainingCollateralAmount);
|
34
|
+
event LogPoolServiceSaleProcessed(NftId poolNftId, NftId bundleNftId, Amount bundleNetAmount, Amount bundleFeeAmount, Amount poolFeeAmount);
|
35
|
+
event LogPoolServicePayoutProcessed(NftId poolNftId, NftId bundleNftId, NftId policyNftId, PayoutId payoutId, Amount netPayoutAmount, Amount processingFeeAmount, address payoutBeneficiary);
|
36
|
+
|
32
37
|
error ErrorPoolServicePoolNotExternallyManaged(NftId poolNftId);
|
33
38
|
error ErrorPoolServicePolicyPoolMismatch(NftId policyNftId, NftId productNftId, NftId expectedProductNftId);
|
34
39
|
error ErrorPoolServiceBundleOwnerRoleAlreadySet(NftId poolNftId);
|
@@ -81,7 +86,7 @@ interface IPoolService is IService {
|
|
81
86
|
PayoutId payoutId,
|
82
87
|
Amount payoutAmount,
|
83
88
|
address payoutBeneficiary
|
84
|
-
) external;
|
89
|
+
) external returns (Amount netPayoutAmount, Amount processingFeeAmount);
|
85
90
|
|
86
91
|
|
87
92
|
/// @dev increase stakes for bundle
|
@@ -129,7 +129,7 @@ library PoolLib {
|
|
129
129
|
// calculate processing fees if applicable
|
130
130
|
IComponents.FeeInfo memory feeInfo = instanceReader.getFeeInfo(productNftId);
|
131
131
|
if(FeeLib.gtz(feeInfo.processingFee)) {
|
132
|
-
|
132
|
+
(processingFeeAmount, netPayoutAmount) = FeeLib.calculateFee(feeInfo.processingFee, payoutAmount);
|
133
133
|
}
|
134
134
|
}
|
135
135
|
}
|
@@ -271,11 +271,17 @@ library PoolLib {
|
|
271
271
|
address payoutBeneficiary
|
272
272
|
)
|
273
273
|
external
|
274
|
+
returns (
|
275
|
+
Amount netPayoutAmount,
|
276
|
+
Amount processingFeeAmount
|
277
|
+
)
|
274
278
|
{
|
279
|
+
address beneficiary;
|
280
|
+
|
275
281
|
(
|
276
|
-
|
277
|
-
|
278
|
-
|
282
|
+
netPayoutAmount,
|
283
|
+
processingFeeAmount,
|
284
|
+
beneficiary
|
279
285
|
) = calculatePayoutAmounts(
|
280
286
|
registry,
|
281
287
|
instanceReader,
|
@@ -361,6 +361,8 @@ contract PoolService is
|
|
361
361
|
bundleNftId,
|
362
362
|
bundleNetAmount,
|
363
363
|
bundleFeeAmount);
|
364
|
+
|
365
|
+
emit LogPoolServiceSaleProcessed(poolNftId, bundleNftId, bundleNetAmount, bundleFeeAmount, poolFeeAmount);
|
364
366
|
}
|
365
367
|
|
366
368
|
|
@@ -419,10 +421,15 @@ contract PoolService is
|
|
419
421
|
bundleNftId,
|
420
422
|
totalCollateralAmount);
|
421
423
|
|
422
|
-
|
424
|
+
emit LogPoolServiceApplicationVerified(poolNftId, bundleNftId, applicationNftId, totalCollateralAmount);
|
423
425
|
}
|
424
426
|
|
425
|
-
|
427
|
+
emit LogPoolServiceCollateralLocked(
|
428
|
+
poolNftId,
|
429
|
+
bundleNftId,
|
430
|
+
applicationNftId,
|
431
|
+
totalCollateralAmount,
|
432
|
+
localCollateralAmount);
|
426
433
|
}
|
427
434
|
|
428
435
|
function processPayout(
|
@@ -438,6 +445,10 @@ contract PoolService is
|
|
438
445
|
external
|
439
446
|
virtual
|
440
447
|
restricted()
|
448
|
+
returns (
|
449
|
+
Amount netPayoutAmount,
|
450
|
+
Amount processingFeeAmount
|
451
|
+
)
|
441
452
|
{
|
442
453
|
// checks
|
443
454
|
_checkNftType(policyNftId, POLICY());
|
@@ -472,7 +483,7 @@ contract PoolService is
|
|
472
483
|
payoutAmount);
|
473
484
|
|
474
485
|
// interactions
|
475
|
-
PoolLib.transferTokenAndNotifyPolicyHolder(
|
486
|
+
(netPayoutAmount, processingFeeAmount) = PoolLib.transferTokenAndNotifyPolicyHolder(
|
476
487
|
getRegistry(),
|
477
488
|
instanceReader,
|
478
489
|
poolTokenHandler,
|
@@ -481,6 +492,22 @@ contract PoolService is
|
|
481
492
|
payoutId,
|
482
493
|
payoutAmount,
|
483
494
|
payoutBeneficiary);
|
495
|
+
|
496
|
+
if (processingFeeAmount.gtz()) {
|
497
|
+
_accountingService.increaseProductFeesForPool(
|
498
|
+
instanceStore,
|
499
|
+
productNftId,
|
500
|
+
processingFeeAmount);
|
501
|
+
}
|
502
|
+
|
503
|
+
emit LogPoolServicePayoutProcessed(
|
504
|
+
poolNftId,
|
505
|
+
bundleNftId,
|
506
|
+
policyNftId,
|
507
|
+
payoutId,
|
508
|
+
netPayoutAmount,
|
509
|
+
processingFeeAmount,
|
510
|
+
payoutBeneficiary);
|
484
511
|
}
|
485
512
|
|
486
513
|
|
@@ -560,6 +587,11 @@ contract PoolService is
|
|
560
587
|
instanceReader.getInstanceNftId(),
|
561
588
|
address(instanceReader.getToken(policyInfo.productNftId)),
|
562
589
|
remainingCollateralAmount);
|
590
|
+
|
591
|
+
emit LogPoolServiceCollateralReleased(
|
592
|
+
policyInfo.bundleNftId,
|
593
|
+
policyNftId,
|
594
|
+
remainingCollateralAmount);
|
563
595
|
}
|
564
596
|
|
565
597
|
|
@@ -185,7 +185,28 @@ contract ApplicationService is
|
|
185
185
|
applicationNftId,
|
186
186
|
applicationInfo);
|
187
187
|
|
188
|
-
|
188
|
+
_emitApplicationCreatedEvent(applicationNftId, applicationOwner, applicationInfo);
|
189
|
+
}
|
190
|
+
|
191
|
+
function _emitApplicationCreatedEvent(
|
192
|
+
NftId applicationNftId,
|
193
|
+
address applicationOwner,
|
194
|
+
IPolicy.PolicyInfo memory applicationInfo
|
195
|
+
)
|
196
|
+
internal
|
197
|
+
virtual
|
198
|
+
{
|
199
|
+
emit LogApplicationServiceApplicationCreated(
|
200
|
+
applicationNftId,
|
201
|
+
applicationInfo.productNftId,
|
202
|
+
applicationInfo.bundleNftId,
|
203
|
+
applicationInfo.riskId,
|
204
|
+
applicationInfo.referralId,
|
205
|
+
applicationOwner,
|
206
|
+
applicationInfo.sumInsuredAmount,
|
207
|
+
applicationInfo.premiumAmount,
|
208
|
+
applicationInfo.lifetime
|
209
|
+
);
|
189
210
|
}
|
190
211
|
|
191
212
|
function _createApplicationInfo(
|
@@ -234,7 +255,10 @@ contract ApplicationService is
|
|
234
255
|
{
|
235
256
|
_checkNftType(policyNftId, POLICY());
|
236
257
|
_checkNftType(bundleNftId, BUNDLE());
|
237
|
-
|
258
|
+
|
259
|
+
// TODO: implement
|
260
|
+
|
261
|
+
emit LogApplicationServiceApplicationRenewed(policyNftId, bundleNftId);
|
238
262
|
}
|
239
263
|
|
240
264
|
|
@@ -254,7 +278,10 @@ contract ApplicationService is
|
|
254
278
|
{
|
255
279
|
_checkNftType(applicationNftId, POLICY());
|
256
280
|
_checkNftType(bundleNftId, BUNDLE());
|
257
|
-
|
281
|
+
|
282
|
+
// TODO: implement
|
283
|
+
|
284
|
+
emit LogApplicationServiceApplicationAdjusted(applicationNftId, bundleNftId, riskId, referralId, sumInsuredAmount, lifetime);
|
258
285
|
}
|
259
286
|
|
260
287
|
function revoke(NftId applicationNftId)
|
@@ -267,6 +294,7 @@ contract ApplicationService is
|
|
267
294
|
|
268
295
|
(, IInstance instance) = _getAndVerifyActiveProduct();
|
269
296
|
instance.getInstanceStore().updateApplicationState(applicationNftId, REVOKED());
|
297
|
+
emit LogApplicationServiceApplicationRevoked(applicationNftId);
|
270
298
|
}
|
271
299
|
|
272
300
|
// internal functions
|
@@ -255,6 +255,8 @@ contract ClaimService is
|
|
255
255
|
|
256
256
|
claimInfo.closedAt = TimestampLib.blockTimestamp();
|
257
257
|
instanceStore.updateClaim(policyNftId, claimId, claimInfo, CLOSED());
|
258
|
+
|
259
|
+
emit LogClaimServiceClaimClosed(policyNftId, claimId);
|
258
260
|
}
|
259
261
|
|
260
262
|
|
@@ -315,6 +317,7 @@ contract ClaimService is
|
|
315
317
|
virtual
|
316
318
|
restricted()
|
317
319
|
// nonReentrant() // prevents creating a reinsurance payout in a single tx
|
320
|
+
returns (Amount netPayoutAmount, Amount processingFeeAmount)
|
318
321
|
{
|
319
322
|
// checks
|
320
323
|
(
|
@@ -324,30 +327,37 @@ contract ClaimService is
|
|
324
327
|
IPolicy.PolicyInfo memory policyInfo
|
325
328
|
) = _verifyCallerWithPolicy(policyNftId);
|
326
329
|
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
330
|
+
IPolicy.ClaimInfo memory claimInfo;
|
331
|
+
address payoutBeneficiary;
|
332
|
+
Amount payoutAmount;
|
333
|
+
|
334
|
+
{
|
335
|
+
// check that payout exists and is open
|
336
|
+
IPolicy.PayoutInfo memory payoutInfo = instanceReader.getPayoutInfo(policyNftId, payoutId);
|
337
|
+
payoutBeneficiary = payoutInfo.beneficiary;
|
338
|
+
payoutAmount = payoutInfo.amount;
|
339
|
+
StateId payoutState = instanceReader.getPayoutState(policyNftId, payoutId);
|
340
|
+
if(payoutState != EXPECTED()) {
|
341
|
+
revert ErrorClaimServicePayoutNotExpected(policyNftId, payoutId, payoutState);
|
342
|
+
}
|
333
343
|
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
344
|
+
// check that payout amount does not violate claim amount
|
345
|
+
claimInfo = instanceReader.getClaimInfo(policyNftId, payoutId.toClaimId());
|
346
|
+
if(claimInfo.paidAmount + payoutInfo.amount > claimInfo.claimAmount) {
|
347
|
+
revert ErrorClaimServicePayoutExceedsClaimAmount(
|
348
|
+
policyNftId,
|
349
|
+
payoutId.toClaimId(),
|
350
|
+
claimInfo.claimAmount,
|
351
|
+
claimInfo.paidAmount + payoutInfo.amount);
|
352
|
+
}
|
343
353
|
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
354
|
+
// effects
|
355
|
+
// update and save payout info with instance
|
356
|
+
payoutInfo.paidAt = TimestampLib.blockTimestamp();
|
357
|
+
instanceStore.updatePayout(policyNftId, payoutId, payoutInfo, PAID());
|
358
|
+
}
|
348
359
|
|
349
360
|
// update and save claim info with instance
|
350
|
-
Amount payoutAmount = payoutInfo.amount;
|
351
361
|
{
|
352
362
|
ClaimId claimId = payoutId.toClaimId();
|
353
363
|
// TODO cleanup
|
@@ -375,7 +385,7 @@ contract ClaimService is
|
|
375
385
|
|
376
386
|
// effects + interactions (push tokens to beneficiary, product)
|
377
387
|
// delegate to pool to update book keeping and moving tokens payout
|
378
|
-
_poolService.processPayout(
|
388
|
+
(netPayoutAmount, processingFeeAmount) = _poolService.processPayout(
|
379
389
|
instanceReader,
|
380
390
|
instanceStore,
|
381
391
|
policyInfo.productNftId, // product nft id
|
@@ -383,7 +393,7 @@ contract ClaimService is
|
|
383
393
|
policyInfo.bundleNftId,
|
384
394
|
payoutId,
|
385
395
|
payoutAmount,
|
386
|
-
|
396
|
+
payoutBeneficiary);
|
387
397
|
}
|
388
398
|
|
389
399
|
function cancelPayout(
|
@@ -6,7 +6,6 @@ import {IService} from "../shared/IService.sol";
|
|
6
6
|
|
7
7
|
import {Amount} from "../type/Amount.sol";
|
8
8
|
import {NftId} from "../type/NftId.sol";
|
9
|
-
import {ObjectType} from "../type/ObjectType.sol";
|
10
9
|
import {ReferralId} from "../type/Referral.sol";
|
11
10
|
import {RiskId} from "../type/RiskId.sol";
|
12
11
|
import {Seconds} from "../type/Seconds.sol";
|
@@ -15,6 +14,26 @@ import {Seconds} from "../type/Seconds.sol";
|
|
15
14
|
/// only product components may call transaction functions
|
16
15
|
interface IApplicationService is IService {
|
17
16
|
|
17
|
+
event LogApplicationServiceApplicationCreated(
|
18
|
+
NftId applicationNftId,
|
19
|
+
NftId productNftId,
|
20
|
+
NftId bundleNftId,
|
21
|
+
RiskId riskId,
|
22
|
+
ReferralId referralId,
|
23
|
+
address applicationOwner,
|
24
|
+
Amount sumInsuredAmount,
|
25
|
+
Amount premiumAmount,
|
26
|
+
Seconds lifetime);
|
27
|
+
event LogApplicationServiceApplicationRenewed(NftId policyNftId, NftId bundleNftId);
|
28
|
+
event LogApplicationServiceApplicationAdjusted(
|
29
|
+
NftId applicationNftId,
|
30
|
+
NftId bundleNftId,
|
31
|
+
RiskId riskId,
|
32
|
+
ReferralId referralId,
|
33
|
+
Amount sumInsuredAmount,
|
34
|
+
Seconds lifetime);
|
35
|
+
event LogApplicationServiceApplicationRevoked(NftId applicationNftId);
|
36
|
+
|
18
37
|
// _checkLinkedApplicationParameters
|
19
38
|
error ErrorApplicationServiceRiskProductMismatch(RiskId riskId, NftId riskProductNftId, NftId productNftId);
|
20
39
|
error ErrorApplicationServiceRiskUnknown(RiskId riskId, NftId productNftId);
|
@@ -125,7 +125,7 @@ interface IClaimService is
|
|
125
125
|
function processPayout(
|
126
126
|
NftId policyNftId,
|
127
127
|
PayoutId payoutId
|
128
|
-
) external;
|
128
|
+
) external returns (Amount netPayoutAmount, Amount processingFeeAmount);
|
129
129
|
|
130
130
|
/// @dev cancels the specified payout. no tokens are moved, payout is set to cancelled.
|
131
131
|
function cancelPayout(
|
@@ -19,6 +19,7 @@ interface IPolicyService is IService {
|
|
19
19
|
event LogPolicyServicePolicyExpirationUpdated(NftId policyNftId, Timestamp expiredAt);
|
20
20
|
event LogPolicyServicePolicyClosed(NftId policyNftId);
|
21
21
|
|
22
|
+
error LogPolicyServiceMaxPremiumAmountExceeded(NftId policyNftId, Amount maxPremiumAmount, Amount premiumAmount);
|
22
23
|
error ErrorPolicyServicePolicyProductMismatch(NftId applicationNftId, NftId expectedProductNftId, NftId actualProductNftId);
|
23
24
|
error ErrorPolicyServicePolicyStateNotApplied(NftId applicationNftId);
|
24
25
|
error ErrorPolicyServicePolicyStateNotCollateralized(NftId applicationNftId);
|
@@ -44,14 +45,21 @@ interface IPolicyService is IService {
|
|
44
45
|
error ErrorPolicyServiceTransferredPremiumMismatch(NftId policyNftId, Amount expectedPremiumAmount, Amount transferredPremiumAmount);
|
45
46
|
|
46
47
|
/// @dev creates the policy from {applicationNftId}.
|
48
|
+
/// @param applicationNftId the application NftId
|
49
|
+
/// @param activateAt the timestamp when the policy should be activated
|
50
|
+
/// @param maxPremiumAmount the maximum premium amount that the policy holder is willing to pay
|
51
|
+
/// During policy creation, the effective premium amount is calculated based on the provided parameters. If this
|
52
|
+
/// amount is higher than the maxPremiumAmount, the function will revert.
|
47
53
|
/// After successful completion of the function the policy can be referenced using the application NftId.
|
48
54
|
/// Locks the sum insured amount in the pool, but does not transfer tokens. Call collectPremium to transfer tokens.
|
49
55
|
/// Sets the policy state to collateralized.
|
50
56
|
/// Optionally activates the policy if activateAt is a non-zero timestamp.
|
51
57
|
/// only the related product may create a policy from an application
|
58
|
+
/// @return premiumAmount the effective premium amount
|
52
59
|
function createPolicy(
|
53
60
|
NftId applicationNftId,
|
54
|
-
Timestamp activateAt
|
61
|
+
Timestamp activateAt,
|
62
|
+
Amount maxPremiumAmount
|
55
63
|
)
|
56
64
|
external
|
57
65
|
returns (Amount premiumAmount);
|
@@ -9,6 +9,10 @@ import {StateId} from "../type/StateId.sol";
|
|
9
9
|
|
10
10
|
interface IRiskService is IService {
|
11
11
|
|
12
|
+
event LogRiskServiceRiskCreated(NftId productNftId, RiskId riskId);
|
13
|
+
event LogRiskServiceRiskUpdated(NftId productNftId, RiskId riskId);
|
14
|
+
event LogRiskServiceRiskStateUpdated(NftId productNftId, RiskId riskId, StateId newState);
|
15
|
+
|
12
16
|
error ErrorRiskServiceRiskProductMismatch(RiskId riskId, NftId riskProductNftId, NftId productNftId);
|
13
17
|
|
14
18
|
/// @dev Create a new risk with the given id and provided data.
|
@@ -94,7 +94,8 @@ contract PolicyService is
|
|
94
94
|
/// @inheritdoc IPolicyService
|
95
95
|
function createPolicy(
|
96
96
|
NftId applicationNftId, // = policyNftId
|
97
|
-
Timestamp activateAt
|
97
|
+
Timestamp activateAt,
|
98
|
+
Amount maxPremiumAmount
|
98
99
|
)
|
99
100
|
external
|
100
101
|
virtual
|
@@ -149,7 +150,14 @@ contract PolicyService is
|
|
149
150
|
bundleNftId,
|
150
151
|
applicationInfo.referralId);
|
151
152
|
|
152
|
-
premiumAmount
|
153
|
+
if (premium.premiumAmount > maxPremiumAmount) {
|
154
|
+
revert LogPolicyServiceMaxPremiumAmountExceeded(
|
155
|
+
applicationNftId,
|
156
|
+
maxPremiumAmount,
|
157
|
+
premium.premiumAmount);
|
158
|
+
}
|
159
|
+
|
160
|
+
premiumAmount = premium.premiumAmount;
|
153
161
|
instance.getInstanceStore().createPremium(
|
154
162
|
applicationNftId,
|
155
163
|
premium);
|
@@ -18,7 +18,7 @@ import {COMPONENT, PRODUCT, BUNDLE, APPLICATION, POLICY, CLAIM, PRICE } from "..
|
|
18
18
|
import {PayoutId} from "../type/PayoutId.sol";
|
19
19
|
import {COMPONENT, PRODUCT, APPLICATION, POLICY, CLAIM, PRICE, BUNDLE, RISK } from "../type/ObjectType.sol";
|
20
20
|
import {ReferralId} from "../type/Referral.sol";
|
21
|
-
import {RiskId
|
21
|
+
import {RiskId} from "../type/RiskId.sol";
|
22
22
|
import {Seconds} from "../type/Seconds.sol";
|
23
23
|
import {StateId} from "../type/StateId.sol";
|
24
24
|
import {Timestamp} from "../type/Timestamp.sol";
|
@@ -251,7 +251,8 @@ abstract contract Product is
|
|
251
251
|
|
252
252
|
function _createPolicy(
|
253
253
|
NftId applicationNftId,
|
254
|
-
Timestamp activateAt
|
254
|
+
Timestamp activateAt,
|
255
|
+
Amount maxPremiumAmount
|
255
256
|
)
|
256
257
|
internal
|
257
258
|
virtual
|
@@ -259,7 +260,8 @@ abstract contract Product is
|
|
259
260
|
{
|
260
261
|
premiumAmount = _getProductStorage()._policyService.createPolicy(
|
261
262
|
applicationNftId,
|
262
|
-
activateAt
|
263
|
+
activateAt,
|
264
|
+
maxPremiumAmount);
|
263
265
|
}
|
264
266
|
|
265
267
|
function _decline(
|
@@ -443,8 +445,9 @@ abstract contract Product is
|
|
443
445
|
)
|
444
446
|
internal
|
445
447
|
virtual
|
448
|
+
returns (Amount netPayoutAmount, Amount processingFeeAmount)
|
446
449
|
{
|
447
|
-
_getProductStorage()._claimService.processPayout(
|
450
|
+
(netPayoutAmount, processingFeeAmount) = _getProductStorage()._claimService.processPayout(
|
448
451
|
policyNftId,
|
449
452
|
payoutId);
|
450
453
|
}
|
@@ -67,6 +67,8 @@ contract RiskService is
|
|
67
67
|
// add risk to RiskSet
|
68
68
|
RiskSet riskSet = instance.getRiskSet();
|
69
69
|
riskSet.add(riskId);
|
70
|
+
|
71
|
+
emit LogRiskServiceRiskCreated(productNftId, riskId);
|
70
72
|
}
|
71
73
|
|
72
74
|
|
@@ -91,6 +93,8 @@ contract RiskService is
|
|
91
93
|
|
92
94
|
riskInfo.data = data;
|
93
95
|
instance.getInstanceStore().updateRisk(riskId, riskInfo, KEEP_STATE());
|
96
|
+
|
97
|
+
emit LogRiskServiceRiskUpdated(productNftId, riskId);
|
94
98
|
}
|
95
99
|
|
96
100
|
|
@@ -118,6 +122,8 @@ contract RiskService is
|
|
118
122
|
} else if (state == PAUSED()) {
|
119
123
|
instance.getRiskSet().pause(riskId);
|
120
124
|
}
|
125
|
+
|
126
|
+
emit LogRiskServiceRiskStateUpdated(productNftId, riskId, state);
|
121
127
|
}
|
122
128
|
|
123
129
|
function _getAndVerifyActiveComponent(ObjectType expectedType)
|
@@ -19,13 +19,16 @@ interface IRegistry is
|
|
19
19
|
IERC165
|
20
20
|
{
|
21
21
|
|
22
|
-
event
|
23
|
-
event
|
24
|
-
event
|
22
|
+
event LogRegistryObjectRegistered(NftId nftId, NftId parentNftId, ObjectType objectType, bool isInterceptor, address objectAddress, address initialOwner);
|
23
|
+
event LogRegistryServiceRegistered(VersionPart majorVersion, ObjectType domain);
|
24
|
+
event LogRegistryChainRegistryRegistered(NftId nftId, uint256 chainId, address chainRegistryAddress);
|
25
25
|
|
26
26
|
// initialize
|
27
27
|
error ErrorRegistryCallerNotDeployer();
|
28
28
|
|
29
|
+
// register()
|
30
|
+
error ErrorRegistryObjectTypeNotSupported(ObjectType objectType);
|
31
|
+
|
29
32
|
// registerRegistry()
|
30
33
|
error ErrorRegistryNotOnMainnet(uint256 chainId);
|
31
34
|
error ErrorRegistryChainRegistryChainIdZero(NftId nftId);
|
@@ -36,6 +39,8 @@ interface IRegistry is
|
|
36
39
|
// registerService()
|
37
40
|
error ErrorRegistryServiceAddressZero();
|
38
41
|
error ErrorRegistryServiceVersionZero(address service);
|
42
|
+
|
43
|
+
// TODO cleanup
|
39
44
|
//error ErrorRegistryServiceVersionMismatch(address service, VersionPart serviceVersion, VersionPart releaseVersion);
|
40
45
|
//error ErrorRegistryServiceVersionNotDeploying(address service, VersionPart version);
|
41
46
|
error ErrorRegistryServiceDomainZero(address service, VersionPart version);
|
@@ -48,7 +53,7 @@ interface IRegistry is
|
|
48
53
|
|
49
54
|
// _register()
|
50
55
|
error ErrorRegistryGlobalRegistryAsParent(address objectAddress, ObjectType objectType);
|
51
|
-
error
|
56
|
+
error ErrorRegistryTypeCombinationInvalid(address objectAddress, ObjectType objectType, ObjectType parentType);
|
52
57
|
error ErrorRegistryContractAlreadyRegistered(address objectAddress);
|
53
58
|
|
54
59
|
struct ObjectInfo {
|