@etherisc/gif-next 0.0.2-e769e2e-077 → 0.0.2-e79d227-681
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +77 -10
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +1293 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.json +24 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +1206 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +414 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.json +10 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +1060 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +295 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +167 -0
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +4 -0
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +1196 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +253 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +1324 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +470 -0
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +154 -546
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +380 -229
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +198 -96
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +186 -238
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +223 -47
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.json +22 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +1429 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +502 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +1979 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +470 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.json +376 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +1430 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +1177 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +1606 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2281 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +4 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +808 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +153 -86
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +181 -119
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +174 -215
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1666 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +574 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +876 -160
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +260 -268
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +163 -81
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +506 -338
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +810 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.json +0 -53
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +10 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +223 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +181 -0
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +8 -116
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +4 -0
- package/artifacts/contracts/mock/Dip.sol/Dip.json +376 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +961 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +478 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.json +52 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +776 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +709 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +877 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +990 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +766 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +1254 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +502 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +456 -187
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +218 -80
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +264 -26
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +115 -354
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +464 -223
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +152 -682
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +590 -382
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +190 -76
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +147 -161
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +147 -77
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +1148 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +470 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +343 -168
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +200 -90
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +88 -8
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +196 -7
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +364 -121
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +134 -86
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +176 -160
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +4 -0
- package/artifacts/contracts/product/{IProductService.sol/IProductService.json → IRiskService.sol/IRiskService.json} +51 -3
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +475 -294
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +199 -81
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +229 -275
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +172 -102
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +201 -486
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +4 -0
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +638 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +718 -0
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +59 -16
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +412 -35
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +225 -196
- 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 +761 -87
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +1899 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +278 -306
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +154 -78
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +205 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +1067 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +272 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +185 -135
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +79 -274
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +626 -252
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +209 -99
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +55 -101
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +488 -0
- 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/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +74 -79
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +561 -13
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +120 -108
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +45 -13
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +34 -3
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +23 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +16 -30
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +36 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +49 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +4 -0
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +53 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +129 -360
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +55 -98
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +42 -62
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +4 -0
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +306 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +26 -55
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +20 -124
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +62 -87
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +55 -101
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +697 -25
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +395 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +172 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +462 -634
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +546 -48
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +440 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +613 -871
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +205 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +185 -81
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +587 -0
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +633 -173
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +166 -68
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2283 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +607 -0
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.json +2 -2
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +121 -4
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +40 -2
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +28 -4
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +4 -4
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +17 -12
- 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 +47 -4
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +149 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +19 -19
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +4 -4
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +204 -0
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +99 -5
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +219 -6
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +124 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +129 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +10 -0
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +15 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +4 -0
- package/artifacts/contracts/type/String.sol/StrLib.json +132 -0
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +36 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +9 -3
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +71 -2
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -2
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +21 -2
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +4 -0
- package/artifacts/contracts/{shared → upgradeability}/IVersionable.sol/IVersionable.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +618 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +129 -0
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +4 -0
- package/artifacts/contracts/{shared → upgradeability}/Versionable.sol/Versionable.json +1 -1
- package/contracts/authorization/AccessAdmin.sol +616 -0
- package/contracts/authorization/AccessManagerCloneable.sol +16 -0
- package/contracts/authorization/Authorization.sol +289 -0
- package/contracts/authorization/IAccess.sol +49 -0
- package/contracts/authorization/IAccessAdmin.sol +137 -0
- package/contracts/authorization/IAuthorization.sol +60 -0
- package/contracts/authorization/IServiceAuthorization.sol +40 -0
- package/contracts/authorization/ReleaseAccessManager.sol +38 -0
- package/contracts/authorization/ServiceAuthorization.sol +106 -0
- package/contracts/distribution/BasicDistribution.sol +139 -0
- package/contracts/distribution/BasicDistributionAuthorization.sol +47 -0
- package/contracts/distribution/Distribution.sol +145 -124
- package/contracts/distribution/DistributionService.sol +156 -99
- package/contracts/distribution/DistributionServiceManager.sol +13 -25
- package/contracts/distribution/IDistributionComponent.sol +27 -41
- package/contracts/distribution/IDistributionService.sol +29 -10
- package/contracts/examples/fire/DamageLevel.sol +59 -0
- package/contracts/examples/fire/FirePool.sol +86 -0
- package/contracts/examples/fire/FirePoolAuthorization.sol +34 -0
- package/contracts/examples/fire/FireProduct.sol +431 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +44 -0
- package/contracts/examples/fire/FireUSD.sol +26 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +58 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +137 -0
- package/contracts/examples/unpermissioned/SimplePool.sol +108 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +345 -0
- package/contracts/instance/BundleSet.sol +130 -0
- package/contracts/instance/IInstance.sol +39 -44
- package/contracts/instance/IInstanceService.sol +33 -42
- package/contracts/instance/Instance.sol +137 -124
- package/contracts/instance/InstanceAdmin.sol +278 -0
- package/contracts/instance/InstanceAuthorizationV3.sol +217 -0
- package/contracts/instance/InstanceReader.sol +249 -36
- package/contracts/instance/InstanceService.sol +227 -151
- package/contracts/instance/InstanceServiceManager.sol +14 -29
- package/contracts/instance/InstanceStore.sol +85 -57
- package/contracts/instance/RiskSet.sol +119 -0
- package/contracts/instance/base/BalanceStore.sol +12 -7
- package/contracts/instance/base/Cloneable.sol +2 -25
- package/contracts/instance/base/ObjectCounter.sol +21 -0
- package/contracts/instance/base/ObjectLifecycle.sol +111 -0
- package/contracts/instance/base/ObjectSet.sol +78 -0
- package/contracts/instance/module/IAccess.sol +2 -10
- package/contracts/instance/module/IBundle.sol +1 -1
- package/contracts/instance/module/IComponents.sol +11 -13
- package/contracts/instance/module/IDistribution.sol +0 -1
- package/contracts/instance/module/IPolicy.sol +26 -25
- package/contracts/instance/module/IRisk.sol +1 -0
- package/contracts/mock/Dip.sol +26 -0
- package/contracts/oracle/BasicOracle.sol +47 -0
- package/contracts/oracle/BasicOracleAuthorization.sol +46 -0
- package/contracts/oracle/IOracle.sol +36 -0
- package/contracts/oracle/IOracleComponent.sol +33 -0
- package/contracts/oracle/IOracleService.sol +66 -0
- package/contracts/oracle/Oracle.sol +156 -0
- package/contracts/oracle/OracleService.sol +309 -0
- package/contracts/oracle/OracleServiceManager.sol +39 -0
- package/contracts/pool/BasicPool.sol +175 -0
- package/contracts/pool/BasicPoolAuthorization.sol +68 -0
- package/contracts/pool/BundleService.sol +232 -122
- package/contracts/pool/BundleServiceManager.sol +13 -25
- package/contracts/pool/IBundleService.sol +34 -18
- package/contracts/pool/IPoolComponent.sol +20 -70
- package/contracts/pool/IPoolService.sol +57 -51
- package/contracts/pool/Pool.sol +208 -162
- package/contracts/pool/PoolService.sol +372 -181
- package/contracts/pool/PoolServiceManager.sol +12 -24
- package/contracts/product/ApplicationService.sol +90 -84
- package/contracts/product/ApplicationServiceManager.sol +12 -9
- package/contracts/product/BasicProduct.sol +49 -0
- package/contracts/product/BasicProductAuthorization.sol +42 -0
- package/contracts/product/ClaimService.sol +331 -153
- package/contracts/product/ClaimServiceManager.sol +12 -9
- package/contracts/product/IApplicationService.sol +7 -3
- package/contracts/product/IClaimService.sol +35 -5
- package/contracts/product/IPolicyService.sol +47 -35
- package/contracts/product/IPricingService.sol +11 -11
- package/contracts/product/IProductComponent.sol +26 -9
- package/contracts/product/{IProductService.sol → IRiskService.sol} +2 -2
- package/contracts/product/PolicyService.sol +524 -262
- package/contracts/product/PolicyServiceManager.sol +12 -27
- package/contracts/product/PricingService.sol +64 -64
- package/contracts/product/PricingServiceManager.sol +12 -24
- package/contracts/product/Product.sol +189 -139
- package/contracts/product/{ProductService.sol → RiskService.sol} +35 -50
- package/contracts/product/RiskServiceManager.sol +39 -0
- package/contracts/registry/ChainNft.sol +68 -37
- package/contracts/registry/IRegistry.sol +90 -28
- package/contracts/registry/IRegistryService.sol +26 -43
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +424 -228
- package/contracts/registry/RegistryAdmin.sol +451 -0
- package/contracts/registry/RegistryService.sol +63 -149
- package/contracts/registry/RegistryServiceManager.sol +23 -30
- package/contracts/registry/ReleaseLifecycle.sol +30 -0
- package/contracts/registry/ReleaseRegistry.sol +485 -0
- package/contracts/registry/ServiceAuthorizationV3.sol +175 -0
- package/contracts/registry/TokenRegistry.sol +187 -59
- package/contracts/shared/Component.sol +56 -125
- package/contracts/shared/ComponentService.sol +411 -201
- package/contracts/shared/ComponentServiceManager.sol +10 -7
- package/contracts/shared/ComponentVerifyingService.sol +40 -23
- package/contracts/shared/ContractLib.sol +224 -0
- package/contracts/shared/IComponent.sol +11 -18
- package/contracts/shared/IComponentService.sol +52 -13
- package/contracts/shared/IInstanceLinkedComponent.sol +11 -16
- package/contracts/shared/IKeyValueStore.sol +2 -1
- package/contracts/shared/ILifecycle.sol +3 -2
- package/contracts/shared/INftOwnable.sol +3 -1
- package/contracts/shared/IPolicyHolder.sol +12 -17
- package/contracts/shared/IRegisterable.sol +11 -0
- package/contracts/shared/IService.sol +9 -2
- package/contracts/shared/{ERC165.sol → InitializableERC165.sol} +4 -4
- package/contracts/shared/InstanceLinkedComponent.sol +103 -43
- package/contracts/shared/KeyValueStore.sol +30 -68
- package/contracts/shared/Lifecycle.sol +30 -63
- package/contracts/shared/NftIdSet.sol +65 -0
- package/contracts/shared/NftOwnable.sol +31 -22
- package/contracts/shared/PolicyHolder.sol +18 -50
- package/contracts/shared/Registerable.sol +19 -11
- package/contracts/shared/RegistryLinked.sol +9 -14
- package/contracts/shared/Service.sol +44 -37
- package/contracts/shared/TokenHandler.sol +358 -27
- package/contracts/shared/TokenHandlerDeployerLib.sol +20 -0
- package/contracts/staking/IStaking.sol +133 -37
- package/contracts/staking/IStakingService.sol +93 -41
- package/contracts/staking/StakeManagerLib.sol +224 -0
- package/contracts/staking/Staking.sol +394 -101
- package/contracts/staking/StakingLifecycle.sol +23 -0
- package/contracts/staking/StakingManager.sol +24 -18
- package/contracts/staking/StakingReader.sol +190 -0
- package/contracts/staking/StakingService.sol +282 -42
- package/contracts/staking/StakingServiceManager.sol +10 -7
- package/contracts/staking/StakingStore.sol +605 -0
- package/contracts/staking/TargetManagerLib.sol +211 -0
- package/contracts/type/AddressSet.sol +1 -1
- package/contracts/type/Amount.sol +39 -3
- package/contracts/type/Blocknumber.sol +20 -2
- package/contracts/type/ClaimId.sol +6 -1
- package/contracts/type/Fee.sol +1 -1
- package/contracts/type/Key32.sol +2 -2
- package/contracts/type/Key32Set.sol +62 -0
- package/contracts/type/NftId.sol +16 -4
- package/contracts/type/NftIdSet.sol +1 -1
- package/contracts/type/ObjectType.sol +178 -65
- package/contracts/type/PayoutId.sol +10 -10
- package/contracts/type/Referral.sol +2 -1
- package/contracts/type/RequestId.sol +75 -0
- package/contracts/type/RiskId.sol +31 -5
- package/contracts/type/RoleId.sol +98 -74
- package/contracts/type/Seconds.sol +48 -1
- package/contracts/type/Selector.sol +102 -0
- package/contracts/type/StateId.sol +41 -2
- package/contracts/type/String.sol +53 -0
- package/contracts/type/Timestamp.sol +17 -3
- package/contracts/type/UFixed.sol +38 -9
- package/contracts/type/Version.sol +4 -2
- package/contracts/{shared → upgradeability}/ProxyManager.sol +90 -27
- package/contracts/{shared → upgradeability}/UpgradableProxyWithAdmin.sol +1 -3
- package/contracts/{shared → upgradeability}/Versionable.sol +2 -2
- package/package.json +11 -7
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +0 -4
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +0 -778
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +0 -1348
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +0 -132
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +0 -256
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +0 -4
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +0 -4
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +0 -673
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +0 -4
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +0 -636
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +0 -4
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +0 -308
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +0 -4
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +0 -688
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.json +0 -137
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +0 -1206
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +0 -4
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +0 -73
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +0 -4
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +0 -4
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +0 -569
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +0 -4
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +0 -129
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +0 -4
- package/contracts/instance/BundleManager.sol +0 -126
- package/contracts/instance/InstanceAccessManager.sol +0 -543
- package/contracts/instance/InstanceAuthorizationsLib.sol +0 -336
- package/contracts/instance/base/ObjectManager.sol +0 -82
- package/contracts/product/ProductServiceManager.sol +0 -54
- package/contracts/registry/RegistryAccessManager.sol +0 -213
- package/contracts/registry/ReleaseManager.sol +0 -375
- package/contracts/registry/ServiceAuthorizationsLib.sol +0 -173
- package/contracts/shared/AccessManagerUpgradeableInitializeable.sol +0 -13
- /package/contracts/{shared → upgradeability}/IVersionable.sol +0 -0
@@ -0,0 +1,68 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {Authorization} from "../authorization/Authorization.sol";
|
5
|
+
import {BasicPool} from "./BasicPool.sol";
|
6
|
+
import {IAccess} from "../authorization/IAccess.sol";
|
7
|
+
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
8
|
+
import {IPoolComponent} from "./IPoolComponent.sol";
|
9
|
+
import {POOL} from "../type/ObjectType.sol";
|
10
|
+
import {PUBLIC_ROLE} from "../../contracts/type/RoleId.sol";
|
11
|
+
import {RoleId} from "../type/RoleId.sol";
|
12
|
+
|
13
|
+
|
14
|
+
contract BasicPoolAuthorization
|
15
|
+
is Authorization
|
16
|
+
{
|
17
|
+
|
18
|
+
constructor(string memory poolName)
|
19
|
+
Authorization(poolName)
|
20
|
+
{}
|
21
|
+
|
22
|
+
function _setupServiceTargets()
|
23
|
+
internal
|
24
|
+
virtual override
|
25
|
+
{
|
26
|
+
_addServiceTargetWithRole(POOL());
|
27
|
+
}
|
28
|
+
|
29
|
+
function _setupTargets()
|
30
|
+
internal
|
31
|
+
virtual override
|
32
|
+
{
|
33
|
+
_addComponentTargetWithRole(POOL()); // basic pool target
|
34
|
+
}
|
35
|
+
|
36
|
+
|
37
|
+
function _setupTargetAuthorizations()
|
38
|
+
internal
|
39
|
+
virtual override
|
40
|
+
{
|
41
|
+
IAccess.FunctionInfo[] storage functions;
|
42
|
+
|
43
|
+
// authorize public role (open access to any account, only allows to lock target)
|
44
|
+
functions = _authorizeForTarget(getTargetName(), PUBLIC_ROLE());
|
45
|
+
_authorize(functions, BasicPool.stake.selector, "stake");
|
46
|
+
_authorize(functions, BasicPool.unstake.selector, "unstake");
|
47
|
+
_authorize(functions, BasicPool.extend.selector, "extend");
|
48
|
+
_authorize(functions, BasicPool.lockBundle.selector, "lockBundle");
|
49
|
+
_authorize(functions, BasicPool.unlockBundle.selector, "unlockBundle");
|
50
|
+
_authorize(functions, BasicPool.closeBundle.selector, "closeBundle");
|
51
|
+
_authorize(functions, BasicPool.setBundleFee.selector, "setBundleFee");
|
52
|
+
|
53
|
+
_authorize(functions, BasicPool.setMaxBalanceAmount.selector, "setMaxBalanceAmount");
|
54
|
+
_authorize(functions, BasicPool.setFees.selector, "setFees");
|
55
|
+
_authorize(functions, BasicPool.stake.selector, "stake");
|
56
|
+
_authorize(functions, BasicPool.unstake.selector, "unstake");
|
57
|
+
_authorize(functions, BasicPool.extend.selector, "extend");
|
58
|
+
|
59
|
+
_authorize(functions, IInstanceLinkedComponent.withdrawFees.selector, "withdrawFees");
|
60
|
+
|
61
|
+
_authorize(functions, BasicPool.withdrawBundleFees.selector, "withdrawBundleFees");
|
62
|
+
|
63
|
+
// authorize pool service
|
64
|
+
functions = _authorizeForTarget(getTargetName(), getServiceRole(POOL()));
|
65
|
+
_authorize(functions, IPoolComponent.verifyApplication.selector, "verifyApplication");
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
@@ -1,37 +1,26 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
|
-
pragma solidity ^0.8.
|
2
|
+
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {IBundle} from "../instance/module/IBundle.sol";
|
5
|
+
import {IBundleService} from "./IBundleService.sol";
|
5
6
|
import {IComponents} from "../instance/module/IComponents.sol";
|
6
7
|
import {IComponentService} from "../shared/IComponentService.sol";
|
7
8
|
import {IRegistry} from "../registry/IRegistry.sol";
|
9
|
+
import {IRegistryService} from "../registry/IRegistryService.sol";
|
8
10
|
import {IInstance} from "../instance/IInstance.sol";
|
9
11
|
import {InstanceStore} from "../instance/InstanceStore.sol";
|
10
12
|
import {IPolicy} from "../instance/module/IPolicy.sol";
|
11
13
|
|
12
|
-
import {IVersionable} from "../shared/IVersionable.sol";
|
13
|
-
import {INftOwnable} from "../shared/INftOwnable.sol";
|
14
|
-
import {NftId, NftIdLib} from "../type/NftId.sol";
|
15
|
-
import {ObjectType, COMPONENT, POOL, BUNDLE, REGISTRY} from "../type/ObjectType.sol";
|
16
|
-
import {POOL_OWNER_ROLE, RoleId} from "../type/RoleId.sol";
|
17
|
-
import {Pool} from "./Pool.sol";
|
18
|
-
|
19
14
|
import {Amount, AmountLib} from "../type/Amount.sol";
|
20
|
-
import {
|
21
|
-
import {StateId, ACTIVE, PAUSED, CLOSED, KEEP_STATE} from "../type/StateId.sol";
|
22
|
-
import {Seconds} from "../type/Seconds.sol";
|
23
|
-
import {TimestampLib, zeroTimestamp} from "../type/Timestamp.sol";
|
24
|
-
import {Version, VersionLib} from "../type/Version.sol";
|
25
|
-
import {Versionable} from "../shared/Versionable.sol";
|
26
|
-
|
27
|
-
import {IService} from "../shared/IService.sol";
|
28
|
-
import {Service} from "../shared/Service.sol";
|
29
|
-
import {BundleManager} from "../instance/BundleManager.sol";
|
15
|
+
import {BundleSet} from "../instance/BundleSet.sol";
|
30
16
|
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
31
|
-
import {
|
32
|
-
import {IRegistryService} from "../registry/IRegistryService.sol";
|
33
|
-
import {InstanceService} from "../instance/InstanceService.sol";
|
17
|
+
import {Fee} from "../type/Fee.sol";
|
34
18
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
19
|
+
import {NftId, NftIdLib} from "../type/NftId.sol";
|
20
|
+
import {ObjectType, COMPONENT, POOL, BUNDLE, POLICY, REGISTRY} from "../type/ObjectType.sol";
|
21
|
+
import {StateId, ACTIVE, PAUSED, CLOSED, KEEP_STATE} from "../type/StateId.sol";
|
22
|
+
import {Seconds} from "../type/Seconds.sol";
|
23
|
+
import {Timestamp, TimestampLib, zeroTimestamp} from "../type/Timestamp.sol";
|
35
24
|
|
36
25
|
string constant BUNDLE_SERVICE_NAME = "BundleService";
|
37
26
|
|
@@ -39,8 +28,7 @@ contract BundleService is
|
|
39
28
|
ComponentVerifyingService,
|
40
29
|
IBundleService
|
41
30
|
{
|
42
|
-
|
43
|
-
|
31
|
+
|
44
32
|
string public constant NAME = "BundleService";
|
45
33
|
|
46
34
|
address private _registryAddress;
|
@@ -52,24 +40,20 @@ contract BundleService is
|
|
52
40
|
bytes memory data
|
53
41
|
)
|
54
42
|
internal
|
55
|
-
initializer
|
56
43
|
virtual override
|
44
|
+
initializer()
|
57
45
|
{
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
46
|
+
(
|
47
|
+
address registryAddress,
|
48
|
+
address authority
|
49
|
+
) = abi.decode(data, (address, address));
|
50
|
+
|
51
|
+
_initializeService(registryAddress, authority, owner);
|
64
52
|
|
65
53
|
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
66
54
|
_componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
67
55
|
|
68
|
-
|
69
|
-
}
|
70
|
-
|
71
|
-
function getDomain() public pure override returns(ObjectType) {
|
72
|
-
return BUNDLE();
|
56
|
+
_registerInterface(type(IBundleService).interfaceId);
|
73
57
|
}
|
74
58
|
|
75
59
|
|
@@ -79,7 +63,10 @@ contract BundleService is
|
|
79
63
|
)
|
80
64
|
external
|
81
65
|
virtual
|
66
|
+
restricted()
|
82
67
|
{
|
68
|
+
_checkNftType(bundleNftId, BUNDLE());
|
69
|
+
|
83
70
|
(NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
84
71
|
InstanceReader instanceReader = instance.getInstanceReader();
|
85
72
|
IBundle.BundleInfo memory bundleInfo = instanceReader.getBundleInfo(bundleNftId);
|
@@ -97,19 +84,18 @@ contract BundleService is
|
|
97
84
|
|
98
85
|
|
99
86
|
function create(
|
100
|
-
IInstance instance,
|
101
|
-
NftId poolNftId,
|
102
87
|
address owner,
|
103
88
|
Fee memory bundleFee,
|
104
|
-
Amount stakingAmount,
|
105
89
|
Seconds lifetime,
|
106
90
|
bytes calldata filter
|
107
91
|
)
|
108
92
|
external
|
109
|
-
|
110
|
-
|
93
|
+
virtual
|
94
|
+
restricted()
|
111
95
|
returns(NftId bundleNftId)
|
112
96
|
{
|
97
|
+
(NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
98
|
+
|
113
99
|
// register bundle with registry
|
114
100
|
bundleNftId = _registryService.registerBundle(
|
115
101
|
IRegistry.ObjectInfo(
|
@@ -127,26 +113,21 @@ contract BundleService is
|
|
127
113
|
InstanceStore instanceStore = instance.getInstanceStore();
|
128
114
|
instanceStore.createBundle(
|
129
115
|
bundleNftId,
|
130
|
-
IBundle.BundleInfo(
|
131
|
-
poolNftId,
|
132
|
-
bundleFee,
|
133
|
-
filter,
|
134
|
-
|
135
|
-
TimestampLib.blockTimestamp().addSeconds(lifetime),
|
136
|
-
zeroTimestamp()
|
137
|
-
|
138
|
-
|
139
|
-
_componentService.increaseBundleBalance(
|
140
|
-
instanceStore,
|
141
|
-
bundleNftId,
|
142
|
-
stakingAmount,
|
143
|
-
AmountLib.zero()); // fee amount
|
116
|
+
IBundle.BundleInfo({
|
117
|
+
poolNftId: poolNftId,
|
118
|
+
fee: bundleFee,
|
119
|
+
filter: filter,
|
120
|
+
activatedAt: TimestampLib.blockTimestamp(),
|
121
|
+
expiredAt: TimestampLib.blockTimestamp().addSeconds(lifetime),
|
122
|
+
closedAt: zeroTimestamp()
|
123
|
+
})
|
124
|
+
);
|
144
125
|
|
145
126
|
// put bundle under bundle managemet
|
146
|
-
|
127
|
+
BundleSet bundleManager = instance.getBundleSet();
|
147
128
|
bundleManager.add(bundleNftId);
|
148
129
|
|
149
|
-
|
130
|
+
emit LogBundleServiceBundleCreated(bundleNftId, poolNftId);
|
150
131
|
}
|
151
132
|
|
152
133
|
|
@@ -159,49 +140,58 @@ contract BundleService is
|
|
159
140
|
)
|
160
141
|
external
|
161
142
|
virtual
|
162
|
-
|
143
|
+
restricted()
|
163
144
|
{
|
145
|
+
_checkNftType(policyNftId, POLICY());
|
146
|
+
_checkNftType(bundleNftId, BUNDLE());
|
147
|
+
|
164
148
|
InstanceReader instanceReader = instance.getInstanceReader();
|
165
|
-
StateId bundleState = instanceReader.getMetadata(bundleNftId.toKey32(BUNDLE())).state;
|
166
|
-
IBundle.BundleInfo memory bundleInfo = instanceReader.getBundleInfo(bundleNftId);
|
167
149
|
|
168
|
-
|
169
|
-
|
170
|
-
|
150
|
+
{
|
151
|
+
StateId bundleState = instance.getInstanceReader().getBundleState(bundleNftId);
|
152
|
+
IBundle.BundleInfo memory bundleInfo = instanceReader.getBundleInfo(bundleNftId);
|
153
|
+
|
154
|
+
// ensure bundle is active and not yet expired
|
155
|
+
if(bundleState != ACTIVE() || bundleInfo.expiredAt < TimestampLib.blockTimestamp()) {
|
156
|
+
revert ErrorBundleServiceBundleNotOpen(bundleNftId, bundleState, bundleInfo.expiredAt);
|
157
|
+
}
|
171
158
|
}
|
172
159
|
|
173
|
-
// ensure bundle capacity is sufficent to collateralize policy
|
174
160
|
InstanceStore instanceStore = instance.getInstanceStore();
|
175
|
-
(
|
176
|
-
Amount balanceAmount,
|
177
|
-
Amount lockedAmount,
|
178
|
-
Amount feeAmount
|
179
|
-
) = instanceStore.getAmounts(bundleNftId);
|
180
161
|
|
181
|
-
|
182
|
-
|
183
|
-
|
162
|
+
{
|
163
|
+
// ensure bundle capacity is sufficent to collateralize policy
|
164
|
+
(
|
165
|
+
Amount balanceAmount,
|
166
|
+
Amount lockedAmount,
|
167
|
+
Amount feeAmount
|
168
|
+
) = instanceStore.getAmounts(bundleNftId);
|
169
|
+
|
170
|
+
Amount capacity = balanceAmount - (lockedAmount + feeAmount);
|
171
|
+
if(capacity < collateralAmount) {
|
172
|
+
revert ErrorBundleServiceCapacityInsufficient(bundleNftId, capacity, collateralAmount);
|
173
|
+
}
|
184
174
|
}
|
185
175
|
|
186
176
|
// updated locked amount
|
187
177
|
instanceStore.increaseLocked(bundleNftId, collateralAmount);
|
188
|
-
|
189
|
-
// link policy to bundle in bundle manger
|
190
|
-
_linkPolicy(instance, policyNftId);
|
191
178
|
}
|
192
179
|
|
193
180
|
|
194
181
|
function lock(NftId bundleNftId)
|
195
182
|
external
|
196
183
|
virtual
|
184
|
+
restricted()
|
197
185
|
{
|
186
|
+
_checkNftType(bundleNftId, BUNDLE());
|
187
|
+
|
198
188
|
(,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
199
189
|
|
200
190
|
// udpate bundle state
|
201
191
|
instance.getInstanceStore().updateBundleState(bundleNftId, PAUSED());
|
202
192
|
|
203
193
|
// update set of active bundles
|
204
|
-
|
194
|
+
BundleSet bundleManager = instance.getBundleSet();
|
205
195
|
bundleManager.lock(bundleNftId);
|
206
196
|
|
207
197
|
emit LogBundleServiceBundleLocked(bundleNftId);
|
@@ -211,14 +201,17 @@ contract BundleService is
|
|
211
201
|
function unlock(NftId bundleNftId)
|
212
202
|
external
|
213
203
|
virtual
|
204
|
+
restricted()
|
214
205
|
{
|
206
|
+
_checkNftType(bundleNftId, BUNDLE());
|
207
|
+
|
215
208
|
(,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
216
209
|
|
217
210
|
// udpate bundle state
|
218
211
|
instance.getInstanceStore().updateBundleState(bundleNftId, ACTIVE());
|
219
212
|
|
220
213
|
// update set of active bundles
|
221
|
-
|
214
|
+
BundleSet bundleManager = instance.getBundleSet();
|
222
215
|
bundleManager.unlock(bundleNftId);
|
223
216
|
|
224
217
|
emit LogBundleServiceBundleActivated(bundleNftId);
|
@@ -231,40 +224,137 @@ contract BundleService is
|
|
231
224
|
)
|
232
225
|
external
|
233
226
|
virtual
|
234
|
-
|
227
|
+
restricted()
|
228
|
+
returns (Amount unstakedAmount, Amount feeAmount)
|
235
229
|
{
|
236
|
-
|
237
|
-
|
230
|
+
_checkNftType(bundleNftId, BUNDLE());
|
231
|
+
|
232
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
238
233
|
|
239
234
|
// ensure no open policies attached to bundle
|
240
|
-
|
235
|
+
BundleSet bundleManager = instance.getBundleSet();
|
241
236
|
uint256 openPolicies = bundleManager.activePolicies(bundleNftId);
|
242
237
|
if(openPolicies > 0) {
|
243
238
|
revert ErrorBundleServiceBundleWithOpenPolicies(bundleNftId, openPolicies);
|
244
239
|
}
|
245
240
|
|
246
|
-
|
247
|
-
|
241
|
+
{
|
242
|
+
// update bundle state
|
243
|
+
InstanceStore instanceStore = instance.getInstanceStore();
|
244
|
+
instanceStore.updateBundleState(bundleNftId, CLOSED());
|
245
|
+
bundleManager.lock(bundleNftId);
|
246
|
+
|
247
|
+
// decrease bundle counters
|
248
|
+
Amount balanceAmountWithFees = instanceReader.getBalanceAmount(bundleNftId);
|
249
|
+
feeAmount = instanceReader.getFeeAmount(bundleNftId);
|
250
|
+
unstakedAmount = balanceAmountWithFees - feeAmount;
|
251
|
+
_componentService.decreaseBundleBalance(instanceStore, bundleNftId, unstakedAmount, feeAmount);
|
252
|
+
}
|
253
|
+
}
|
254
|
+
|
255
|
+
/// @inheritdoc IBundleService
|
256
|
+
function stake(
|
257
|
+
IInstance instance,
|
258
|
+
NftId bundleNftId,
|
259
|
+
Amount amount
|
260
|
+
)
|
261
|
+
external
|
262
|
+
virtual
|
263
|
+
restricted()
|
264
|
+
{
|
265
|
+
_checkNftType(bundleNftId, BUNDLE());
|
266
|
+
|
267
|
+
IBundle.BundleInfo memory bundleInfo = instance.getInstanceReader().getBundleInfo(bundleNftId);
|
268
|
+
StateId bundleState = instance.getInstanceReader().getBundleState(bundleNftId);
|
269
|
+
|
270
|
+
if( (bundleState != ACTIVE() && bundleState != PAUSED()) // locked bundles can be staked
|
271
|
+
|| bundleInfo.expiredAt < TimestampLib.blockTimestamp()
|
272
|
+
|| bundleInfo.closedAt.gtz()) {
|
273
|
+
revert ErrorBundleServiceBundleNotOpen(bundleNftId, bundleState, bundleInfo.expiredAt);
|
274
|
+
}
|
275
|
+
|
276
|
+
_componentService.increaseBundleBalance(
|
277
|
+
instance.getInstanceStore(),
|
278
|
+
bundleNftId,
|
279
|
+
amount,
|
280
|
+
AmountLib.zero());
|
248
281
|
}
|
249
282
|
|
283
|
+
/// @inheritdoc IBundleService
|
284
|
+
function unstake(
|
285
|
+
IInstance instance,
|
286
|
+
NftId bundleNftId,
|
287
|
+
Amount amount
|
288
|
+
)
|
289
|
+
external
|
290
|
+
virtual
|
291
|
+
restricted()
|
292
|
+
returns (Amount unstakedAmount)
|
293
|
+
{
|
294
|
+
_checkNftType(bundleNftId, BUNDLE());
|
250
295
|
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
// virtual
|
258
|
-
// // TODO add replace with restricted + appropriate granting
|
259
|
-
// {
|
260
|
-
// InstanceReader instanceReader = instance.getInstanceReader();
|
261
|
-
// IBundle.BundleInfo memory bundleInfo = instanceReader.getBundleInfo(bundleNftId);
|
296
|
+
InstanceStore instanceStore = instance.getInstanceStore();
|
297
|
+
(
|
298
|
+
Amount balanceAmount,
|
299
|
+
Amount lockedAmount,
|
300
|
+
Amount feeAmount
|
301
|
+
) = instanceStore.getAmounts(bundleNftId);
|
262
302
|
|
263
|
-
|
264
|
-
|
303
|
+
unstakedAmount = amount;
|
304
|
+
Amount availableAmount = balanceAmount - (lockedAmount + feeAmount);
|
305
|
+
|
306
|
+
// if amount is max, then unstake all available
|
307
|
+
if (amount.gte(AmountLib.max())) {
|
308
|
+
unstakedAmount = availableAmount;
|
309
|
+
}
|
310
|
+
|
311
|
+
// ensure unstaked amount does not exceed available amount
|
312
|
+
if (unstakedAmount > availableAmount) {
|
313
|
+
revert ErrorBundleServiceUnstakeAmountExceedsLimit(amount, availableAmount);
|
314
|
+
}
|
315
|
+
|
316
|
+
_componentService.decreaseBundleBalance(
|
317
|
+
instanceStore,
|
318
|
+
bundleNftId,
|
319
|
+
unstakedAmount,
|
320
|
+
AmountLib.zero());
|
321
|
+
}
|
322
|
+
|
323
|
+
/// @inheritdoc IBundleService
|
324
|
+
function extend(NftId bundleNftId, Seconds lifetimeExtension)
|
325
|
+
external
|
326
|
+
virtual
|
327
|
+
restricted()
|
328
|
+
returns (Timestamp extendedExpiredAt)
|
329
|
+
{
|
330
|
+
_checkNftType(bundleNftId, BUNDLE());
|
331
|
+
|
332
|
+
(NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
333
|
+
IBundle.BundleInfo memory bundleInfo = instance.getInstanceReader().getBundleInfo(bundleNftId);
|
334
|
+
StateId bundleState = instance.getInstanceReader().getBundleState(bundleNftId);
|
335
|
+
|
336
|
+
// ensure bundle belongs to the pool
|
337
|
+
if (bundleInfo.poolNftId != poolNftId) {
|
338
|
+
revert ErrorBundleServiceBundlePoolMismatch(bundleNftId, bundleInfo.poolNftId, poolNftId);
|
339
|
+
}
|
340
|
+
|
341
|
+
// ensure bundle is active and not yet expired
|
342
|
+
if(bundleState != ACTIVE() || bundleInfo.expiredAt < TimestampLib.blockTimestamp()) {
|
343
|
+
revert ErrorBundleServiceBundleNotOpen(bundleNftId, bundleState, bundleInfo.expiredAt);
|
344
|
+
}
|
345
|
+
|
346
|
+
if (lifetimeExtension.eqz()) {
|
347
|
+
revert ErrorBundleServiceExtensionLifetimeIsZero();
|
348
|
+
}
|
349
|
+
|
350
|
+
bundleInfo.expiredAt = bundleInfo.expiredAt.addSeconds(lifetimeExtension);
|
351
|
+
instance.getInstanceStore().updateBundle(bundleNftId, bundleInfo, KEEP_STATE());
|
352
|
+
|
353
|
+
emit LogBundleServiceBundleExtended(bundleNftId, lifetimeExtension, bundleInfo.expiredAt);
|
354
|
+
|
355
|
+
return bundleInfo.expiredAt;
|
356
|
+
}
|
265
357
|
|
266
|
-
// // TODO add logging (?)
|
267
|
-
// }
|
268
358
|
|
269
359
|
function releaseCollateral(
|
270
360
|
IInstance instance,
|
@@ -274,40 +364,60 @@ contract BundleService is
|
|
274
364
|
)
|
275
365
|
external
|
276
366
|
virtual
|
277
|
-
|
367
|
+
restricted()
|
278
368
|
{
|
369
|
+
_checkNftType(policyNftId, POLICY());
|
370
|
+
_checkNftType(bundleNftId, BUNDLE());
|
371
|
+
|
279
372
|
instance.getInstanceStore().decreaseLocked(bundleNftId, collateralAmount);
|
280
373
|
}
|
281
374
|
|
282
|
-
|
283
|
-
|
284
|
-
|
375
|
+
|
376
|
+
/// @inheritdoc IBundleService
|
377
|
+
function withdrawBundleFees(NftId bundleNftId, Amount amount)
|
378
|
+
public
|
379
|
+
virtual
|
380
|
+
restricted()
|
381
|
+
returns (Amount withdrawnAmount)
|
285
382
|
{
|
286
|
-
|
287
|
-
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
383
|
+
_checkNftType(bundleNftId, BUNDLE());
|
288
384
|
|
289
|
-
|
290
|
-
|
291
|
-
revert BundleManager.ErrorBundleManagerPolicyAlreadyActivated(policyNftId);
|
292
|
-
}
|
385
|
+
(NftId poolNftId,, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
386
|
+
InstanceReader reader = instance.getInstanceReader();
|
293
387
|
|
294
|
-
|
295
|
-
|
296
|
-
|
388
|
+
IComponents.ComponentInfo memory poolInfo = reader.getComponentInfo(poolNftId);
|
389
|
+
address poolWallet = poolInfo.tokenHandler.getWallet();
|
390
|
+
|
391
|
+
// IBundle.BundleInfo memory bundleInfo = reader.getBundleInfo(bundleNftId);
|
392
|
+
|
393
|
+
// determine withdrawn amount
|
394
|
+
withdrawnAmount = amount;
|
395
|
+
if (withdrawnAmount.gte(AmountLib.max())) {
|
396
|
+
withdrawnAmount = reader.getFeeAmount(bundleNftId);
|
397
|
+
} else {
|
398
|
+
if (withdrawnAmount.gt(reader.getFeeAmount(bundleNftId))) {
|
399
|
+
revert ErrorBundleServiceFeesWithdrawAmountExceedsLimit(withdrawnAmount, reader.getFeeAmount(bundleNftId));
|
400
|
+
}
|
401
|
+
}
|
297
402
|
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
{
|
306
|
-
// ensure policy is closeable
|
307
|
-
if (!instance.getInstanceReader().policyIsCloseable(policyNftId)) {
|
308
|
-
revert ErrorBundleServicePolicyNotCloseable(policyNftId);
|
403
|
+
// decrease fee counters by withdrawnAmount
|
404
|
+
{
|
405
|
+
InstanceStore store = instance.getInstanceStore();
|
406
|
+
// decrease fee amount of the bundle
|
407
|
+
_componentService.decreaseBundleBalance(store, bundleNftId, AmountLib.zero(), withdrawnAmount);
|
408
|
+
// decrease pool balance
|
409
|
+
_componentService.decreasePoolBalance(store, poolNftId, withdrawnAmount, AmountLib.zero());
|
309
410
|
}
|
310
411
|
|
311
|
-
|
412
|
+
// transfer amount to bundle owner
|
413
|
+
{
|
414
|
+
address owner = getRegistry().ownerOf(bundleNftId);
|
415
|
+
emit LogBundleServiceFeesWithdrawn(bundleNftId, owner, address(poolInfo.token), withdrawnAmount);
|
416
|
+
poolInfo.tokenHandler.distributeTokens(poolWallet, owner, withdrawnAmount);
|
417
|
+
}
|
418
|
+
}
|
419
|
+
|
420
|
+
function _getDomain() internal pure override returns(ObjectType) {
|
421
|
+
return BUNDLE();
|
312
422
|
}
|
313
423
|
}
|
@@ -1,12 +1,9 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {IVersionable} from "../
|
5
|
-
import {ProxyManager} from "../
|
4
|
+
import {IVersionable} from "../upgradeability/IVersionable.sol";
|
5
|
+
import {ProxyManager} from "../upgradeability/ProxyManager.sol";
|
6
6
|
import {BundleService} from "./BundleService.sol";
|
7
|
-
import {Registry} from "../registry/Registry.sol";
|
8
|
-
import {RegistryService} from "../registry/RegistryService.sol";
|
9
|
-
import {ObjectType, REGISTRY} from "../type/ObjectType.sol";
|
10
7
|
|
11
8
|
contract BundleServiceManager is ProxyManager {
|
12
9
|
|
@@ -14,29 +11,20 @@ contract BundleServiceManager is ProxyManager {
|
|
14
11
|
|
15
12
|
/// @dev initializes proxy manager with pool service implementation
|
16
13
|
constructor(
|
17
|
-
address
|
18
|
-
|
19
|
-
|
14
|
+
address authority,
|
15
|
+
address registry,
|
16
|
+
bytes32 salt
|
17
|
+
)
|
20
18
|
{
|
21
|
-
BundleService
|
22
|
-
bytes memory data = abi.encode(
|
23
|
-
IVersionable versionable =
|
24
|
-
|
25
|
-
|
19
|
+
BundleService svc = new BundleService{salt: salt}();
|
20
|
+
bytes memory data = abi.encode(registry, authority);
|
21
|
+
IVersionable versionable = initialize(
|
22
|
+
registry,
|
23
|
+
address(svc),
|
24
|
+
data,
|
25
|
+
salt);
|
26
26
|
|
27
27
|
_bundleService = BundleService(address(versionable));
|
28
|
-
|
29
|
-
// TODO `this` must have a role or own nft to register service
|
30
|
-
//Registry registry = Registry(registryAddress);
|
31
|
-
//address registryServiceAddress = registry.getServiceAddress(REGISTRY(), _bundleService.getMajorVersion());
|
32
|
-
//RegistryService registryService = RegistryService(registryServiceAddress);
|
33
|
-
//registryService.registerService(_poolService);
|
34
|
-
|
35
|
-
// TODO no nft to link yet
|
36
|
-
// link ownership of instance service manager ot nft owner of instance service
|
37
|
-
//_linkToNftOwnable(
|
38
|
-
// address(registryAddress),
|
39
|
-
// address(_poolService));
|
40
28
|
}
|
41
29
|
|
42
30
|
//--- view functions ----------------------------------------------------//
|