@etherisc/gif-next 0.0.2-f7eda15-119 → 0.0.2-f831797-539
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 +1 -1
- package/artifacts/contracts/components/Component.sol/Component.json +252 -94
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +611 -159
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IComponent.sol/IComponent.json +104 -72
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +311 -108
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +331 -164
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +108 -144
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +553 -185
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +356 -166
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +30 -11
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +722 -422
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +94 -171
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +911 -779
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +39 -89
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +119 -216
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +276 -254
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +319 -99
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +2 -2
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.json +118 -169
- 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 +13 -13
- 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 +1 -1
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +306 -315
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +305 -93
- 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 +1207 -255
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +449 -85
- 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 +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +155 -240
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.json +409 -0
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +711 -139
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +60 -286
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +81 -147
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +22 -169
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +185 -391
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +311 -127
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +214 -204
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +306 -90
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +142 -221
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +302 -90
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +15 -2
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +83 -174
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +28 -15
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +2 -2
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +193 -216
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +300 -94
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +11 -11
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +141 -37
- 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 -29
- 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 +22 -169
- 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 +113 -33
- 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 -74
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +125 -55
- 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 +113 -164
- 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 +125 -55
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.dbg.json +1 -1
- package/artifacts/contracts/test/TestRoleId.sol/TestRoleId.json +2 -2
- package/artifacts/contracts/test/TestService.sol/TestService.dbg.json +1 -1
- package/artifacts/contracts/test/TestService.sol/TestService.json +134 -221
- 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 +103 -78
- package/contracts/components/Distribution.sol +187 -57
- package/contracts/components/IComponent.sol +48 -17
- package/contracts/components/IDistributionComponent.sol +39 -15
- package/contracts/components/IPoolComponent.sol +84 -31
- package/contracts/components/IProductComponent.sol +3 -2
- package/contracts/components/Pool.sol +217 -145
- package/contracts/components/Product.sol +97 -69
- package/contracts/instance/BundleManager.sol +7 -5
- package/contracts/instance/IInstance.sol +24 -3
- package/contracts/instance/IInstanceService.sol +20 -1
- package/contracts/instance/Instance.sol +65 -39
- package/contracts/instance/InstanceAccessManager.sol +12 -13
- package/contracts/instance/InstanceReader.sol +4 -3
- package/contracts/instance/InstanceService.sol +111 -57
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/base/ComponentService.sol +1 -1
- package/contracts/instance/base/KeyValueStore.sol +5 -2
- package/contracts/instance/base/Lifecycle.sol +11 -2
- package/contracts/instance/module/IAccess.sol +3 -4
- 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 +82 -39
- package/contracts/instance/service/BundleServiceManager.sol +1 -1
- package/contracts/instance/service/ClaimService.sol +151 -0
- package/contracts/instance/service/ClaimServiceManager.sol +35 -0
- package/contracts/instance/service/DistributionService.sol +360 -16
- package/contracts/instance/service/DistributionServiceManager.sol +1 -1
- package/contracts/instance/service/IApplicationService.sol +82 -0
- package/contracts/instance/service/IBundleService.sol +30 -12
- package/contracts/instance/service/IClaimService.sol +61 -0
- package/contracts/instance/service/IDistributionService.sol +86 -0
- package/contracts/instance/service/IPolicyService.sol +27 -49
- package/contracts/instance/service/IPoolService.sol +17 -2
- package/contracts/instance/service/PolicyService.sol +148 -283
- package/contracts/instance/service/PolicyServiceManager.sol +2 -2
- package/contracts/instance/service/PoolService.sol +75 -22
- package/contracts/instance/service/PoolServiceManager.sol +1 -1
- package/contracts/instance/service/ProductService.sol +10 -11
- package/contracts/instance/service/ProductServiceManager.sol +2 -2
- package/contracts/registry/IRegistry.sol +3 -2
- package/contracts/registry/IRegistryService.sol +10 -8
- package/contracts/registry/Registry.sol +20 -8
- package/contracts/registry/RegistryService.sol +69 -48
- package/contracts/registry/RegistryServiceManager.sol +13 -13
- package/contracts/registry/ReleaseManager.sol +18 -28
- package/contracts/registry/TokenRegistry.sol +16 -12
- 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 +3 -3
- package/contracts/shared/IRegistryLinked.sol +12 -0
- package/contracts/shared/IService.sol +2 -0
- package/contracts/shared/IVersionable.sol +4 -47
- package/contracts/shared/NftOwnable.sol +66 -85
- package/contracts/shared/PolicyHolder.sol +81 -0
- package/contracts/shared/ProxyManager.sol +100 -25
- package/contracts/shared/Registerable.sol +7 -19
- package/contracts/shared/RegistryLinked.sol +48 -0
- package/contracts/shared/Service.sol +15 -17
- 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 +1 -1
- 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 +10 -5
- 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/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/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
@@ -6,20 +6,20 @@ 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
18
|
import {ObjectType, POOL, BUNDLE} from "../../types/ObjectType.sol";
|
18
|
-
import {POOL_OWNER_ROLE,
|
19
|
-
import {
|
20
|
-
import {Version, VersionLib} from "../../types/Version.sol";
|
21
|
-
import {KEEP_STATE, StateId} from "../../types/StateId.sol";
|
19
|
+
import {RoleId, POOL_OWNER_ROLE, PUBLIC_ROLE} from "../../types/RoleId.sol";
|
20
|
+
import {StateId, KEEP_STATE} from "../../types/StateId.sol";
|
22
21
|
import {TimestampLib, zeroTimestamp} from "../../types/Timestamp.sol";
|
22
|
+
import {Version, VersionLib} from "../../types/Version.sol";
|
23
23
|
|
24
24
|
import {IService} from "../../shared/IService.sol";
|
25
25
|
import {Service} from "../../shared/Service.sol";
|
@@ -55,9 +55,8 @@ contract PoolService is
|
|
55
55
|
(registryAddress, initialOwner) = abi.decode(data, (address, address));
|
56
56
|
// TODO while PoolService is not deployed in PoolServiceManager constructor
|
57
57
|
// owner is PoolServiceManager deployer
|
58
|
-
|
59
|
-
|
60
|
-
_registerInterface(type(IPoolService).interfaceId);
|
58
|
+
initializeService(registryAddress, owner);
|
59
|
+
registerInterface(type(IPoolService).interfaceId);
|
61
60
|
}
|
62
61
|
|
63
62
|
function getDomain() public pure override(Service, IService) returns(ObjectType) {
|
@@ -79,32 +78,86 @@ contract PoolService is
|
|
79
78
|
POOL_OWNER_ROLE());
|
80
79
|
|
81
80
|
IPoolComponent pool = IPoolComponent(poolAddress);
|
82
|
-
IRegistry.ObjectInfo memory
|
81
|
+
IRegistry.ObjectInfo memory registryInfo = getRegistryService().registerPool(pool, owner);
|
83
82
|
pool.linkToRegisteredNftId();
|
84
|
-
poolNftId =
|
83
|
+
poolNftId = registryInfo.nftId;
|
84
|
+
|
85
|
+
// amend component info with pool specific token handler
|
86
|
+
IComponents.ComponentInfo memory componentInfo = pool.getComponentInfo();
|
87
|
+
componentInfo.tokenHandler = new TokenHandler(address(componentInfo.token));
|
88
|
+
|
89
|
+
// save amended component info with instance
|
90
|
+
instance.createPoolSetup(poolNftId, componentInfo);
|
85
91
|
|
86
|
-
instance.createPoolSetup(poolNftId, pool.getSetupInfo());
|
87
92
|
getInstanceService().createGifTarget(instanceNftId, poolAddress, pool.getName());
|
88
|
-
getInstanceService().grantPoolDefaultPermissions(instanceNftId, pool);
|
93
|
+
getInstanceService().grantPoolDefaultPermissions(instanceNftId, poolAddress, pool.getName());
|
89
94
|
}
|
90
95
|
|
96
|
+
|
97
|
+
function setMaxCapitalAmount(uint256 maxCapitalAmount)
|
98
|
+
external
|
99
|
+
virtual
|
100
|
+
{
|
101
|
+
(IRegistry.ObjectInfo memory registryInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(POOL());
|
102
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
103
|
+
NftId poolNftId = registryInfo.nftId;
|
104
|
+
|
105
|
+
IComponents.ComponentInfo memory componentInfo = instanceReader.getComponentInfo(poolNftId);
|
106
|
+
IComponents.PoolInfo memory poolInfo = abi.decode(componentInfo.data, (IComponents.PoolInfo));
|
107
|
+
uint256 previousMaxCapitalAmount = poolInfo.maxCapitalAmount;
|
108
|
+
|
109
|
+
poolInfo.maxCapitalAmount = maxCapitalAmount;
|
110
|
+
componentInfo.data = abi.encode(poolInfo);
|
111
|
+
instance.updatePoolSetup(poolNftId, componentInfo, KEEP_STATE());
|
112
|
+
|
113
|
+
emit LogPoolServiceMaxCapitalAmountUpdated(poolNftId, previousMaxCapitalAmount, maxCapitalAmount);
|
114
|
+
}
|
115
|
+
|
116
|
+
function setBundleOwnerRole(RoleId bundleOwnerRole)
|
117
|
+
external
|
118
|
+
virtual
|
119
|
+
{
|
120
|
+
(IRegistry.ObjectInfo memory registryInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(POOL());
|
121
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
122
|
+
NftId poolNftId = registryInfo.nftId;
|
123
|
+
|
124
|
+
IComponents.ComponentInfo memory componentInfo = instanceReader.getComponentInfo(poolNftId);
|
125
|
+
IComponents.PoolInfo memory poolInfo = abi.decode(componentInfo.data, (IComponents.PoolInfo));
|
126
|
+
|
127
|
+
// bundle owner role may only be set once per pool
|
128
|
+
if(poolInfo.bundleOwnerRole != PUBLIC_ROLE()) {
|
129
|
+
revert ErrorPoolServiceBundleOwnerRoleAlreadySet(poolNftId);
|
130
|
+
}
|
131
|
+
|
132
|
+
poolInfo.bundleOwnerRole = bundleOwnerRole;
|
133
|
+
componentInfo.data = abi.encode(poolInfo);
|
134
|
+
instance.updatePoolSetup(poolNftId, componentInfo, KEEP_STATE());
|
135
|
+
|
136
|
+
emit LogPoolServiceBundleOwnerRoleSet(poolNftId, bundleOwnerRole);
|
137
|
+
}
|
138
|
+
|
139
|
+
|
91
140
|
function setFees(
|
92
141
|
Fee memory poolFee,
|
93
142
|
Fee memory stakingFee,
|
94
143
|
Fee memory performanceFee
|
95
144
|
)
|
96
145
|
external
|
97
|
-
|
146
|
+
virtual
|
98
147
|
{
|
99
|
-
(IRegistry.ObjectInfo memory
|
148
|
+
(IRegistry.ObjectInfo memory registryInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(POOL());
|
100
149
|
InstanceReader instanceReader = instance.getInstanceReader();
|
101
|
-
NftId poolNftId =
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
150
|
+
NftId poolNftId = registryInfo.nftId;
|
151
|
+
|
152
|
+
IComponents.ComponentInfo memory componentInfo = instanceReader.getComponentInfo(poolNftId);
|
153
|
+
IComponents.PoolInfo memory poolInfo = abi.decode(componentInfo.data, (IComponents.PoolInfo));
|
154
|
+
|
155
|
+
poolInfo.poolFee = poolFee;
|
156
|
+
poolInfo.stakingFee = stakingFee;
|
157
|
+
poolInfo.performanceFee = performanceFee;
|
158
|
+
componentInfo.data = abi.encode(poolInfo);
|
159
|
+
instance.updatePoolSetup(poolNftId, componentInfo, KEEP_STATE());
|
160
|
+
|
161
|
+
// TODO add logging
|
109
162
|
}
|
110
163
|
}
|
@@ -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));
|
@@ -60,11 +60,11 @@ contract ProductService is ComponentService, IProductService {
|
|
60
60
|
address initialOwner;
|
61
61
|
(registryAddress, initialOwner) = abi.decode(data, (address, address));
|
62
62
|
|
63
|
-
|
63
|
+
initializeService(registryAddress, owner);
|
64
64
|
|
65
|
-
_poolService = IPoolService(
|
65
|
+
_poolService = IPoolService(getRegistry().getServiceAddress(POOL(), getMajorVersion()));
|
66
66
|
|
67
|
-
|
67
|
+
registerInterface(type(IProductService).interfaceId);
|
68
68
|
}
|
69
69
|
|
70
70
|
|
@@ -102,8 +102,8 @@ contract ProductService is ComponentService, IProductService {
|
|
102
102
|
{
|
103
103
|
// wire distribution and pool components to product component
|
104
104
|
ISetup.ProductSetupInfo memory setup = product.getSetupInfo();
|
105
|
-
IComponent distribution = IComponent(
|
106
|
-
IComponent pool = IComponent(
|
105
|
+
IComponent distribution = IComponent(getRegistry().getObjectInfo(setup.distributionNftId).objectAddress);
|
106
|
+
IComponent pool = IComponent(getRegistry().getObjectInfo(setup.poolNftId).objectAddress);
|
107
107
|
|
108
108
|
distribution.setProductNftId(productNftId);
|
109
109
|
pool.setProductNftId(productNftId);
|
@@ -115,11 +115,10 @@ contract ProductService is ComponentService, IProductService {
|
|
115
115
|
|
116
116
|
// create target for instane access manager
|
117
117
|
getInstanceService().createGifTarget(
|
118
|
-
|
118
|
+
getRegistry().getNftId(address(instance)),
|
119
119
|
address(product),
|
120
120
|
product.getName());
|
121
|
-
getInstanceService().grantProductDefaultPermissions(instance.getNftId(), product);
|
122
|
-
|
121
|
+
getInstanceService().grantProductDefaultPermissions(instance.getNftId(), address(product), product.getName());
|
123
122
|
}
|
124
123
|
|
125
124
|
function getDomain() public pure override(IService, Service) returns(ObjectType) {
|
@@ -141,13 +140,13 @@ contract ProductService is ComponentService, IProductService {
|
|
141
140
|
// revert WalletIsZero();
|
142
141
|
// }
|
143
142
|
|
144
|
-
// IRegistry.ObjectInfo memory tokenInfo =
|
143
|
+
// IRegistry.ObjectInfo memory tokenInfo = getRegistry().getObjectInfo(address(info.token));
|
145
144
|
|
146
145
|
// if(tokenInfo.objectType != TOKEN()) {
|
147
146
|
// revert InvalidToken();
|
148
147
|
// }
|
149
148
|
|
150
|
-
// IRegistry.ObjectInfo memory poolInfo =
|
149
|
+
// IRegistry.ObjectInfo memory poolInfo = getRegistry().getObjectInfo(info.poolNftId);
|
151
150
|
|
152
151
|
// if(poolInfo.objectType != POOL()) {
|
153
152
|
// revert InvalidPool();
|
@@ -161,7 +160,7 @@ contract ProductService is ComponentService, IProductService {
|
|
161
160
|
// //require(tokenInfo.objectAddress == address(poolSetup.token), "ERROR:COS-018:PRODUCT_POOL_TOKEN_MISMATCH");
|
162
161
|
// // TODO pool is not linked
|
163
162
|
|
164
|
-
// IRegistry.ObjectInfo memory distributionInfo =
|
163
|
+
// IRegistry.ObjectInfo memory distributionInfo = getRegistry().getObjectInfo(info.distributionNftId);
|
165
164
|
|
166
165
|
// if(distributionInfo.objectType != DISTRIBUTION()) {
|
167
166
|
// revert InvalidDistribution();
|
@@ -16,7 +16,7 @@ contract ProductServiceManager is ProxyManager {
|
|
16
16
|
constructor(
|
17
17
|
address registryAddress
|
18
18
|
)
|
19
|
-
ProxyManager()
|
19
|
+
ProxyManager(registryAddress)
|
20
20
|
{
|
21
21
|
ProductService svc = new ProductService();
|
22
22
|
bytes memory data = abi.encode(registryAddress, address(this));
|
@@ -39,7 +39,7 @@ contract ProductServiceManager 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 ----------------------------------------------------//
|
@@ -3,7 +3,6 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
5
5
|
|
6
|
-
import {ChainNft} from "./ChainNft.sol";
|
7
6
|
import {NftId} from "../types/NftId.sol";
|
8
7
|
import {ObjectType} from "../types/ObjectType.sol";
|
9
8
|
import {VersionPart} from "../types/Version.sol";
|
@@ -92,7 +91,9 @@ interface IRegistry is IERC165 {
|
|
92
91
|
VersionPart releaseVersion
|
93
92
|
) external view returns (address serviceAddress);
|
94
93
|
|
95
|
-
function
|
94
|
+
function getReleaseManagerAddress() external view returns (address);
|
95
|
+
|
96
|
+
function getChainNftAddress() external view returns (address);
|
96
97
|
|
97
98
|
function getOwner() external view returns (address);
|
98
99
|
}
|
@@ -35,18 +35,18 @@ interface IRegistryService is
|
|
35
35
|
struct FunctionConfig
|
36
36
|
{
|
37
37
|
ObjectType serviceDomain;
|
38
|
-
bytes4
|
38
|
+
bytes4[] selectors;
|
39
39
|
}
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
41
|
+
function getFunctionConfigs()
|
42
|
+
external
|
43
|
+
pure
|
44
|
+
returns(
|
45
|
+
FunctionConfig[] memory config
|
46
|
+
);
|
47
47
|
|
48
48
|
// TODO used by service -> add owner arg
|
49
|
-
|
49
|
+
function registerInstance(IRegisterable instance, address owner)
|
50
50
|
external returns(IRegistry.ObjectInfo memory info);
|
51
51
|
|
52
52
|
function registerProduct(IComponent product, address owner)
|
@@ -58,6 +58,8 @@ interface IRegistryService is
|
|
58
58
|
function registerDistribution(IComponent distribution, address owner)
|
59
59
|
external returns(IRegistry.ObjectInfo memory info);
|
60
60
|
|
61
|
+
function registerDistributor(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
62
|
+
|
61
63
|
function registerPolicy(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
62
64
|
|
63
65
|
function registerBundle(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
@@ -1,12 +1,11 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
4
5
|
|
5
6
|
import {NftId, toNftId, zeroNftId} from "../types/NftId.sol";
|
6
7
|
import {VersionPart} from "../types/Version.sol";
|
7
|
-
import {ObjectType, PROTOCOL, REGISTRY, TOKEN, SERVICE, INSTANCE, STAKE, PRODUCT, DISTRIBUTION, ORACLE, POOL, POLICY, BUNDLE} from "../types/ObjectType.sol";
|
8
|
-
|
9
|
-
import {ERC165} from "../shared/ERC165.sol";
|
8
|
+
import {ObjectType, PROTOCOL, REGISTRY, TOKEN, SERVICE, INSTANCE, STAKE, PRODUCT, DISTRIBUTION, DISTRIBUTOR, ORACLE, POOL, POLICY, BUNDLE} from "../types/ObjectType.sol";
|
10
9
|
|
11
10
|
import {ChainNft} from "./ChainNft.sol";
|
12
11
|
import {IRegistry} from "./IRegistry.sol";
|
@@ -23,7 +22,6 @@ import {ReleaseManager} from "./ReleaseManager.sol";
|
|
23
22
|
// 4) state object by regular service (POLICY, BUNDLE, STAKE)
|
24
23
|
|
25
24
|
contract Registry is
|
26
|
-
ERC165,
|
27
25
|
IRegistry
|
28
26
|
{
|
29
27
|
address public constant NFT_LOCK_ADDRESS = address(0x1);
|
@@ -75,8 +73,6 @@ contract Registry is
|
|
75
73
|
|
76
74
|
// set object types and object parent relations
|
77
75
|
_setupValidCoreTypesAndCombinations();
|
78
|
-
|
79
|
-
_registerInterface(type(IRegistry).interfaceId);
|
80
76
|
}
|
81
77
|
|
82
78
|
function registerService(
|
@@ -194,6 +190,10 @@ contract Registry is
|
|
194
190
|
return _chainNft.totalSupply();
|
195
191
|
}
|
196
192
|
|
193
|
+
function getReleaseManagerAddress() external view returns (address) {
|
194
|
+
return address(_releaseManager);
|
195
|
+
}
|
196
|
+
|
197
197
|
function getNftId() external view returns (NftId nftId) {
|
198
198
|
return _registryNftId;
|
199
199
|
}
|
@@ -246,14 +246,24 @@ contract Registry is
|
|
246
246
|
//}
|
247
247
|
}
|
248
248
|
|
249
|
-
function
|
250
|
-
return _chainNft;
|
249
|
+
function getChainNftAddress() external view override returns (address) {
|
250
|
+
return address(_chainNft);
|
251
251
|
}
|
252
252
|
|
253
253
|
function getOwner() public view returns (address owner) {
|
254
254
|
return ownerOf(address(this));
|
255
255
|
}
|
256
256
|
|
257
|
+
// IERC165
|
258
|
+
|
259
|
+
function supportsInterface(bytes4 interfaceId) external pure returns (bool) {
|
260
|
+
if(interfaceId == type(IERC165).interfaceId || interfaceId == type(IRegistry).interfaceId) {
|
261
|
+
return true;
|
262
|
+
}
|
263
|
+
|
264
|
+
return false;
|
265
|
+
}
|
266
|
+
|
257
267
|
// Internals
|
258
268
|
|
259
269
|
/// @dev registry protects only against tampering existing records, registering with invalid types pairs and 0 parent address
|
@@ -442,6 +452,8 @@ contract Registry is
|
|
442
452
|
_coreContractCombinations[ORACLE()][INSTANCE()] = true;
|
443
453
|
_coreContractCombinations[POOL()][INSTANCE()] = true;
|
444
454
|
|
455
|
+
_coreObjectCombinations[DISTRIBUTOR()][DISTRIBUTION()] = true;
|
456
|
+
|
445
457
|
// product as parent, ONLY approved
|
446
458
|
_coreObjectCombinations[POLICY()][PRODUCT()] = true;
|
447
459
|
|
@@ -19,7 +19,7 @@ import {IRegisterable} from "../../contracts/shared/IRegisterable.sol";
|
|
19
19
|
import {Registerable} from "../../contracts/shared/Registerable.sol";
|
20
20
|
|
21
21
|
import {RoleId, PRODUCT_OWNER_ROLE, POOL_OWNER_ROLE, ORACLE_OWNER_ROLE} from "../../contracts/types/RoleId.sol";
|
22
|
-
import {ObjectType, REGISTRY, SERVICE, PRODUCT, ORACLE, POOL, INSTANCE, DISTRIBUTION, POLICY, BUNDLE, STAKE} from "../../contracts/types/ObjectType.sol";
|
22
|
+
import {ObjectType, REGISTRY, SERVICE, PRODUCT, ORACLE, POOL, INSTANCE, DISTRIBUTION, DISTRIBUTOR, APPLICATION, POLICY, CLAIM, BUNDLE, STAKE} from "../../contracts/types/ObjectType.sol";
|
23
23
|
import {StateId, ACTIVE, PAUSED} from "../../contracts/types/StateId.sol";
|
24
24
|
import {NftId, NftIdLib, zeroNftId} from "../../contracts/types/NftId.sol";
|
25
25
|
import {Fee, FeeLib} from "../../contracts/types/Fee.sol";
|
@@ -40,6 +40,33 @@ contract RegistryService is
|
|
40
40
|
// TODO update to real hash when registry is stable
|
41
41
|
bytes32 public constant REGISTRY_CREATION_CODE_HASH = bytes32(0);
|
42
42
|
|
43
|
+
// From IService
|
44
|
+
function getDomain() public pure override(IService, Service) returns(ObjectType serviceDomain) {
|
45
|
+
return REGISTRY();
|
46
|
+
}
|
47
|
+
|
48
|
+
// from Versionable
|
49
|
+
|
50
|
+
/// @dev top level initializer
|
51
|
+
function _initialize(
|
52
|
+
address owner,
|
53
|
+
bytes memory data
|
54
|
+
)
|
55
|
+
internal
|
56
|
+
virtual override
|
57
|
+
initializer()
|
58
|
+
{
|
59
|
+
(
|
60
|
+
address registryAddress,
|
61
|
+
address initialAuthority
|
62
|
+
) = abi.decode(data, (address, address));
|
63
|
+
|
64
|
+
__AccessManaged_init(initialAuthority);
|
65
|
+
|
66
|
+
initializeService(registryAddress, owner);
|
67
|
+
registerInterface(type(IRegistryService).interfaceId);
|
68
|
+
}
|
69
|
+
|
43
70
|
function registerInstance(IRegisterable instance, address owner)
|
44
71
|
external
|
45
72
|
restricted
|
@@ -52,7 +79,7 @@ contract RegistryService is
|
|
52
79
|
}
|
53
80
|
|
54
81
|
info = _getAndVerifyContractInfo(instance, INSTANCE(), owner);
|
55
|
-
info.nftId =
|
82
|
+
info.nftId = getRegistry().register(info);
|
56
83
|
|
57
84
|
instance.linkToRegisteredNftId(); // asume safe
|
58
85
|
}
|
@@ -70,7 +97,7 @@ contract RegistryService is
|
|
70
97
|
}
|
71
98
|
|
72
99
|
info = _getAndVerifyContractInfo(product, PRODUCT(), owner);
|
73
|
-
info.nftId =
|
100
|
+
info.nftId = getRegistry().register(info);
|
74
101
|
}
|
75
102
|
|
76
103
|
function registerPool(IComponent pool, address owner)
|
@@ -85,7 +112,7 @@ contract RegistryService is
|
|
85
112
|
}
|
86
113
|
|
87
114
|
info = _getAndVerifyContractInfo(pool, POOL(), owner);
|
88
|
-
info.nftId =
|
115
|
+
info.nftId = getRegistry().register(info);
|
89
116
|
}
|
90
117
|
|
91
118
|
function registerDistribution(IComponent distribution, address owner)
|
@@ -100,7 +127,16 @@ contract RegistryService is
|
|
100
127
|
}
|
101
128
|
|
102
129
|
info = _getAndVerifyContractInfo(distribution, DISTRIBUTION(), owner);
|
103
|
-
info.nftId =
|
130
|
+
info.nftId = getRegistry().register(info);
|
131
|
+
}
|
132
|
+
|
133
|
+
function registerDistributor(IRegistry.ObjectInfo memory info)
|
134
|
+
external
|
135
|
+
restricted
|
136
|
+
returns(NftId nftId)
|
137
|
+
{
|
138
|
+
_verifyObjectInfo(info, DISTRIBUTOR());
|
139
|
+
nftId = getRegistry().register(info);
|
104
140
|
}
|
105
141
|
|
106
142
|
function registerPolicy(IRegistry.ObjectInfo memory info)
|
@@ -110,7 +146,7 @@ contract RegistryService is
|
|
110
146
|
{
|
111
147
|
_verifyObjectInfo(info, POLICY());
|
112
148
|
|
113
|
-
nftId =
|
149
|
+
nftId = getRegistry().register(info);
|
114
150
|
}
|
115
151
|
|
116
152
|
function registerBundle(IRegistry.ObjectInfo memory info)
|
@@ -120,7 +156,7 @@ contract RegistryService is
|
|
120
156
|
{
|
121
157
|
_verifyObjectInfo(info, BUNDLE());
|
122
158
|
|
123
|
-
nftId =
|
159
|
+
nftId = getRegistry().register(info);
|
124
160
|
}
|
125
161
|
|
126
162
|
function registerStake(IRegistry.ObjectInfo memory info)
|
@@ -130,35 +166,7 @@ contract RegistryService is
|
|
130
166
|
{
|
131
167
|
_verifyObjectInfo(info, STAKE());
|
132
168
|
|
133
|
-
nftId =
|
134
|
-
}
|
135
|
-
|
136
|
-
// From IService
|
137
|
-
function getDomain() public pure override(IService, Service) returns(ObjectType serviceDomain) {
|
138
|
-
return REGISTRY();
|
139
|
-
}
|
140
|
-
|
141
|
-
// from Versionable
|
142
|
-
|
143
|
-
/// @dev top level initializer
|
144
|
-
function _initialize(
|
145
|
-
address owner,
|
146
|
-
bytes memory data
|
147
|
-
)
|
148
|
-
internal
|
149
|
-
initializer
|
150
|
-
virtual override
|
151
|
-
{
|
152
|
-
(
|
153
|
-
address initialAuthority,
|
154
|
-
address registry
|
155
|
-
) = abi.decode(data, (address, address));
|
156
|
-
|
157
|
-
__AccessManaged_init(initialAuthority);
|
158
|
-
|
159
|
-
_initializeService(address(registry), owner);
|
160
|
-
|
161
|
-
_registerInterface(type(IRegistryService).interfaceId);
|
169
|
+
nftId = getRegistry().register(info);
|
162
170
|
}
|
163
171
|
|
164
172
|
// from IRegisterable
|
@@ -170,30 +178,43 @@ contract RegistryService is
|
|
170
178
|
FunctionConfig[] memory config
|
171
179
|
)
|
172
180
|
{
|
173
|
-
config = new FunctionConfig[](
|
181
|
+
config = new FunctionConfig[](8);
|
174
182
|
|
175
183
|
// order of service registrations MUST be reverse to this array
|
176
184
|
/*config[-1].serviceDomain = STAKE();
|
177
185
|
config[-1].selector = RegistryService.registerStake.selector;*/
|
178
186
|
|
179
187
|
config[0].serviceDomain = POLICY();
|
180
|
-
config[0].
|
188
|
+
config[0].selectors = new bytes4[](0);
|
189
|
+
|
190
|
+
config[1].serviceDomain = APPLICATION();
|
191
|
+
config[1].selectors = new bytes4[](1);
|
192
|
+
config[1].selectors[0] = RegistryService.registerPolicy.selector;
|
193
|
+
|
194
|
+
config[2].serviceDomain = CLAIM();
|
195
|
+
config[2].selectors = new bytes4[](0);
|
181
196
|
|
182
|
-
config[
|
183
|
-
config[
|
197
|
+
config[3].serviceDomain = BUNDLE();
|
198
|
+
config[3].selectors = new bytes4[](1);
|
199
|
+
config[3].selectors[0] = RegistryService.registerBundle.selector;
|
184
200
|
|
185
|
-
config[
|
186
|
-
config[
|
201
|
+
config[4].serviceDomain = PRODUCT();
|
202
|
+
config[4].selectors = new bytes4[](1);
|
203
|
+
config[4].selectors[0] = RegistryService.registerProduct.selector;
|
187
204
|
|
188
|
-
config[
|
189
|
-
config[
|
205
|
+
config[5].serviceDomain = POOL();
|
206
|
+
config[5].selectors = new bytes4[](1);
|
207
|
+
config[5].selectors[0] = RegistryService.registerPool.selector;
|
190
208
|
|
191
|
-
config[
|
192
|
-
config[
|
209
|
+
config[6].serviceDomain = DISTRIBUTION();
|
210
|
+
config[6].selectors = new bytes4[](2);
|
211
|
+
config[6].selectors[0] = RegistryService.registerDistribution.selector;
|
212
|
+
config[6].selectors[1] = RegistryService.registerDistributor.selector;
|
193
213
|
|
194
214
|
// registerInstance() have no restriction
|
195
|
-
config[
|
196
|
-
config[
|
215
|
+
config[7].serviceDomain = INSTANCE();
|
216
|
+
config[7].selectors = new bytes4[](1);
|
217
|
+
config[7].selectors[0] = RegistryService.registerInstance.selector;
|
197
218
|
}
|
198
219
|
|
199
220
|
// Internal
|
@@ -22,32 +22,32 @@ contract RegistryServiceManager is
|
|
22
22
|
/// @dev initializes proxy manager with registry service implementation and deploys registry
|
23
23
|
constructor(
|
24
24
|
address initialAuthority, // used by implementation
|
25
|
-
address
|
26
|
-
ProxyManager()
|
25
|
+
address registryAddress) // used by implementation
|
26
|
+
ProxyManager(registryAddress)
|
27
27
|
{
|
28
28
|
require(initialAuthority > address(0), "RegistryServiceManager: initial authority is 0");
|
29
|
-
require(
|
29
|
+
require(registryAddress > address(0), "RegistryServiceManager: registry is 0");
|
30
30
|
|
31
31
|
// implementation's initializer func `data` argument
|
32
|
-
|
33
|
-
|
34
|
-
registry);
|
35
|
-
|
32
|
+
RegistryService srv = new RegistryService();
|
33
|
+
bytes memory data = abi.encode(registryAddress, initialAuthority);
|
36
34
|
IVersionable versionable = deploy(
|
37
|
-
address(
|
38
|
-
|
35
|
+
address(srv),
|
36
|
+
data);
|
39
37
|
|
40
38
|
_registryService = RegistryService(address(versionable));
|
39
|
+
|
40
|
+
// _linkToNftOwnable(address(_registryService));
|
41
41
|
}
|
42
42
|
|
43
|
-
// from IRegisterable
|
43
|
+
// // from IRegisterable
|
44
44
|
|
45
|
-
// IMPORTANT: registry here and in constructor MUST be the same
|
46
|
-
function
|
45
|
+
// // IMPORTANT: registry here and in constructor MUST be the same
|
46
|
+
function linkOwnershipToServiceNft()
|
47
47
|
public
|
48
48
|
onlyOwner
|
49
49
|
{
|
50
|
-
_linkToNftOwnable(
|
50
|
+
_linkToNftOwnable(address(_registryService));
|
51
51
|
}
|
52
52
|
|
53
53
|
//--- view functions ----------------------------------------------------//
|