@etherisc/gif-next 0.0.2-e79d227-681 → 0.0.2-e7a5428-226
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +57 -1
- 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 +640 -269
- 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 +409 -33
- 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 +525 -213
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +179 -19
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +246 -16
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +420 -27
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +105 -185
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +381 -46
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +58 -127
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +533 -218
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +150 -82
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +37 -106
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +379 -79
- 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 +183 -128
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +355 -52
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +324 -250
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +380 -45
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +191 -182
- 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 +94 -100
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +196 -155
- 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 +600 -296
- 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/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +88 -45
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +482 -50
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +373 -13
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +493 -85
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1017 -334
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +380 -52
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +914 -554
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +377 -80
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +83 -57
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +690 -566
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +141 -85
- 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 +2 -2
- 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 +77 -81
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +379 -47
- 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 +41 -45
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +56 -3
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +61 -65
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +120 -68
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +99 -55
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +102 -114
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +355 -52
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +304 -226
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +120 -76
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +200 -89
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +59 -63
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +333 -169
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +72 -76
- 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 +574 -360
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +146 -74
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +293 -63
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +106 -46
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +193 -182
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +380 -45
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +292 -195
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +127 -99
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +235 -4
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +181 -19
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +160 -68
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +77 -3
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +168 -157
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +258 -22
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +278 -187
- 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 +129 -85
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +135 -126
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +103 -75
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +187 -176
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +326 -91
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +103 -47
- 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 +54 -19
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +56 -3
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +4 -0
- package/artifacts/contracts/{authorization/AccessAdmin.sol/IAccessManagedChecker.json → registry/IRelease.sol/IRelease.json} +6 -6
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +92 -57
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +727 -479
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +1061 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +75 -39
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +79 -43
- 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 +2 -2
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +386 -64
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +437 -26
- 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 +60 -50
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +247 -531
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +111 -95
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +178 -34
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +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 +41 -31
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +155 -382
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +41 -45
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +6 -6
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +19 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +139 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +56 -3
- 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 +60 -64
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +6 -6
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +21 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +137 -62
- 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 +51 -11
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +63 -162
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +118 -29
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +32 -32
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1026 -101
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +214 -110
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +1218 -214
- 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/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +139 -61
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +174 -217
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +253 -174
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +87 -55
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +957 -603
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +101 -51
- 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 +1 -1
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +33 -31
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +30 -6
- 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 +45 -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/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.json +50 -2
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +3 -3
- 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 +65 -27
- 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 +422 -258
- package/contracts/authorization/AccessAdminLib.sol +396 -0
- package/contracts/authorization/AccessManagerCloneable.sol +146 -4
- package/contracts/authorization/Authorization.sol +142 -262
- package/contracts/authorization/IAccess.sol +25 -7
- package/contracts/authorization/IAccessAdmin.sol +87 -80
- package/contracts/authorization/IAuthorization.sol +9 -43
- package/contracts/authorization/IServiceAuthorization.sol +55 -17
- package/contracts/authorization/ServiceAuthorization.sol +248 -34
- package/contracts/distribution/BasicDistribution.sol +16 -14
- package/contracts/distribution/BasicDistributionAuthorization.sol +29 -9
- package/contracts/distribution/Distribution.sol +38 -75
- package/contracts/distribution/DistributionService.sol +181 -87
- package/contracts/distribution/DistributionServiceManager.sol +1 -1
- package/contracts/distribution/IDistributionComponent.sol +3 -10
- package/contracts/distribution/IDistributionService.sol +34 -19
- package/contracts/examples/fire/FirePool.sol +6 -6
- package/contracts/examples/fire/FirePoolAuthorization.sol +2 -1
- package/contracts/examples/fire/FireProduct.sol +15 -13
- package/contracts/examples/fire/FireProductAuthorization.sol +2 -1
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +34 -11
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -8
- package/contracts/examples/unpermissioned/SimplePool.sol +7 -13
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +119 -27
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BundleSet.sol +4 -4
- package/contracts/instance/IInstance.sol +92 -19
- package/contracts/instance/IInstanceService.sol +52 -9
- package/contracts/instance/Instance.sol +163 -57
- package/contracts/instance/InstanceAdmin.sol +271 -166
- package/contracts/instance/InstanceAuthorizationV3.sol +89 -40
- package/contracts/instance/InstanceReader.sol +422 -369
- package/contracts/instance/InstanceService.sol +252 -176
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/InstanceStore.sol +13 -2
- package/contracts/instance/RiskSet.sol +21 -14
- 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 +7 -8
- package/contracts/instance/base/ObjectSetHelperLib.sol +30 -0
- package/contracts/instance/module/IBundle.sol +6 -5
- package/contracts/instance/module/IComponents.sol +19 -7
- package/contracts/instance/module/IDistribution.sol +21 -8
- package/contracts/instance/module/IPolicy.sol +28 -8
- package/contracts/instance/module/IRisk.sol +4 -0
- package/contracts/oracle/BasicOracle.sol +2 -4
- package/contracts/oracle/BasicOracleAuthorization.sol +15 -8
- package/contracts/oracle/IOracle.sol +9 -4
- package/contracts/oracle/Oracle.sol +3 -5
- package/contracts/oracle/OracleService.sol +24 -23
- package/contracts/oracle/OracleServiceManager.sol +1 -1
- package/contracts/pool/BasicPool.sol +3 -16
- package/contracts/pool/BasicPoolAuthorization.sol +29 -16
- package/contracts/pool/BundleService.sol +67 -104
- package/contracts/pool/BundleServiceManager.sol +1 -1
- package/contracts/pool/IBundleService.sol +27 -33
- package/contracts/pool/IPoolService.sol +57 -40
- package/contracts/pool/Pool.sol +13 -25
- package/contracts/pool/PoolLib.sol +341 -0
- package/contracts/pool/PoolService.sol +203 -201
- package/contracts/pool/PoolServiceManager.sol +1 -1
- package/contracts/product/ApplicationService.sol +86 -18
- package/contracts/product/ApplicationServiceManager.sol +1 -1
- package/contracts/product/BasicProduct.sol +3 -3
- package/contracts/product/BasicProductAuthorization.sol +32 -11
- package/contracts/product/ClaimService.sol +187 -171
- package/contracts/product/ClaimServiceManager.sol +1 -1
- package/contracts/product/IApplicationService.sol +24 -2
- package/contracts/product/IClaimService.sol +18 -5
- package/contracts/product/IPolicyService.sol +20 -8
- package/contracts/product/IPricingService.sol +1 -0
- package/contracts/product/IProductComponent.sol +4 -1
- package/contracts/product/IRiskService.sol +25 -10
- package/contracts/product/PolicyService.sol +110 -198
- package/contracts/product/PolicyServiceLib.sol +139 -0
- package/contracts/product/PolicyServiceManager.sol +1 -1
- package/contracts/product/PricingService.sol +52 -46
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +93 -27
- package/contracts/product/RiskService.sol +119 -36
- package/contracts/product/RiskServiceManager.sol +1 -1
- package/contracts/registry/ChainNft.sol +4 -2
- package/contracts/registry/IRegistry.sol +23 -24
- package/contracts/registry/IRelease.sol +29 -0
- package/contracts/registry/Registry.sol +22 -11
- package/contracts/registry/RegistryAdmin.sol +100 -363
- package/contracts/registry/RegistryAuthorization.sol +309 -0
- package/contracts/registry/RegistryService.sol +4 -4
- package/contracts/registry/RegistryServiceManager.sol +1 -1
- package/contracts/registry/ReleaseAdmin.sol +195 -0
- package/contracts/registry/ReleaseLifecycle.sol +2 -0
- package/contracts/registry/ReleaseRegistry.sol +157 -117
- package/contracts/registry/ServiceAuthorizationV3.sol +194 -27
- package/contracts/registry/TokenRegistry.sol +61 -59
- package/contracts/shared/Component.sol +34 -37
- package/contracts/shared/ComponentService.sol +314 -433
- package/contracts/shared/ComponentServiceManager.sol +1 -1
- package/contracts/shared/ContractLib.sol +164 -76
- package/contracts/shared/IComponent.sol +1 -10
- package/contracts/shared/IComponentService.sol +22 -41
- package/contracts/shared/IInstanceLinkedComponent.sol +0 -11
- package/contracts/shared/IKeyValueStore.sol +1 -1
- package/contracts/shared/INftOwnable.sol +2 -0
- package/contracts/shared/IRegisterable.sol +15 -5
- package/contracts/shared/IService.sol +3 -5
- package/contracts/shared/InitializableERC165.sol +9 -1
- package/contracts/shared/InstanceLinkedComponent.sol +7 -18
- package/contracts/shared/KeyValueStore.sol +3 -3
- package/contracts/shared/NftOwnable.sol +8 -6
- package/contracts/shared/PolicyHolder.sol +4 -3
- package/contracts/shared/Registerable.sol +42 -19
- package/contracts/shared/RegistryLinked.sol +1 -1
- package/contracts/shared/Service.sol +13 -30
- package/contracts/shared/TokenHandler.sol +45 -92
- package/contracts/staking/IStaking.sol +155 -64
- package/contracts/staking/IStakingService.sol +45 -75
- package/contracts/staking/Staking.sol +444 -203
- package/contracts/staking/{StakeManagerLib.sol → StakingLib.sol} +55 -84
- package/contracts/staking/StakingManager.sol +1 -2
- package/contracts/staking/StakingReader.sol +41 -80
- package/contracts/staking/StakingService.sol +62 -181
- package/contracts/staking/StakingServiceManager.sol +6 -4
- package/contracts/staking/StakingStore.sol +697 -329
- package/contracts/staking/TargetManagerLib.sol +1 -1
- 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/NftId.sol +3 -3
- package/contracts/type/ObjectType.sol +67 -38
- package/contracts/type/RiskId.sol +9 -3
- package/contracts/type/RoleId.sol +63 -45
- package/contracts/type/Seconds.sol +14 -0
- package/contracts/type/Selector.sol +5 -0
- package/contracts/type/String.sol +12 -0
- package/contracts/type/Timestamp.sol +4 -7
- 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 +26 -12
- package/contracts/upgradeability/UpgradableProxyWithAdmin.sol +12 -2
- package/contracts/upgradeability/Versionable.sol +6 -3
- package/package.json +2 -2
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +0 -4
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +0 -4
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +0 -1196
- 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 -474
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -440
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +0 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +0 -16
- package/contracts/authorization/ReleaseAccessManager.sol +0 -38
- package/contracts/instance/module/IAccess.sol +0 -46
- package/contracts/shared/ComponentVerifyingService.sol +0 -128
@@ -1,7 +1,7 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {
|
4
|
+
import {IAccountingService} from "../accounting/IAccountingService.sol";
|
5
5
|
import {IBundleService} from "./IBundleService.sol";
|
6
6
|
import {IComponents} from "../instance/module/IComponents.sol";
|
7
7
|
import {IComponentService} from "../shared/IComponentService.sol";
|
@@ -16,22 +16,22 @@ import {IStaking} from "../staking/IStaking.sol";
|
|
16
16
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
17
17
|
import {ClaimId} from "../type/ClaimId.sol";
|
18
18
|
import {ContractLib} from "../shared/ContractLib.sol";
|
19
|
-
import {Fee, FeeLib} from "../type/Fee.sol";
|
20
|
-
import {NftId} from "../type/NftId.sol";
|
21
|
-
import {ObjectType, POOL, BUNDLE, PRODUCT, POLICY, COMPONENT} from "../type/ObjectType.sol";
|
22
|
-
import {Fee, FeeLib} from "../type/Fee.sol";
|
23
|
-
import {KEEP_STATE} from "../type/StateId.sol";
|
24
|
-
import {UFixed} from "../type/UFixed.sol";
|
25
|
-
import {Service} from "../shared/Service.sol";
|
26
19
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
27
20
|
import {InstanceStore} from "../instance/InstanceStore.sol";
|
21
|
+
import {KEEP_STATE} from "../type/StateId.sol";
|
22
|
+
import {NftId} from "../type/NftId.sol";
|
23
|
+
import {ObjectType, ACCOUNTING, POOL, BUNDLE, PRODUCT, POLICY, COMPONENT} from "../type/ObjectType.sol";
|
24
|
+
import {PayoutId} from "../type/PayoutId.sol";
|
25
|
+
import {PoolLib} from "./PoolLib.sol";
|
26
|
+
import {Service} from "../shared/Service.sol";
|
27
|
+
import {TokenHandler} from "../shared/TokenHandler.sol";
|
28
28
|
|
29
|
-
string constant POOL_SERVICE_NAME = "PoolService";
|
30
29
|
|
31
30
|
contract PoolService is
|
32
31
|
Service,
|
33
32
|
IPoolService
|
34
33
|
{
|
34
|
+
IAccountingService private _accountingService;
|
35
35
|
IBundleService internal _bundleService;
|
36
36
|
IComponentService internal _componentService;
|
37
37
|
IStaking private _staking;
|
@@ -45,12 +45,13 @@ contract PoolService is
|
|
45
45
|
initializer()
|
46
46
|
{
|
47
47
|
(
|
48
|
-
address
|
49
|
-
address
|
48
|
+
address authority,
|
49
|
+
address registry
|
50
50
|
) = abi.decode(data, (address, address));
|
51
51
|
|
52
|
-
|
52
|
+
__Service_init(authority, registry, owner);
|
53
53
|
|
54
|
+
_accountingService = IAccountingService(_getServiceAddress(ACCOUNTING()));
|
54
55
|
_bundleService = IBundleService(_getServiceAddress(BUNDLE()));
|
55
56
|
_componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
56
57
|
_staking = IStaking(getRegistry().getStakingAddress());
|
@@ -63,6 +64,7 @@ contract PoolService is
|
|
63
64
|
function setMaxBalanceAmount(Amount maxBalanceAmount)
|
64
65
|
external
|
65
66
|
virtual
|
67
|
+
restricted()
|
66
68
|
{
|
67
69
|
(NftId poolNftId, IInstance instance) = _getAndVerifyActivePool();
|
68
70
|
InstanceReader instanceReader = instance.getInstanceReader();
|
@@ -78,6 +80,7 @@ contract PoolService is
|
|
78
80
|
|
79
81
|
function closeBundle(NftId bundleNftId)
|
80
82
|
external
|
83
|
+
restricted()
|
81
84
|
virtual
|
82
85
|
{
|
83
86
|
_checkNftType(bundleNftId, BUNDLE());
|
@@ -89,7 +92,7 @@ contract PoolService is
|
|
89
92
|
// releasing collateral in bundle
|
90
93
|
(Amount unstakedAmount, Amount feeAmount) = _bundleService.close(instance, bundleNftId);
|
91
94
|
|
92
|
-
|
95
|
+
_accountingService.decreasePoolBalance(
|
93
96
|
instance.getInstanceStore(),
|
94
97
|
poolNftId,
|
95
98
|
unstakedAmount + feeAmount,
|
@@ -99,8 +102,7 @@ contract PoolService is
|
|
99
102
|
|
100
103
|
if ((unstakedAmount + feeAmount).gtz()){
|
101
104
|
IComponents.ComponentInfo memory poolComponentInfo = instance.getInstanceReader().getComponentInfo(poolNftId);
|
102
|
-
poolComponentInfo.tokenHandler.
|
103
|
-
poolComponentInfo.tokenHandler.getWallet(),
|
105
|
+
poolComponentInfo.tokenHandler.pushToken(
|
104
106
|
getRegistry().ownerOf(bundleNftId),
|
105
107
|
unstakedAmount + feeAmount);
|
106
108
|
}
|
@@ -114,13 +116,14 @@ contract PoolService is
|
|
114
116
|
Amount availableAmount
|
115
117
|
)
|
116
118
|
external
|
119
|
+
restricted()
|
117
120
|
virtual
|
118
121
|
{
|
119
122
|
_checkNftType(policyNftId, POLICY());
|
120
123
|
|
121
124
|
(NftId poolNftId, IInstance instance) = _getAndVerifyActivePool();
|
122
125
|
InstanceReader instanceReader = instance.getInstanceReader();
|
123
|
-
NftId productNftId = getRegistry().
|
126
|
+
NftId productNftId = getRegistry().getParentNftId(poolNftId);
|
124
127
|
|
125
128
|
// check policy matches with calling pool
|
126
129
|
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
@@ -141,23 +144,47 @@ contract PoolService is
|
|
141
144
|
}
|
142
145
|
|
143
146
|
|
147
|
+
// function _checkAndGetPoolInfo(NftId bundleNftId)
|
148
|
+
// internal
|
149
|
+
// view
|
150
|
+
// returns (
|
151
|
+
// InstanceReader instanceReader,
|
152
|
+
// InstanceStore instanceStore,
|
153
|
+
// NftId instanceNftId,
|
154
|
+
// NftId poolNftId,
|
155
|
+
// IComponents.PoolInfo memory poolInfo
|
156
|
+
// )
|
157
|
+
// {
|
158
|
+
// _checkNftType(bundleNftId, BUNDLE());
|
159
|
+
|
160
|
+
// (NftId poolNftId, IInstance instance) = _getAndVerifyActivePool();
|
161
|
+
// instanceReader = instance.getInstanceReader();
|
162
|
+
// instanceStore = instance.getInstanceStore();
|
163
|
+
// instanceNftId = instance.getNftId();
|
164
|
+
// poolInfo = instanceReader.getPoolInfo(poolNftId);
|
165
|
+
|
166
|
+
// if (getRegistry().getParentNftId(bundleNftId) != poolNftId) {
|
167
|
+
// revert ErrorPoolServiceBundlePoolMismatch(bundleNftId, poolNftId);
|
168
|
+
// }
|
169
|
+
// }
|
170
|
+
|
171
|
+
|
144
172
|
/// @inheritdoc IPoolService
|
145
173
|
function stake(NftId bundleNftId, Amount amount)
|
146
174
|
external
|
147
175
|
virtual
|
148
|
-
|
149
|
-
returns(
|
176
|
+
restricted()
|
177
|
+
returns(
|
178
|
+
Amount netAmount
|
179
|
+
)
|
150
180
|
{
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
if (bundleInfo.poolNftId != poolNftId) {
|
159
|
-
revert ErrorPoolServiceBundlePoolMismatch(bundleNftId, poolNftId);
|
160
|
-
}
|
181
|
+
(
|
182
|
+
InstanceReader instanceReader,
|
183
|
+
InstanceStore instanceStore,
|
184
|
+
NftId instanceNftId,
|
185
|
+
NftId poolNftId,
|
186
|
+
IComponents.PoolInfo memory poolInfo
|
187
|
+
) = PoolLib.checkAndGetPoolInfo(getRegistry(), msg.sender, bundleNftId);
|
161
188
|
|
162
189
|
{
|
163
190
|
Amount currentPoolBalance = instanceReader.getBalanceAmount(poolNftId);
|
@@ -167,37 +194,33 @@ contract PoolService is
|
|
167
194
|
}
|
168
195
|
|
169
196
|
// calculate fees
|
170
|
-
IRegistry registry = getRegistry();
|
171
197
|
Amount feeAmount;
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
(
|
177
|
-
|
178
|
-
|
179
|
-
)
|
180
|
-
stakingFee,
|
181
|
-
amount);
|
182
|
-
}
|
198
|
+
(
|
199
|
+
feeAmount,
|
200
|
+
netAmount
|
201
|
+
) = PoolLib.calculateStakingAmounts(
|
202
|
+
getRegistry(),
|
203
|
+
instanceReader,
|
204
|
+
poolNftId,
|
205
|
+
amount);
|
183
206
|
|
184
207
|
// do all the book keeping
|
185
|
-
|
186
|
-
|
208
|
+
_accountingService.increasePoolBalance(
|
209
|
+
instanceStore,
|
187
210
|
poolNftId,
|
188
211
|
netAmount,
|
189
212
|
feeAmount);
|
190
213
|
|
191
|
-
_bundleService.stake(
|
214
|
+
_bundleService.stake(instanceReader, instanceStore, bundleNftId, netAmount);
|
192
215
|
|
193
|
-
emit LogPoolServiceBundleStaked(
|
216
|
+
emit LogPoolServiceBundleStaked(instanceNftId, poolNftId, bundleNftId, amount, netAmount);
|
194
217
|
|
195
218
|
// only collect staking amount when pool is not externally managed
|
196
219
|
if (!poolInfo.isExternallyManaged) {
|
197
220
|
|
198
221
|
// collect tokens from bundle owner
|
199
222
|
address bundleOwner = getRegistry().ownerOf(bundleNftId);
|
200
|
-
|
223
|
+
PoolLib.pullStakingAmount(
|
201
224
|
instanceReader,
|
202
225
|
poolNftId,
|
203
226
|
bundleOwner,
|
@@ -210,22 +233,18 @@ contract PoolService is
|
|
210
233
|
function unstake(NftId bundleNftId, Amount amount)
|
211
234
|
external
|
212
235
|
virtual
|
213
|
-
|
236
|
+
restricted()
|
214
237
|
returns(Amount netAmount)
|
215
238
|
{
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
if (bundleInfo.poolNftId != poolNftId) {
|
224
|
-
revert ErrorPoolServiceBundlePoolMismatch(bundleNftId, poolNftId);
|
225
|
-
}
|
239
|
+
(
|
240
|
+
InstanceReader instanceReader,
|
241
|
+
InstanceStore instanceStore,
|
242
|
+
NftId instanceNftId,
|
243
|
+
NftId poolNftId,
|
244
|
+
) = PoolLib.checkAndGetPoolInfo(getRegistry(), msg.sender, bundleNftId);
|
226
245
|
|
227
246
|
// call bundle service for bookkeeping and additional checks
|
228
|
-
Amount unstakedAmount = _bundleService.unstake(
|
247
|
+
Amount unstakedAmount = _bundleService.unstake(instanceStore, bundleNftId, amount);
|
229
248
|
|
230
249
|
// Important: from now on work only with unstakedAmount as it is the only reliable amount.
|
231
250
|
// if amount was max, this was set to the available amount
|
@@ -234,21 +253,21 @@ contract PoolService is
|
|
234
253
|
netAmount = unstakedAmount;
|
235
254
|
|
236
255
|
// update pool bookkeeping - performance fees stay in the pool, but as fees
|
237
|
-
|
256
|
+
_accountingService.decreasePoolBalance(
|
238
257
|
instanceStore,
|
239
258
|
poolNftId,
|
240
259
|
unstakedAmount,
|
241
260
|
AmountLib.zero());
|
242
261
|
|
243
262
|
|
244
|
-
emit LogPoolServiceBundleUnstaked(
|
263
|
+
emit LogPoolServiceBundleUnstaked(instanceNftId, poolNftId, bundleNftId, unstakedAmount, netAmount);
|
245
264
|
|
246
265
|
// only distribute staking amount when pool is not externally managed
|
247
266
|
if (!instanceReader.getPoolInfo(poolNftId).isExternallyManaged) {
|
248
267
|
|
249
268
|
// transfer amount to bundle owner
|
250
269
|
address bundleOwner = getRegistry().ownerOf(bundleNftId);
|
251
|
-
|
270
|
+
PoolLib.pushUnstakingAmount(
|
252
271
|
instanceReader,
|
253
272
|
poolNftId,
|
254
273
|
bundleOwner,
|
@@ -260,7 +279,7 @@ contract PoolService is
|
|
260
279
|
function fundPoolWallet(Amount amount)
|
261
280
|
external
|
262
281
|
virtual
|
263
|
-
|
282
|
+
restricted()
|
264
283
|
{
|
265
284
|
(
|
266
285
|
NftId poolNftId,
|
@@ -276,7 +295,7 @@ contract PoolService is
|
|
276
295
|
address poolOwner = getRegistry().ownerOf(poolNftId);
|
277
296
|
emit LogPoolServiceWalletFunded(poolNftId, poolOwner, amount);
|
278
297
|
|
279
|
-
|
298
|
+
PoolLib.pullStakingAmount(
|
280
299
|
reader,
|
281
300
|
poolNftId,
|
282
301
|
poolOwner,
|
@@ -287,7 +306,7 @@ contract PoolService is
|
|
287
306
|
function defundPoolWallet(Amount amount)
|
288
307
|
external
|
289
308
|
virtual
|
290
|
-
|
309
|
+
restricted()
|
291
310
|
{
|
292
311
|
(
|
293
312
|
NftId poolNftId,
|
@@ -303,7 +322,7 @@ contract PoolService is
|
|
303
322
|
address poolOwner = getRegistry().ownerOf(poolNftId);
|
304
323
|
emit LogPoolServiceWalletDefunded(poolNftId, poolOwner, amount);
|
305
324
|
|
306
|
-
|
325
|
+
PoolLib.pushUnstakingAmount(
|
307
326
|
reader,
|
308
327
|
poolNftId,
|
309
328
|
poolOwner,
|
@@ -322,7 +341,7 @@ contract PoolService is
|
|
322
341
|
_checkNftType(bundleNftId, BUNDLE());
|
323
342
|
|
324
343
|
IRegistry registry = getRegistry();
|
325
|
-
NftId poolNftId = registry.
|
344
|
+
NftId poolNftId = registry.getParentNftId(bundleNftId);
|
326
345
|
(, address instanceAddress) = ContractLib.getInfoAndInstance(registry, poolNftId, true);
|
327
346
|
IInstance instance = IInstance(instanceAddress);
|
328
347
|
|
@@ -331,17 +350,19 @@ contract PoolService is
|
|
331
350
|
Amount bundleNetAmount = premium.netPremiumAmount;
|
332
351
|
|
333
352
|
InstanceStore instanceStore = instance.getInstanceStore();
|
334
|
-
|
353
|
+
_accountingService.increasePoolBalance(
|
335
354
|
instanceStore,
|
336
355
|
poolNftId,
|
337
356
|
bundleNetAmount + bundleFeeAmount,
|
338
357
|
poolFeeAmount);
|
339
358
|
|
340
|
-
|
359
|
+
_accountingService.increaseBundleBalanceForPool(
|
341
360
|
instanceStore,
|
342
361
|
bundleNftId,
|
343
362
|
bundleNetAmount,
|
344
363
|
bundleFeeAmount);
|
364
|
+
|
365
|
+
emit LogPoolServiceSaleProcessed(poolNftId, bundleNftId, bundleNetAmount, bundleFeeAmount, poolFeeAmount);
|
345
366
|
}
|
346
367
|
|
347
368
|
|
@@ -372,7 +393,7 @@ contract PoolService is
|
|
372
393
|
totalCollateralAmount,
|
373
394
|
localCollateralAmount,
|
374
395
|
poolIsVerifyingApplications
|
375
|
-
) = calculateRequiredCollateral(
|
396
|
+
) = PoolLib.calculateRequiredCollateral(
|
376
397
|
instance.getInstanceReader(),
|
377
398
|
productNftId,
|
378
399
|
sumInsuredAmount);
|
@@ -400,52 +421,142 @@ contract PoolService is
|
|
400
421
|
bundleNftId,
|
401
422
|
totalCollateralAmount);
|
402
423
|
|
403
|
-
|
424
|
+
emit LogPoolServiceApplicationVerified(poolNftId, bundleNftId, applicationNftId, totalCollateralAmount);
|
404
425
|
}
|
405
426
|
|
406
|
-
|
427
|
+
emit LogPoolServiceCollateralLocked(
|
428
|
+
poolNftId,
|
429
|
+
bundleNftId,
|
430
|
+
applicationNftId,
|
431
|
+
totalCollateralAmount,
|
432
|
+
localCollateralAmount);
|
407
433
|
}
|
408
434
|
|
409
435
|
function processPayout(
|
410
|
-
|
411
|
-
|
436
|
+
InstanceReader instanceReader,
|
437
|
+
InstanceStore instanceStore,
|
438
|
+
NftId productNftId,
|
412
439
|
NftId policyNftId,
|
413
|
-
|
414
|
-
|
440
|
+
NftId bundleNftId,
|
441
|
+
PayoutId payoutId,
|
442
|
+
Amount payoutAmount,
|
443
|
+
address payoutBeneficiary
|
415
444
|
)
|
416
445
|
external
|
417
446
|
virtual
|
418
447
|
restricted()
|
448
|
+
returns (
|
449
|
+
Amount netPayoutAmount,
|
450
|
+
Amount processingFeeAmount
|
451
|
+
)
|
419
452
|
{
|
453
|
+
// checks
|
420
454
|
_checkNftType(policyNftId, POLICY());
|
421
455
|
|
422
|
-
|
423
|
-
NftId poolNftId = getRegistry().
|
424
|
-
InstanceStore instanceStore = instance.getInstanceStore();
|
456
|
+
// effects
|
457
|
+
NftId poolNftId = getRegistry().getParentNftId(bundleNftId);
|
425
458
|
|
426
|
-
|
459
|
+
_accountingService.decreasePoolBalance(
|
427
460
|
instanceStore,
|
428
461
|
poolNftId,
|
429
462
|
payoutAmount,
|
430
463
|
AmountLib.zero());
|
431
464
|
|
432
|
-
|
465
|
+
_accountingService.decreaseBundleBalanceForPool(
|
433
466
|
instanceStore,
|
434
467
|
bundleNftId,
|
435
468
|
payoutAmount,
|
436
469
|
AmountLib.zero());
|
437
470
|
|
438
471
|
_bundleService.releaseCollateral(
|
439
|
-
|
472
|
+
instanceStore,
|
440
473
|
policyNftId,
|
441
|
-
|
474
|
+
bundleNftId,
|
442
475
|
payoutAmount);
|
443
476
|
|
444
477
|
// update value locked with staking service
|
478
|
+
TokenHandler poolTokenHandler = instanceReader.getTokenHandler(poolNftId);
|
479
|
+
|
445
480
|
_staking.decreaseTotalValueLocked(
|
446
|
-
|
447
|
-
|
481
|
+
instanceReader.getInstanceNftId(),
|
482
|
+
address(poolTokenHandler.TOKEN()),
|
448
483
|
payoutAmount);
|
484
|
+
|
485
|
+
// interactions
|
486
|
+
(netPayoutAmount, processingFeeAmount) = PoolLib.transferTokenAndNotifyPolicyHolder(
|
487
|
+
getRegistry(),
|
488
|
+
instanceReader,
|
489
|
+
poolTokenHandler,
|
490
|
+
productNftId,
|
491
|
+
policyNftId,
|
492
|
+
payoutId,
|
493
|
+
payoutAmount,
|
494
|
+
payoutBeneficiary);
|
495
|
+
|
496
|
+
if (processingFeeAmount.gtz()) {
|
497
|
+
_accountingService.increaseProductFeesForPool(
|
498
|
+
instanceStore,
|
499
|
+
productNftId,
|
500
|
+
processingFeeAmount);
|
501
|
+
}
|
502
|
+
|
503
|
+
emit LogPoolServicePayoutProcessed(
|
504
|
+
poolNftId,
|
505
|
+
bundleNftId,
|
506
|
+
policyNftId,
|
507
|
+
payoutId,
|
508
|
+
netPayoutAmount,
|
509
|
+
processingFeeAmount,
|
510
|
+
payoutBeneficiary);
|
511
|
+
}
|
512
|
+
|
513
|
+
|
514
|
+
/// @inheritdoc IPoolService
|
515
|
+
function withdrawBundleFees(
|
516
|
+
NftId bundleNftId,
|
517
|
+
Amount amount
|
518
|
+
)
|
519
|
+
public
|
520
|
+
virtual
|
521
|
+
restricted()
|
522
|
+
returns (Amount withdrawnAmount)
|
523
|
+
{
|
524
|
+
// checks
|
525
|
+
_checkNftType(bundleNftId, BUNDLE());
|
526
|
+
|
527
|
+
(NftId poolNftId, IInstance instance) = _getAndVerifyActivePool();
|
528
|
+
InstanceReader reader = instance.getInstanceReader();
|
529
|
+
|
530
|
+
// determine withdrawn amount
|
531
|
+
withdrawnAmount = amount;
|
532
|
+
if (withdrawnAmount.gte(AmountLib.max())) {
|
533
|
+
withdrawnAmount = reader.getFeeAmount(bundleNftId);
|
534
|
+
} else {
|
535
|
+
if (withdrawnAmount > reader.getFeeAmount(bundleNftId)) {
|
536
|
+
revert ErrorPoolServiceFeesWithdrawAmountExceedsLimit(withdrawnAmount, reader.getFeeAmount(bundleNftId));
|
537
|
+
}
|
538
|
+
}
|
539
|
+
|
540
|
+
// effects
|
541
|
+
// decrease fee counters by withdrawnAmount
|
542
|
+
{
|
543
|
+
InstanceStore store = instance.getInstanceStore();
|
544
|
+
// decrease fee amount of the bundle
|
545
|
+
_accountingService.decreaseBundleBalanceForPool(store, bundleNftId, AmountLib.zero(), withdrawnAmount);
|
546
|
+
// decrease pool balance
|
547
|
+
_accountingService.decreasePoolBalance(store, poolNftId, withdrawnAmount, AmountLib.zero());
|
548
|
+
}
|
549
|
+
|
550
|
+
// interactions
|
551
|
+
// transfer amount to bundle owner
|
552
|
+
{
|
553
|
+
address bundleOwner = getRegistry().ownerOf(bundleNftId);
|
554
|
+
TokenHandler tokenHandler = reader.getTokenHandler(poolNftId);
|
555
|
+
address token = address(tokenHandler.TOKEN());
|
556
|
+
emit LogPoolServiceFeesWithdrawn(bundleNftId, bundleOwner, token, withdrawnAmount);
|
557
|
+
|
558
|
+
tokenHandler.pushToken(bundleOwner, withdrawnAmount);
|
559
|
+
}
|
449
560
|
}
|
450
561
|
|
451
562
|
|
@@ -453,7 +564,6 @@ contract PoolService is
|
|
453
564
|
/// may only be called by the policy service for unlocked pool components
|
454
565
|
function releaseCollateral(
|
455
566
|
IInstance instance,
|
456
|
-
address token,
|
457
567
|
NftId policyNftId,
|
458
568
|
IPolicy.PolicyInfo memory policyInfo
|
459
569
|
)
|
@@ -466,120 +576,22 @@ contract PoolService is
|
|
466
576
|
Amount remainingCollateralAmount = policyInfo.sumInsuredAmount - policyInfo.claimAmount;
|
467
577
|
|
468
578
|
_bundleService.releaseCollateral(
|
469
|
-
instance,
|
579
|
+
instance.getInstanceStore(),
|
470
580
|
policyNftId,
|
471
581
|
policyInfo.bundleNftId,
|
472
582
|
remainingCollateralAmount);
|
473
583
|
|
474
584
|
// update value locked with staking service
|
585
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
475
586
|
_staking.decreaseTotalValueLocked(
|
476
|
-
|
477
|
-
|
587
|
+
instanceReader.getInstanceNftId(),
|
588
|
+
address(instanceReader.getToken(policyInfo.productNftId)),
|
478
589
|
remainingCollateralAmount);
|
479
|
-
}
|
480
|
-
|
481
|
-
|
482
|
-
function calculateRequiredCollateral(
|
483
|
-
InstanceReader instanceReader,
|
484
|
-
NftId productNftId,
|
485
|
-
Amount sumInsuredAmount
|
486
|
-
)
|
487
|
-
public
|
488
|
-
view
|
489
|
-
returns(
|
490
|
-
NftId poolNftId,
|
491
|
-
Amount totalCollateralAmount,
|
492
|
-
Amount localCollateralAmount,
|
493
|
-
bool poolIsVerifyingApplications
|
494
|
-
)
|
495
|
-
{
|
496
|
-
_checkNftType(productNftId, PRODUCT());
|
497
|
-
|
498
|
-
poolNftId = instanceReader.getProductInfo(productNftId).poolNftId;
|
499
|
-
IComponents.PoolInfo memory poolInfo = instanceReader.getPoolInfo(poolNftId);
|
500
|
-
poolIsVerifyingApplications = poolInfo.isVerifyingApplications;
|
501
|
-
|
502
|
-
(
|
503
|
-
totalCollateralAmount,
|
504
|
-
localCollateralAmount
|
505
|
-
) = calculateRequiredCollateral(
|
506
|
-
poolInfo.collateralizationLevel,
|
507
|
-
poolInfo.retentionLevel,
|
508
|
-
sumInsuredAmount);
|
509
|
-
}
|
510
|
-
|
511
|
-
|
512
|
-
function calculateRequiredCollateral(
|
513
|
-
UFixed collateralizationLevel,
|
514
|
-
UFixed retentionLevel,
|
515
|
-
Amount sumInsuredAmount
|
516
|
-
)
|
517
|
-
public
|
518
|
-
pure
|
519
|
-
returns(
|
520
|
-
Amount totalCollateralAmount,
|
521
|
-
Amount localCollateralAmount
|
522
|
-
)
|
523
|
-
{
|
524
|
-
// collateralization is applied to sum insured
|
525
|
-
UFixed totalUFixed = collateralizationLevel * sumInsuredAmount.toUFixed();
|
526
|
-
totalCollateralAmount = AmountLib.toAmount(totalUFixed.toInt());
|
527
|
-
|
528
|
-
// retention level defines how much capital is required locally
|
529
|
-
localCollateralAmount = AmountLib.toAmount(
|
530
|
-
(retentionLevel * totalUFixed).toInt());
|
531
|
-
}
|
532
|
-
|
533
|
-
|
534
|
-
function _processStakingFees(
|
535
|
-
Fee memory stakingFee,
|
536
|
-
Amount stakingAmount
|
537
|
-
)
|
538
|
-
internal
|
539
|
-
pure
|
540
|
-
returns (Amount stakingNetAmount)
|
541
|
-
{
|
542
|
-
stakingNetAmount = stakingAmount;
|
543
590
|
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
// TODO update fee balance for pool
|
550
|
-
}
|
551
|
-
}
|
552
|
-
|
553
|
-
|
554
|
-
/// @dev transfers the specified amount from the "from account" to the pool's wallet
|
555
|
-
function _collectStakingAmount(
|
556
|
-
InstanceReader reader,
|
557
|
-
NftId poolNftId,
|
558
|
-
address from,
|
559
|
-
Amount amount
|
560
|
-
)
|
561
|
-
internal
|
562
|
-
{
|
563
|
-
IComponents.ComponentInfo memory info = reader.getComponentInfo(poolNftId);
|
564
|
-
info.tokenHandler.collectTokens(
|
565
|
-
from,
|
566
|
-
amount);
|
567
|
-
}
|
568
|
-
|
569
|
-
/// @dev distributes the specified amount from the pool's wallet to the "to account"
|
570
|
-
function _distributeUnstakingAmount(
|
571
|
-
InstanceReader reader,
|
572
|
-
NftId poolNftId,
|
573
|
-
address to,
|
574
|
-
Amount amount
|
575
|
-
)
|
576
|
-
internal
|
577
|
-
{
|
578
|
-
IComponents.ComponentInfo memory info = reader.getComponentInfo(poolNftId);
|
579
|
-
info.tokenHandler.distributeTokens(
|
580
|
-
info.tokenHandler.getWallet(),
|
581
|
-
to,
|
582
|
-
amount);
|
591
|
+
emit LogPoolServiceCollateralReleased(
|
592
|
+
policyInfo.bundleNftId,
|
593
|
+
policyNftId,
|
594
|
+
remainingCollateralAmount);
|
583
595
|
}
|
584
596
|
|
585
597
|
|
@@ -592,17 +604,7 @@ contract PoolService is
|
|
592
604
|
IInstance instance
|
593
605
|
)
|
594
606
|
{
|
595
|
-
(
|
596
|
-
IRegistry.ObjectInfo memory info,
|
597
|
-
address instanceAddress
|
598
|
-
) = ContractLib.getAndVerifyComponent(
|
599
|
-
getRegistry(),
|
600
|
-
msg.sender,
|
601
|
-
POOL(),
|
602
|
-
true); // only active pools
|
603
|
-
|
604
|
-
poolNftId = info.nftId;
|
605
|
-
instance = IInstance(instanceAddress);
|
607
|
+
return PoolLib.getAndVerifyActivePool(getRegistry(), msg.sender);
|
606
608
|
}
|
607
609
|
|
608
610
|
|
@@ -17,7 +17,7 @@ contract PoolServiceManager is ProxyManager {
|
|
17
17
|
)
|
18
18
|
{
|
19
19
|
PoolService poolSrv = new PoolService{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(poolSrv),
|