@etherisc/gif-next 0.0.2-c6d46bb-892 → 0.0.2-c7609c4-545
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +51 -5
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +1293 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +1206 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +414 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/{instance/module/ISetup.sol/ISetup.json → authorization/IAccess.sol/IAccess.json} +2 -2
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +1060 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +295 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +167 -0
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +4 -0
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +1196 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +253 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +1402 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +470 -0
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +236 -564
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +331 -432
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +167 -109
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +220 -291
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +215 -94
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.json +22 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +1538 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +470 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +2072 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +470 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.json +376 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +1471 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +1231 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +1592 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2095 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +4 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +703 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +118 -97
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +173 -87
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +122 -222
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1653 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +561 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +850 -366
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +247 -231
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +145 -79
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +1212 -381
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +4 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +318 -0
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.json +0 -53
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +10 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +223 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +181 -0
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +8 -116
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +4 -0
- package/artifacts/contracts/mock/Dip.sol/Dip.json +376 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +1039 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +478 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.json +52 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +788 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +709 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +907 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +966 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +722 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +1299 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +470 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +494 -317
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +225 -87
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +256 -31
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +238 -373
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +460 -254
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +268 -577
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +572 -569
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +151 -93
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +117 -264
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +138 -76
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +1173 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +470 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +329 -284
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +180 -90
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +54 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +196 -7
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +354 -80
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +154 -86
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +360 -209
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +4 -0
- package/artifacts/contracts/product/{IProductService.sol/IProductService.json → IRiskService.sol/IRiskService.json} +44 -57
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +418 -397
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +163 -121
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +233 -330
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +167 -93
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +381 -448
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +4 -0
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +622 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +694 -0
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +59 -16
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +435 -29
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +270 -109
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +5 -18
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +861 -64
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +1886 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +330 -234
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +132 -76
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +205 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +1067 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +272 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +314 -138
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +138 -286
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +1335 -198
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +814 -0
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +474 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +92 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +110 -114
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +4 -0
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +1335 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +4 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +723 -0
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/{instance/base → shared}/IKeyValueStore.sol/IKeyValueStore.json +46 -14
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +4 -0
- package/artifacts/contracts/{instance/base → shared}/ILifecycle.sol/ILifecycle.json +35 -4
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +23 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +16 -30
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +36 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +49 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +4 -0
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +53 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +4 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +829 -0
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +538 -0
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +4 -0
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +174 -0
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +4 -0
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +306 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +26 -55
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +20 -124
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +68 -85
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +55 -101
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +362 -7
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +108 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +4 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1465 -0
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +573 -53
- 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 +4 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.json +1888 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +205 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +776 -0
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +587 -0
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +658 -176
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +710 -0
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2283 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +607 -0
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.json +2 -2
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +121 -4
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +53 -2
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +28 -4
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +4 -4
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +39 -34
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +47 -4
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +149 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +19 -19
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +4 -4
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +204 -0
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +60 -4
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +219 -6
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +124 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +129 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +10 -0
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +15 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +4 -0
- package/artifacts/contracts/type/String.sol/StrLib.json +132 -0
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +36 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +9 -3
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +71 -2
- 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 +21 -2
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +4 -0
- package/artifacts/contracts/{shared → upgradeability}/IVersionable.sol/IVersionable.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +602 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +129 -0
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +4 -0
- package/artifacts/contracts/{shared → upgradeability}/Versionable.sol/Versionable.json +1 -1
- package/contracts/authorization/AccessAdmin.sol +596 -0
- package/contracts/authorization/AccessManagerCloneable.sol +16 -0
- package/contracts/authorization/Authorization.sol +289 -0
- package/contracts/authorization/IAccess.sol +49 -0
- package/contracts/authorization/IAccessAdmin.sol +137 -0
- package/contracts/authorization/IAuthorization.sol +60 -0
- package/contracts/authorization/IServiceAuthorization.sol +40 -0
- package/contracts/authorization/ReleaseAccessManager.sol +38 -0
- package/contracts/authorization/ServiceAuthorization.sol +106 -0
- package/contracts/distribution/BasicDistribution.sol +139 -0
- package/contracts/distribution/BasicDistributionAuthorization.sol +47 -0
- package/contracts/distribution/Distribution.sol +156 -156
- package/contracts/distribution/DistributionService.sol +179 -173
- package/contracts/distribution/DistributionServiceManager.sol +13 -25
- package/contracts/distribution/IDistributionComponent.sol +28 -47
- package/contracts/distribution/IDistributionService.sol +24 -10
- package/contracts/examples/fire/DamageLevel.sol +59 -0
- package/contracts/examples/fire/FirePool.sol +73 -0
- package/contracts/examples/fire/FirePoolAuthorization.sol +34 -0
- package/contracts/examples/fire/FireProduct.sol +415 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +44 -0
- package/contracts/examples/fire/FireUSD.sol +26 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +50 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +137 -0
- package/contracts/examples/unpermissioned/SimplePool.sol +76 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +351 -0
- package/contracts/instance/{BundleManager.sol → BundleSet.sol} +23 -23
- package/contracts/instance/IInstance.sol +33 -44
- package/contracts/instance/IInstanceService.sol +32 -34
- package/contracts/instance/Instance.sol +129 -126
- package/contracts/instance/InstanceAdmin.sol +277 -0
- package/contracts/instance/InstanceAuthorizationV3.sol +194 -0
- package/contracts/instance/InstanceReader.sol +194 -67
- package/contracts/instance/InstanceService.sol +250 -144
- package/contracts/instance/InstanceServiceManager.sol +14 -29
- package/contracts/instance/InstanceStore.sol +142 -66
- package/contracts/instance/base/BalanceStore.sol +123 -0
- package/contracts/instance/base/Cloneable.sol +2 -25
- package/contracts/instance/base/ObjectCounter.sol +21 -0
- package/contracts/instance/base/ObjectLifecycle.sol +111 -0
- package/contracts/instance/base/{ObjectManager.sol → ObjectSet.sol} +11 -14
- package/contracts/instance/module/IAccess.sol +2 -10
- package/contracts/instance/module/IBundle.sol +1 -4
- package/contracts/instance/module/IComponents.sol +21 -11
- package/contracts/instance/module/IDistribution.sol +0 -1
- package/contracts/instance/module/IPolicy.sol +31 -25
- package/contracts/mock/Dip.sol +26 -0
- package/contracts/oracle/BasicOracle.sol +47 -0
- package/contracts/oracle/BasicOracleAuthorization.sol +46 -0
- package/contracts/oracle/IOracle.sol +36 -0
- package/contracts/oracle/IOracleComponent.sol +33 -0
- package/contracts/oracle/IOracleService.sol +66 -0
- package/contracts/oracle/Oracle.sol +156 -0
- package/contracts/oracle/OracleService.sol +291 -0
- package/contracts/oracle/OracleServiceManager.sol +39 -0
- package/contracts/pool/BasicPool.sol +154 -0
- package/contracts/pool/BasicPoolAuthorization.sol +57 -0
- package/contracts/pool/BundleService.sol +322 -211
- package/contracts/pool/BundleServiceManager.sol +13 -25
- package/contracts/pool/IBundleService.sol +44 -19
- package/contracts/pool/IPoolComponent.sol +27 -73
- package/contracts/pool/IPoolService.sol +93 -40
- package/contracts/pool/Pool.sol +186 -153
- package/contracts/pool/PoolService.sol +375 -234
- package/contracts/pool/PoolServiceManager.sol +12 -24
- package/contracts/product/ApplicationService.sol +158 -85
- package/contracts/product/ApplicationServiceManager.sol +12 -9
- package/contracts/product/BasicProduct.sol +53 -0
- package/contracts/product/BasicProductAuthorization.sol +42 -0
- package/contracts/product/ClaimService.sol +333 -163
- package/contracts/product/ClaimServiceManager.sol +12 -9
- package/contracts/product/IApplicationService.sol +2 -1
- package/contracts/product/IClaimService.sol +35 -5
- package/contracts/product/IPolicyService.sol +38 -38
- package/contracts/product/IPricingService.sol +13 -11
- package/contracts/product/IProductComponent.sol +28 -10
- package/contracts/product/{IProductService.sol → IRiskService.sol} +2 -9
- package/contracts/product/PolicyService.sol +519 -204
- package/contracts/product/PolicyServiceManager.sol +12 -27
- package/contracts/product/PricingService.sol +109 -84
- package/contracts/product/PricingServiceManager.sol +12 -24
- package/contracts/product/Product.sol +222 -146
- package/contracts/product/RiskService.sol +96 -0
- package/contracts/product/RiskServiceManager.sol +39 -0
- package/contracts/registry/ChainNft.sol +75 -38
- package/contracts/registry/IRegistry.sol +91 -21
- package/contracts/registry/IRegistryService.sol +30 -34
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +445 -195
- package/contracts/registry/RegistryAdmin.sol +448 -0
- package/contracts/registry/RegistryService.sol +85 -129
- package/contracts/registry/RegistryServiceManager.sol +23 -30
- package/contracts/registry/ReleaseLifecycle.sol +30 -0
- package/contracts/registry/ReleaseRegistry.sol +501 -0
- package/contracts/registry/ServiceAuthorizationV3.sol +194 -0
- package/contracts/registry/TokenRegistry.sol +261 -62
- package/contracts/shared/Component.sol +150 -156
- package/contracts/shared/ComponentService.sol +694 -99
- package/contracts/shared/ComponentServiceManager.sol +38 -0
- package/contracts/shared/ComponentVerifyingService.sol +126 -0
- package/contracts/shared/ContractLib.sol +38 -0
- package/contracts/shared/IComponent.sol +25 -41
- package/contracts/shared/IComponentService.sol +120 -0
- package/contracts/shared/IInstanceLinkedComponent.sol +41 -0
- package/contracts/{instance/base → shared}/IKeyValueStore.sol +7 -6
- package/contracts/{instance/base → shared}/ILifecycle.sol +5 -4
- package/contracts/shared/INftOwnable.sol +3 -1
- package/contracts/shared/IPolicyHolder.sol +12 -17
- package/contracts/shared/IRegisterable.sol +11 -0
- package/contracts/shared/IService.sol +9 -2
- package/contracts/shared/{ERC165.sol → InitializableERC165.sol} +4 -4
- package/contracts/shared/InstanceLinkedComponent.sol +213 -0
- package/contracts/{instance/base → shared}/KeyValueStore.sol +36 -74
- package/contracts/shared/Lifecycle.sol +88 -0
- package/contracts/shared/NftIdSet.sol +65 -0
- package/contracts/shared/NftOwnable.sol +31 -22
- package/contracts/shared/PolicyHolder.sol +18 -50
- package/contracts/shared/Registerable.sol +21 -11
- package/contracts/shared/RegistryLinked.sol +3 -2
- package/contracts/shared/Service.sol +48 -36
- package/contracts/shared/TokenHandler.sol +112 -8
- package/contracts/shared/TokenHandlerDeployerLib.sol +12 -0
- package/contracts/staking/IStaking.sol +168 -0
- package/contracts/staking/IStakingService.sol +103 -48
- package/contracts/staking/StakeManagerLib.sol +224 -0
- package/contracts/staking/Staking.sol +497 -0
- package/contracts/staking/StakingLifecycle.sol +23 -0
- package/contracts/staking/StakingManager.sol +52 -0
- package/contracts/staking/StakingReader.sol +190 -0
- package/contracts/staking/StakingService.sol +290 -49
- package/contracts/staking/{StakeingServiceManager.sol → StakingServiceManager.sol} +14 -7
- package/contracts/staking/StakingStore.sol +605 -0
- package/contracts/staking/TargetManagerLib.sol +211 -0
- package/contracts/type/AddressSet.sol +1 -1
- package/contracts/type/Amount.sol +44 -3
- package/contracts/type/Blocknumber.sol +26 -3
- package/contracts/type/ClaimId.sol +6 -1
- package/contracts/type/Fee.sol +17 -16
- package/contracts/type/NftId.sol +15 -16
- package/contracts/type/NftIdSet.sol +1 -1
- package/contracts/type/ObjectType.sol +176 -62
- package/contracts/type/PayoutId.sol +10 -10
- package/contracts/type/Referral.sol +2 -1
- package/contracts/type/RequestId.sol +75 -0
- package/contracts/type/RiskId.sol +16 -2
- package/contracts/type/RoleId.sol +98 -68
- package/contracts/type/Seconds.sol +48 -1
- package/contracts/type/Selector.sol +102 -0
- package/contracts/type/StateId.sol +41 -2
- package/contracts/type/String.sol +53 -0
- package/contracts/type/Timestamp.sol +17 -3
- package/contracts/type/UFixed.sol +38 -9
- package/contracts/type/Version.sol +4 -2
- package/contracts/{shared → upgradeability}/ProxyManager.sol +90 -27
- package/contracts/{shared → upgradeability}/UpgradableProxyWithAdmin.sol +1 -3
- package/contracts/{shared → upgradeability}/Versionable.sol +2 -2
- package/package.json +10 -6
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +0 -4
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +0 -778
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +0 -1348
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +0 -124
- package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +0 -4
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +0 -581
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +0 -4
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +0 -194
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +0 -256
- package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +0 -4
- package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +0 -4
- package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.json +0 -10
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +0 -4
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +0 -4
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +0 -864
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +0 -4
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +0 -640
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +0 -4
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +0 -285
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +0 -4
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +0 -559
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +0 -1206
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +0 -4
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +0 -73
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +0 -4
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +0 -4
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +0 -569
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +0 -4
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +0 -129
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeingServiceManager.sol/StakingServiceManager.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeingServiceManager.sol/StakingServiceManager.json +0 -628
- package/contracts/instance/InstanceAccessManager.sol +0 -543
- package/contracts/instance/InstanceAuthorizationsLib.sol +0 -308
- package/contracts/instance/base/Lifecycle.sol +0 -121
- package/contracts/instance/module/ISetup.sol +0 -33
- package/contracts/instance/module/ITreasury.sol +0 -23
- package/contracts/product/ProductService.sol +0 -210
- package/contracts/product/ProductServiceManager.sol +0 -54
- package/contracts/registry/RegistryAccessManager.sol +0 -216
- package/contracts/registry/ReleaseManager.sol +0 -328
- package/contracts/shared/AccessManagerUpgradeableInitializeable.sol +0 -13
- /package/contracts/{shared → upgradeability}/IVersionable.sol +0 -0
@@ -1,115 +1,213 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
|
-
pragma solidity ^0.8.
|
3
|
-
|
4
|
-
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
2
|
+
pragma solidity ^0.8.20;
|
5
3
|
|
6
4
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
7
5
|
import {ClaimId} from "../type/ClaimId.sol";
|
8
|
-
import {
|
9
|
-
import {Fee} from "../type/Fee.sol";
|
6
|
+
import {IComponent} from "../shared/IComponent.sol";
|
7
|
+
import {Fee, FeeLib} from "../type/Fee.sol";
|
10
8
|
import {IRisk} from "../instance/module/IRisk.sol";
|
11
9
|
import {IApplicationService} from "./IApplicationService.sol";
|
10
|
+
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
11
|
+
import {IComponentService} from "../shared/IComponentService.sol";
|
12
|
+
import {InstanceLinkedComponent} from "../shared/InstanceLinkedComponent.sol";
|
13
|
+
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
12
14
|
import {IPolicyService} from "./IPolicyService.sol";
|
13
|
-
import {
|
15
|
+
import {IRiskService} from "./IRiskService.sol";
|
14
16
|
import {IClaimService} from "./IClaimService.sol";
|
15
17
|
import {IPricingService} from "./IPricingService.sol";
|
16
18
|
import {IProductComponent} from "./IProductComponent.sol";
|
17
19
|
import {NftId, NftIdLib} from "../type/NftId.sol";
|
20
|
+
import {ObjectType, COMPONENT, DISTRIBUTION, ORACLE, POOL, PRODUCT, BUNDLE, APPLICATION, POLICY, CLAIM, PRICE } from "../type/ObjectType.sol";
|
18
21
|
import {PayoutId} from "../type/PayoutId.sol";
|
19
|
-
import {PRODUCT, APPLICATION, POLICY, CLAIM, PRICE } from "../type/ObjectType.sol";
|
22
|
+
import {COMPONENT, PRODUCT, APPLICATION, POLICY, CLAIM, PRICE, BUNDLE } from "../type/ObjectType.sol";
|
20
23
|
import {ReferralId} from "../type/Referral.sol";
|
21
24
|
import {RiskId, RiskIdLib} from "../type/RiskId.sol";
|
22
25
|
import {Seconds} from "../type/Seconds.sol";
|
23
26
|
import {StateId} from "../type/StateId.sol";
|
24
27
|
import {Timestamp} from "../type/Timestamp.sol";
|
25
28
|
|
26
|
-
import {TokenHandler} from "../shared/TokenHandler.sol";
|
27
|
-
|
28
|
-
import {InstanceReader} from "../instance/InstanceReader.sol";
|
29
29
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
30
|
-
import {ISetup} from "../instance/module/ISetup.sol";
|
31
30
|
import {IComponents} from "../instance/module/IComponents.sol";
|
32
|
-
import {
|
33
|
-
import {
|
31
|
+
import {IDistributionComponent} from "../distribution/IDistributionComponent.sol";
|
32
|
+
import {IOracleComponent} from "../oracle/IOracleComponent.sol";
|
33
|
+
import {IPoolComponent} from "../pool/IPoolComponent.sol";
|
34
34
|
|
35
35
|
abstract contract Product is
|
36
|
-
|
36
|
+
InstanceLinkedComponent,
|
37
37
|
IProductComponent
|
38
38
|
{
|
39
39
|
// keccak256(abi.encode(uint256(keccak256("etherisc.storage.Product")) - 1)) & ~bytes32(uint256(0xff));
|
40
40
|
bytes32 public constant PRODUCT_STORAGE_LOCATION_V1 = 0x0bb7aafdb8e380f81267337bc5b5dfdf76e6d3a380ecadb51ec665246d9d6800;
|
41
41
|
|
42
42
|
struct ProductStorage {
|
43
|
-
|
43
|
+
bool _isProcessingFundedClaims;
|
44
|
+
bool _hasDistribution;
|
45
|
+
uint8 _numberOfOracles;
|
46
|
+
IRiskService _riskService;
|
44
47
|
IApplicationService _applicationService;
|
45
48
|
IPolicyService _policyService;
|
46
49
|
IClaimService _claimService;
|
47
50
|
IPricingService _pricingService;
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
51
|
+
IComponentService _componentService;
|
52
|
+
}
|
53
|
+
|
54
|
+
|
55
|
+
function registerComponent(address component)
|
56
|
+
external
|
57
|
+
virtual
|
58
|
+
onlyOwner()
|
59
|
+
returns (NftId componentNftId)
|
60
|
+
{
|
61
|
+
return _getProductStorage()._componentService.registerComponent(component);
|
62
|
+
}
|
63
|
+
|
64
|
+
|
65
|
+
function processFundedClaim(
|
66
|
+
NftId policyNftId,
|
67
|
+
ClaimId claimId,
|
68
|
+
Amount availableAmount
|
69
|
+
)
|
70
|
+
external
|
71
|
+
virtual
|
72
|
+
restricted() // pool service role
|
73
|
+
onlyNftOfType(policyNftId, POLICY())
|
74
|
+
{
|
75
|
+
// default implementation does nothing
|
76
|
+
}
|
77
|
+
|
78
|
+
|
79
|
+
function calculatePremium(
|
80
|
+
Amount sumInsuredAmount,
|
81
|
+
RiskId riskId,
|
82
|
+
Seconds lifetime,
|
83
|
+
bytes memory applicationData,
|
84
|
+
NftId bundleNftId,
|
85
|
+
ReferralId referralId
|
86
|
+
)
|
87
|
+
public
|
88
|
+
view
|
89
|
+
override
|
90
|
+
onlyNftOfType(bundleNftId, BUNDLE())
|
91
|
+
returns (Amount premiumAmount)
|
92
|
+
{
|
93
|
+
IPolicy.PremiumInfo memory premium = _getProductStorage()._pricingService.calculatePremium(
|
94
|
+
getNftId(),
|
95
|
+
riskId,
|
96
|
+
sumInsuredAmount,
|
97
|
+
lifetime,
|
98
|
+
applicationData,
|
99
|
+
bundleNftId,
|
100
|
+
referralId
|
101
|
+
);
|
102
|
+
|
103
|
+
return premium.premiumAmount;
|
104
|
+
}
|
105
|
+
|
106
|
+
function calculateNetPremium(
|
107
|
+
Amount sumInsuredAmount,
|
108
|
+
RiskId,
|
109
|
+
Seconds,
|
110
|
+
bytes memory
|
111
|
+
)
|
112
|
+
external
|
113
|
+
view
|
114
|
+
virtual override
|
115
|
+
returns (Amount netPremiumAmount)
|
116
|
+
{
|
117
|
+
// default 10% of sum insured
|
118
|
+
return AmountLib.toAmount(sumInsuredAmount.toInt() / 10);
|
55
119
|
}
|
56
120
|
|
57
|
-
|
121
|
+
|
122
|
+
function getInitialProductInfo()
|
123
|
+
public
|
124
|
+
virtual
|
125
|
+
view
|
126
|
+
returns (IComponents.ProductInfo memory poolInfo)
|
127
|
+
{
|
128
|
+
ProductStorage storage $ = _getProductStorage();
|
129
|
+
|
130
|
+
return IComponents.ProductInfo({
|
131
|
+
isProcessingFundedClaims: false,
|
132
|
+
hasDistribution: $._hasDistribution,
|
133
|
+
expectedNumberOfOracles: $._numberOfOracles,
|
134
|
+
numberOfOracles: 0,
|
135
|
+
poolNftId: NftIdLib.zero(),
|
136
|
+
distributionNftId: NftIdLib.zero(),
|
137
|
+
oracleNftId: new NftId[]($._numberOfOracles),
|
138
|
+
productFee: FeeLib.zero(),
|
139
|
+
processingFee: FeeLib.zero(),
|
140
|
+
distributionFee: FeeLib.zero(),
|
141
|
+
minDistributionOwnerFee: FeeLib.zero(),
|
142
|
+
poolFee: FeeLib.zero(),
|
143
|
+
stakingFee: FeeLib.zero(),
|
144
|
+
performanceFee: FeeLib.zero()
|
145
|
+
});
|
146
|
+
}
|
147
|
+
|
148
|
+
|
149
|
+
function _initializeProduct(
|
58
150
|
address registry,
|
59
151
|
NftId instanceNftId,
|
152
|
+
IAuthorization authorization,
|
153
|
+
address initialOwner,
|
60
154
|
string memory name,
|
61
155
|
address token,
|
62
156
|
bool isInterceptor,
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
address initialOwner,
|
68
|
-
bytes memory registryData // writeonly data that will saved in the object info record of the registry
|
157
|
+
bool isProcessingFundedClaims,
|
158
|
+
bool hasDistribution,
|
159
|
+
uint8 numberOfOracles,
|
160
|
+
bytes memory componentData // writeonly data that will saved in the object info record of the registry
|
69
161
|
)
|
70
|
-
|
162
|
+
internal
|
71
163
|
virtual
|
72
164
|
onlyInitializing()
|
73
165
|
{
|
74
|
-
|
166
|
+
_initializeInstanceLinkedComponent(
|
167
|
+
registry,
|
168
|
+
instanceNftId,
|
169
|
+
name,
|
170
|
+
token,
|
171
|
+
PRODUCT(),
|
172
|
+
authorization,
|
173
|
+
isInterceptor,
|
174
|
+
initialOwner,
|
175
|
+
componentData);
|
75
176
|
|
76
177
|
ProductStorage storage $ = _getProductStorage();
|
77
|
-
|
78
|
-
|
79
|
-
$.
|
178
|
+
$._isProcessingFundedClaims = isProcessingFundedClaims;
|
179
|
+
$._hasDistribution = hasDistribution;
|
180
|
+
$._numberOfOracles = numberOfOracles;
|
181
|
+
$._riskService = IRiskService(_getServiceAddress(PRODUCT()));
|
80
182
|
$._applicationService = IApplicationService(_getServiceAddress(APPLICATION()));
|
81
183
|
$._policyService = IPolicyService(_getServiceAddress(POLICY()));
|
82
184
|
$._claimService = IClaimService(_getServiceAddress(CLAIM()));
|
83
185
|
$._pricingService = IPricingService(_getServiceAddress(PRICE()));
|
84
|
-
$.
|
85
|
-
|
86
|
-
|
87
|
-
$._initialProcessingFee = processingFee;
|
88
|
-
$._tokenHandler = new TokenHandler(token);
|
89
|
-
$._poolNftId = getRegistry().getNftId(pool);
|
90
|
-
$._distributionNftId = getRegistry().getNftId(distribution);
|
91
|
-
|
92
|
-
registerInterface(type(IProductComponent).interfaceId);
|
186
|
+
$._componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
187
|
+
|
188
|
+
_registerInterface(type(IProductComponent).interfaceId);
|
93
189
|
}
|
94
190
|
|
95
|
-
|
96
|
-
function
|
191
|
+
|
192
|
+
function _setFees(
|
97
193
|
Fee memory productFee,
|
98
194
|
Fee memory processingFee
|
99
195
|
)
|
100
|
-
|
101
|
-
|
102
|
-
restricted()
|
103
|
-
override
|
196
|
+
internal
|
197
|
+
virtual
|
104
198
|
{
|
105
|
-
|
199
|
+
_getProductStorage()._componentService.setProductFees(productFee, processingFee);
|
106
200
|
}
|
107
201
|
|
202
|
+
|
108
203
|
function _createRisk(
|
109
204
|
RiskId id,
|
110
205
|
bytes memory data
|
111
|
-
)
|
112
|
-
|
206
|
+
)
|
207
|
+
internal
|
208
|
+
virtual
|
209
|
+
{
|
210
|
+
_getProductStorage()._riskService.createRisk(
|
113
211
|
id,
|
114
212
|
data
|
115
213
|
);
|
@@ -118,8 +216,11 @@ abstract contract Product is
|
|
118
216
|
function _updateRisk(
|
119
217
|
RiskId id,
|
120
218
|
bytes memory data
|
121
|
-
)
|
122
|
-
|
219
|
+
)
|
220
|
+
internal
|
221
|
+
virtual
|
222
|
+
{
|
223
|
+
_getProductStorage()._riskService.updateRisk(
|
123
224
|
id,
|
124
225
|
data
|
125
226
|
);
|
@@ -128,33 +229,41 @@ abstract contract Product is
|
|
128
229
|
function _updateRiskState(
|
129
230
|
RiskId id,
|
130
231
|
StateId state
|
131
|
-
)
|
132
|
-
|
232
|
+
)
|
233
|
+
internal
|
234
|
+
virtual
|
235
|
+
{
|
236
|
+
_getProductStorage()._riskService.updateRiskState(
|
133
237
|
id,
|
134
238
|
state
|
135
239
|
);
|
136
240
|
}
|
137
241
|
|
138
|
-
|
242
|
+
|
243
|
+
function _getRiskInfo(RiskId id) internal virtual view returns (IRisk.RiskInfo memory info) {
|
139
244
|
return getInstance().getInstanceReader().getRiskInfo(id);
|
140
245
|
}
|
141
246
|
|
247
|
+
|
142
248
|
function _createApplication(
|
143
249
|
address applicationOwner,
|
144
250
|
RiskId riskId,
|
145
251
|
Amount sumInsuredAmount,
|
252
|
+
Amount premiumAmount,
|
146
253
|
Seconds lifetime,
|
147
254
|
NftId bundleNftId,
|
148
255
|
ReferralId referralId,
|
149
256
|
bytes memory applicationData
|
150
257
|
)
|
151
258
|
internal
|
259
|
+
virtual
|
152
260
|
returns (NftId applicationNftId)
|
153
261
|
{
|
154
262
|
return _getProductStorage()._applicationService.create(
|
155
263
|
applicationOwner,
|
156
264
|
riskId,
|
157
265
|
sumInsuredAmount,
|
266
|
+
premiumAmount,
|
158
267
|
lifetime,
|
159
268
|
bundleNftId,
|
160
269
|
referralId,
|
@@ -162,24 +271,45 @@ abstract contract Product is
|
|
162
271
|
);
|
163
272
|
}
|
164
273
|
|
165
|
-
function
|
166
|
-
NftId
|
167
|
-
bool requirePremiumPayment,
|
274
|
+
function _createPolicy(
|
275
|
+
NftId applicationNftId,
|
168
276
|
Timestamp activateAt
|
169
277
|
)
|
170
278
|
internal
|
279
|
+
virtual
|
171
280
|
{
|
172
|
-
_getProductStorage()._policyService.
|
173
|
-
|
174
|
-
requirePremiumPayment,
|
281
|
+
_getProductStorage()._policyService.createPolicy(
|
282
|
+
applicationNftId,
|
175
283
|
activateAt);
|
176
284
|
}
|
177
285
|
|
286
|
+
function _decline(
|
287
|
+
NftId policyNftId
|
288
|
+
)
|
289
|
+
internal
|
290
|
+
virtual
|
291
|
+
{
|
292
|
+
_getProductStorage()._policyService.decline(
|
293
|
+
policyNftId);
|
294
|
+
}
|
295
|
+
|
296
|
+
function _expire(
|
297
|
+
NftId policyNftId,
|
298
|
+
Timestamp expireAt
|
299
|
+
)
|
300
|
+
internal
|
301
|
+
virtual
|
302
|
+
returns (Timestamp expiredAt)
|
303
|
+
{
|
304
|
+
expiredAt = _getProductStorage()._policyService.expire(policyNftId, expireAt);
|
305
|
+
}
|
306
|
+
|
178
307
|
function _collectPremium(
|
179
308
|
NftId policyNftId,
|
180
309
|
Timestamp activateAt
|
181
310
|
)
|
182
311
|
internal
|
312
|
+
virtual
|
183
313
|
{
|
184
314
|
_getProductStorage()._policyService.collectPremium(
|
185
315
|
policyNftId,
|
@@ -191,6 +321,7 @@ abstract contract Product is
|
|
191
321
|
Timestamp activateAt
|
192
322
|
)
|
193
323
|
internal
|
324
|
+
virtual
|
194
325
|
{
|
195
326
|
_getProductStorage()._policyService.activate(
|
196
327
|
policyNftId,
|
@@ -201,6 +332,7 @@ abstract contract Product is
|
|
201
332
|
NftId policyNftId
|
202
333
|
)
|
203
334
|
internal
|
335
|
+
virtual
|
204
336
|
{
|
205
337
|
_getProductStorage()._policyService.close(
|
206
338
|
policyNftId);
|
@@ -212,6 +344,7 @@ abstract contract Product is
|
|
212
344
|
bytes memory claimData
|
213
345
|
)
|
214
346
|
internal
|
347
|
+
virtual
|
215
348
|
returns(ClaimId)
|
216
349
|
{
|
217
350
|
return _getProductStorage()._claimService.submit(
|
@@ -227,6 +360,7 @@ abstract contract Product is
|
|
227
360
|
bytes memory data
|
228
361
|
)
|
229
362
|
internal
|
363
|
+
virtual
|
230
364
|
{
|
231
365
|
_getProductStorage()._claimService.confirm(
|
232
366
|
policyNftId,
|
@@ -241,6 +375,7 @@ abstract contract Product is
|
|
241
375
|
bytes memory data
|
242
376
|
)
|
243
377
|
internal
|
378
|
+
virtual
|
244
379
|
{
|
245
380
|
_getProductStorage()._claimService.decline(
|
246
381
|
policyNftId,
|
@@ -253,6 +388,7 @@ abstract contract Product is
|
|
253
388
|
ClaimId claimId
|
254
389
|
)
|
255
390
|
internal
|
391
|
+
virtual
|
256
392
|
{
|
257
393
|
_getProductStorage()._claimService.close(
|
258
394
|
policyNftId,
|
@@ -266,6 +402,7 @@ abstract contract Product is
|
|
266
402
|
bytes memory data
|
267
403
|
)
|
268
404
|
internal
|
405
|
+
virtual
|
269
406
|
returns (PayoutId)
|
270
407
|
{
|
271
408
|
return _getProductStorage()._claimService.createPayout(
|
@@ -275,105 +412,44 @@ abstract contract Product is
|
|
275
412
|
data);
|
276
413
|
}
|
277
414
|
|
415
|
+
function _createPayoutForBeneficiary(
|
416
|
+
NftId policyNftId,
|
417
|
+
ClaimId claimId,
|
418
|
+
Amount amount,
|
419
|
+
address beneficiary,
|
420
|
+
bytes memory data
|
421
|
+
)
|
422
|
+
internal
|
423
|
+
virtual
|
424
|
+
returns (PayoutId)
|
425
|
+
{
|
426
|
+
return _getProductStorage()._claimService.createPayoutForBeneficiary(
|
427
|
+
policyNftId,
|
428
|
+
claimId,
|
429
|
+
amount,
|
430
|
+
beneficiary,
|
431
|
+
data);
|
432
|
+
}
|
433
|
+
|
278
434
|
function _processPayout(
|
279
435
|
NftId policyNftId,
|
280
436
|
PayoutId payoutId
|
281
437
|
)
|
282
438
|
internal
|
439
|
+
virtual
|
283
440
|
{
|
284
441
|
_getProductStorage()._claimService.processPayout(
|
285
442
|
policyNftId,
|
286
443
|
payoutId);
|
287
444
|
}
|
288
445
|
|
289
|
-
function
|
290
|
-
Amount sumInsuredAmount,
|
291
|
-
RiskId riskId,
|
292
|
-
Seconds lifetime,
|
293
|
-
bytes memory applicationData,
|
294
|
-
NftId bundleNftId,
|
295
|
-
ReferralId referralId
|
296
|
-
)
|
297
|
-
external
|
298
|
-
view
|
299
|
-
override
|
300
|
-
returns (Amount premiumAmount)
|
301
|
-
{
|
302
|
-
IPolicy.Premium memory premium = _getProductStorage()._pricingService.calculatePremium(
|
303
|
-
getNftId(),
|
304
|
-
riskId,
|
305
|
-
sumInsuredAmount,
|
306
|
-
lifetime,
|
307
|
-
applicationData,
|
308
|
-
bundleNftId,
|
309
|
-
referralId
|
310
|
-
);
|
311
|
-
|
312
|
-
return AmountLib.toAmount(premium.premiumAmount);
|
313
|
-
}
|
314
|
-
|
315
|
-
function calculateNetPremium(
|
316
|
-
Amount sumInsuredAmount,
|
317
|
-
RiskId riskId,
|
318
|
-
Seconds lifetime,
|
319
|
-
bytes memory applicationData
|
320
|
-
)
|
321
|
-
external
|
322
|
-
view
|
323
|
-
virtual override
|
324
|
-
returns (Amount netPremiumAmount)
|
325
|
-
{
|
326
|
-
// default 10% of sum insured
|
327
|
-
return AmountLib.toAmount(sumInsuredAmount.toInt() / 10);
|
328
|
-
}
|
329
|
-
|
330
|
-
function _toRiskId(string memory riskName) internal pure returns (RiskId riskId) {
|
446
|
+
function _toRiskId(string memory riskName) internal virtual pure returns (RiskId riskId) {
|
331
447
|
return RiskIdLib.toRiskId(riskName);
|
332
448
|
}
|
333
449
|
|
334
|
-
function
|
335
|
-
return getRegistry().getNftId(address(_getProductStorage()._pool));
|
336
|
-
}
|
337
|
-
|
338
|
-
function getDistributionNftId() external view override returns (NftId distributionNftId) {
|
339
|
-
return getRegistry().getNftId(address(_getProductStorage()._distribution));
|
340
|
-
}
|
341
|
-
|
342
|
-
function getSetupInfo() public view returns (ISetup.ProductSetupInfo memory setupInfo) {
|
343
|
-
InstanceReader reader = getInstance().getInstanceReader();
|
344
|
-
setupInfo = reader.getProductSetupInfo(getNftId());
|
345
|
-
|
346
|
-
// fallback to initial setup info (wallet is always != address(0))
|
347
|
-
if(setupInfo.wallet == address(0)) {
|
348
|
-
setupInfo = _getInitialSetupInfo();
|
349
|
-
}
|
350
|
-
}
|
351
|
-
|
352
|
-
function _getInitialSetupInfo() internal view returns (ISetup.ProductSetupInfo memory setupInfo) {
|
353
|
-
ProductStorage storage $ = _getProductStorage();
|
354
|
-
|
355
|
-
ISetup.DistributionSetupInfo memory distributionSetupInfo = $._distribution.getSetupInfo();
|
356
|
-
IComponents.PoolInfo memory poolInfo = $._pool.getPoolInfo();
|
357
|
-
|
358
|
-
return ISetup.ProductSetupInfo(
|
359
|
-
getToken(),
|
360
|
-
$._tokenHandler,
|
361
|
-
$._distributionNftId,
|
362
|
-
$._poolNftId,
|
363
|
-
$._initialProductFee,
|
364
|
-
$._initialProcessingFee,
|
365
|
-
false,
|
366
|
-
getWallet()
|
367
|
-
);
|
368
|
-
}
|
369
|
-
|
370
|
-
function _getProductStorage() private pure returns (ProductStorage storage $) {
|
450
|
+
function _getProductStorage() internal virtual pure returns (ProductStorage storage $) {
|
371
451
|
assembly {
|
372
452
|
$.slot := PRODUCT_STORAGE_LOCATION_V1
|
373
453
|
}
|
374
454
|
}
|
375
|
-
|
376
|
-
function _getProductService() internal view returns (IProductService) {
|
377
|
-
return _getProductStorage()._productService;
|
378
|
-
}
|
379
455
|
}
|
@@ -0,0 +1,96 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IInstance} from "../instance/IInstance.sol";
|
5
|
+
import {IInstanceService} from "../instance/IInstanceService.sol";
|
6
|
+
import {IPoolService} from "../pool/PoolService.sol";
|
7
|
+
import {IRiskService} from "./IRiskService.sol";
|
8
|
+
import {IRegistryService} from "../registry/IRegistryService.sol";
|
9
|
+
import {IRisk} from "../instance/module/IRisk.sol";
|
10
|
+
|
11
|
+
import {InstanceReader} from "../instance/InstanceReader.sol";
|
12
|
+
import {ObjectType, INSTANCE, PRODUCT, POOL, POLICY, REGISTRY} from "../type/ObjectType.sol";
|
13
|
+
import {KEEP_STATE} from "../type/StateId.sol";
|
14
|
+
import {NftId} from "../type/NftId.sol";
|
15
|
+
import {RiskId} from "../type/RiskId.sol";
|
16
|
+
import {StateId} from "../type/StateId.sol";
|
17
|
+
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
18
|
+
|
19
|
+
contract RiskService is
|
20
|
+
ComponentVerifyingService,
|
21
|
+
IRiskService
|
22
|
+
{
|
23
|
+
IInstanceService private _instanceService;
|
24
|
+
IPoolService internal _poolService;
|
25
|
+
IRegistryService private _registryService;
|
26
|
+
|
27
|
+
function _initialize(
|
28
|
+
address owner,
|
29
|
+
bytes memory data
|
30
|
+
)
|
31
|
+
internal
|
32
|
+
initializer
|
33
|
+
virtual override
|
34
|
+
{
|
35
|
+
(
|
36
|
+
address registryAddress,
|
37
|
+
address authority
|
38
|
+
) = abi.decode(data, (address, address));
|
39
|
+
|
40
|
+
_initializeService(registryAddress, authority, owner);
|
41
|
+
|
42
|
+
_instanceService = IInstanceService(_getServiceAddress(INSTANCE()));
|
43
|
+
_poolService = IPoolService(getRegistry().getServiceAddress(POOL(), getVersion().toMajorPart()));
|
44
|
+
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
45
|
+
|
46
|
+
_registerInterface(type(IRiskService).interfaceId);
|
47
|
+
}
|
48
|
+
|
49
|
+
|
50
|
+
function createRisk(
|
51
|
+
RiskId riskId,
|
52
|
+
bytes memory data
|
53
|
+
)
|
54
|
+
external
|
55
|
+
override
|
56
|
+
{
|
57
|
+
(NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
58
|
+
IRisk.RiskInfo memory riskInfo = IRisk.RiskInfo(productNftId, data);
|
59
|
+
|
60
|
+
instance.getInstanceStore().createRisk(
|
61
|
+
riskId,
|
62
|
+
riskInfo
|
63
|
+
);
|
64
|
+
}
|
65
|
+
|
66
|
+
|
67
|
+
function updateRisk(
|
68
|
+
RiskId riskId,
|
69
|
+
bytes memory data
|
70
|
+
)
|
71
|
+
external
|
72
|
+
{
|
73
|
+
(,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
74
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
75
|
+
|
76
|
+
IRisk.RiskInfo memory riskInfo = instanceReader.getRiskInfo(riskId);
|
77
|
+
riskInfo.data = data;
|
78
|
+
instance.getInstanceStore().updateRisk(riskId, riskInfo, KEEP_STATE());
|
79
|
+
}
|
80
|
+
|
81
|
+
|
82
|
+
function updateRiskState(
|
83
|
+
RiskId riskId,
|
84
|
+
StateId state
|
85
|
+
)
|
86
|
+
external
|
87
|
+
{
|
88
|
+
(,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
89
|
+
instance.getInstanceStore().updateRiskState(riskId, state);
|
90
|
+
}
|
91
|
+
|
92
|
+
|
93
|
+
function _getDomain() internal pure override returns(ObjectType) {
|
94
|
+
return PRODUCT();
|
95
|
+
}
|
96
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IVersionable} from "../upgradeability/IVersionable.sol";
|
5
|
+
import {ProxyManager} from "../upgradeability/ProxyManager.sol";
|
6
|
+
import {RiskService} from "./RiskService.sol";
|
7
|
+
|
8
|
+
contract RiskServiceManager is ProxyManager {
|
9
|
+
|
10
|
+
RiskService private _riskService;
|
11
|
+
|
12
|
+
/// @dev initializes proxy manager with product service implementation
|
13
|
+
constructor(
|
14
|
+
address authority,
|
15
|
+
address registry,
|
16
|
+
bytes32 salt
|
17
|
+
)
|
18
|
+
{
|
19
|
+
RiskService svc = new RiskService{salt: salt}();
|
20
|
+
bytes memory data = abi.encode(registry, authority);
|
21
|
+
IVersionable versionable = initialize(
|
22
|
+
registry,
|
23
|
+
address(svc),
|
24
|
+
data,
|
25
|
+
salt);
|
26
|
+
|
27
|
+
_riskService = RiskService(address(versionable));
|
28
|
+
}
|
29
|
+
|
30
|
+
//--- view functions ----------------------------------------------------//
|
31
|
+
function getRiskService()
|
32
|
+
external
|
33
|
+
view
|
34
|
+
returns (RiskService riskService)
|
35
|
+
{
|
36
|
+
return _riskService;
|
37
|
+
}
|
38
|
+
|
39
|
+
}
|