@etherisc/gif-next 0.0.2-d551b5e-892 → 0.0.2-d5b7b78-706
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +73 -1
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +4 -0
- package/artifacts/contracts/components/Component.sol/Component.json +832 -0
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +743 -168
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +4 -0
- package/artifacts/contracts/components/{BaseComponent.sol/BaseComponent.json → IComponent.sol/IComponent.json} +152 -100
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +743 -26
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +737 -58
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +582 -9
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +675 -258
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +525 -223
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +1 -1
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +15 -15
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +69 -79
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.json +5 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +1030 -394
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +246 -164
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +919 -1206
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +569 -198
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +120 -263
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +403 -369
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +295 -126
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +11 -40
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +4 -0
- package/artifacts/contracts/instance/base/{ComponentServiceBase.sol/ComponentServiceBase.json → ComponentService.sol/ComponentService.json} +197 -166
- package/artifacts/contracts/instance/base/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/KeyValueStore.sol/KeyValueStore.json +40 -10
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Lifecycle.sol/Lifecycle.json +36 -11
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +69 -43
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +4 -0
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.json +10 -0
- 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/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
- package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +968 -0
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +665 -0
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +1093 -0
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +661 -0
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +754 -0
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ClaimServiceManager.sol/ClaimServiceManager.json +637 -0
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionService.sol/DistributionService.json +1250 -202
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +450 -73
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +556 -0
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +630 -0
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/{IComponentOwnerService.sol/IComponentOwnerService.json → IClaimService.sol/IClaimService.json} +150 -207
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +727 -160
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +166 -290
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +75 -375
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +47 -201
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +393 -356
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +321 -96
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +253 -446
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +301 -92
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +218 -230
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +305 -76
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +15 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +244 -133
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +158 -215
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +18 -0
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +257 -235
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +285 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +202 -318
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +298 -145
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +547 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +141 -53
- package/artifacts/contracts/shared/ContractDeployerLib.sol/ContractDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +41 -3
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +40 -29
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +129 -0
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +21 -34
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/{experiment/inheritance/IB.sol/IB.json → shared/IRegistryLinked.sol/IRegistryLinked.json} +18 -20
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +31 -183
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +2 -152
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +120 -27
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +248 -0
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +294 -61
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +129 -51
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +84 -0
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +127 -170
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/shared/Versionable.sol/Versionable.json +2 -152
- package/artifacts/contracts/test/TestFee.sol/TestFee.dbg.json +1 -1
- package/artifacts/contracts/test/TestFee.sol/TestFee.json +2 -2
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.dbg.json +1 -1
- package/artifacts/contracts/test/TestRegisterable.sol/TestRegisterable.json +129 -51
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +6 -6
- package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
- package/artifacts/contracts/test/TestService.sol/TestService.json +148 -227
- package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersion.sol/TestVersion.json +2 -2
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +8 -190
- package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
- package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.json +2 -2
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.json +100 -0
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/types/Fee.sol/FeeLib.json +2 -2
- package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/types/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/NftId.sol/NftIdLib.json +17 -4
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
- package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.json +100 -0
- package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/types/Referral.sol/ReferralLib.json +23 -4
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +2 -2
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
- package/artifacts/contracts/types/Seconds.sol/SecondsLib.dbg.json +4 -0
- package/artifacts/contracts/types/Seconds.sol/SecondsLib.json +124 -0
- package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/StateId.sol/StateIdLib.json +2 -2
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +25 -7
- package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/MathLib.json +2 -2
- package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/UFixedLib.json +2 -2
- package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionLib.json +2 -2
- package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionPartLib.json +2 -2
- package/contracts/components/Component.sol +251 -0
- package/contracts/components/Distribution.sol +200 -83
- package/contracts/components/IComponent.sol +74 -0
- package/contracts/components/IDistributionComponent.sol +44 -17
- package/contracts/components/IPoolComponent.sol +88 -41
- package/contracts/components/IProductComponent.sol +10 -5
- package/contracts/components/Pool.sol +210 -178
- package/contracts/components/Product.sol +125 -124
- package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +2 -12
- package/contracts/instance/BundleManager.sol +14 -16
- package/contracts/instance/Cloneable.sol +7 -2
- package/contracts/instance/IInstance.sol +54 -14
- package/contracts/instance/IInstanceService.sol +43 -3
- package/contracts/instance/Instance.sol +129 -262
- package/contracts/instance/InstanceAccessManager.sol +410 -176
- package/contracts/instance/InstanceReader.sol +9 -34
- package/contracts/instance/InstanceService.sol +404 -161
- package/contracts/instance/InstanceServiceManager.sol +6 -9
- package/contracts/instance/ObjectManager.sol +10 -29
- package/contracts/instance/base/ComponentService.sol +134 -0
- package/contracts/instance/base/KeyValueStore.sol +5 -2
- package/contracts/instance/base/Lifecycle.sol +11 -2
- package/contracts/instance/module/IAccess.sol +36 -20
- package/contracts/instance/module/IBundle.sol +2 -1
- package/contracts/instance/module/IComponents.sol +35 -0
- package/contracts/instance/module/IDistribution.sol +2 -0
- package/contracts/instance/module/IPolicy.sol +30 -3
- package/contracts/instance/module/ISetup.sol +7 -20
- package/contracts/instance/service/ApplicationService.sol +350 -0
- package/contracts/instance/service/ApplicationServiceManager.sol +35 -0
- package/contracts/instance/service/BundleService.sol +336 -0
- package/contracts/instance/service/BundleServiceManager.sol +51 -0
- package/contracts/instance/service/ClaimService.sol +151 -0
- package/contracts/instance/service/ClaimServiceManager.sol +35 -0
- package/contracts/instance/service/DistributionService.sol +397 -48
- package/contracts/instance/service/DistributionServiceManager.sol +7 -10
- package/contracts/instance/service/IApplicationService.sol +82 -0
- package/contracts/instance/service/IBundleService.sol +62 -0
- package/contracts/instance/service/IClaimService.sol +61 -0
- package/contracts/instance/service/IDistributionService.sol +86 -0
- package/contracts/instance/service/IPolicyService.sol +38 -53
- package/contracts/instance/service/IPoolService.sol +19 -35
- package/contracts/instance/service/IProductService.sol +2 -2
- package/contracts/instance/service/PolicyService.sol +207 -317
- package/contracts/instance/service/PolicyServiceManager.sol +2 -2
- package/contracts/instance/service/PoolService.sol +133 -230
- package/contracts/instance/service/PoolServiceManager.sol +6 -9
- package/contracts/instance/service/ProductService.sol +108 -40
- package/contracts/instance/service/ProductServiceManager.sol +2 -2
- package/contracts/registry/ChainNft.sol +9 -1
- package/contracts/registry/IRegistry.sol +39 -19
- package/contracts/registry/IRegistryService.sol +30 -13
- package/contracts/registry/ITransferInterceptor.sol +1 -0
- package/contracts/registry/Registry.sol +243 -224
- package/contracts/registry/RegistryAccessManager.sol +216 -0
- package/contracts/registry/RegistryService.sol +96 -171
- package/contracts/registry/RegistryServiceManager.sol +21 -39
- package/contracts/registry/ReleaseManager.sol +322 -0
- package/contracts/registry/TokenRegistry.sol +22 -17
- package/contracts/shared/ERC165.sol +14 -12
- package/contracts/shared/INftOwnable.sol +11 -10
- package/contracts/shared/IPolicyHolder.sol +26 -0
- package/contracts/shared/IRegisterable.sol +4 -6
- package/contracts/shared/IRegistryLinked.sol +12 -0
- package/contracts/shared/IService.sol +4 -1
- package/contracts/shared/IVersionable.sol +4 -47
- package/contracts/shared/NftOwnable.sol +66 -80
- package/contracts/shared/PolicyHolder.sol +81 -0
- package/contracts/shared/ProxyManager.sol +100 -25
- package/contracts/shared/Registerable.sol +16 -32
- package/contracts/shared/RegistryLinked.sol +48 -0
- package/contracts/shared/Service.sol +25 -22
- package/contracts/shared/TokenHandler.sol +11 -5
- package/contracts/shared/Versionable.sol +4 -92
- package/contracts/test/TestRegisterable.sol +1 -1
- package/contracts/test/TestService.sol +4 -3
- package/contracts/types/Blocknumber.sol +1 -0
- package/contracts/types/ClaimId.sol +52 -0
- package/contracts/types/DistributorType.sol +2 -2
- package/contracts/types/Fee.sol +1 -0
- package/contracts/types/NftId.sol +8 -0
- package/contracts/types/ObjectType.sol +10 -5
- package/contracts/types/PayoutId.sol +54 -0
- package/contracts/types/Referral.sol +4 -0
- package/contracts/types/RoleId.sol +26 -20
- package/contracts/types/Seconds.sol +54 -0
- package/contracts/types/StateId.sol +1 -0
- package/contracts/types/Timestamp.sol +13 -13
- package/contracts/types/UFixed.sol +1 -0
- package/contracts/types/Version.sol +1 -0
- package/package.json +3 -3
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.json +0 -368
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.dbg.json +0 -4
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Cloner.json +0 -66
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.dbg.json +0 -4
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock1.json +0 -24
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.dbg.json +0 -4
- package/artifacts/contracts/experiment/cloning/Cloner.sol/Mock2.json +0 -42
- package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +0 -4
- package/artifacts/contracts/experiment/errors/Require.sol/Require.json +0 -105
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +0 -4
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.json +0 -105
- package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/A.sol/A.json +0 -128
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.json +0 -42
- package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/B.sol/B.json +0 -76
- package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/C.sol/C.json +0 -89
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.json +0 -128
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.json +0 -37
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.json +0 -63
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/Dummy.sol/LifeCycleModule.json +0 -59
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISM.json +0 -124
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/ISM.sol/ISMEE.json +0 -74
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/SM.sol/SM.json +0 -124
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.dbg.json +0 -4
- package/artifacts/contracts/experiment/statemachine/SimpleStateMachine.sol/SimpleStateMachine.json +0 -207
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +0 -4
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.json +0 -10
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +0 -4
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.json +0 -10
- package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.dbg.json +0 -4
- package/artifacts/contracts/instance/IAccessManagerSimple.sol/IAccessManagerSimple.json +0 -1082
- package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.json +0 -448
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.json +0 -763
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +0 -113
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +0 -827
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.dbg.json +0 -4
- package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.json +0 -442
- package/contracts/components/BaseComponent.sol +0 -132
- package/contracts/components/IBaseComponent.sol +0 -31
- package/contracts/experiment/cloning/Cloner.sol +0 -47
- package/contracts/experiment/errors/Require.sol +0 -38
- package/contracts/experiment/errors/Revert.sol +0 -44
- package/contracts/experiment/inheritance/A.sol +0 -53
- package/contracts/experiment/inheritance/B.sol +0 -28
- package/contracts/experiment/inheritance/C.sol +0 -34
- package/contracts/experiment/inheritance/IA.sol +0 -13
- package/contracts/experiment/inheritance/IB.sol +0 -10
- package/contracts/experiment/inheritance/IC.sol +0 -12
- package/contracts/experiment/statemachine/Dummy.sol +0 -27
- package/contracts/experiment/statemachine/ISM.sol +0 -25
- package/contracts/experiment/statemachine/SM.sol +0 -57
- package/contracts/experiment/statemachine/SimpleStateMachine.sol +0 -31
- package/contracts/experiment/types/TypeA.sol +0 -47
- package/contracts/experiment/types/TypeB.sol +0 -29
- package/contracts/instance/IAccessManagerSimple.sol +0 -391
- package/contracts/instance/IInstanceBase.sol +0 -26
- package/contracts/instance/InstanceBase.sol +0 -41
- package/contracts/instance/base/ComponentServiceBase.sol +0 -72
- package/contracts/instance/base/IInstanceBase.sol +0 -23
- package/contracts/instance/service/ComponentOwnerService.sol +0 -317
- package/contracts/instance/service/IComponentOwnerService.sol +0 -20
- package/contracts/shared/RegisterableUpgradable.sol +0 -16
@@ -16,7 +16,7 @@ contract PolicyServiceManager is ProxyManager {
|
|
16
16
|
constructor(
|
17
17
|
address registryAddress
|
18
18
|
)
|
19
|
-
ProxyManager()
|
19
|
+
ProxyManager(registryAddress)
|
20
20
|
{
|
21
21
|
PolicyService svc = new PolicyService();
|
22
22
|
bytes memory data = abi.encode(registryAddress, address(this));
|
@@ -39,7 +39,7 @@ contract PolicyServiceManager is ProxyManager {
|
|
39
39
|
// address(_productService));
|
40
40
|
|
41
41
|
// implies that after this constructor call only upgrade functionality is available
|
42
|
-
_isDeployed = true;
|
42
|
+
// _isDeployed = true;
|
43
43
|
}
|
44
44
|
|
45
45
|
//--- view functions ----------------------------------------------------//
|
@@ -6,41 +6,42 @@ import {IRegistry} from "../../registry/IRegistry.sol";
|
|
6
6
|
import {IInstance} from "../../instance/IInstance.sol";
|
7
7
|
import {IBundle} from "../../instance/module/IBundle.sol";
|
8
8
|
import {TokenHandler} from "../../instance/module/ITreasury.sol";
|
9
|
-
import {
|
9
|
+
import {IComponents} from "../module/IComponents.sol";
|
10
10
|
import {IPolicy} from "../module/IPolicy.sol";
|
11
11
|
|
12
12
|
import {IVersionable} from "../../shared/IVersionable.sol";
|
13
13
|
import {Versionable} from "../../shared/Versionable.sol";
|
14
14
|
import {INftOwnable} from "../../shared/INftOwnable.sol";
|
15
15
|
|
16
|
+
import {Fee, FeeLib} from "../../types/Fee.sol";
|
16
17
|
import {NftId, NftIdLib, zeroNftId} from "../../types/NftId.sol";
|
17
|
-
import {POOL, BUNDLE} from "../../types/ObjectType.sol";
|
18
|
-
import {POOL_OWNER_ROLE, RoleId} from "../../types/RoleId.sol";
|
18
|
+
import {ObjectType, POOL, BUNDLE} from "../../types/ObjectType.sol";
|
19
|
+
import {PUBLIC_ROLE, POOL_OWNER_ROLE, POLICY_SERVICE_ROLE, RoleId} from "../../types/RoleId.sol";
|
19
20
|
import {Fee, FeeLib} from "../../types/Fee.sol";
|
20
21
|
import {Version, VersionLib} from "../../types/Version.sol";
|
21
22
|
import {KEEP_STATE, StateId} from "../../types/StateId.sol";
|
22
23
|
import {TimestampLib, zeroTimestamp} from "../../types/Timestamp.sol";
|
24
|
+
import {Version, VersionLib} from "../../types/Version.sol";
|
23
25
|
|
24
26
|
import {IService} from "../../shared/IService.sol";
|
25
27
|
import {Service} from "../../shared/Service.sol";
|
26
28
|
import {BundleManager} from "../BundleManager.sol";
|
27
|
-
import {
|
29
|
+
import {ComponentService} from "../base/ComponentService.sol";
|
28
30
|
import {IPoolService} from "./IPoolService.sol";
|
29
31
|
import {IRegistryService} from "../../registry/IRegistryService.sol";
|
30
32
|
import {InstanceService} from "../InstanceService.sol";
|
31
33
|
import {InstanceReader} from "../InstanceReader.sol";
|
32
|
-
import {
|
34
|
+
import {IComponent} from "../../components/IComponent.sol";
|
35
|
+
import {IPoolComponent} from "../../components/IPoolComponent.sol";
|
33
36
|
|
34
37
|
string constant POOL_SERVICE_NAME = "PoolService";
|
35
38
|
|
36
39
|
contract PoolService is
|
37
|
-
|
40
|
+
ComponentService,
|
38
41
|
IPoolService
|
39
42
|
{
|
40
43
|
using NftIdLib for NftId;
|
41
44
|
|
42
|
-
string public constant NAME = "PoolService";
|
43
|
-
|
44
45
|
address internal _registryAddress;
|
45
46
|
|
46
47
|
function _initialize(
|
@@ -56,262 +57,164 @@ contract PoolService is
|
|
56
57
|
(registryAddress, initialOwner) = abi.decode(data, (address, address));
|
57
58
|
// TODO while PoolService is not deployed in PoolServiceManager constructor
|
58
59
|
// owner is PoolServiceManager deployer
|
59
|
-
|
60
|
-
|
61
|
-
_registerInterface(type(IPoolService).interfaceId);
|
60
|
+
initializeService(registryAddress, owner);
|
61
|
+
registerInterface(type(IPoolService).interfaceId);
|
62
62
|
}
|
63
63
|
|
64
|
-
function
|
65
|
-
return
|
64
|
+
function getDomain() public pure override(Service, IService) returns(ObjectType) {
|
65
|
+
return POOL();
|
66
66
|
}
|
67
67
|
|
68
|
-
function register(address poolAddress)
|
68
|
+
/*function register(address poolAddress)
|
69
69
|
external
|
70
70
|
returns(NftId poolNftId)
|
71
71
|
{
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
)
|
101
|
-
|
102
|
-
|
103
|
-
|
72
|
+
(
|
73
|
+
IComponent component,
|
74
|
+
address owner,
|
75
|
+
IInstance instance,
|
76
|
+
NftId instanceNftId
|
77
|
+
) = _checkComponentForRegistration(
|
78
|
+
poolAddress,
|
79
|
+
POOL(),
|
80
|
+
POOL_OWNER_ROLE());
|
81
|
+
|
82
|
+
IPoolComponent pool = IPoolComponent(poolAddress);
|
83
|
+
IRegistry.ObjectInfo memory registryInfo = getRegistryService().registerPool(pool, owner);
|
84
|
+
pool.linkToRegisteredNftId();
|
85
|
+
poolNftId = registryInfo.nftId;
|
86
|
+
|
87
|
+
instance.createPoolSetup(poolNftId, pool.getSetupInfo());
|
88
|
+
|
89
|
+
bytes4[][] memory selectors = new bytes4[][](2);
|
90
|
+
selectors[0] = new bytes4[](1);
|
91
|
+
selectors[1] = new bytes4[](1);
|
92
|
+
|
93
|
+
selectors[0][0] = IPoolComponent.setFees.selector;
|
94
|
+
selectors[1][0] = IPoolComponent.verifyApplication.selector;
|
95
|
+
|
96
|
+
RoleId[] memory roles = new RoleId[](2);
|
97
|
+
roles[0] = POOL_OWNER_ROLE();
|
98
|
+
roles[1] = POLICY_SERVICE_ROLE();
|
99
|
+
|
100
|
+
getInstanceService().createGifTarget(
|
101
|
+
instanceNftId,
|
102
|
+
poolAddress,
|
103
|
+
pool.getName(),
|
104
|
+
selectors,
|
105
|
+
roles);
|
106
|
+
}*/
|
104
107
|
|
105
|
-
function
|
106
|
-
Fee memory poolFee,
|
107
|
-
Fee memory stakingFee,
|
108
|
-
Fee memory performanceFee
|
109
|
-
)
|
108
|
+
function register(address poolAddress)
|
110
109
|
external
|
111
|
-
|
110
|
+
returns(NftId poolNftId)
|
112
111
|
{
|
113
|
-
(
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
112
|
+
(
|
113
|
+
IComponent component,
|
114
|
+
address owner,
|
115
|
+
IInstance instance,
|
116
|
+
NftId instanceNftId
|
117
|
+
) = _checkComponentForRegistration(
|
118
|
+
poolAddress,
|
119
|
+
POOL(),
|
120
|
+
POOL_OWNER_ROLE());
|
121
|
+
|
122
|
+
IPoolComponent pool = IPoolComponent(poolAddress);
|
123
|
+
IRegistry.ObjectInfo memory registryInfo = getRegistryService().registerPool(pool, owner);
|
124
|
+
pool.linkToRegisteredNftId();
|
125
|
+
poolNftId = registryInfo.nftId;
|
126
|
+
|
127
|
+
// amend component info with pool specific token handler
|
128
|
+
IComponents.ComponentInfo memory componentInfo = pool.getComponentInfo();
|
129
|
+
componentInfo.tokenHandler = new TokenHandler(address(componentInfo.token));
|
130
|
+
|
131
|
+
// save amended component info with instance
|
132
|
+
instance.createPoolSetup(poolNftId, componentInfo);
|
133
|
+
|
134
|
+
bytes4[][] memory selectors = new bytes4[][](2);
|
135
|
+
selectors[0] = new bytes4[](1);
|
136
|
+
selectors[1] = new bytes4[](1);
|
137
|
+
|
138
|
+
selectors[0][0] = IPoolComponent.setFees.selector;
|
139
|
+
selectors[1][0] = IPoolComponent.verifyApplication.selector;
|
140
|
+
|
141
|
+
RoleId[] memory roles = new RoleId[](2);
|
142
|
+
roles[0] = POOL_OWNER_ROLE();
|
143
|
+
roles[1] = POLICY_SERVICE_ROLE();
|
144
|
+
|
145
|
+
getInstanceService().createGifTarget(
|
146
|
+
instanceNftId,
|
147
|
+
poolAddress,
|
148
|
+
pool.getName(),
|
149
|
+
selectors,
|
150
|
+
roles);
|
123
151
|
}
|
124
152
|
|
125
|
-
function createBundle(
|
126
|
-
address owner,
|
127
|
-
Fee memory fee,
|
128
|
-
uint256 stakingAmount,
|
129
|
-
uint256 lifetime,
|
130
|
-
bytes calldata filter
|
131
|
-
)
|
132
|
-
external
|
133
|
-
override
|
134
|
-
returns(NftId bundleNftId)
|
135
|
-
{
|
136
|
-
(IRegistry.ObjectInfo memory info, IInstance instance) = _getAndVerifyComponentInfoAndInstance(POOL());
|
137
|
-
InstanceReader instanceReader = instance.getInstanceReader();
|
138
|
-
NftId poolNftId = info.nftId;
|
139
|
-
|
140
|
-
IBundle.BundleInfo memory bundleInfo = IBundle.BundleInfo(
|
141
|
-
poolNftId,
|
142
|
-
fee,
|
143
|
-
filter,
|
144
|
-
stakingAmount,
|
145
|
-
0,
|
146
|
-
stakingAmount,
|
147
|
-
lifetime,
|
148
|
-
zeroTimestamp(),
|
149
|
-
zeroTimestamp()
|
150
|
-
);
|
151
|
-
|
152
|
-
// register bundle with registry
|
153
|
-
bundleNftId = getRegistryService().registerBundle(
|
154
|
-
IRegistry.ObjectInfo(
|
155
|
-
zeroNftId(),
|
156
|
-
poolNftId,
|
157
|
-
BUNDLE(),
|
158
|
-
false, // intercepting property for bundles is defined on pool
|
159
|
-
address(0),
|
160
|
-
owner,
|
161
|
-
abi.encode(bundleInfo)
|
162
|
-
)
|
163
|
-
);
|
164
|
-
|
165
|
-
// create bundle info in instance
|
166
|
-
instance.createBundle(bundleNftId, bundleInfo);
|
167
|
-
|
168
|
-
BundleManager bundleManager = instance.getBundleManager();
|
169
|
-
bundleManager.add(bundleNftId);
|
170
|
-
|
171
|
-
_processStakingByTreasury(
|
172
|
-
instanceReader,
|
173
|
-
poolNftId,
|
174
|
-
bundleNftId,
|
175
|
-
stakingAmount);
|
176
|
-
|
177
|
-
// TODO add logging
|
178
|
-
}
|
179
153
|
|
180
|
-
function
|
181
|
-
NftId bundleNftId,
|
182
|
-
Fee memory fee
|
183
|
-
)
|
154
|
+
function setMaxCapitalAmount(uint256 maxCapitalAmount)
|
184
155
|
external
|
185
|
-
|
156
|
+
virtual
|
186
157
|
{
|
187
|
-
(IRegistry.ObjectInfo memory
|
158
|
+
(IRegistry.ObjectInfo memory registryInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(POOL());
|
188
159
|
InstanceReader instanceReader = instance.getInstanceReader();
|
189
|
-
NftId poolNftId =
|
190
|
-
|
191
|
-
IBundle.BundleInfo memory bundleInfo = instanceReader.getBundleInfo(bundleNftId);
|
192
|
-
require(bundleInfo.poolNftId.gtz(), "ERROR:PLS-010:BUNDLE_UNKNOWN");
|
193
|
-
require(poolNftId == bundleInfo.poolNftId, "ERROR:PLS-011:BUNDLE_POOL_MISMATCH");
|
194
|
-
|
195
|
-
bundleInfo.fee = fee;
|
160
|
+
NftId poolNftId = registryInfo.nftId;
|
196
161
|
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
function updateBundle(NftId instanceNftId, NftId bundleNftId, IBundle.BundleInfo memory bundleInfo, StateId state)
|
201
|
-
external
|
202
|
-
onlyService
|
203
|
-
{
|
204
|
-
IRegistry.ObjectInfo memory instanceInfo = getRegistry().getObjectInfo(instanceNftId);
|
205
|
-
IInstance instance = IInstance(instanceInfo.objectAddress);
|
206
|
-
instance.updateBundle(bundleNftId, bundleInfo, state);
|
207
|
-
}
|
162
|
+
IComponents.ComponentInfo memory componentInfo = instanceReader.getComponentInfo(poolNftId);
|
163
|
+
IComponents.PoolInfo memory poolInfo = abi.decode(componentInfo.data, (IComponents.PoolInfo));
|
164
|
+
uint256 previousMaxCapitalAmount = poolInfo.maxCapitalAmount;
|
208
165
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
(, IInstance instance) = _getAndVerifyComponentInfoAndInstance(POOL());
|
213
|
-
BundleManager bundleManager = instance.getBundleManager();
|
214
|
-
bundleManager.lock(bundleNftId);
|
215
|
-
}
|
166
|
+
poolInfo.maxCapitalAmount = maxCapitalAmount;
|
167
|
+
componentInfo.data = abi.encode(poolInfo);
|
168
|
+
instance.updatePoolSetup(poolNftId, componentInfo, KEEP_STATE());
|
216
169
|
|
217
|
-
|
218
|
-
external
|
219
|
-
{
|
220
|
-
(, IInstance instance) = _getAndVerifyComponentInfoAndInstance(POOL());
|
221
|
-
BundleManager bundleManager = instance.getBundleManager();
|
222
|
-
bundleManager.unlock(bundleNftId);
|
170
|
+
emit LogPoolServiceMaxCapitalAmountUpdated(poolNftId, previousMaxCapitalAmount, maxCapitalAmount);
|
223
171
|
}
|
224
172
|
|
225
|
-
function
|
226
|
-
NftId policyNftId,
|
227
|
-
NftId bundleNftId,
|
228
|
-
uint256 collateralAmount,
|
229
|
-
uint256 netPremiumAmount
|
230
|
-
)
|
173
|
+
function setBundleOwnerRole(RoleId bundleOwnerRole)
|
231
174
|
external
|
232
|
-
|
175
|
+
virtual
|
233
176
|
{
|
177
|
+
(IRegistry.ObjectInfo memory registryInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(POOL());
|
234
178
|
InstanceReader instanceReader = instance.getInstanceReader();
|
235
|
-
|
179
|
+
NftId poolNftId = registryInfo.nftId;
|
236
180
|
|
237
|
-
|
238
|
-
|
239
|
-
bundleInfo.balanceAmount += netPremiumAmount;
|
181
|
+
IComponents.ComponentInfo memory componentInfo = instanceReader.getComponentInfo(poolNftId);
|
182
|
+
IComponents.PoolInfo memory poolInfo = abi.decode(componentInfo.data, (IComponents.PoolInfo));
|
240
183
|
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
184
|
+
// bundle owner role may only be set once per pool
|
185
|
+
if(poolInfo.bundleOwnerRole != PUBLIC_ROLE()) {
|
186
|
+
revert ErrorPoolServiceBundleOwnerRoleAlreadySet(poolNftId);
|
187
|
+
}
|
245
188
|
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
onlyService
|
250
|
-
{
|
251
|
-
InstanceReader instanceReader = instance.getInstanceReader();
|
252
|
-
IPolicy.PolicyInfo memory policyInfo = instanceReader.getPolicyInfo(policyNftId);
|
189
|
+
poolInfo.bundleOwnerRole = bundleOwnerRole;
|
190
|
+
componentInfo.data = abi.encode(poolInfo);
|
191
|
+
instance.updatePoolSetup(poolNftId, componentInfo, KEEP_STATE());
|
253
192
|
|
254
|
-
|
255
|
-
if (policyInfo.activatedAt.gtz()) {
|
256
|
-
revert BundleManager.ErrorBundleManagerErrorPolicyAlreadyActivated(policyNftId);
|
257
|
-
}
|
258
|
-
|
259
|
-
BundleManager bundleManager = instance.getBundleManager();
|
260
|
-
bundleManager.linkPolicy(policyNftId);
|
193
|
+
emit LogPoolServiceBundleOwnerRoleSet(poolNftId, bundleOwnerRole);
|
261
194
|
}
|
262
195
|
|
263
|
-
|
264
|
-
function
|
265
|
-
|
266
|
-
|
196
|
+
|
197
|
+
function setFees(
|
198
|
+
Fee memory poolFee,
|
199
|
+
Fee memory stakingFee,
|
200
|
+
Fee memory performanceFee
|
201
|
+
)
|
202
|
+
external
|
203
|
+
virtual
|
267
204
|
{
|
205
|
+
(IRegistry.ObjectInfo memory registryInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(POOL());
|
268
206
|
InstanceReader instanceReader = instance.getInstanceReader();
|
269
|
-
|
207
|
+
NftId poolNftId = registryInfo.nftId;
|
270
208
|
|
271
|
-
|
272
|
-
|
273
|
-
revert BundleManager.ErrorBundleManagerPolicyWithOpenClaims(
|
274
|
-
policyNftId,
|
275
|
-
policyInfo.openClaimsCount);
|
276
|
-
}
|
209
|
+
IComponents.ComponentInfo memory componentInfo = instanceReader.getComponentInfo(poolNftId);
|
210
|
+
IComponents.PoolInfo memory poolInfo = abi.decode(componentInfo.data, (IComponents.PoolInfo));
|
277
211
|
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
}
|
284
|
-
|
285
|
-
BundleManager bundleManager = instance.getBundleManager();
|
286
|
-
bundleManager.unlinkPolicy(policyNftId);
|
287
|
-
}
|
212
|
+
poolInfo.poolFee = poolFee;
|
213
|
+
poolInfo.stakingFee = stakingFee;
|
214
|
+
poolInfo.performanceFee = performanceFee;
|
215
|
+
componentInfo.data = abi.encode(poolInfo);
|
216
|
+
instance.updatePoolSetup(poolNftId, componentInfo, KEEP_STATE());
|
288
217
|
|
289
|
-
|
290
|
-
InstanceReader instanceReader,
|
291
|
-
NftId poolNftId,
|
292
|
-
NftId bundleNftId,
|
293
|
-
uint256 stakingAmount
|
294
|
-
)
|
295
|
-
internal
|
296
|
-
{
|
297
|
-
// process token transfer(s)
|
298
|
-
if(stakingAmount > 0) {
|
299
|
-
ISetup.PoolSetupInfo memory poolInfo = instanceReader.getPoolSetupInfo(poolNftId);
|
300
|
-
TokenHandler tokenHandler = poolInfo.tokenHandler;
|
301
|
-
address bundleOwner = getRegistry().ownerOf(bundleNftId);
|
302
|
-
Fee memory stakingFee = poolInfo.stakingFee;
|
303
|
-
|
304
|
-
tokenHandler.transfer(
|
305
|
-
bundleOwner,
|
306
|
-
poolInfo.wallet,
|
307
|
-
stakingAmount
|
308
|
-
);
|
309
|
-
|
310
|
-
|
311
|
-
if (! FeeLib.feeIsZero(stakingFee)) {
|
312
|
-
(uint256 stakingFeeAmount, uint256 netAmount) = FeeLib.calculateFee(stakingFee, stakingAmount);
|
313
|
-
// TODO: track staking fees in pool's state (issue #177)
|
314
|
-
}
|
315
|
-
}
|
218
|
+
// TODO add logging
|
316
219
|
}
|
317
220
|
}
|
@@ -6,7 +6,7 @@ import {ProxyManager} from "../../shared/ProxyManager.sol";
|
|
6
6
|
import {PoolService} from "./PoolService.sol";
|
7
7
|
import {Registry} from "../../registry/Registry.sol";
|
8
8
|
import {RegistryService} from "../../registry/RegistryService.sol";
|
9
|
-
import {
|
9
|
+
import {REGISTRY} from "../../types/ObjectType.sol";
|
10
10
|
|
11
11
|
contract PoolServiceManager is ProxyManager {
|
12
12
|
|
@@ -16,7 +16,7 @@ contract PoolServiceManager is ProxyManager {
|
|
16
16
|
constructor(
|
17
17
|
address registryAddress
|
18
18
|
)
|
19
|
-
ProxyManager()
|
19
|
+
ProxyManager(registryAddress)
|
20
20
|
{
|
21
21
|
PoolService poolSrv = new PoolService();
|
22
22
|
bytes memory data = abi.encode(registryAddress, address(this));
|
@@ -26,10 +26,10 @@ contract PoolServiceManager is ProxyManager {
|
|
26
26
|
|
27
27
|
_poolService = PoolService(address(versionable));
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
//
|
29
|
+
// TODO `this` must have a role or own nft to register service
|
30
|
+
//Registry registry = Registry(registryAddress);
|
31
|
+
//address registryServiceAddress = registry.getServiceAddress(REGISTRY(), _poolService.getMajorVersion());
|
32
|
+
//RegistryService registryService = RegistryService(registryServiceAddress);
|
33
33
|
//registryService.registerService(_poolService);
|
34
34
|
|
35
35
|
// TODO no nft to link yet
|
@@ -37,9 +37,6 @@ contract PoolServiceManager is ProxyManager {
|
|
37
37
|
//_linkToNftOwnable(
|
38
38
|
// address(registryAddress),
|
39
39
|
// address(_poolService));
|
40
|
-
|
41
|
-
// implies that after this constructor call only upgrade functionality is available
|
42
|
-
_isDeployed = true;
|
43
40
|
}
|
44
41
|
|
45
42
|
//--- view functions ----------------------------------------------------//
|