@etherisc/gif-next 0.0.2-bfb44e0-483 → 0.0.2-c0b400a-177
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +8 -8
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/components/Component.sol/Component.json +80 -145
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +125 -239
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IComponent.sol/IComponent.json +77 -92
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +102 -183
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +261 -201
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +81 -164
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +278 -288
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +85 -218
- 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 +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +64 -50
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.json +5 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +496 -536
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +105 -212
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +567 -621
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +448 -121
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +120 -227
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +170 -397
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +207 -116
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +8 -13
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.json +18 -220
- 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 +54 -71
- 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 +1 -1
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +182 -331
- 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 +141 -366
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +182 -107
- 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 +824 -268
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +312 -109
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.json +124 -206
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +89 -257
- 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 +514 -157
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +45 -289
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +69 -153
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +12 -177
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +85 -442
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +188 -141
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +116 -249
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +187 -104
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +42 -272
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +179 -104
- 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 +19 -0
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +71 -180
- 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 +31 -12
- 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 +90 -264
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +182 -113
- 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 +34 -67
- 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 +2 -2
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +4 -30
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +4 -30
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.json +0 -21
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +12 -177
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.json +0 -150
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +10 -62
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -23
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +171 -88
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +11 -74
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -23
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +13 -215
- 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 +0 -150
- 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 +11 -74
- 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 +31 -269
- 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 +6 -188
- 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 +96 -81
- package/contracts/components/Distribution.sol +29 -47
- package/contracts/components/IComponent.sol +40 -16
- package/contracts/components/IDistributionComponent.sol +1 -30
- package/contracts/components/IPoolComponent.sol +73 -47
- package/contracts/components/IProductComponent.sol +3 -2
- package/contracts/components/Pool.sol +171 -126
- package/contracts/components/Product.sol +38 -23
- package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +13 -0
- package/contracts/instance/BundleManager.sol +7 -5
- package/contracts/instance/Cloneable.sol +7 -2
- package/contracts/instance/IInstance.sol +23 -11
- package/contracts/instance/IInstanceService.sol +18 -5
- package/contracts/instance/Instance.sol +62 -16
- package/contracts/instance/InstanceAccessManager.sol +382 -157
- package/contracts/instance/InstanceReader.sol +7 -10
- package/contracts/instance/InstanceService.sol +222 -160
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/ObjectManager.sol +6 -8
- package/contracts/instance/base/ComponentService.sol +5 -5
- package/contracts/instance/base/KeyValueStore.sol +5 -2
- package/contracts/instance/base/Lifecycle.sol +11 -2
- package/contracts/instance/module/IAccess.sol +20 -13
- 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 -21
- package/contracts/instance/service/ApplicationService.sol +139 -57
- package/contracts/instance/service/ApplicationServiceManager.sol +35 -0
- package/contracts/instance/service/BundleService.sol +76 -38
- 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 +224 -31
- package/contracts/instance/service/DistributionServiceManager.sol +1 -1
- package/contracts/instance/service/IApplicationService.sol +9 -9
- package/contracts/instance/service/IBundleService.sol +19 -11
- package/contracts/instance/service/IClaimService.sol +61 -0
- package/contracts/instance/service/IDistributionService.sol +36 -3
- package/contracts/instance/service/IPolicyService.sol +18 -34
- package/contracts/instance/service/IPoolService.sol +17 -2
- package/contracts/instance/service/PolicyService.sol +74 -195
- package/contracts/instance/service/PolicyServiceManager.sol +2 -2
- package/contracts/instance/service/PoolService.sol +128 -17
- package/contracts/instance/service/PoolServiceManager.sol +1 -1
- package/contracts/instance/service/ProductService.sol +10 -2
- package/contracts/instance/service/ProductServiceManager.sol +2 -2
- package/contracts/registry/ChainNft.sol +8 -0
- package/contracts/registry/IRegistry.sol +2 -0
- package/contracts/registry/IRegistryService.sol +10 -8
- package/contracts/registry/ITransferInterceptor.sol +1 -0
- package/contracts/registry/Registry.sol +26 -21
- package/contracts/registry/RegistryService.sol +62 -40
- package/contracts/registry/RegistryServiceManager.sol +13 -13
- package/contracts/registry/ReleaseManager.sol +18 -28
- package/contracts/registry/TokenRegistry.sol +13 -10
- package/contracts/shared/ERC165.sol +2 -1
- package/contracts/shared/INftOwnable.sol +4 -9
- package/contracts/shared/IRegistryLinked.sol +0 -3
- package/contracts/shared/IService.sol +2 -0
- package/contracts/shared/IVersionable.sol +4 -47
- package/contracts/shared/NftOwnable.sol +10 -80
- package/contracts/shared/ProxyManager.sol +98 -24
- package/contracts/shared/Registerable.sol +3 -10
- package/contracts/shared/RegistryLinked.sol +10 -26
- package/contracts/shared/Service.sol +10 -12
- package/contracts/shared/TokenHandler.sol +11 -5
- package/contracts/shared/Versionable.sol +1 -90
- package/contracts/types/Blocknumber.sol +1 -0
- package/contracts/types/ClaimId.sol +52 -0
- package/contracts/types/Fee.sol +1 -0
- package/contracts/types/NftId.sol +8 -0
- package/contracts/types/ObjectType.sol +5 -4
- package/contracts/types/PayoutId.sol +54 -0
- package/contracts/types/Referral.sol +4 -0
- package/contracts/types/RoleId.sol +16 -9
- 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 +1 -1
- 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/IB.sol/IB.json +0 -50
- 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
@@ -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);
|
@@ -5,7 +5,7 @@ import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
|
5
5
|
|
6
6
|
import {NftId, toNftId, zeroNftId} from "../types/NftId.sol";
|
7
7
|
import {VersionPart} from "../types/Version.sol";
|
8
|
-
import {ObjectType, PROTOCOL, REGISTRY, TOKEN, SERVICE, INSTANCE, STAKE, PRODUCT, DISTRIBUTION, ORACLE, POOL, POLICY, BUNDLE} from "../types/ObjectType.sol";
|
8
|
+
import {ObjectType, PROTOCOL, REGISTRY, TOKEN, SERVICE, INSTANCE, STAKE, PRODUCT, DISTRIBUTION, DISTRIBUTOR, ORACLE, POOL, POLICY, BUNDLE} from "../types/ObjectType.sol";
|
9
9
|
|
10
10
|
import {ChainNft} from "./ChainNft.sol";
|
11
11
|
import {IRegistry} from "./IRegistry.sol";
|
@@ -149,7 +149,6 @@ contract Registry is
|
|
149
149
|
}
|
150
150
|
|
151
151
|
if(
|
152
|
-
|
153
152
|
parentType == PROTOCOL() ||
|
154
153
|
parentType == REGISTRY() ||
|
155
154
|
parentType == SERVICE()
|
@@ -186,7 +185,7 @@ contract Registry is
|
|
186
185
|
return _releaseManager.getReleaseInfo(version);
|
187
186
|
}
|
188
187
|
|
189
|
-
function getObjectCount() external view
|
188
|
+
function getObjectCount() external view returns (uint256) {
|
190
189
|
return _chainNft.totalSupply();
|
191
190
|
}
|
192
191
|
|
@@ -198,11 +197,11 @@ contract Registry is
|
|
198
197
|
return _registryNftId;
|
199
198
|
}
|
200
199
|
|
201
|
-
function getNftId(address object) external view
|
200
|
+
function getNftId(address object) external view returns (NftId id) {
|
202
201
|
return _nftIdByAddress[object];
|
203
202
|
}
|
204
203
|
|
205
|
-
function ownerOf(NftId nftId) public view
|
204
|
+
function ownerOf(NftId nftId) public view returns (address) {
|
206
205
|
return _chainNft.ownerOf(nftId.toInt());
|
207
206
|
}
|
208
207
|
|
@@ -210,26 +209,31 @@ contract Registry is
|
|
210
209
|
return _chainNft.ownerOf(_nftIdByAddress[contractAddress].toInt());
|
211
210
|
}
|
212
211
|
|
213
|
-
function getObjectInfo(NftId nftId) external view
|
212
|
+
function getObjectInfo(NftId nftId) external view returns (ObjectInfo memory) {
|
214
213
|
return _info[nftId];
|
215
214
|
}
|
216
215
|
|
217
|
-
function getObjectInfo(address object) external view
|
216
|
+
function getObjectInfo(address object) external view returns (ObjectInfo memory) {
|
218
217
|
return _info[_nftIdByAddress[object]];
|
219
218
|
}
|
220
219
|
|
221
|
-
function isRegistered(NftId nftId) public view
|
220
|
+
function isRegistered(NftId nftId) public view returns (bool) {
|
222
221
|
return _info[nftId].objectType.gtz();
|
223
222
|
}
|
224
223
|
|
225
|
-
function isRegistered(address object) external view
|
224
|
+
function isRegistered(address object) external view returns (bool) {
|
226
225
|
return _nftIdByAddress[object].gtz();
|
227
226
|
}
|
228
227
|
|
229
|
-
function isRegisteredService(address object) external view
|
228
|
+
function isRegisteredService(address object) external view returns (bool) {
|
230
229
|
return _info[_nftIdByAddress[object]].objectType == SERVICE();
|
231
230
|
}
|
232
231
|
|
232
|
+
function isRegisteredComponent(address object) external view returns (bool) {
|
233
|
+
NftId objectParentNftId = _info[_nftIdByAddress[object]].parentNftId;
|
234
|
+
return _info[objectParentNftId].objectType == INSTANCE();
|
235
|
+
}
|
236
|
+
|
233
237
|
function isValidRelease(VersionPart version) external view returns (bool)
|
234
238
|
{
|
235
239
|
return _releaseManager.isValidRelease(version);
|
@@ -287,18 +291,9 @@ contract Registry is
|
|
287
291
|
}
|
288
292
|
|
289
293
|
address interceptor = _getInterceptor(info.isInterceptor, info.objectAddress, parentInfo.isInterceptor, parentAddress);
|
294
|
+
uint256 tokenId = _chainNft.getNextTokenId();
|
295
|
+
nftId = toNftId(tokenId);
|
290
296
|
|
291
|
-
// TODO does external call
|
292
|
-
// compute next nftId, do all checks and stores, mint() at most end...
|
293
|
-
uint256 mintedTokenId = _chainNft.mint(
|
294
|
-
info.initialOwner,
|
295
|
-
interceptor,
|
296
|
-
EMPTY_URI);
|
297
|
-
nftId = toNftId(mintedTokenId);
|
298
|
-
|
299
|
-
// TODO move nftId out of info struct
|
300
|
-
// getters by nftId -> return struct without nftId
|
301
|
-
// getters by address -> return nftId AND struct
|
302
297
|
info.nftId = nftId;
|
303
298
|
_info[nftId] = info;
|
304
299
|
|
@@ -314,6 +309,14 @@ contract Registry is
|
|
314
309
|
}
|
315
310
|
|
316
311
|
emit LogRegistration(nftId, parentNftId, objectType, info.isInterceptor, info.objectAddress, info.initialOwner);
|
312
|
+
|
313
|
+
// calls nft receiver(1) and interceptor(2)
|
314
|
+
uint256 mintedTokenId = _chainNft.mint(
|
315
|
+
info.initialOwner,
|
316
|
+
interceptor,
|
317
|
+
EMPTY_URI);
|
318
|
+
assert(mintedTokenId == tokenId);
|
319
|
+
|
317
320
|
}
|
318
321
|
|
319
322
|
/// @dev obtain interceptor address for this nft if applicable, address(0) otherwise
|
@@ -452,6 +455,8 @@ contract Registry is
|
|
452
455
|
_coreContractCombinations[ORACLE()][INSTANCE()] = true;
|
453
456
|
_coreContractCombinations[POOL()][INSTANCE()] = true;
|
454
457
|
|
458
|
+
_coreObjectCombinations[DISTRIBUTOR()][DISTRIBUTION()] = true;
|
459
|
+
|
455
460
|
// product as parent, ONLY approved
|
456
461
|
_coreObjectCombinations[POLICY()][PRODUCT()] = true;
|
457
462
|
|
@@ -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
|
@@ -103,6 +130,15 @@ contract RegistryService is
|
|
103
130
|
info.nftId = getRegistry().register(info);
|
104
131
|
}
|
105
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);
|
140
|
+
}
|
141
|
+
|
106
142
|
function registerPolicy(IRegistry.ObjectInfo memory info)
|
107
143
|
external
|
108
144
|
restricted
|
@@ -133,33 +169,6 @@ contract RegistryService is
|
|
133
169
|
nftId = getRegistry().register(info);
|
134
170
|
}
|
135
171
|
|
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
|
-
registerInterface(type(IRegistryService).interfaceId);
|
161
|
-
}
|
162
|
-
|
163
172
|
// from IRegisterable
|
164
173
|
|
165
174
|
function getFunctionConfigs()
|
@@ -169,30 +178,43 @@ contract RegistryService is
|
|
169
178
|
FunctionConfig[] memory config
|
170
179
|
)
|
171
180
|
{
|
172
|
-
config = new FunctionConfig[](
|
181
|
+
config = new FunctionConfig[](8);
|
173
182
|
|
174
183
|
// order of service registrations MUST be reverse to this array
|
175
184
|
/*config[-1].serviceDomain = STAKE();
|
176
185
|
config[-1].selector = RegistryService.registerStake.selector;*/
|
177
186
|
|
178
187
|
config[0].serviceDomain = POLICY();
|
179
|
-
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);
|
180
196
|
|
181
|
-
config[
|
182
|
-
config[
|
197
|
+
config[3].serviceDomain = BUNDLE();
|
198
|
+
config[3].selectors = new bytes4[](1);
|
199
|
+
config[3].selectors[0] = RegistryService.registerBundle.selector;
|
183
200
|
|
184
|
-
config[
|
185
|
-
config[
|
201
|
+
config[4].serviceDomain = PRODUCT();
|
202
|
+
config[4].selectors = new bytes4[](1);
|
203
|
+
config[4].selectors[0] = RegistryService.registerProduct.selector;
|
186
204
|
|
187
|
-
config[
|
188
|
-
config[
|
205
|
+
config[5].serviceDomain = POOL();
|
206
|
+
config[5].selectors = new bytes4[](1);
|
207
|
+
config[5].selectors[0] = RegistryService.registerPool.selector;
|
189
208
|
|
190
|
-
config[
|
191
|
-
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;
|
192
213
|
|
193
214
|
// registerInstance() have no restriction
|
194
|
-
config[
|
195
|
-
config[
|
215
|
+
config[7].serviceDomain = INSTANCE();
|
216
|
+
config[7].selectors = new bytes4[](1);
|
217
|
+
config[7].selectors[0] = RegistryService.registerInstance.selector;
|
196
218
|
}
|
197
219
|
|
198
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 ----------------------------------------------------//
|
@@ -41,7 +41,7 @@ contract ReleaseManager is AccessManaged
|
|
41
41
|
error SelfRegistration();
|
42
42
|
error RegisterableOwnerIsRegistered();
|
43
43
|
|
44
|
-
//
|
44
|
+
// _verifyService
|
45
45
|
error UnexpectedServiceVersion(VersionPart expected, VersionPart found);
|
46
46
|
error UnexpectedServiceDomain(ObjectType expected, ObjectType found);
|
47
47
|
|
@@ -61,7 +61,7 @@ contract ReleaseManager is AccessManaged
|
|
61
61
|
|
62
62
|
mapping(VersionPart version => IRegistry.ReleaseInfo info) _release;
|
63
63
|
|
64
|
-
mapping(VersionPart version => mapping(ObjectType serviceDomain => bytes4))
|
64
|
+
mapping(VersionPart version => mapping(ObjectType serviceDomain => bytes4[])) _selectors; // registry service function selector assigned to domain
|
65
65
|
|
66
66
|
uint _awaitingRegistration; // "services left to register" counter
|
67
67
|
|
@@ -148,12 +148,8 @@ contract ReleaseManager is AccessManaged
|
|
148
148
|
|
149
149
|
VersionPart version = _next;
|
150
150
|
ObjectType domain = REGISTRY();
|
151
|
-
|
152
|
-
|
153
|
-
// data: config bytes
|
151
|
+
_verifyService(service, version, domain);
|
154
152
|
_createRelease(service.getFunctionConfigs());
|
155
|
-
|
156
|
-
//setTargetClosed(service, true);
|
157
153
|
|
158
154
|
nftId = _registry.registerService(info, version, domain);
|
159
155
|
|
@@ -175,17 +171,16 @@ contract ReleaseManager is AccessManaged
|
|
175
171
|
IRegistry.ObjectInfo memory info = _getAndVerifyContractInfo(service, SERVICE(), msg.sender);
|
176
172
|
VersionPart version = getNextVersion();
|
177
173
|
ObjectType domain = _release[version].domains[_awaitingRegistration];// reversed registration order of services specified in RegistryService config
|
178
|
-
|
174
|
+
_verifyService(service, version, domain);
|
179
175
|
|
180
176
|
// setup and grant unique role if service does registrations
|
181
|
-
bytes4[] memory
|
182
|
-
selector[0] = _selector[version][domain];
|
177
|
+
bytes4[] memory selectors = _selectors[version][domain];
|
183
178
|
address registryService = _registry.getServiceAddress(REGISTRY(), version);
|
184
|
-
if(
|
179
|
+
if(selectors.length > 0) {
|
185
180
|
_accessManager.setAndGrantUniqueRole(
|
186
181
|
address(service),
|
187
182
|
registryService,
|
188
|
-
|
183
|
+
selectors);
|
189
184
|
}
|
190
185
|
|
191
186
|
_awaitingRegistration--;
|
@@ -267,8 +262,8 @@ contract ReleaseManager is AccessManaged
|
|
267
262
|
}
|
268
263
|
}
|
269
264
|
|
270
|
-
function
|
271
|
-
|
265
|
+
function _verifyService(
|
266
|
+
IService service,
|
272
267
|
VersionPart expectedVersion,
|
273
268
|
ObjectType expectedDomain
|
274
269
|
)
|
@@ -276,20 +271,15 @@ contract ReleaseManager is AccessManaged
|
|
276
271
|
view
|
277
272
|
returns(ObjectType)
|
278
273
|
{
|
279
|
-
(
|
280
|
-
|
281
|
-
VersionPart version
|
282
|
-
) = abi.decode(info.data, (ObjectType, VersionPart));
|
283
|
-
|
284
|
-
if(version != expectedVersion) {
|
285
|
-
revert UnexpectedServiceVersion(expectedVersion, version);
|
274
|
+
if(service.getMajorVersion() != expectedVersion) {
|
275
|
+
revert UnexpectedServiceVersion(expectedVersion, service.getMajorVersion());
|
286
276
|
}
|
287
277
|
|
288
|
-
if(
|
289
|
-
revert UnexpectedServiceDomain(expectedDomain,
|
278
|
+
if(service.getDomain() != expectedDomain) {
|
279
|
+
revert UnexpectedServiceDomain(expectedDomain, service.getDomain());
|
290
280
|
}
|
291
281
|
|
292
|
-
return
|
282
|
+
return expectedDomain;
|
293
283
|
}
|
294
284
|
|
295
285
|
// TODO check if registry supports types specified in the config array
|
@@ -306,21 +296,21 @@ contract ReleaseManager is AccessManaged
|
|
306
296
|
for(uint idx = 0; idx < config.length; idx++)
|
307
297
|
{
|
308
298
|
ObjectType domain = config[idx].serviceDomain;
|
309
|
-
bytes4 selector = config[idx].selector;
|
310
|
-
|
311
299
|
// not "registry service" / zero domain
|
312
300
|
if(
|
313
301
|
domain == REGISTRY() ||
|
314
302
|
domain.eqz()
|
315
303
|
) { revert ConfigServiceDomainInvalid(idx, domain); }
|
316
304
|
|
305
|
+
bytes4[] memory selectors = config[idx].selectors;
|
306
|
+
|
317
307
|
// TODO can be zero -> e.g. duplicate domain, first with zero selector, second with non zero selector -> need to check _release[version].domains.contains(domain) instead
|
318
308
|
// no overwrite
|
319
|
-
if(
|
309
|
+
if(_selectors[version][domain].length > 0) {
|
320
310
|
revert SelectorAlreadyExists(version, domain);
|
321
311
|
}
|
322
312
|
|
323
|
-
|
313
|
+
_selectors[version][domain] = selectors;
|
324
314
|
_release[version].domains.push(domain);
|
325
315
|
}
|
326
316
|
// TODO set when activated?
|
@@ -26,9 +26,18 @@ contract TokenRegistry is
|
|
26
26
|
mapping(address token => bool registered) internal _registered;
|
27
27
|
mapping(address token => mapping(VersionPart majorVersion => bool isActive)) internal _active;
|
28
28
|
|
29
|
-
constructor(
|
29
|
+
constructor(
|
30
|
+
address registry
|
31
|
+
)
|
30
32
|
{
|
31
|
-
|
33
|
+
initialize(registry);
|
34
|
+
}
|
35
|
+
|
36
|
+
function initialize(address registry)
|
37
|
+
public
|
38
|
+
initializer()
|
39
|
+
{
|
40
|
+
initializeNftOwnable(msg.sender, registry);
|
32
41
|
}
|
33
42
|
|
34
43
|
|
@@ -41,9 +50,8 @@ contract TokenRegistry is
|
|
41
50
|
IRegistry registry = IRegistry(registryAddress);
|
42
51
|
// TODO use _latest instead of _initial -> but _latest is 0 before first release activation
|
43
52
|
address registryServiceAddress = registry.getServiceAddress(REGISTRY(), registry.getNextVersion());
|
44
|
-
//address registryServiceAddress = registry.getServiceAddress(REGISTRY(), registry.getInitialVersion());
|
45
53
|
|
46
|
-
_linkToNftOwnable(
|
54
|
+
_linkToNftOwnable(registryServiceAddress);
|
47
55
|
}
|
48
56
|
|
49
57
|
/// @dev token state is informative, registry have no clue about used tokens
|
@@ -94,12 +102,7 @@ contract TokenRegistry is
|
|
94
102
|
revert NotContract(token);
|
95
103
|
}
|
96
104
|
|
97
|
-
// MUST
|
98
|
-
if(ERC165Checker.supportsInterface(token, type(IRegisterable).interfaceId)) {
|
99
|
-
revert NotToken(token);
|
100
|
-
}
|
101
|
-
|
102
|
-
// MUST have decimals > 0
|
105
|
+
// MUST have decimals > 0 (indicator that this is in fact an erc20 token)
|
103
106
|
IERC20Metadata erc20 = IERC20Metadata(token);
|
104
107
|
if(erc20.decimals() == 0) {
|
105
108
|
revert TokenDecimalsZero();
|
@@ -10,12 +10,13 @@ contract ERC165 is
|
|
10
10
|
{
|
11
11
|
mapping(bytes4 => bool) private _isSupported;
|
12
12
|
|
13
|
-
// @dev
|
13
|
+
// @dev initializes with support for ERC165
|
14
14
|
function initializeERC165() public onlyInitializing() {
|
15
15
|
_isSupported[type(IERC165).interfaceId] = true;
|
16
16
|
}
|
17
17
|
|
18
18
|
// @dev register support for provided interfaceId
|
19
|
+
// includes initialization for ERC165_ID if not yet done
|
19
20
|
function registerInterface(bytes4 interfaceId) public onlyInitializing() {
|
20
21
|
_isSupported[interfaceId] = true;
|
21
22
|
}
|
@@ -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 {IRegistry} from "../registry/IRegistry.sol";
|
7
6
|
import {IRegistryLinked} from "./IRegistryLinked.sol";
|
8
7
|
import {NftId} from "../types/NftId.sol";
|
9
8
|
|
@@ -11,15 +10,11 @@ interface INftOwnable is
|
|
11
10
|
IERC165,
|
12
11
|
IRegistryLinked
|
13
12
|
{
|
14
|
-
error
|
15
|
-
error
|
13
|
+
error ErrorNftOwnableInitialOwnerZero();
|
14
|
+
error ErrorNftOwnableNotOwner(address account);
|
16
15
|
|
17
|
-
error
|
18
|
-
|
19
|
-
// error ErrorRegistryNotInitialized();
|
20
|
-
// error ErrorRegistryAddressZero();
|
21
|
-
// error ErrorNotRegistry(address registryAddress);
|
22
|
-
error ErrorContractNotRegistered(address contractAddress);
|
16
|
+
error ErrorNftOwnableAlreadyLinked(NftId nftId);
|
17
|
+
error ErrorNftOwnableContractNotRegistered(address contractAddress);
|
23
18
|
|
24
19
|
function linkToRegisteredNftId() external;
|
25
20
|
|
@@ -5,9 +5,6 @@ import {IRegistry} from "../registry/IRegistry.sol";
|
|
5
5
|
|
6
6
|
interface IRegistryLinked {
|
7
7
|
|
8
|
-
error ErrorRegistryAlreadyInitialized(address registry);
|
9
|
-
error ErrorRegistryNotInitialized();
|
10
|
-
error ErrorRegistryAddressZero();
|
11
8
|
error ErrorNotRegistry(address registryAddress);
|
12
9
|
|
13
10
|
function getRegistry() external view returns (IRegistry);
|
@@ -11,6 +11,8 @@ interface IService is
|
|
11
11
|
IRegisterable,
|
12
12
|
IVersionable
|
13
13
|
{
|
14
|
+
error ErrorIServiceCallerUnknown(address caller);
|
15
|
+
|
14
16
|
function getDomain() external pure returns(ObjectType serviceDomain);
|
15
17
|
function getMajorVersion() external view returns(VersionPart majorVersion);
|
16
18
|
}
|