@etherisc/gif-next 0.0.2-d13bb9e-069 → 0.0.2-d18e1c5-511
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +91 -7
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1075 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +790 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +843 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +684 -254
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +1289 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +202 -5
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +456 -24
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +560 -201
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +215 -18
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +265 -16
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +473 -17
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +204 -312
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +431 -36
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +123 -196
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +629 -225
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +195 -83
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +102 -170
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +429 -77
- 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 +227 -244
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +430 -35
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +445 -348
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +427 -36
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
- package/artifacts/contracts/examples/flight/FlightLib.sol/FlightLib.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightLib.sol/FlightLib.json +408 -0
- package/artifacts/contracts/examples/flight/FlightOracle.sol/FlightOracle.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightOracle.sol/FlightOracle.json +1198 -0
- package/artifacts/contracts/examples/flight/FlightOracleAuthorization.sol/FlightOracleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightOracleAuthorization.sol/FlightOracleAuthorization.json +805 -0
- package/artifacts/contracts/examples/flight/FlightPool.sol/FlightPool.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightPool.sol/FlightPool.json +1466 -0
- package/artifacts/contracts/examples/flight/FlightPoolAuthorization.sol/FlightPoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightPoolAuthorization.sol/FlightPoolAuthorization.json +805 -0
- package/artifacts/contracts/examples/flight/FlightProduct.sol/FlightProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightProduct.sol/FlightProduct.json +2185 -0
- package/artifacts/contracts/examples/flight/FlightProductAuthorization.sol/FlightProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightProductAuthorization.sol/FlightProductAuthorization.json +805 -0
- package/artifacts/contracts/examples/flight/FlightUSD.sol/FlightUSD.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightUSD.sol/FlightUSD.json +376 -0
- package/artifacts/contracts/examples/flight/originalV1.sol/FlightDelayChainlink.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/originalV1.sol/FlightDelayChainlink.json +901 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +293 -275
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +805 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +175 -185
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +343 -251
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +805 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +957 -362
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +805 -0
- package/artifacts/contracts/instance/BaseStore.sol/BaseStore.dbg.json +4 -0
- package/artifacts/contracts/{shared/IKeyValueStore.sol/IKeyValueStore.json → instance/BaseStore.sol/BaseStore.json} +55 -197
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +193 -45
- package/artifacts/contracts/instance/IBaseStore.sol/IBaseStore.dbg.json +4 -0
- package/artifacts/contracts/{shared/KeyValueStore.sol/KeyValueStore.json → instance/IBaseStore.sol/IBaseStore.json} +34 -227
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +578 -65
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +395 -60
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +641 -119
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1023 -362
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +328 -92
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +1131 -553
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +416 -131
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +119 -61
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +1290 -1858
- package/artifacts/contracts/instance/ProductStore.sol/ProductStore.dbg.json +4 -0
- package/artifacts/contracts/instance/ProductStore.sol/ProductStore.json +3427 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +866 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +8 -8
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +46 -5
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +16 -5
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +168 -0
- 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 +161 -193
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +424 -37
- 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 +116 -119
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +98 -11
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +137 -145
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +196 -81
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +153 -53
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +165 -209
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +430 -35
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +347 -340
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +144 -100
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +247 -145
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +131 -173
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +400 -218
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +144 -191
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +522 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +626 -405
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +187 -79
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +356 -57
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +142 -50
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +284 -233
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +430 -35
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +323 -184
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +153 -93
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +296 -9
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +209 -18
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +194 -54
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +140 -37
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +254 -198
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +286 -21
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +320 -184
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +783 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +169 -85
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +197 -130
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +134 -66
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +274 -223
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +367 -82
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +142 -50
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +125 -33
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +169 -37
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +4 -0
- package/artifacts/contracts/registry/IRelease.sol/IRelease.json +24 -0
- 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 +169 -69
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +766 -464
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +1074 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +206 -70
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +118 -46
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +2152 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +47 -6
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +478 -258
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +489 -20
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +120 -60
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +113 -103
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +495 -517
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +154 -86
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +544 -4
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.json +24 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.json +30 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.json +40 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +93 -78
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +432 -290
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +116 -119
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +36 -0
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +35 -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 +167 -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 +84 -2
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -2
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +136 -144
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +42 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +37 -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 +171 -38
- 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 +84 -2
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +327 -73
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +484 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +88 -24
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1492 -183
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +235 -123
- package/artifacts/contracts/staking/ITargetLimitHandler.sol/ITargetLimitHandler.dbg.json +4 -0
- package/artifacts/contracts/staking/ITargetLimitHandler.sol/ITargetLimitHandler.json +50 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +1651 -304
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +470 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +163 -66
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +295 -183
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +281 -173
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +121 -53
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +1645 -790
- package/artifacts/contracts/staking/TargetHandler.sol/TargetHandler.dbg.json +4 -0
- package/artifacts/contracts/staking/TargetHandler.sol/TargetHandler.json +309 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +160 -88
- 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/Amount.sol/AmountLib.json +11 -11
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +45 -19
- package/artifacts/contracts/type/ChainId.sol/ChainIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/ChainId.sol/ChainIdLib.json +193 -0
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +94 -38
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +4 -0
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +33 -0
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +23 -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 +49 -50
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +23 -4
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- package/artifacts/contracts/type/RequestIdSet.sol/RequestIdSet.dbg.json +4 -0
- package/artifacts/contracts/type/RequestIdSet.sol/RequestIdSet.json +33 -0
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +69 -7
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +42 -157
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +64 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +21 -2
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +2 -2
- 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 +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.json +69 -2
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +37 -5
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +61 -37
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -21
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +101 -2
- 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 +95 -25
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +15 -2
- 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 +274 -0
- package/contracts/accounting/AccountingServiceManager.sol +38 -0
- package/contracts/accounting/IAccountingService.sol +47 -0
- package/contracts/authorization/AccessAdmin.sol +460 -272
- package/contracts/authorization/AccessAdminLib.sol +396 -0
- package/contracts/authorization/AccessManagerCloneable.sol +146 -4
- package/contracts/authorization/Authorization.sol +159 -211
- package/contracts/authorization/IAccess.sol +25 -6
- package/contracts/authorization/IAccessAdmin.sol +87 -78
- package/contracts/authorization/IAuthorization.sol +9 -37
- package/contracts/authorization/IServiceAuthorization.sol +57 -17
- package/contracts/authorization/ServiceAuthorization.sol +255 -25
- package/contracts/distribution/BasicDistribution.sol +21 -19
- package/contracts/distribution/BasicDistributionAuthorization.sol +30 -10
- package/contracts/distribution/Distribution.sol +45 -95
- package/contracts/distribution/DistributionService.sol +221 -109
- package/contracts/distribution/DistributionServiceManager.sol +1 -1
- package/contracts/distribution/IDistributionComponent.sol +4 -11
- package/contracts/distribution/IDistributionService.sol +38 -24
- package/contracts/examples/fire/FirePool.sol +24 -13
- package/contracts/examples/fire/FirePoolAuthorization.sol +2 -1
- package/contracts/examples/fire/FireProduct.sol +79 -56
- package/contracts/examples/fire/FireProductAuthorization.sol +3 -3
- package/contracts/examples/flight/FlightLib.sol +279 -0
- package/contracts/examples/flight/FlightOracle.sol +167 -0
- package/contracts/examples/flight/FlightOracleAuthorization.sol +34 -0
- package/contracts/examples/flight/FlightPool.sol +89 -0
- package/contracts/examples/flight/FlightPoolAuthorization.sol +37 -0
- package/contracts/examples/flight/FlightProduct.sol +470 -0
- package/contracts/examples/flight/FlightProductAuthorization.sol +44 -0
- package/contracts/examples/flight/FlightUSD.sol +26 -0
- package/contracts/examples/flight/originalV1.sol +396 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +43 -12
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +8 -12
- package/contracts/examples/unpermissioned/SimplePool.sol +36 -10
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +134 -48
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BaseStore.sol +93 -0
- package/contracts/instance/BundleSet.sol +42 -38
- package/contracts/instance/IBaseStore.sol +37 -0
- package/contracts/instance/IInstance.sol +111 -18
- package/contracts/instance/IInstanceService.sol +61 -34
- package/contracts/instance/Instance.sol +196 -74
- package/contracts/instance/InstanceAdmin.sol +270 -179
- package/contracts/instance/InstanceAuthorizationV3.sol +152 -81
- package/contracts/instance/InstanceReader.sol +453 -314
- package/contracts/instance/InstanceService.sol +313 -264
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/InstanceStore.sol +152 -116
- package/contracts/instance/ProductStore.sol +290 -0
- package/contracts/instance/RiskSet.sol +126 -0
- package/contracts/instance/TargetNames.sol +10 -0
- package/contracts/instance/base/BalanceStore.sol +4 -6
- package/contracts/instance/base/ObjectCounter.sol +1 -2
- package/contracts/instance/base/ObjectLifecycle.sol +6 -8
- package/contracts/instance/base/ObjectSet.sol +31 -33
- package/contracts/instance/base/ObjectSetHelperLib.sol +30 -0
- package/contracts/instance/module/IBundle.sol +6 -5
- package/contracts/instance/module/IComponents.sol +25 -13
- package/contracts/instance/module/IDistribution.sol +21 -8
- package/contracts/instance/module/IPolicy.sol +28 -7
- package/contracts/instance/module/IRisk.sol +5 -0
- package/contracts/oracle/BasicOracle.sol +3 -7
- package/contracts/oracle/BasicOracleAuthorization.sol +14 -8
- package/contracts/oracle/IOracle.sol +9 -4
- package/contracts/oracle/IOracleService.sol +14 -13
- package/contracts/oracle/Oracle.sol +9 -24
- package/contracts/oracle/OracleService.sol +113 -84
- package/contracts/oracle/OracleServiceManager.sol +1 -1
- package/contracts/pool/BasicPool.sol +35 -40
- package/contracts/pool/BasicPoolAuthorization.sol +34 -11
- package/contracts/pool/BundleService.sol +112 -187
- package/contracts/pool/BundleServiceManager.sol +1 -1
- package/contracts/pool/IBundleService.sol +28 -55
- package/contracts/pool/IPoolComponent.sol +1 -7
- package/contracts/pool/IPoolService.sol +65 -66
- package/contracts/pool/Pool.sol +114 -136
- package/contracts/pool/PoolLib.sol +341 -0
- package/contracts/pool/PoolService.sol +308 -257
- package/contracts/pool/PoolServiceManager.sol +1 -1
- package/contracts/product/ApplicationService.sol +102 -26
- package/contracts/product/ApplicationServiceManager.sol +1 -1
- package/contracts/product/BasicProduct.sol +10 -15
- package/contracts/product/BasicProductAuthorization.sol +33 -12
- package/contracts/product/ClaimService.sol +241 -196
- package/contracts/product/ClaimServiceManager.sol +1 -1
- package/contracts/product/IApplicationService.sol +28 -3
- package/contracts/product/IClaimService.sol +18 -5
- package/contracts/product/IPolicyService.sol +34 -12
- package/contracts/product/IPricingService.sol +10 -9
- package/contracts/product/IProductComponent.sol +10 -1
- package/contracts/product/IRiskService.sol +25 -10
- package/contracts/product/PolicyService.sol +264 -305
- package/contracts/product/PolicyServiceLib.sol +139 -0
- package/contracts/product/PolicyServiceManager.sol +1 -1
- package/contracts/product/PricingService.sol +58 -52
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +136 -77
- package/contracts/product/RiskService.sol +130 -37
- package/contracts/product/RiskServiceManager.sol +1 -1
- package/contracts/registry/ChainNft.sol +10 -11
- package/contracts/registry/IRegistry.sol +29 -27
- package/contracts/registry/IRegistryService.sol +6 -4
- package/contracts/registry/IRelease.sol +29 -0
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +44 -15
- package/contracts/registry/RegistryAdmin.sol +107 -380
- package/contracts/registry/RegistryAuthorization.sol +336 -0
- package/contracts/registry/RegistryService.sol +41 -59
- package/contracts/registry/RegistryServiceManager.sol +1 -1
- package/contracts/registry/ReleaseAdmin.sol +195 -0
- package/contracts/registry/ReleaseLifecycle.sol +8 -3
- package/contracts/registry/ReleaseRegistry.sol +278 -244
- package/contracts/registry/ServiceAuthorizationV3.sol +203 -59
- package/contracts/registry/TokenRegistry.sol +61 -59
- package/contracts/shared/Component.sol +67 -125
- package/contracts/shared/ComponentService.sol +425 -375
- package/contracts/shared/ComponentServiceManager.sol +1 -1
- package/contracts/shared/ContractLib.sol +277 -3
- package/contracts/shared/IComponent.sol +6 -18
- package/contracts/shared/IComponentService.sol +43 -40
- package/contracts/shared/IInstanceLinkedComponent.sol +3 -22
- package/contracts/shared/ILifecycle.sol +3 -1
- package/contracts/shared/INftOwnable.sol +4 -0
- package/contracts/shared/IRegisterable.sol +22 -1
- package/contracts/shared/IService.sol +3 -5
- package/contracts/shared/InitializableERC165.sol +9 -1
- package/contracts/shared/InstanceLinkedComponent.sol +114 -53
- package/contracts/shared/Lifecycle.sol +15 -4
- package/contracts/shared/NftOwnable.sol +29 -7
- package/contracts/shared/PolicyHolder.sol +4 -3
- package/contracts/shared/Registerable.sol +50 -19
- package/contracts/shared/RegistryLinked.sol +7 -13
- package/contracts/shared/Service.sol +14 -34
- package/contracts/shared/TokenHandler.sol +275 -72
- package/contracts/shared/TokenHandlerDeployerLib.sol +10 -2
- package/contracts/staking/IStaking.sol +271 -72
- package/contracts/staking/IStakingService.sol +45 -78
- package/contracts/staking/ITargetLimitHandler.sol +17 -0
- package/contracts/staking/Staking.sol +524 -225
- package/contracts/staking/{StakeManagerLib.sol → StakingLib.sol} +55 -84
- package/contracts/staking/StakingManager.sol +4 -3
- package/contracts/staking/StakingReader.sol +70 -82
- package/contracts/staking/StakingService.sol +62 -148
- package/contracts/staking/StakingServiceManager.sol +6 -4
- package/contracts/staking/StakingStore.sol +1093 -330
- package/contracts/staking/TargetHandler.sol +132 -0
- package/contracts/staking/TargetManagerLib.sol +69 -46
- package/contracts/type/Amount.sol +4 -0
- package/contracts/type/Blocknumber.sol +15 -15
- package/contracts/type/ChainId.sol +101 -0
- package/contracts/type/Fee.sol +8 -8
- package/contracts/type/Key32.sol +2 -2
- package/contracts/type/Key32Set.sol +62 -0
- package/contracts/type/NftId.sol +6 -0
- package/contracts/type/ObjectType.sol +71 -68
- package/contracts/type/Referral.sol +6 -0
- package/contracts/type/RequestIdSet.sol +62 -0
- package/contracts/type/RiskId.sol +26 -8
- package/contracts/type/RoleId.sol +61 -55
- package/contracts/type/Seconds.sol +23 -0
- package/contracts/type/Selector.sol +5 -0
- package/contracts/type/StateId.sol +14 -1
- package/contracts/type/String.sol +42 -0
- package/contracts/type/Timestamp.sol +14 -8
- package/contracts/type/UFixed.sol +35 -127
- package/contracts/type/Version.sol +54 -5
- package/contracts/upgradeability/IVersionable.sol +3 -0
- package/contracts/upgradeability/ProxyManager.sol +27 -12
- package/contracts/upgradeability/UpgradableProxyWithAdmin.sol +12 -2
- package/contracts/upgradeability/Versionable.sol +6 -3
- package/package.json +5 -4
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +0 -4
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.json +0 -290
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +0 -4
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +0 -390
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +0 -4
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +0 -129
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +0 -4
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +0 -432
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +0 -39
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -440
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +0 -4
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +0 -164
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +0 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +0 -16
- package/contracts/authorization/IModuleAuthorization.sol +0 -21
- package/contracts/authorization/ModuleAuthorization.sol +0 -78
- package/contracts/instance/module/IAccess.sol +0 -46
- package/contracts/shared/ComponentVerifyingService.sol +0 -116
- package/contracts/shared/IKeyValueStore.sol +0 -54
- package/contracts/shared/InitializableCustom.sol +0 -177
- package/contracts/shared/KeyValueStore.sol +0 -131
- package/contracts/staking/StakingLifecycle.sol +0 -23
@@ -3,30 +3,28 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
5
5
|
import {ClaimId} from "../type/ClaimId.sol";
|
6
|
-
import {
|
7
|
-
import {Fee, FeeLib} from "../type/Fee.sol";
|
8
|
-
import {IRisk} from "../instance/module/IRisk.sol";
|
6
|
+
import {Fee} from "../type/Fee.sol";
|
9
7
|
import {IApplicationService} from "./IApplicationService.sol";
|
10
8
|
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
11
9
|
import {IComponentService} from "../shared/IComponentService.sol";
|
10
|
+
import {InstanceLinkedComponent} from "../shared/InstanceLinkedComponent.sol";
|
12
11
|
import {IPolicyService} from "./IPolicyService.sol";
|
13
12
|
import {IRiskService} from "./IRiskService.sol";
|
14
13
|
import {IClaimService} from "./IClaimService.sol";
|
15
14
|
import {IPricingService} from "./IPricingService.sol";
|
16
15
|
import {IProductComponent} from "./IProductComponent.sol";
|
17
16
|
import {NftId} from "../type/NftId.sol";
|
17
|
+
import {COMPONENT, PRODUCT, BUNDLE, APPLICATION, POLICY, CLAIM, PRICE } from "../type/ObjectType.sol";
|
18
18
|
import {PayoutId} from "../type/PayoutId.sol";
|
19
|
-
import {COMPONENT, PRODUCT, APPLICATION, POLICY, CLAIM, PRICE } from "../type/ObjectType.sol";
|
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";
|
25
25
|
|
26
26
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
27
27
|
import {IComponents} from "../instance/module/IComponents.sol";
|
28
|
-
import {Pool} from "../pool/Pool.sol";
|
29
|
-
import {Distribution} from "../distribution/Distribution.sol";
|
30
28
|
|
31
29
|
abstract contract Product is
|
32
30
|
InstanceLinkedComponent,
|
@@ -36,26 +34,25 @@ abstract contract Product is
|
|
36
34
|
bytes32 public constant PRODUCT_STORAGE_LOCATION_V1 = 0x0bb7aafdb8e380f81267337bc5b5dfdf76e6d3a380ecadb51ec665246d9d6800;
|
37
35
|
|
38
36
|
struct ProductStorage {
|
37
|
+
IComponents.ProductInfo _productInfo;
|
38
|
+
IComponents.FeeInfo _feeInfo;
|
39
|
+
IComponentService _componentService;
|
39
40
|
IRiskService _riskService;
|
40
41
|
IApplicationService _applicationService;
|
41
42
|
IPolicyService _policyService;
|
42
43
|
IClaimService _claimService;
|
43
44
|
IPricingService _pricingService;
|
44
|
-
IComponentService _componentService;
|
45
|
-
NftId _poolNftId;
|
46
|
-
NftId _distributionNftId;
|
47
|
-
Pool _pool;
|
48
|
-
Distribution _distribution;
|
49
45
|
}
|
50
46
|
|
51
47
|
|
52
|
-
function
|
48
|
+
function registerComponent(address component)
|
53
49
|
external
|
54
50
|
virtual
|
51
|
+
restricted()
|
55
52
|
onlyOwner()
|
53
|
+
returns (NftId componentNftId)
|
56
54
|
{
|
57
|
-
_getProductStorage()._componentService.
|
58
|
-
_approveTokenHandler(type(uint256).max);
|
55
|
+
return _getProductStorage()._componentService.registerComponent(component);
|
59
56
|
}
|
60
57
|
|
61
58
|
|
@@ -67,6 +64,7 @@ abstract contract Product is
|
|
67
64
|
external
|
68
65
|
virtual
|
69
66
|
restricted() // pool service role
|
67
|
+
onlyNftOfType(policyNftId, POLICY())
|
70
68
|
{
|
71
69
|
// default implementation does nothing
|
72
70
|
}
|
@@ -82,7 +80,9 @@ abstract contract Product is
|
|
82
80
|
)
|
83
81
|
public
|
84
82
|
view
|
83
|
+
virtual
|
85
84
|
override
|
85
|
+
onlyNftOfType(bundleNftId, BUNDLE())
|
86
86
|
returns (Amount premiumAmount)
|
87
87
|
{
|
88
88
|
IPolicy.PremiumInfo memory premium = _getProductStorage()._pricingService.calculatePremium(
|
@@ -120,66 +120,50 @@ abstract contract Product is
|
|
120
120
|
view
|
121
121
|
returns (IComponents.ProductInfo memory poolInfo)
|
122
122
|
{
|
123
|
-
|
123
|
+
return _getProductStorage()._productInfo;
|
124
|
+
}
|
124
125
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
minDistributionOwnerFee: FeeLib.zero(),
|
133
|
-
poolFee: FeeLib.zero(),
|
134
|
-
stakingFee: FeeLib.zero(),
|
135
|
-
performanceFee: FeeLib.zero()
|
136
|
-
});
|
126
|
+
function getInitialFeeInfo()
|
127
|
+
public
|
128
|
+
virtual
|
129
|
+
view
|
130
|
+
returns (IComponents.FeeInfo memory feeInfo)
|
131
|
+
{
|
132
|
+
return _getProductStorage()._feeInfo;
|
137
133
|
}
|
138
134
|
|
139
135
|
|
140
|
-
function
|
136
|
+
function __Product_init(
|
141
137
|
address registry,
|
142
138
|
NftId instanceNftId,
|
143
|
-
IAuthorization authorization,
|
144
|
-
address initialOwner,
|
145
139
|
string memory name,
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
address
|
150
|
-
// add NftId [] oracleNftIds (#527)
|
151
|
-
bytes memory registryData, // writeonly data that will saved in the object info record of the registry
|
152
|
-
bytes memory componentData // writeonly data that will saved in the object info record of the registry
|
140
|
+
IComponents.ProductInfo memory productInfo,
|
141
|
+
IComponents.FeeInfo memory feeInfo,
|
142
|
+
IAuthorization authorization,
|
143
|
+
address initialOwner
|
153
144
|
)
|
154
145
|
internal
|
155
146
|
virtual
|
156
147
|
onlyInitializing()
|
157
148
|
{
|
158
|
-
|
149
|
+
__InstanceLinkedComponent_init(
|
159
150
|
registry,
|
160
151
|
instanceNftId,
|
161
152
|
name,
|
162
|
-
token,
|
163
153
|
PRODUCT(),
|
164
154
|
authorization,
|
165
|
-
|
166
|
-
initialOwner
|
167
|
-
registryData,
|
168
|
-
componentData);
|
155
|
+
productInfo.isInterceptingPolicyTransfers,
|
156
|
+
initialOwner);
|
169
157
|
|
170
158
|
ProductStorage storage $ = _getProductStorage();
|
171
|
-
|
172
|
-
|
173
|
-
$._riskService = IRiskService(_getServiceAddress(
|
159
|
+
$._productInfo = productInfo;
|
160
|
+
$._feeInfo = feeInfo;
|
161
|
+
$._riskService = IRiskService(_getServiceAddress(RISK()));
|
174
162
|
$._applicationService = IApplicationService(_getServiceAddress(APPLICATION()));
|
175
163
|
$._policyService = IPolicyService(_getServiceAddress(POLICY()));
|
176
164
|
$._claimService = IClaimService(_getServiceAddress(CLAIM()));
|
177
165
|
$._pricingService = IPricingService(_getServiceAddress(PRICE()));
|
178
166
|
$._componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
179
|
-
$._pool = Pool(pool);
|
180
|
-
$._distribution = Distribution(distribution);
|
181
|
-
$._poolNftId = getRegistry().getNftIdForAddress(pool);
|
182
|
-
$._distributionNftId = getRegistry().getNftIdForAddress(distribution);
|
183
167
|
|
184
168
|
_registerInterface(type(IProductComponent).interfaceId);
|
185
169
|
}
|
@@ -197,10 +181,14 @@ abstract contract Product is
|
|
197
181
|
|
198
182
|
|
199
183
|
function _createRisk(
|
200
|
-
|
184
|
+
bytes32 id,
|
201
185
|
bytes memory data
|
202
|
-
)
|
203
|
-
|
186
|
+
)
|
187
|
+
internal
|
188
|
+
virtual
|
189
|
+
returns (RiskId riskId)
|
190
|
+
{
|
191
|
+
return _getProductStorage()._riskService.createRisk(
|
204
192
|
id,
|
205
193
|
data
|
206
194
|
);
|
@@ -209,26 +197,38 @@ abstract contract Product is
|
|
209
197
|
function _updateRisk(
|
210
198
|
RiskId id,
|
211
199
|
bytes memory data
|
212
|
-
)
|
213
|
-
|
200
|
+
)
|
201
|
+
internal
|
202
|
+
virtual
|
203
|
+
{
|
204
|
+
_getProductStorage()._riskService.updateRisk(
|
214
205
|
id,
|
215
206
|
data
|
216
207
|
);
|
217
208
|
}
|
218
209
|
|
219
|
-
function
|
210
|
+
function _setRiskLocked(
|
220
211
|
RiskId id,
|
221
|
-
|
222
|
-
)
|
223
|
-
|
212
|
+
bool locked
|
213
|
+
)
|
214
|
+
internal
|
215
|
+
virtual
|
216
|
+
{
|
217
|
+
_getProductStorage()._riskService.setRiskLocked(
|
224
218
|
id,
|
225
|
-
|
219
|
+
locked
|
226
220
|
);
|
227
221
|
}
|
228
222
|
|
229
|
-
|
230
|
-
|
231
|
-
|
223
|
+
function _closeRisk(
|
224
|
+
RiskId id
|
225
|
+
)
|
226
|
+
internal
|
227
|
+
virtual
|
228
|
+
{
|
229
|
+
_getProductStorage()._riskService.closeRisk(
|
230
|
+
id
|
231
|
+
);
|
232
232
|
}
|
233
233
|
|
234
234
|
|
@@ -243,6 +243,7 @@ abstract contract Product is
|
|
243
243
|
bytes memory applicationData
|
244
244
|
)
|
245
245
|
internal
|
246
|
+
virtual
|
246
247
|
returns (NftId applicationNftId)
|
247
248
|
{
|
248
249
|
return _getProductStorage()._applicationService.create(
|
@@ -257,21 +258,36 @@ abstract contract Product is
|
|
257
258
|
);
|
258
259
|
}
|
259
260
|
|
261
|
+
function _revoke(
|
262
|
+
NftId applicationNftId
|
263
|
+
)
|
264
|
+
internal
|
265
|
+
virtual
|
266
|
+
{
|
267
|
+
_getProductStorage()._applicationService.revoke(
|
268
|
+
applicationNftId);
|
269
|
+
}
|
270
|
+
|
260
271
|
function _createPolicy(
|
261
272
|
NftId applicationNftId,
|
262
|
-
Timestamp activateAt
|
273
|
+
Timestamp activateAt,
|
274
|
+
Amount maxPremiumAmount
|
263
275
|
)
|
264
276
|
internal
|
277
|
+
virtual
|
278
|
+
returns (Amount premiumAmount)
|
265
279
|
{
|
266
|
-
_getProductStorage()._policyService.createPolicy(
|
280
|
+
premiumAmount = _getProductStorage()._policyService.createPolicy(
|
267
281
|
applicationNftId,
|
268
|
-
activateAt
|
282
|
+
activateAt,
|
283
|
+
maxPremiumAmount);
|
269
284
|
}
|
270
285
|
|
271
286
|
function _decline(
|
272
287
|
NftId policyNftId
|
273
288
|
)
|
274
289
|
internal
|
290
|
+
virtual
|
275
291
|
{
|
276
292
|
_getProductStorage()._policyService.decline(
|
277
293
|
policyNftId);
|
@@ -282,16 +298,33 @@ abstract contract Product is
|
|
282
298
|
Timestamp expireAt
|
283
299
|
)
|
284
300
|
internal
|
301
|
+
virtual
|
285
302
|
returns (Timestamp expiredAt)
|
286
303
|
{
|
287
304
|
expiredAt = _getProductStorage()._policyService.expire(policyNftId, expireAt);
|
288
305
|
}
|
289
306
|
|
307
|
+
/// @dev adjust the activation date of the policy.
|
308
|
+
/// The policy must already have an activation date set.
|
309
|
+
/// Allowed values are from the current blocktime to the expiration date of the policy.
|
310
|
+
function _adjustActivation(
|
311
|
+
NftId policyNftId,
|
312
|
+
Timestamp activateAt
|
313
|
+
)
|
314
|
+
internal
|
315
|
+
virtual
|
316
|
+
{
|
317
|
+
_getProductStorage()._policyService.adjustActivation(
|
318
|
+
policyNftId,
|
319
|
+
activateAt);
|
320
|
+
}
|
321
|
+
|
290
322
|
function _collectPremium(
|
291
323
|
NftId policyNftId,
|
292
324
|
Timestamp activateAt
|
293
325
|
)
|
294
326
|
internal
|
327
|
+
virtual
|
295
328
|
{
|
296
329
|
_getProductStorage()._policyService.collectPremium(
|
297
330
|
policyNftId,
|
@@ -303,6 +336,7 @@ abstract contract Product is
|
|
303
336
|
Timestamp activateAt
|
304
337
|
)
|
305
338
|
internal
|
339
|
+
virtual
|
306
340
|
{
|
307
341
|
_getProductStorage()._policyService.activate(
|
308
342
|
policyNftId,
|
@@ -313,6 +347,7 @@ abstract contract Product is
|
|
313
347
|
NftId policyNftId
|
314
348
|
)
|
315
349
|
internal
|
350
|
+
virtual
|
316
351
|
{
|
317
352
|
_getProductStorage()._policyService.close(
|
318
353
|
policyNftId);
|
@@ -324,6 +359,7 @@ abstract contract Product is
|
|
324
359
|
bytes memory claimData
|
325
360
|
)
|
326
361
|
internal
|
362
|
+
virtual
|
327
363
|
returns(ClaimId)
|
328
364
|
{
|
329
365
|
return _getProductStorage()._claimService.submit(
|
@@ -332,6 +368,18 @@ abstract contract Product is
|
|
332
368
|
claimData);
|
333
369
|
}
|
334
370
|
|
371
|
+
function _revokeClaim(
|
372
|
+
NftId policyNftId,
|
373
|
+
ClaimId claimId
|
374
|
+
)
|
375
|
+
internal
|
376
|
+
virtual
|
377
|
+
{
|
378
|
+
_getProductStorage()._claimService.revoke(
|
379
|
+
policyNftId,
|
380
|
+
claimId);
|
381
|
+
}
|
382
|
+
|
335
383
|
function _confirmClaim(
|
336
384
|
NftId policyNftId,
|
337
385
|
ClaimId claimId,
|
@@ -339,6 +387,7 @@ abstract contract Product is
|
|
339
387
|
bytes memory data
|
340
388
|
)
|
341
389
|
internal
|
390
|
+
virtual
|
342
391
|
{
|
343
392
|
_getProductStorage()._claimService.confirm(
|
344
393
|
policyNftId,
|
@@ -353,6 +402,7 @@ abstract contract Product is
|
|
353
402
|
bytes memory data
|
354
403
|
)
|
355
404
|
internal
|
405
|
+
virtual
|
356
406
|
{
|
357
407
|
_getProductStorage()._claimService.decline(
|
358
408
|
policyNftId,
|
@@ -360,13 +410,14 @@ abstract contract Product is
|
|
360
410
|
data);
|
361
411
|
}
|
362
412
|
|
363
|
-
function
|
413
|
+
function _cancelConfirmedClaim(
|
364
414
|
NftId policyNftId,
|
365
415
|
ClaimId claimId
|
366
416
|
)
|
367
417
|
internal
|
418
|
+
virtual
|
368
419
|
{
|
369
|
-
_getProductStorage()._claimService.
|
420
|
+
_getProductStorage()._claimService.cancelConfirmedClaim(
|
370
421
|
policyNftId,
|
371
422
|
claimId);
|
372
423
|
}
|
@@ -378,6 +429,7 @@ abstract contract Product is
|
|
378
429
|
bytes memory data
|
379
430
|
)
|
380
431
|
internal
|
432
|
+
virtual
|
381
433
|
returns (PayoutId)
|
382
434
|
{
|
383
435
|
return _getProductStorage()._claimService.createPayout(
|
@@ -395,6 +447,7 @@ abstract contract Product is
|
|
395
447
|
bytes memory data
|
396
448
|
)
|
397
449
|
internal
|
450
|
+
virtual
|
398
451
|
returns (PayoutId)
|
399
452
|
{
|
400
453
|
return _getProductStorage()._claimService.createPayoutForBeneficiary(
|
@@ -410,23 +463,29 @@ abstract contract Product is
|
|
410
463
|
PayoutId payoutId
|
411
464
|
)
|
412
465
|
internal
|
466
|
+
virtual
|
467
|
+
returns (Amount netPayoutAmount, Amount processingFeeAmount)
|
413
468
|
{
|
414
|
-
_getProductStorage()._claimService.processPayout(
|
469
|
+
(netPayoutAmount, processingFeeAmount) = _getProductStorage()._claimService.processPayout(
|
415
470
|
policyNftId,
|
416
471
|
payoutId);
|
417
472
|
}
|
418
473
|
|
419
|
-
function
|
420
|
-
|
474
|
+
function _cancelPayout(
|
475
|
+
NftId policyNftId,
|
476
|
+
PayoutId payoutId
|
477
|
+
)
|
478
|
+
internal
|
479
|
+
virtual
|
480
|
+
{
|
481
|
+
_getProductStorage()._claimService.cancelPayout(
|
482
|
+
policyNftId,
|
483
|
+
payoutId);
|
421
484
|
}
|
422
485
|
|
423
|
-
function _getProductStorage() internal pure returns (ProductStorage storage $) {
|
486
|
+
function _getProductStorage() internal virtual pure returns (ProductStorage storage $) {
|
424
487
|
assembly {
|
425
488
|
$.slot := PRODUCT_STORAGE_LOCATION_V1
|
426
489
|
}
|
427
490
|
}
|
428
|
-
|
429
|
-
function _getRiskService() internal view returns (IRiskService) {
|
430
|
-
return _getProductStorage()._riskService;
|
431
|
-
}
|
432
491
|
}
|
@@ -2,27 +2,24 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {IInstance} from "../instance/IInstance.sol";
|
5
|
-
import {
|
6
|
-
import {IPoolService} from "../pool/PoolService.sol";
|
7
|
-
import {IRiskService} from "./IRiskService.sol";
|
8
|
-
import {IRegistryService} from "../registry/IRegistryService.sol";
|
5
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
9
6
|
import {IRisk} from "../instance/module/IRisk.sol";
|
7
|
+
import {IRiskService} from "./IRiskService.sol";
|
10
8
|
|
9
|
+
import {ContractLib} from "../shared/ContractLib.sol";
|
11
10
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
12
|
-
import {ObjectType,
|
13
|
-
import {KEEP_STATE} from "../type/StateId.sol";
|
11
|
+
import {ObjectType, COMPONENT, PRODUCT, RISK} from "../type/ObjectType.sol";
|
12
|
+
import {ACTIVE, KEEP_STATE, CLOSED} from "../type/StateId.sol";
|
14
13
|
import {NftId} from "../type/NftId.sol";
|
15
|
-
import {RiskId} from "../type/RiskId.sol";
|
16
|
-
import {
|
17
|
-
import {
|
14
|
+
import {RiskId, RiskIdLib} from "../type/RiskId.sol";
|
15
|
+
import {RiskSet} from "../instance/RiskSet.sol";
|
16
|
+
import {Service} from "../shared/Service.sol";
|
17
|
+
import {TimestampLib} from "../type/Timestamp.sol";
|
18
18
|
|
19
19
|
contract RiskService is
|
20
|
-
|
20
|
+
Service,
|
21
21
|
IRiskService
|
22
22
|
{
|
23
|
-
IInstanceService private _instanceService;
|
24
|
-
IPoolService internal _poolService;
|
25
|
-
IRegistryService private _registryService;
|
26
23
|
|
27
24
|
function _initialize(
|
28
25
|
address owner,
|
@@ -33,34 +30,44 @@ contract RiskService is
|
|
33
30
|
virtual override
|
34
31
|
{
|
35
32
|
(
|
36
|
-
address
|
37
|
-
address
|
33
|
+
address authority,
|
34
|
+
address registry
|
38
35
|
) = abi.decode(data, (address, address));
|
39
36
|
|
40
|
-
|
41
|
-
|
42
|
-
_instanceService = IInstanceService(_getServiceAddress(INSTANCE()));
|
43
|
-
_poolService = IPoolService(getRegistry().getServiceAddress(POOL(), getVersion().toMajorPart()));
|
44
|
-
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
45
|
-
|
37
|
+
__Service_init(authority, registry, owner);
|
46
38
|
_registerInterface(type(IRiskService).interfaceId);
|
47
39
|
}
|
48
40
|
|
49
|
-
|
41
|
+
/// @inheritdoc IRiskService
|
50
42
|
function createRisk(
|
51
|
-
|
43
|
+
bytes32 id,
|
52
44
|
bytes memory data
|
53
45
|
)
|
54
46
|
external
|
55
|
-
|
47
|
+
virtual
|
48
|
+
restricted()
|
49
|
+
returns (RiskId riskId)
|
56
50
|
{
|
57
|
-
|
58
|
-
|
51
|
+
// checks
|
52
|
+
(NftId productNftId, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
53
|
+
|
54
|
+
// effects
|
55
|
+
riskId = RiskIdLib.toRiskId(productNftId, id);
|
56
|
+
IRisk.RiskInfo memory riskInfo = IRisk.RiskInfo({
|
57
|
+
productNftId: productNftId,
|
58
|
+
createdAt: TimestampLib.current(),
|
59
|
+
data: data});
|
59
60
|
|
60
|
-
instance.
|
61
|
+
instance.getProductStore().createRisk(
|
61
62
|
riskId,
|
62
63
|
riskInfo
|
63
64
|
);
|
65
|
+
|
66
|
+
// add risk to RiskSet
|
67
|
+
RiskSet riskSet = instance.getRiskSet();
|
68
|
+
riskSet.add(riskId);
|
69
|
+
|
70
|
+
emit LogRiskServiceRiskCreated(productNftId, riskId);
|
64
71
|
}
|
65
72
|
|
66
73
|
|
@@ -68,29 +75,115 @@ contract RiskService is
|
|
68
75
|
RiskId riskId,
|
69
76
|
bytes memory data
|
70
77
|
)
|
71
|
-
external
|
78
|
+
external
|
79
|
+
virtual
|
80
|
+
restricted()
|
72
81
|
{
|
73
|
-
|
74
|
-
|
82
|
+
// checks
|
83
|
+
(NftId productNftId, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
75
84
|
|
85
|
+
// effects
|
86
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
76
87
|
IRisk.RiskInfo memory riskInfo = instanceReader.getRiskInfo(riskId);
|
88
|
+
|
89
|
+
if (riskInfo.productNftId != productNftId) {
|
90
|
+
revert ErrorRiskServiceRiskProductMismatch(riskId, riskInfo.productNftId, productNftId);
|
91
|
+
}
|
92
|
+
|
77
93
|
riskInfo.data = data;
|
78
|
-
instance.
|
94
|
+
instance.getProductStore().updateRisk(riskId, riskInfo, KEEP_STATE());
|
95
|
+
|
96
|
+
emit LogRiskServiceRiskUpdated(productNftId, riskId);
|
79
97
|
}
|
80
98
|
|
81
99
|
|
82
|
-
|
100
|
+
/// @inheritdoc IRiskService
|
101
|
+
function setRiskLocked(
|
83
102
|
RiskId riskId,
|
84
|
-
|
103
|
+
bool locked
|
85
104
|
)
|
86
|
-
external
|
105
|
+
external
|
106
|
+
virtual
|
107
|
+
restricted()
|
108
|
+
{
|
109
|
+
// checks
|
110
|
+
(NftId productNftId, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
111
|
+
|
112
|
+
if (!instance.getRiskSet().hasRisk(productNftId, riskId)) {
|
113
|
+
revert ErrorRiskServiceUnknownRisk(productNftId, riskId);
|
114
|
+
}
|
115
|
+
|
116
|
+
if (instance.getInstanceReader().getRiskState(riskId) != ACTIVE()) {
|
117
|
+
revert ErrorRiskServiceRiskNotActive(productNftId, riskId);
|
118
|
+
}
|
119
|
+
|
120
|
+
if (locked) {
|
121
|
+
instance.getRiskSet().deactivate(riskId);
|
122
|
+
emit LogRiskServiceRiskLocked(productNftId, riskId);
|
123
|
+
} else {
|
124
|
+
instance.getRiskSet().activate(riskId);
|
125
|
+
emit LogRiskServiceRiskUnlocked(productNftId, riskId);
|
126
|
+
}
|
127
|
+
}
|
128
|
+
|
129
|
+
/// @inheritdoc IRiskService
|
130
|
+
function closeRisk(
|
131
|
+
RiskId riskId
|
132
|
+
)
|
133
|
+
external
|
134
|
+
virtual
|
135
|
+
restricted()
|
136
|
+
{
|
137
|
+
// checks
|
138
|
+
(NftId productNftId, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
139
|
+
(bool exists, bool active) = instance.getRiskSet().checkRisk(productNftId, riskId);
|
140
|
+
|
141
|
+
if (!exists) {
|
142
|
+
revert ErrorRiskServiceUnknownRisk(productNftId, riskId);
|
143
|
+
}
|
144
|
+
|
145
|
+
if (active) {
|
146
|
+
revert ErrorRiskServiceRiskNotLocked(productNftId, riskId);
|
147
|
+
}
|
148
|
+
|
149
|
+
// effects
|
150
|
+
instance.getProductStore().updateRiskState(riskId, CLOSED());
|
151
|
+
|
152
|
+
emit LogRiskServiceRiskClosed(productNftId, riskId);
|
153
|
+
}
|
154
|
+
|
155
|
+
function _getAndVerifyActiveComponent(ObjectType expectedType)
|
156
|
+
internal
|
157
|
+
view
|
158
|
+
returns (
|
159
|
+
NftId componentNftId,
|
160
|
+
IInstance instance
|
161
|
+
)
|
87
162
|
{
|
88
|
-
|
89
|
-
|
163
|
+
IRegistry.ObjectInfo memory info;
|
164
|
+
address instanceAddress;
|
165
|
+
bool isActive = true;
|
166
|
+
|
167
|
+
if (expectedType != COMPONENT()) {
|
168
|
+
(info, instanceAddress) = ContractLib.getAndVerifyComponent(
|
169
|
+
getRegistry(),
|
170
|
+
msg.sender, // caller
|
171
|
+
expectedType,
|
172
|
+
isActive);
|
173
|
+
} else {
|
174
|
+
(info, instanceAddress) = ContractLib.getAndVerifyAnyComponent(
|
175
|
+
getRegistry(),
|
176
|
+
msg.sender,
|
177
|
+
isActive);
|
178
|
+
}
|
179
|
+
|
180
|
+
// get component nft id and instance
|
181
|
+
componentNftId = info.nftId;
|
182
|
+
instance = IInstance(instanceAddress);
|
90
183
|
}
|
91
184
|
|
92
185
|
|
93
186
|
function _getDomain() internal pure override returns(ObjectType) {
|
94
|
-
return
|
187
|
+
return RISK();
|
95
188
|
}
|
96
189
|
}
|
@@ -17,7 +17,7 @@ contract RiskServiceManager is ProxyManager {
|
|
17
17
|
)
|
18
18
|
{
|
19
19
|
RiskService svc = new RiskService{salt: salt}();
|
20
|
-
bytes memory data = abi.encode(
|
20
|
+
bytes memory data = abi.encode(authority, registry);
|
21
21
|
IVersionable versionable = initialize(
|
22
22
|
registry,
|
23
23
|
address(svc),
|