@etherisc/gif-next 0.0.2-cff6256-424 → 0.0.2-d086e6d-456
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +141 -2
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +4 -0
- package/artifacts/contracts/components/Component.sol/Component.json +842 -0
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +897 -238
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +4 -0
- package/artifacts/contracts/{shared/RegisterableUpgradable.sol/RegisterableUpgradable.json → components/IComponent.sol/IComponent.json} +295 -132
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +801 -36
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +864 -49
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +682 -9
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +844 -258
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +626 -234
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +4 -0
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +1206 -0
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +4 -0
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +778 -0
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +4 -0
- package/artifacts/contracts/instance/{AccessManagedSimple.sol/AccessManagedSimple.json → Cloneable.sol/Cloneable.json} +91 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +2107 -184
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +334 -157
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +979 -1206
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +571 -177
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +227 -221
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +529 -233
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +324 -91
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +4 -0
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +256 -0
- 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} +298 -137
- 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 +1058 -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 +1258 -0
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +717 -0
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ClaimService.sol/ClaimService.json +844 -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 +1405 -224
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +451 -74
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +646 -0
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +683 -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} +227 -194
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +791 -134
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +630 -0
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +450 -143
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +96 -373
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +1111 -0
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +689 -0
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +1264 -0
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +657 -0
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +867 -0
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +649 -0
- 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 +227 -224
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +243 -206
- 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 +241 -330
- 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 +235 -295
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +295 -150
- 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 +95 -157
- 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 +195 -148
- 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 +213 -202
- 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/Amount.sol/AmountLib.dbg.json +4 -0
- package/artifacts/contracts/types/Amount.sol/AmountLib.json +161 -0
- 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 +40 -9
- 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 +26 -3
- 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 +253 -0
- package/contracts/components/Distribution.sol +197 -83
- package/contracts/components/IComponent.sol +76 -0
- package/contracts/components/IDistributionComponent.sol +43 -18
- package/contracts/components/IPoolComponent.sol +88 -37
- package/contracts/components/IProductComponent.sol +10 -5
- package/contracts/components/Pool.sol +225 -180
- package/contracts/components/Product.sol +130 -134
- package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +13 -0
- package/contracts/instance/BundleManager.sol +127 -0
- package/contracts/instance/Cloneable.sol +51 -0
- package/contracts/instance/IInstance.sol +77 -12
- package/contracts/instance/IInstanceService.sol +47 -5
- package/contracts/instance/Instance.sol +152 -268
- package/contracts/instance/InstanceAccessManager.sol +410 -176
- package/contracts/instance/InstanceReader.sol +36 -35
- package/contracts/instance/InstanceService.sol +429 -92
- package/contracts/instance/InstanceServiceManager.sol +11 -13
- package/contracts/instance/ObjectManager.sol +82 -0
- package/contracts/instance/base/ComponentService.sol +136 -0
- package/contracts/instance/base/KeyValueStore.sol +13 -5
- package/contracts/instance/base/Lifecycle.sol +11 -2
- package/contracts/instance/module/IAccess.sol +36 -20
- package/contracts/instance/module/IBundle.sol +8 -4
- package/contracts/instance/module/IComponents.sol +41 -0
- package/contracts/instance/module/IDistribution.sol +2 -0
- package/contracts/instance/module/IPolicy.sol +30 -3
- package/contracts/instance/module/ISetup.sol +9 -19
- package/contracts/instance/service/ApplicationService.sol +350 -0
- package/contracts/instance/service/ApplicationServiceManager.sol +35 -0
- package/contracts/instance/service/BundleService.sol +431 -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 +378 -39
- package/contracts/instance/service/DistributionServiceManager.sol +11 -13
- package/contracts/instance/service/IApplicationService.sol +82 -0
- package/contracts/instance/service/IBundleService.sol +93 -0
- package/contracts/instance/service/IClaimService.sol +61 -0
- package/contracts/instance/service/IDistributionService.sol +86 -0
- package/contracts/instance/service/IPolicyService.sol +72 -0
- package/contracts/instance/service/IPoolService.sol +79 -17
- package/contracts/instance/service/IProductService.sol +6 -73
- package/contracts/instance/service/PolicyService.sol +360 -0
- package/contracts/instance/service/PolicyServiceManager.sol +54 -0
- package/contracts/instance/service/PoolService.sol +343 -0
- package/contracts/instance/service/PoolServiceManager.sol +51 -0
- package/contracts/instance/service/ProductService.sol +210 -0
- package/contracts/instance/service/ProductServiceManager.sol +54 -0
- package/contracts/registry/ChainNft.sol +9 -1
- package/contracts/registry/IRegistry.sol +40 -33
- package/contracts/registry/IRegistryService.sol +48 -13
- package/contracts/registry/ITransferInterceptor.sol +1 -0
- package/contracts/registry/Registry.sol +234 -256
- package/contracts/registry/RegistryAccessManager.sol +216 -0
- package/contracts/registry/RegistryService.sol +117 -231
- 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 +8 -2
- package/contracts/shared/IVersionable.sol +4 -47
- package/contracts/shared/NftOwnable.sol +67 -83
- 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 +31 -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/Amount.sol +60 -0
- 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 +13 -5
- package/contracts/types/NftId.sol +8 -0
- package/contracts/types/NftIdSet.sol +26 -24
- 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 -17
- 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/BaseComponent.sol/BaseComponent.json +0 -327
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.json +0 -280
- 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/AccessManagedSimple.sol/AccessManagedSimple.dbg.json +0 -4
- package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.dbg.json +0 -4
- package/artifacts/contracts/instance/AccessManagerSimple.sol/AccessManagerSimple.json +0 -1132
- 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/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/contracts/components/BaseComponent.sol +0 -91
- package/contracts/components/IBaseComponent.sol +0 -25
- 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/AccessManagedSimple.sol +0 -115
- package/contracts/instance/AccessManagerSimple.sol +0 -692
- package/contracts/instance/IAccessManagerSimple.sol +0 -391
- package/contracts/instance/base/ComponentServiceBase.sol +0 -39
- 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
@@ -2,15 +2,13 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
|
5
|
-
import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
5
|
+
// import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
6
6
|
|
7
7
|
import {IRegistry} from "./IRegistry.sol";
|
8
8
|
import {IInstance} from "../instance/IInstance.sol";
|
9
9
|
|
10
10
|
import {ContractDeployerLib} from "../shared/ContractDeployerLib.sol";
|
11
|
-
|
12
|
-
// import {IPool} from "../../contracts/instance/module/pool/IPoolModule.sol";
|
13
|
-
import {IBaseComponent} from "../../contracts/components/IBaseComponent.sol";
|
11
|
+
import {IComponent} from "../../contracts/components/IComponent.sol";
|
14
12
|
import {IPoolComponent} from "../../contracts/components/IPoolComponent.sol";
|
15
13
|
import {IProductComponent} from "../../contracts/components/IProductComponent.sol";
|
16
14
|
import {IDistributionComponent} from "../../contracts/components/IDistributionComponent.sol";
|
@@ -18,9 +16,10 @@ import {IDistributionComponent} from "../../contracts/components/IDistributionCo
|
|
18
16
|
import {IVersionable} from "../../contracts/shared/IVersionable.sol";
|
19
17
|
import {Versionable} from "../../contracts/shared/Versionable.sol";
|
20
18
|
import {IRegisterable} from "../../contracts/shared/IRegisterable.sol";
|
19
|
+
import {Registerable} from "../../contracts/shared/Registerable.sol";
|
21
20
|
|
22
21
|
import {RoleId, PRODUCT_OWNER_ROLE, POOL_OWNER_ROLE, ORACLE_OWNER_ROLE} from "../../contracts/types/RoleId.sol";
|
23
|
-
import {ObjectType, REGISTRY, SERVICE, PRODUCT, ORACLE, POOL, INSTANCE, DISTRIBUTION, POLICY, BUNDLE} 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";
|
24
23
|
import {StateId, ACTIVE, PAUSED} from "../../contracts/types/StateId.sol";
|
25
24
|
import {NftId, NftIdLib, zeroNftId} from "../../contracts/types/NftId.sol";
|
26
25
|
import {Fee, FeeLib} from "../../contracts/types/Fee.sol";
|
@@ -30,113 +29,67 @@ import {Service} from "../shared/Service.sol";
|
|
30
29
|
import {IService} from "../shared/IService.sol";
|
31
30
|
import {IRegistryService} from "./IRegistryService.sol";
|
32
31
|
import {Registry} from "./Registry.sol";
|
33
|
-
import {ChainNft} from "./ChainNft.sol";
|
34
32
|
|
35
33
|
contract RegistryService is
|
36
|
-
|
34
|
+
// TODO cleanup
|
35
|
+
// AccessManagedUpgradeable,
|
37
36
|
Service,
|
38
37
|
IRegistryService
|
39
38
|
{
|
40
39
|
using NftIdLib for NftId;
|
41
40
|
|
42
|
-
// TODO move errors to interface contract
|
43
|
-
error SelfRegistration();
|
44
|
-
error NotRegistryOwner();
|
45
|
-
|
46
|
-
error NotService();
|
47
|
-
error NotInstance();
|
48
|
-
error NotProduct();
|
49
|
-
error NotPool();
|
50
|
-
error NotDistribution();
|
51
|
-
|
52
|
-
error UnexpectedRegisterableType(ObjectType expected, ObjectType found);
|
53
|
-
error NotRegisterableOwner(address expectedOwner);
|
54
|
-
error RegisterableOwnerIsZero();
|
55
|
-
error RegisterableOwnerIsRegistered();
|
56
|
-
error InvalidInitialOwner(address initialOwner);
|
57
|
-
error InvalidAddress(address registerableAddress);
|
58
|
-
|
59
|
-
// Initial value for constant variable has to be compile-time constant
|
60
|
-
// TODO define types as constants?
|
61
|
-
//ObjectType public constant SERVICE_TYPE = REGISTRY();
|
62
|
-
string public constant NAME = "RegistryService";
|
63
|
-
|
64
41
|
// TODO update to real hash when registry is stable
|
65
42
|
bytes32 public constant REGISTRY_CREATION_CODE_HASH = bytes32(0);
|
66
43
|
|
67
|
-
|
44
|
+
// From IService
|
45
|
+
function getDomain() public pure override(IService, Service) returns(ObjectType serviceDomain) {
|
46
|
+
return REGISTRY();
|
47
|
+
}
|
68
48
|
|
69
|
-
|
70
|
-
// msg.sender - ONLY registry owner
|
71
|
-
// CAN NOT register itself
|
72
|
-
// CAN register ONLY valid object-parent types combinations for SERVICE
|
73
|
-
// CAN register ONLY IRegisterable address he owns
|
74
|
-
// IMPORTANT: MUST NOT check owner before calling external contract
|
75
|
-
function registerService(IService service)
|
76
|
-
external
|
77
|
-
// TODO restrict access - registryService.registerService must use accessmanager for checking permissions as
|
78
|
-
// services are not always owned by registry owner - actually only registry service is owned by registry owner
|
49
|
+
// from Versionable
|
79
50
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
51
|
+
/// @dev top level initializer
|
52
|
+
function _initialize(
|
53
|
+
address owner,
|
54
|
+
bytes memory data
|
55
|
+
)
|
56
|
+
internal
|
57
|
+
virtual override
|
58
|
+
initializer()
|
84
59
|
{
|
60
|
+
(
|
61
|
+
address registryAddress,
|
62
|
+
address initialAuthority
|
63
|
+
) = abi.decode(data, (address, address));
|
85
64
|
|
86
|
-
|
87
|
-
if(!service.supportsInterface(type(IService).interfaceId)) {
|
88
|
-
revert NotService();
|
89
|
-
}
|
65
|
+
__AccessManaged_init(initialAuthority);
|
90
66
|
|
91
|
-
(
|
92
|
-
|
93
|
-
data
|
94
|
-
) = _getAndVerifyContractInfo(service, SERVICE(), msg.sender);
|
95
|
-
|
96
|
-
info.nftId = _registry.register(info);
|
97
|
-
service.linkToRegisteredNftId();
|
98
|
-
return (
|
99
|
-
info,
|
100
|
-
data
|
101
|
-
);
|
67
|
+
initializeService(registryAddress, owner);
|
68
|
+
registerInterface(type(IRegistryService).interfaceId);
|
102
69
|
}
|
103
70
|
|
104
|
-
|
105
|
-
// 1) add owner arg (service MUST pass it's msg.sender as owner)
|
106
|
-
// 2) check service allowance
|
107
|
-
// 3) comment self registrstion check
|
108
|
-
//function registerInstance(IRegisterable instance, address owner)
|
109
|
-
function registerInstance(IRegisterable instance)
|
71
|
+
function registerInstance(IRegisterable instance, address owner)
|
110
72
|
external
|
73
|
+
restricted
|
111
74
|
returns(
|
112
|
-
IRegistry.ObjectInfo memory info
|
113
|
-
bytes memory data
|
75
|
+
IRegistry.ObjectInfo memory info
|
114
76
|
)
|
115
77
|
{
|
116
78
|
if(!instance.supportsInterface(type(IInstance).interfaceId)) {
|
117
79
|
revert NotInstance();
|
118
80
|
}
|
119
81
|
|
120
|
-
(
|
121
|
-
|
122
|
-
data
|
123
|
-
) = _getAndVerifyContractInfo(instance, INSTANCE(), msg.sender);
|
82
|
+
info = _getAndVerifyContractInfo(instance, INSTANCE(), owner);
|
83
|
+
info.nftId = getRegistry().register(info);
|
124
84
|
|
125
|
-
info.nftId = _registry.register(info);
|
126
85
|
instance.linkToRegisteredNftId(); // asume safe
|
127
|
-
|
128
|
-
return (
|
129
|
-
info,
|
130
|
-
data
|
131
|
-
);
|
132
86
|
}
|
133
87
|
|
134
|
-
function registerProduct(
|
88
|
+
function registerProduct(IComponent product, address owner)
|
135
89
|
external
|
136
90
|
restricted
|
137
91
|
returns(
|
138
|
-
IRegistry.ObjectInfo memory info
|
139
|
-
bytes memory data
|
92
|
+
IRegistry.ObjectInfo memory info
|
140
93
|
)
|
141
94
|
{
|
142
95
|
// CAN revert if no ERC165 support -> will revert with empty message
|
@@ -144,77 +97,47 @@ contract RegistryService is
|
|
144
97
|
revert NotProduct();
|
145
98
|
}
|
146
99
|
|
147
|
-
(
|
148
|
-
|
149
|
-
data
|
150
|
-
) = _getAndVerifyContractInfo(product, PRODUCT(), owner);
|
151
|
-
|
152
|
-
NftId serviceNftId = _registry.getNftId(msg.sender);
|
153
|
-
|
154
|
-
info.nftId = _registry.register(info);
|
155
|
-
// TODO unsafe, let component or its owner derive nftId latter, when state assumptions and modifications of GIF contracts are finished
|
156
|
-
product.linkToRegisteredNftId();
|
157
|
-
|
158
|
-
return (
|
159
|
-
info,
|
160
|
-
data
|
161
|
-
);
|
100
|
+
info = _getAndVerifyContractInfo(product, PRODUCT(), owner);
|
101
|
+
info.nftId = getRegistry().register(info);
|
162
102
|
}
|
163
103
|
|
164
|
-
function registerPool(
|
104
|
+
function registerPool(IComponent pool, address owner)
|
165
105
|
external
|
166
106
|
restricted
|
167
107
|
returns(
|
168
|
-
IRegistry.ObjectInfo memory info
|
169
|
-
bytes memory data
|
108
|
+
IRegistry.ObjectInfo memory info
|
170
109
|
)
|
171
110
|
{
|
172
111
|
if(!pool.supportsInterface(type(IPoolComponent).interfaceId)) {
|
173
112
|
revert NotPool();
|
174
113
|
}
|
175
114
|
|
176
|
-
(
|
177
|
-
|
178
|
-
data
|
179
|
-
) = _getAndVerifyContractInfo(pool, POOL(), owner);
|
180
|
-
|
181
|
-
NftId serviceNftId = _registry.getNftId(msg.sender);
|
182
|
-
|
183
|
-
info.nftId = _registry.register(info);
|
184
|
-
pool.linkToRegisteredNftId();
|
185
|
-
|
186
|
-
return (
|
187
|
-
info,
|
188
|
-
data
|
189
|
-
);
|
115
|
+
info = _getAndVerifyContractInfo(pool, POOL(), owner);
|
116
|
+
info.nftId = getRegistry().register(info);
|
190
117
|
}
|
191
118
|
|
192
|
-
function registerDistribution(
|
119
|
+
function registerDistribution(IComponent distribution, address owner)
|
193
120
|
external
|
194
121
|
restricted
|
195
122
|
returns(
|
196
|
-
IRegistry.ObjectInfo memory info
|
197
|
-
bytes memory data
|
123
|
+
IRegistry.ObjectInfo memory info
|
198
124
|
)
|
199
125
|
{
|
200
126
|
if(!distribution.supportsInterface(type(IDistributionComponent).interfaceId)) {
|
201
127
|
revert NotDistribution();
|
202
128
|
}
|
203
129
|
|
204
|
-
(
|
205
|
-
|
206
|
-
|
207
|
-
) = _getAndVerifyContractInfo(distribution, DISTRIBUTION(), owner);
|
208
|
-
|
209
|
-
NftId serviceNftId = _registry.getNftId(msg.sender);
|
210
|
-
|
211
|
-
info.nftId = _registry.register(info);
|
212
|
-
distribution.linkToRegisteredNftId();
|
130
|
+
info = _getAndVerifyContractInfo(distribution, DISTRIBUTION(), owner);
|
131
|
+
info.nftId = getRegistry().register(info);
|
132
|
+
}
|
213
133
|
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
)
|
134
|
+
function registerDistributor(IRegistry.ObjectInfo memory info)
|
135
|
+
external
|
136
|
+
restricted
|
137
|
+
returns(NftId nftId)
|
138
|
+
{
|
139
|
+
_verifyObjectInfo(info, DISTRIBUTOR());
|
140
|
+
nftId = getRegistry().register(info);
|
218
141
|
}
|
219
142
|
|
220
143
|
function registerPolicy(IRegistry.ObjectInfo memory info)
|
@@ -222,11 +145,9 @@ contract RegistryService is
|
|
222
145
|
restricted
|
223
146
|
returns(NftId nftId)
|
224
147
|
{
|
225
|
-
NftId senderNftId = _registry.getNftId(msg.sender);
|
226
|
-
|
227
148
|
_verifyObjectInfo(info, POLICY());
|
228
149
|
|
229
|
-
nftId =
|
150
|
+
nftId = getRegistry().register(info);
|
230
151
|
}
|
231
152
|
|
232
153
|
function registerBundle(IRegistry.ObjectInfo memory info)
|
@@ -234,85 +155,84 @@ contract RegistryService is
|
|
234
155
|
restricted
|
235
156
|
returns(NftId nftId)
|
236
157
|
{
|
237
|
-
|
238
|
-
NftId senderNftId = _registry.getNftId(msg.sender);
|
239
|
-
|
240
158
|
_verifyObjectInfo(info, BUNDLE());
|
241
159
|
|
242
|
-
nftId =
|
160
|
+
nftId = getRegistry().register(info);
|
243
161
|
}
|
244
162
|
|
163
|
+
function registerStake(IRegistry.ObjectInfo memory info)
|
164
|
+
external
|
165
|
+
restricted
|
166
|
+
returns(NftId nftId)
|
167
|
+
{
|
168
|
+
_verifyObjectInfo(info, STAKE());
|
245
169
|
|
246
|
-
|
247
|
-
function getName() public pure override(IService, Service) returns(string memory) {
|
248
|
-
return NAME;
|
170
|
+
nftId = getRegistry().register(info);
|
249
171
|
}
|
250
|
-
//function getType() public pure override(IService, ServiceBase) returns(ObjectType serviceType) {
|
251
|
-
// return SERVICE_TYPE;
|
252
|
-
//}
|
253
|
-
|
254
172
|
|
255
|
-
// from
|
173
|
+
// from IRegisterable
|
256
174
|
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
address owner,
|
264
|
-
bytes memory data
|
265
|
-
)
|
266
|
-
internal
|
267
|
-
initializer
|
268
|
-
virtual override
|
175
|
+
function getFunctionConfigs()
|
176
|
+
external
|
177
|
+
pure
|
178
|
+
returns(
|
179
|
+
FunctionConfig[] memory config
|
180
|
+
)
|
269
181
|
{
|
270
|
-
(
|
271
|
-
address initialAuthority,
|
272
|
-
bytes memory registryByteCodeWithInitCode
|
273
|
-
) = abi.decode(data, (address, bytes));
|
182
|
+
config = new FunctionConfig[](8);
|
274
183
|
|
275
|
-
|
184
|
+
// order of service registrations MUST be reverse to this array
|
185
|
+
/*config[-1].serviceDomain = STAKE();
|
186
|
+
config[-1].selector = RegistryService.registerStake.selector;*/
|
276
187
|
|
277
|
-
|
278
|
-
|
279
|
-
getMajorVersion());
|
188
|
+
config[0].serviceDomain = POLICY();
|
189
|
+
config[0].selectors = new bytes4[](0);
|
280
190
|
|
281
|
-
|
282
|
-
|
283
|
-
|
191
|
+
config[1].serviceDomain = APPLICATION();
|
192
|
+
config[1].selectors = new bytes4[](1);
|
193
|
+
config[1].selectors[0] = RegistryService.registerPolicy.selector;
|
284
194
|
|
285
|
-
|
286
|
-
|
287
|
-
REGISTRY_CREATION_CODE_HASH));
|
195
|
+
config[2].serviceDomain = CLAIM();
|
196
|
+
config[2].selectors = new bytes4[](0);
|
288
197
|
|
289
|
-
|
198
|
+
config[3].serviceDomain = PRODUCT();
|
199
|
+
config[3].selectors = new bytes4[](1);
|
200
|
+
config[3].selectors[0] = RegistryService.registerProduct.selector;
|
290
201
|
|
291
|
-
|
202
|
+
config[4].serviceDomain = POOL();
|
203
|
+
config[4].selectors = new bytes4[](1);
|
204
|
+
config[4].selectors[0] = RegistryService.registerPool.selector;
|
292
205
|
|
293
|
-
//
|
294
|
-
|
295
|
-
|
296
|
-
|
206
|
+
// registration of bundle service must preceed registration of pool service
|
207
|
+
config[5].serviceDomain = BUNDLE();
|
208
|
+
config[5].selectors = new bytes4[](1);
|
209
|
+
config[5].selectors[0] = RegistryService.registerBundle.selector;
|
210
|
+
|
211
|
+
config[6].serviceDomain = DISTRIBUTION();
|
212
|
+
config[6].selectors = new bytes4[](2);
|
213
|
+
config[6].selectors[0] = RegistryService.registerDistribution.selector;
|
214
|
+
config[6].selectors[1] = RegistryService.registerDistributor.selector;
|
215
|
+
|
216
|
+
// registerInstance() have no restriction
|
217
|
+
config[7].serviceDomain = INSTANCE();
|
218
|
+
config[7].selectors = new bytes4[](1);
|
219
|
+
config[7].selectors[0] = RegistryService.registerInstance.selector;
|
297
220
|
}
|
298
221
|
|
299
|
-
//
|
222
|
+
// Internal
|
223
|
+
|
300
224
|
function _getAndVerifyContractInfo(
|
301
225
|
IRegisterable registerable,
|
302
226
|
ObjectType expectedType, // assume can be valid only
|
303
|
-
address expectedOwner // assume can be 0
|
227
|
+
address expectedOwner // assume can be 0 when given by other service
|
304
228
|
)
|
305
229
|
internal
|
306
|
-
view
|
230
|
+
// view
|
307
231
|
returns(
|
308
|
-
IRegistry.ObjectInfo memory info
|
309
|
-
bytes memory data
|
232
|
+
IRegistry.ObjectInfo memory info
|
310
233
|
)
|
311
234
|
{
|
312
|
-
(
|
313
|
-
info,
|
314
|
-
data
|
315
|
-
) = registerable.getInitialInfo();
|
235
|
+
info = registerable.getInitialInfo();
|
316
236
|
info.objectAddress = address(registerable);
|
317
237
|
|
318
238
|
if(info.objectType != expectedType) {// type is checked in registry anyway...but service logic may depend on expected value
|
@@ -321,13 +241,8 @@ contract RegistryService is
|
|
321
241
|
|
322
242
|
address owner = info.initialOwner;
|
323
243
|
|
324
|
-
//
|
325
|
-
|
326
|
-
// any address may create a new instance via instance service
|
327
|
-
} else {
|
328
|
-
if(owner != expectedOwner) { // registerable owner protection
|
329
|
-
revert NotRegisterableOwner(expectedOwner);
|
330
|
-
}
|
244
|
+
if(owner != expectedOwner) { // registerable owner protection
|
245
|
+
revert NotRegisterableOwner(expectedOwner);
|
331
246
|
}
|
332
247
|
|
333
248
|
if(owner == address(registerable)) {
|
@@ -341,59 +256,30 @@ contract RegistryService is
|
|
341
256
|
if(getRegistry().isRegistered(owner)) {
|
342
257
|
revert RegisterableOwnerIsRegistered();
|
343
258
|
}
|
344
|
-
|
345
|
-
/*NftId parentNftId = info.parentNftId;
|
346
|
-
IRegistry.ObjectInfo memory parentInfo = getRegistry().getObjectInfo(parentNftId);
|
347
|
-
|
348
|
-
if(parentInfo.objectType != parentType) { // parent registration + type
|
349
|
-
revert InvalidParent(parentNftId);
|
350
|
-
}*/
|
351
|
-
|
352
|
-
return(
|
353
|
-
info,
|
354
|
-
data
|
355
|
-
);
|
356
259
|
}
|
357
260
|
|
358
|
-
// parent checks done in registry because of approve()
|
359
261
|
function _verifyObjectInfo(
|
360
262
|
IRegistry.ObjectInfo memory info,
|
361
|
-
ObjectType
|
263
|
+
ObjectType expectedType
|
362
264
|
)
|
363
265
|
internal
|
364
266
|
view
|
365
267
|
{
|
366
|
-
|
367
|
-
|
368
|
-
}
|
268
|
+
// enforce instead of check
|
269
|
+
info.objectAddress = address(0);
|
369
270
|
|
370
|
-
if(
|
371
|
-
|
372
|
-
info.initialOwner == address(0)) {
|
373
|
-
// TODO non registered address can register object(e.g. POLICY()) and then transfer associated nft to registered contract
|
374
|
-
// what are motivations to do so?
|
375
|
-
// at least registered contract can not register objects by itself, SERVICE,
|
376
|
-
revert InvalidInitialOwner(info.initialOwner);
|
271
|
+
if(info.objectType != expectedType) {// type is checked in registry anyway...but service logic may depend on expected value
|
272
|
+
revert UnexpectedRegisterableType(expectedType, info.objectType);
|
377
273
|
}
|
378
274
|
|
379
|
-
|
380
|
-
/*if(info.initialOwner == msg.sender) {
|
381
|
-
revert InitialOwnerIsParent();
|
382
|
-
}
|
275
|
+
address owner = info.initialOwner;
|
383
276
|
|
384
|
-
if(
|
385
|
-
revert
|
277
|
+
if(owner == address(0)) {
|
278
|
+
revert RegisterableOwnerIsZero();
|
386
279
|
}
|
387
280
|
|
388
|
-
if(
|
389
|
-
revert
|
390
|
-
}
|
391
|
-
|
392
|
-
/*NftId parentNftId = info.parentNftId;
|
393
|
-
IRegistry.ObjectInfo memory parentInfo = getRegistry().getObjectInfo(parentNftId);
|
394
|
-
|
395
|
-
if(parentInfo.objectType != parentType) { // parent registration + type
|
396
|
-
revert InvalidParent(parentNftId);
|
397
|
-
}*/
|
281
|
+
if(getRegistry().isRegistered(owner)) {
|
282
|
+
revert RegisterableOwnerIsRegistered();
|
283
|
+
}
|
398
284
|
}
|
399
285
|
}
|
@@ -17,51 +17,41 @@ contract RegistryServiceManager is
|
|
17
17
|
{
|
18
18
|
bytes32 constant public ACCESS_MANAGER_CREATION_CODE_HASH = 0x0;
|
19
19
|
|
20
|
-
|
21
|
-
RegistryService private _registryService;
|
22
|
-
TokenRegistry private _tokenRegistry;
|
20
|
+
RegistryService private immutable _registryService;
|
23
21
|
|
24
22
|
/// @dev initializes proxy manager with registry service implementation and deploys registry
|
25
23
|
constructor(
|
26
|
-
address
|
27
|
-
|
28
|
-
ProxyManager()
|
24
|
+
address initialAuthority, // used by implementation
|
25
|
+
address registryAddress) // used by implementation
|
26
|
+
ProxyManager(registryAddress)
|
29
27
|
{
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
require(initialAuthority > address(0), "RegistryServiceManager: initial authority is 0");
|
29
|
+
require(registryAddress > address(0), "RegistryServiceManager: registry is 0");
|
30
|
+
|
31
|
+
// implementation's initializer func `data` argument
|
32
|
+
RegistryService srv = new RegistryService();
|
33
|
+
bytes memory data = abi.encode(registryAddress, initialAuthority);
|
34
34
|
IVersionable versionable = deploy(
|
35
|
-
address(
|
36
|
-
|
35
|
+
address(srv),
|
36
|
+
data);
|
37
37
|
|
38
38
|
_registryService = RegistryService(address(versionable));
|
39
39
|
|
40
|
-
|
41
|
-
_linkToNftOwnable(
|
42
|
-
address(_registryService.getRegistry()),
|
43
|
-
address(_registryService));
|
44
|
-
|
45
|
-
// deploy token registry
|
46
|
-
|
47
|
-
// _tokenRegistry = new TokenRegistry(
|
48
|
-
// address(_registryService.getRegistry()),
|
49
|
-
// address(_registryService));
|
50
|
-
|
51
|
-
// implies that after this constructor call only upgrade functionality is available
|
52
|
-
_isDeployed = true;
|
40
|
+
// _linkToNftOwnable(address(_registryService));
|
53
41
|
}
|
54
42
|
|
55
|
-
|
43
|
+
// // from IRegisterable
|
56
44
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
45
|
+
// // IMPORTANT: registry here and in constructor MUST be the same
|
46
|
+
function linkOwnershipToServiceNft()
|
47
|
+
public
|
48
|
+
onlyOwner
|
61
49
|
{
|
62
|
-
|
50
|
+
_linkToNftOwnable(address(_registryService));
|
63
51
|
}
|
64
52
|
|
53
|
+
//--- view functions ----------------------------------------------------//
|
54
|
+
|
65
55
|
function getRegistryService()
|
66
56
|
external
|
67
57
|
view
|
@@ -69,12 +59,4 @@ contract RegistryServiceManager is
|
|
69
59
|
{
|
70
60
|
return _registryService;
|
71
61
|
}
|
72
|
-
|
73
|
-
function getTokenRegistry()
|
74
|
-
external
|
75
|
-
view
|
76
|
-
returns (TokenRegistry)
|
77
|
-
{
|
78
|
-
return _tokenRegistry;
|
79
|
-
}
|
80
62
|
}
|