@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
@@ -27,9 +27,7 @@ interface IPoolComponent is IInstanceLinkedComponent {
|
|
27
27
|
/// The default implementation is empty.
|
28
28
|
function verifyApplication(
|
29
29
|
NftId applicationNftId,
|
30
|
-
bytes memory applicationData,
|
31
30
|
NftId bundleNftId,
|
32
|
-
bytes memory bundleFilter,
|
33
31
|
Amount collateralizationAmount
|
34
32
|
) external;
|
35
33
|
|
@@ -47,6 +45,7 @@ interface IPoolComponent is IInstanceLinkedComponent {
|
|
47
45
|
view
|
48
46
|
returns (bool isMatching);
|
49
47
|
|
48
|
+
|
50
49
|
/// @dev This is a callback function that is called by the claim service when a claim is confirmed.
|
51
50
|
/// The pool has the option to implement custom behavirous such as triggering a reinsurance claim or blocking the claim confirmaation.
|
52
51
|
/// The default implementation is empty.
|
@@ -56,11 +55,6 @@ interface IPoolComponent is IInstanceLinkedComponent {
|
|
56
55
|
Amount amount
|
57
56
|
) external;
|
58
57
|
|
59
|
-
/// @dev Withdraw bundle feeds for the given bundle
|
60
|
-
/// @param bundleNftId the bundle Nft Id
|
61
|
-
/// @param amount the amount to withdraw. If set to AMOUNT_MAX, the full commission available is withdrawn
|
62
|
-
/// @return withdrawnAmount the effective withdrawn amount
|
63
|
-
function withdrawBundleFees(NftId bundleNftId, Amount amount) external returns (Amount withdrawnAmount);
|
64
58
|
|
65
59
|
/// @dev Returns initial pool specific infos for this pool
|
66
60
|
function getInitialPoolInfo() external view returns (IComponents.PoolInfo memory info);
|
@@ -1,43 +1,46 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {Amount} from "../type/Amount.sol";
|
5
|
-
import {ClaimId} from "../type/ClaimId.sol";
|
6
|
-
import {Fee} from "../type/Fee.sol";
|
7
|
-
import {IBundle} from "../instance/module/IBundle.sol";
|
8
4
|
import {IInstance} from "../instance/IInstance.sol";
|
9
|
-
import {InstanceReader} from "../instance/InstanceReader.sol";
|
10
5
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
11
6
|
import {IService} from "../shared/IService.sol";
|
7
|
+
|
8
|
+
import {Amount} from "../type/Amount.sol";
|
9
|
+
import {ClaimId} from "../type/ClaimId.sol";
|
10
|
+
import {InstanceReader} from "../instance/InstanceReader.sol";
|
11
|
+
import {InstanceStore} from "../instance/InstanceStore.sol";
|
12
12
|
import {NftId} from "../type/NftId.sol";
|
13
13
|
import {PayoutId} from "../type/PayoutId.sol";
|
14
|
-
import {RoleId} from "../type/RoleId.sol";
|
15
|
-
import {Seconds} from "../type/Seconds.sol";
|
16
|
-
import {StateId} from "../type/StateId.sol";
|
17
|
-
import {UFixed} from "../type/UFixed.sol";
|
18
14
|
|
19
15
|
interface IPoolService is IService {
|
20
16
|
|
21
17
|
event LogPoolServiceMaxBalanceAmountUpdated(NftId poolNftId, Amount previousMaxCapitalAmount, Amount currentMaxCapitalAmount);
|
22
|
-
event
|
18
|
+
event LogPoolServiceWalletFunded(NftId poolNftId, address poolOwner, Amount amount);
|
19
|
+
event LogPoolServiceWalletDefunded(NftId poolNftId, address poolOwner, Amount amount);
|
23
20
|
|
24
21
|
event LogPoolServiceBundleCreated(NftId instanceNftId, NftId poolNftId, NftId bundleNftId);
|
25
22
|
event LogPoolServiceBundleClosed(NftId instanceNftId, NftId poolNftId, NftId bundleNftId);
|
26
23
|
|
27
24
|
event LogPoolServiceBundleStaked(NftId instanceNftId, NftId poolNftId, NftId bundleNftId, Amount amount, Amount netAmount);
|
28
|
-
event LogPoolServiceBundleUnstaked(NftId instanceNftId, NftId poolNftId, NftId bundleNftId, Amount amount);
|
25
|
+
event LogPoolServiceBundleUnstaked(NftId instanceNftId, NftId poolNftId, NftId bundleNftId, Amount amount, Amount netAmount);
|
26
|
+
|
27
|
+
event LogPoolServiceFeesWithdrawn(NftId bundleNftId, address recipient, address tokenAddress, Amount amount);
|
29
28
|
|
30
29
|
event LogPoolServiceProcessFundedClaim(NftId policyNftId, ClaimId claimId, Amount availableAmount);
|
31
30
|
|
31
|
+
event LogPoolServiceApplicationVerified(NftId poolNftId, NftId bundleNftId, NftId applicationNftId, Amount totalCollateralAmount);
|
32
|
+
event LogPoolServiceCollateralLocked(NftId poolNftId, NftId bundleNftId, NftId applicationNftId, Amount totalCollateralAmount, Amount lockedCollateralAmount);
|
33
|
+
event LogPoolServiceCollateralReleased(NftId bundleNftId, NftId policyNftId, Amount remainingCollateralAmount);
|
34
|
+
event LogPoolServiceSaleProcessed(NftId poolNftId, NftId bundleNftId, Amount bundleNetAmount, Amount bundleFeeAmount, Amount poolFeeAmount);
|
35
|
+
event LogPoolServicePayoutProcessed(NftId poolNftId, NftId bundleNftId, NftId policyNftId, PayoutId payoutId, Amount netPayoutAmount, Amount processingFeeAmount, address payoutBeneficiary);
|
36
|
+
|
37
|
+
error ErrorPoolServicePoolNotExternallyManaged(NftId poolNftId);
|
32
38
|
error ErrorPoolServicePolicyPoolMismatch(NftId policyNftId, NftId productNftId, NftId expectedProductNftId);
|
33
39
|
error ErrorPoolServiceBundleOwnerRoleAlreadySet(NftId poolNftId);
|
34
40
|
error ErrorPoolServiceInvalidTransferAmount(Amount expectedAmount, Amount actualAmount);
|
35
41
|
error ErrorPoolServiceBundlePoolMismatch(NftId bundleNftId, NftId poolNftId);
|
36
42
|
error ErrorPoolServiceMaxBalanceAmountExceeded(NftId poolNftId, Amount maxBalanceAmount, Amount currentBalanceAmount, Amount transferAmount);
|
37
|
-
|
38
|
-
/// @dev defines the required role for bundle owners for the calling pool
|
39
|
-
/// default implementation returns PUBLIC ROLE
|
40
|
-
function setBundleOwnerRole(RoleId bundleOwnerRole) external;
|
43
|
+
error ErrorPoolServiceFeesWithdrawAmountExceedsLimit(Amount amount, Amount limit);
|
41
44
|
|
42
45
|
/// @dev sets the max balance amount for the calling pool
|
43
46
|
function setMaxBalanceAmount(Amount maxBalanceAmount) external;
|
@@ -66,7 +69,6 @@ interface IPoolService is IService {
|
|
66
69
|
/// may only be called by the policy service for unlocked pool components
|
67
70
|
function releaseCollateral(
|
68
71
|
IInstance instance,
|
69
|
-
address token,
|
70
72
|
NftId policyNftId,
|
71
73
|
IPolicy.PolicyInfo memory policyInfo
|
72
74
|
) external;
|
@@ -76,24 +78,15 @@ interface IPoolService is IService {
|
|
76
78
|
/// every payout of a policy reduces the collateral by the payout amount
|
77
79
|
/// may only be called by the claim service for unlocked pool components
|
78
80
|
function processPayout(
|
79
|
-
|
80
|
-
|
81
|
+
InstanceReader instanceReader,
|
82
|
+
InstanceStore instanceStore,
|
83
|
+
NftId productNftId,
|
81
84
|
NftId policyNftId,
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
/// @dev create a new empty bundle with the provided parameters
|
88
|
-
/// may only be called by registered and unlocked pool components.
|
89
|
-
function createBundle(
|
90
|
-
address owner, // initial bundle owner
|
91
|
-
Fee memory fee, // fees deducted from premium that go to bundle owner
|
92
|
-
Seconds lifetime, // initial duration for which new policies are covered
|
93
|
-
bytes calldata filter // optional use case specific criteria that define if a policy may be covered by this bundle
|
94
|
-
)
|
95
|
-
external
|
96
|
-
returns(NftId bundleNftId); // the nft id of the newly created bundle
|
85
|
+
NftId bundleNftId,
|
86
|
+
PayoutId payoutId,
|
87
|
+
Amount payoutAmount,
|
88
|
+
address payoutBeneficiary
|
89
|
+
) external returns (Amount netPayoutAmount, Amount processingFeeAmount);
|
97
90
|
|
98
91
|
|
99
92
|
/// @dev increase stakes for bundle
|
@@ -116,56 +109,62 @@ interface IPoolService is IService {
|
|
116
109
|
function closeBundle(NftId bundleNftId) external;
|
117
110
|
|
118
111
|
|
112
|
+
/// @dev Withdraw bundle feeds for the specified bundle.
|
113
|
+
function withdrawBundleFees(NftId bundleNftId, Amount amount) external returns (Amount withdrawnAmount);
|
114
|
+
|
115
|
+
|
119
116
|
/// @dev Informs product about available funds to process a confirmed claim.
|
120
117
|
/// The function triggers a callback to the product component when the product's property isProcessingFundedClaims is set.
|
121
118
|
function processFundedClaim(NftId policyNftId, ClaimId claimId, Amount availableAmount) external;
|
122
119
|
|
123
120
|
|
124
|
-
/// @dev Fund the
|
125
|
-
/// This function will collect the amount from the
|
121
|
+
/// @dev Fund the pool wallet with the provided amount.
|
122
|
+
/// This function will collect the amount from the pool owner and transfers it to the pool wallet.
|
126
123
|
/// The function will not update balance amounts managed by the framework.
|
127
124
|
/// Only available for externally managed pools.
|
128
|
-
function fundPoolWallet(
|
125
|
+
function fundPoolWallet(Amount amount) external;
|
129
126
|
|
130
127
|
|
131
128
|
/// @dev Defund the specified pool wallet with the provided amount.
|
132
|
-
/// This function will transfer the amount from the pool wallet to the
|
129
|
+
/// This function will transfer the amount from the pool wallet to the pool owner.
|
133
130
|
/// The function will not update balance amounts managed by the framework.
|
134
131
|
/// Only available for externally managed pools.
|
135
|
-
function defundPoolWallet(
|
132
|
+
function defundPoolWallet(Amount amount) external;
|
136
133
|
|
137
134
|
|
138
135
|
/// @dev processes the sale of a bundle and track the pool fee and bundle fee amounts
|
139
136
|
function processSale(NftId bundleNftId, IPolicy.PremiumInfo memory premium) external;
|
140
137
|
|
141
138
|
|
142
|
-
/// @dev Calulate required collateral for the provided parameters.
|
143
|
-
function calculateRequiredCollateral(
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
)
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
///
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
139
|
+
// /// @dev Calulate required collateral for the provided parameters.
|
140
|
+
// function calculateRequiredCollateral(
|
141
|
+
// InstanceReader instanceReader,
|
142
|
+
// NftId productNftId,
|
143
|
+
// Amount sumInsuredAmount
|
144
|
+
// )
|
145
|
+
// external
|
146
|
+
// view
|
147
|
+
// returns(
|
148
|
+
// NftId poolNftId,
|
149
|
+
// Amount totalCollateralAmount,
|
150
|
+
// Amount localCollateralAmount,
|
151
|
+
// bool poolIsVerifyingApplications
|
152
|
+
// );
|
153
|
+
|
154
|
+
|
155
|
+
// /// @dev calulate required collateral for the provided parameters.
|
156
|
+
// /// Collateralization is applied to sum insured.
|
157
|
+
// /// Retention level defines the fraction of the collateral that is required locally.
|
158
|
+
// function calculateRequiredCollateral(
|
159
|
+
// UFixed collateralizationLevel,
|
160
|
+
// UFixed retentionLevel,
|
161
|
+
// Amount sumInsuredAmount
|
162
|
+
// )
|
163
|
+
// external
|
164
|
+
// pure
|
165
|
+
// returns(
|
166
|
+
// Amount totalCollateralAmount,
|
167
|
+
// Amount localCollateralAmount
|
168
|
+
// );
|
170
169
|
|
171
170
|
}
|
package/contracts/pool/Pool.sol
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
5
|
-
import {BUNDLE, COMPONENT, POOL} from "../type/ObjectType.sol";
|
5
|
+
import {BUNDLE, COMPONENT, POLICY, POOL} from "../type/ObjectType.sol";
|
6
6
|
import {ClaimId} from "../type/ClaimId.sol";
|
7
7
|
import {IBundleService} from "./IBundleService.sol";
|
8
8
|
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
@@ -11,13 +11,13 @@ import {IPoolService} from "./IPoolService.sol";
|
|
11
11
|
import {IComponents} from "../instance/module/IComponents.sol";
|
12
12
|
import {IComponentService} from "../shared/IComponentService.sol";
|
13
13
|
import {InstanceLinkedComponent} from "../shared/InstanceLinkedComponent.sol";
|
14
|
-
import {
|
15
|
-
import {
|
14
|
+
import {InstanceReader} from "../instance/InstanceReader.sol";
|
15
|
+
import {Fee} from "../type/Fee.sol";
|
16
|
+
import {NftId} from "../type/NftId.sol";
|
16
17
|
import {RoleId, PUBLIC_ROLE} from "../type/RoleId.sol";
|
17
18
|
import {Seconds} from "../type/Seconds.sol";
|
18
19
|
import {Timestamp} from "../type/Timestamp.sol";
|
19
|
-
import {
|
20
|
-
import {UFixed, UFixedLib} from "../type/UFixed.sol";
|
20
|
+
import {UFixed} from "../type/UFixed.sol";
|
21
21
|
|
22
22
|
abstract contract Pool is
|
23
23
|
InstanceLinkedComponent,
|
@@ -27,6 +27,7 @@ abstract contract Pool is
|
|
27
27
|
bytes32 public constant POOL_STORAGE_LOCATION_V1 = 0x25e3e51823fbfffb988e0a2744bb93722d9f3e906c07cc0a9e77884c46c58300;
|
28
28
|
|
29
29
|
struct PoolStorage {
|
30
|
+
IComponents.PoolInfo _poolInfo;
|
30
31
|
IComponentService _componentService;
|
31
32
|
IPoolService _poolService;
|
32
33
|
IBundleService _bundleService;
|
@@ -41,33 +42,29 @@ abstract contract Pool is
|
|
41
42
|
}
|
42
43
|
|
43
44
|
|
44
|
-
function
|
45
|
-
|
46
|
-
|
47
|
-
onlyOwner()
|
48
|
-
{
|
49
|
-
_getPoolStorage()._componentService.registerPool();
|
50
|
-
_approveTokenHandler(type(uint256).max);
|
45
|
+
// TODO remove function once this is no longer used to produce contract locations on the fly ...
|
46
|
+
function getContractLocation(bytes memory name) external pure returns (bytes32 hash) {
|
47
|
+
return keccak256(abi.encode(uint256(keccak256(name)) - 1)) & ~bytes32(uint256(0xff));
|
51
48
|
}
|
52
49
|
|
53
50
|
|
54
51
|
/// @dev see {IPoolComponent.verifyApplication}
|
55
52
|
function verifyApplication(
|
56
53
|
NftId applicationNftId,
|
57
|
-
bytes memory applicationData,
|
58
54
|
NftId bundleNftId,
|
59
|
-
bytes memory bundleFilter,
|
60
55
|
Amount collateralizationAmount
|
61
56
|
)
|
62
57
|
public
|
63
58
|
virtual
|
64
59
|
restricted()
|
60
|
+
onlyNftOfType(applicationNftId, POLICY())
|
65
61
|
{
|
62
|
+
InstanceReader reader = _getInstanceReader();
|
66
63
|
if(!applicationMatchesBundle(
|
67
64
|
applicationNftId,
|
68
|
-
applicationData,
|
65
|
+
reader.getPolicyInfo(applicationNftId).applicationData,
|
69
66
|
bundleNftId,
|
70
|
-
|
67
|
+
reader.getBundleInfo(bundleNftId).filter,
|
71
68
|
collateralizationAmount)
|
72
69
|
)
|
73
70
|
{
|
@@ -87,14 +84,16 @@ abstract contract Pool is
|
|
87
84
|
public
|
88
85
|
virtual
|
89
86
|
restricted()
|
87
|
+
onlyNftOfType(policyNftId, POLICY())
|
90
88
|
{
|
91
89
|
// default implementation is empty
|
92
90
|
}
|
93
91
|
|
94
92
|
|
95
93
|
/// @dev see {IPoolComponent.applicationMatchesBundle}
|
96
|
-
///
|
97
|
-
///
|
94
|
+
/// Default implementation always returns true.
|
95
|
+
/// Override this function to implement any custom application verification.
|
96
|
+
/// Calling super.applicationMatchesBundle will ensure validation of application and bundle nft ids.
|
98
97
|
function applicationMatchesBundle(
|
99
98
|
NftId applicationNftId,
|
100
99
|
bytes memory applicationData,
|
@@ -105,22 +104,13 @@ abstract contract Pool is
|
|
105
104
|
public
|
106
105
|
virtual
|
107
106
|
view
|
107
|
+
onlyNftOfType(applicationNftId, POLICY())
|
108
|
+
onlyNftOfType(bundleNftId, BUNDLE())
|
108
109
|
returns (bool isMatching)
|
109
110
|
{
|
110
111
|
return true;
|
111
112
|
}
|
112
113
|
|
113
|
-
/// @inheritdoc IPoolComponent
|
114
|
-
function withdrawBundleFees(NftId bundleNftId, Amount amount)
|
115
|
-
external
|
116
|
-
virtual
|
117
|
-
restricted()
|
118
|
-
onlyBundleOwner(bundleNftId)
|
119
|
-
returns (Amount withdrawnAmount)
|
120
|
-
{
|
121
|
-
return _withdrawBundleFees(bundleNftId, amount);
|
122
|
-
}
|
123
|
-
|
124
114
|
|
125
115
|
function getInitialPoolInfo()
|
126
116
|
public
|
@@ -128,48 +118,35 @@ abstract contract Pool is
|
|
128
118
|
view
|
129
119
|
returns (IComponents.PoolInfo memory poolInfo)
|
130
120
|
{
|
131
|
-
return
|
132
|
-
maxBalanceAmount: AmountLib.max(),
|
133
|
-
bundleOwnerRole: PUBLIC_ROLE(),
|
134
|
-
isInterceptingBundleTransfers: isNftInterceptor(),
|
135
|
-
isProcessingConfirmedClaims: false,
|
136
|
-
isExternallyManaged: false,
|
137
|
-
isVerifyingApplications: false,
|
138
|
-
collateralizationLevel: UFixedLib.toUFixed(1),
|
139
|
-
retentionLevel: UFixedLib.toUFixed(1)
|
140
|
-
});
|
121
|
+
return _getPoolStorage()._poolInfo;
|
141
122
|
}
|
142
123
|
|
143
124
|
// Internals
|
144
125
|
|
145
|
-
function
|
126
|
+
function __Pool_init(
|
146
127
|
address registry,
|
147
|
-
NftId
|
128
|
+
NftId productNftId,
|
148
129
|
string memory name,
|
149
|
-
|
130
|
+
IComponents.PoolInfo memory poolInfo,
|
150
131
|
IAuthorization authorization,
|
151
|
-
|
152
|
-
address initialOwner,
|
153
|
-
bytes memory registryData, // writeonly data that will saved in the object info record of the registry
|
154
|
-
bytes memory componentData // component specifidc data
|
132
|
+
address initialOwner
|
155
133
|
)
|
156
134
|
internal
|
157
135
|
virtual
|
158
136
|
onlyInitializing()
|
159
137
|
{
|
160
|
-
|
138
|
+
__InstanceLinkedComponent_init(
|
161
139
|
registry,
|
162
|
-
|
140
|
+
productNftId,
|
163
141
|
name,
|
164
|
-
token,
|
165
142
|
POOL(),
|
166
143
|
authorization,
|
167
|
-
|
168
|
-
initialOwner
|
169
|
-
registryData,
|
170
|
-
componentData);
|
144
|
+
poolInfo.isInterceptingBundleTransfers,
|
145
|
+
initialOwner);
|
171
146
|
|
172
147
|
PoolStorage storage $ = _getPoolStorage();
|
148
|
+
|
149
|
+
$._poolInfo = poolInfo;
|
173
150
|
$._poolService = IPoolService(_getServiceAddress(POOL()));
|
174
151
|
$._bundleService = IBundleService(_getServiceAddress(BUNDLE()));
|
175
152
|
$._componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
@@ -177,79 +154,71 @@ abstract contract Pool is
|
|
177
154
|
_registerInterface(type(IPoolComponent).interfaceId);
|
178
155
|
}
|
179
156
|
|
180
|
-
/// @dev increases the staked tokens by the specified amount
|
181
|
-
/// bundle MUST be in active or locked state
|
182
|
-
function _stake(
|
183
|
-
NftId bundleNftId,
|
184
|
-
Amount amount
|
185
|
-
)
|
186
|
-
internal
|
187
|
-
virtual
|
188
|
-
returns(Amount)
|
189
|
-
{
|
190
|
-
return _getPoolStorage()._poolService.stake(bundleNftId, amount);
|
191
|
-
}
|
192
|
-
|
193
157
|
|
194
|
-
/// @dev
|
195
|
-
///
|
196
|
-
|
197
|
-
|
198
|
-
|
158
|
+
/// @dev Update pool fees to the specified values.
|
159
|
+
/// Pool fee: are deducted from the premium amount and goes to the pool owner.
|
160
|
+
/// Staking fee: are deducted from the staked tokens by a bundle owner and goes to the pool owner.
|
161
|
+
/// Performance fee: when a bundle is closed a bundle specific profit is calculated.
|
162
|
+
/// The performance fee is deducted from this profit and goes to the pool owner.
|
163
|
+
function _setPoolFees(
|
164
|
+
Fee memory poolFee,
|
165
|
+
Fee memory stakingFee,
|
166
|
+
Fee memory performanceFee
|
199
167
|
)
|
200
168
|
internal
|
201
169
|
virtual
|
202
|
-
returns(Amount netAmount)
|
203
170
|
{
|
204
|
-
|
171
|
+
_getPoolStorage()._componentService.setPoolFees(poolFee, stakingFee, performanceFee);
|
205
172
|
}
|
206
173
|
|
207
174
|
|
208
|
-
/// @dev
|
209
|
-
///
|
210
|
-
function
|
211
|
-
NftId bundleNftId,
|
212
|
-
Seconds lifetimeExtension
|
213
|
-
)
|
175
|
+
/// @dev Sets the maximum balance amound held by this pool.
|
176
|
+
/// Function may only be called by pool owner.
|
177
|
+
function _setMaxBalanceAmount(Amount maxBalanceAmount)
|
214
178
|
internal
|
215
179
|
virtual
|
216
|
-
returns (Timestamp extendedExpiredAt)
|
217
180
|
{
|
218
|
-
|
181
|
+
_getPoolStorage()._poolService.setMaxBalanceAmount(maxBalanceAmount);
|
219
182
|
}
|
220
183
|
|
221
184
|
|
222
|
-
/// @dev
|
223
|
-
///
|
224
|
-
|
225
|
-
function _lockBundle(NftId bundleNftId)
|
185
|
+
/// @dev Fund the pool wallet with the specified amount.
|
186
|
+
/// Function is only available for externally managed pools.
|
187
|
+
function _fundPoolWallet(Amount amount)
|
226
188
|
internal
|
227
189
|
virtual
|
228
190
|
{
|
229
|
-
_getPoolStorage().
|
191
|
+
_getPoolStorage()._poolService.fundPoolWallet(amount);
|
230
192
|
}
|
231
193
|
|
232
194
|
|
233
|
-
/// @dev
|
234
|
-
///
|
235
|
-
function
|
195
|
+
/// @dev Withdraw the specified amount from the pool wallet.
|
196
|
+
/// Function is only available for externally managed pools.
|
197
|
+
function _defundPoolWallet(Amount amount)
|
236
198
|
internal
|
237
199
|
virtual
|
238
200
|
{
|
239
|
-
_getPoolStorage().
|
201
|
+
_getPoolStorage()._poolService.defundPoolWallet(amount);
|
240
202
|
}
|
241
203
|
|
242
204
|
|
243
|
-
/// @dev
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
205
|
+
/// @dev Creates a new empty bundle using the provided parameter values.
|
206
|
+
function _createBundle(
|
207
|
+
address bundleOwner,
|
208
|
+
Fee memory fee,
|
209
|
+
Seconds lifetime,
|
210
|
+
bytes memory filter
|
211
|
+
)
|
249
212
|
internal
|
250
|
-
|
213
|
+
returns(NftId bundleNftId)
|
251
214
|
{
|
252
|
-
_getPoolStorage().
|
215
|
+
bundleNftId = _getPoolStorage()._bundleService.create(
|
216
|
+
bundleOwner,
|
217
|
+
fee,
|
218
|
+
lifetime,
|
219
|
+
filter);
|
220
|
+
|
221
|
+
// TODO add logging
|
253
222
|
}
|
254
223
|
|
255
224
|
|
@@ -267,73 +236,81 @@ abstract contract Pool is
|
|
267
236
|
}
|
268
237
|
|
269
238
|
|
270
|
-
/// @dev
|
271
|
-
///
|
272
|
-
function
|
239
|
+
/// @dev increases the staked tokens by the specified amount
|
240
|
+
/// bundle MUST be in active or locked state
|
241
|
+
function _stake(
|
242
|
+
NftId bundleNftId,
|
243
|
+
Amount amount
|
244
|
+
)
|
273
245
|
internal
|
274
246
|
virtual
|
247
|
+
returns(Amount)
|
275
248
|
{
|
276
|
-
_getPoolStorage()._poolService.
|
249
|
+
return _getPoolStorage()._poolService.stake(bundleNftId, amount);
|
277
250
|
}
|
278
251
|
|
279
|
-
|
280
|
-
///
|
281
|
-
///
|
282
|
-
function
|
252
|
+
|
253
|
+
/// @dev decreases the staked tokens by the specified amount
|
254
|
+
/// bundle MUST be in active, locked or closed state
|
255
|
+
function _unstake(
|
256
|
+
NftId bundleNftId,
|
257
|
+
Amount amount
|
258
|
+
)
|
283
259
|
internal
|
284
260
|
virtual
|
261
|
+
returns(Amount netAmount)
|
285
262
|
{
|
286
|
-
_getPoolStorage()._poolService.
|
263
|
+
return _getPoolStorage()._poolService.unstake(bundleNftId, amount);
|
287
264
|
}
|
288
265
|
|
289
266
|
|
290
|
-
/// @dev
|
291
|
-
///
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
function _setPoolFees(
|
296
|
-
Fee memory poolFee,
|
297
|
-
Fee memory stakingFee,
|
298
|
-
Fee memory performanceFee
|
267
|
+
/// @dev extends the bundle lifetime of the bundle by the specified time
|
268
|
+
/// bundle MUST be in active or locked state
|
269
|
+
function _extend(
|
270
|
+
NftId bundleNftId,
|
271
|
+
Seconds lifetimeExtension
|
299
272
|
)
|
300
273
|
internal
|
301
274
|
virtual
|
275
|
+
returns (Timestamp extendedExpiredAt)
|
302
276
|
{
|
303
|
-
_getPoolStorage().
|
277
|
+
return _getPoolStorage()._bundleService.extend(bundleNftId, lifetimeExtension);
|
304
278
|
}
|
305
279
|
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
bytes memory filter
|
312
|
-
)
|
280
|
+
|
281
|
+
/// @dev Locks the specified bundle.
|
282
|
+
/// A bundle to be locked MUST be in active state.
|
283
|
+
/// Locked bundles may not be used to collateralize any new policy.
|
284
|
+
function _setBundleLocked(NftId bundleNftId, bool locked)
|
313
285
|
internal
|
314
|
-
|
286
|
+
virtual
|
315
287
|
{
|
316
|
-
|
317
|
-
bundleOwner,
|
318
|
-
fee,
|
319
|
-
lifetime,
|
320
|
-
filter);
|
321
|
-
|
322
|
-
// TODO add logging
|
288
|
+
_getPoolStorage()._bundleService.setLocked(bundleNftId, locked);
|
323
289
|
}
|
324
290
|
|
325
|
-
|
326
|
-
|
327
|
-
|
291
|
+
|
292
|
+
/// @dev Close the specified bundle.
|
293
|
+
/// A bundle to be closed MUST be in active or locked state.
|
294
|
+
/// To close a bundle all all linked policies MUST be in closed state as well.
|
295
|
+
/// Closing a bundle finalizes the bundle bookkeeping including overall profit calculation.
|
296
|
+
/// Once a bundle is closed this action cannot be reversed.
|
297
|
+
function _closeBundle(NftId bundleNftId)
|
298
|
+
internal
|
299
|
+
virtual
|
300
|
+
{
|
301
|
+
_getPoolStorage()._poolService.closeBundle(bundleNftId);
|
328
302
|
}
|
329
303
|
|
304
|
+
|
305
|
+
/// @dev Withdraws the specified amount of fees from the bundle.
|
330
306
|
function _withdrawBundleFees(NftId bundleNftId, Amount amount)
|
331
307
|
internal
|
332
308
|
returns (Amount withdrawnAmount)
|
333
309
|
{
|
334
|
-
return _getPoolStorage().
|
310
|
+
return _getPoolStorage()._poolService.withdrawBundleFees(bundleNftId, amount);
|
335
311
|
}
|
336
312
|
|
313
|
+
|
337
314
|
function _processFundedClaim(
|
338
315
|
NftId policyNftId,
|
339
316
|
ClaimId claimId,
|
@@ -345,6 +322,7 @@ abstract contract Pool is
|
|
345
322
|
policyNftId, claimId, availableAmount);
|
346
323
|
}
|
347
324
|
|
325
|
+
|
348
326
|
function _getPoolStorage() private pure returns (PoolStorage storage $) {
|
349
327
|
assembly {
|
350
328
|
$.slot := POOL_STORAGE_LOCATION_V1
|