@etherisc/gif-next 0.0.2-d5522f6-712 → 0.0.2-d5b7b78-706
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +73 -1
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +4 -0
- package/artifacts/contracts/components/Component.sol/Component.json +832 -0
- package/artifacts/contracts/components/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/components/Distribution.sol/Distribution.json +747 -103
- package/artifacts/contracts/components/IComponent.sol/IComponent.dbg.json +4 -0
- package/artifacts/contracts/components/{BaseComponent.sol/BaseComponent.json → IComponent.sol/IComponent.json} +137 -114
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IDistributionComponent.sol/IDistributionComponent.json +743 -26
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IPoolComponent.sol/IPoolComponent.json +737 -58
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/components/IProductComponent.sol/IProductComponent.json +582 -9
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/components/Pool.sol/Pool.json +692 -178
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/components/Product.sol/Product.json +517 -135
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +1 -1
- package/artifacts/contracts/instance/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +15 -15
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +69 -79
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/Cloneable.sol/Cloneable.json +5 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +1003 -393
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +194 -197
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +1015 -781
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +440 -176
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +120 -263
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +369 -299
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +330 -89
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/ObjectManager.sol/ObjectManager.json +11 -40
- package/artifacts/contracts/instance/base/ComponentService.sol/ComponentService.dbg.json +4 -0
- package/artifacts/contracts/instance/base/{ComponentServiceBase.sol/ComponentServiceBase.json → ComponentService.sol/ComponentService.json} +178 -158
- 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 +61 -78
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +4 -0
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.json +10 -0
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/instance/module/ISetup.sol/ISetup.dbg.json +1 -1
- package/artifacts/contracts/instance/module/ITreasury.sol/ITreasury.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ApplicationService.sol/ApplicationService.json +968 -0
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/service/ApplicationServiceManager.sol/ApplicationServiceManager.json +665 -0
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleService.sol/BundleService.json +363 -301
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/BundleServiceManager.sol/BundleServiceManager.json +305 -80
- 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 +1211 -172
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/DistributionServiceManager.sol/DistributionServiceManager.json +456 -71
- package/artifacts/contracts/instance/service/IApplicationService.sol/IApplicationService.dbg.json +4 -0
- package/artifacts/contracts/instance/service/{IComponentOwnerService.sol/IComponentOwnerService.json → IApplicationService.sol/IApplicationService.json} +275 -185
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IBundleService.sol/IBundleService.json +155 -245
- package/artifacts/contracts/instance/service/IClaimService.sol/IClaimService.dbg.json +4 -0
- package/artifacts/contracts/{components/IBaseComponent.sol/IBaseComponent.json → instance/service/IClaimService.sol/IClaimService.json} +159 -147
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IDistributionService.sol/IDistributionService.json +728 -161
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPolicyService.sol/IPolicyService.json +60 -291
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IPoolService.sol/IPoolService.json +81 -152
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/IProductService.sol/IProductService.json +22 -174
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyService.sol/PolicyService.json +244 -379
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PolicyServiceManager.sol/PolicyServiceManager.json +311 -114
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolService.sol/PoolService.json +289 -192
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/PoolServiceManager.sol/PoolServiceManager.json +313 -76
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductService.sol/ProductService.json +206 -206
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/service/ProductServiceManager.sol/ProductServiceManager.json +305 -76
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +15 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +117 -5
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +112 -198
- 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 +131 -27
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +18 -18
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +216 -234
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +300 -81
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +70 -69
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +151 -50
- 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 +22 -174
- 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 +114 -157
- 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 +135 -214
- package/artifacts/contracts/test/TestToken.sol/TestUsdc.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersion.sol/TestVersion.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersion.sol/TestVersion.json +2 -2
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.dbg.json +1 -1
- package/artifacts/contracts/test/TestVersionable.sol/TestVersionable.json +8 -190
- package/artifacts/contracts/test/Usdc.sol/USDC.dbg.json +1 -1
- package/artifacts/contracts/types/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.json +2 -2
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/ClaimId.sol/ClaimIdLib.json +100 -0
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/types/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/types/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/types/Fee.sol/FeeLib.json +2 -2
- package/artifacts/contracts/types/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/types/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/NftId.sol/NftIdLib.json +17 -4
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/types/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/types/NumberId.sol/NumberIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/types/ObjectType.sol/ObjectTypeLib.json +2 -2
- package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.dbg.json +4 -0
- package/artifacts/contracts/types/PayoutId.sol/PayoutIdLib.json +100 -0
- package/artifacts/contracts/types/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/types/Referral.sol/ReferralLib.json +23 -4
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/RiskId.sol/RiskIdLib.json +2 -2
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/RoleId.sol/RoleIdLib.json +2 -2
- package/artifacts/contracts/types/Seconds.sol/SecondsLib.dbg.json +4 -0
- package/artifacts/contracts/types/Seconds.sol/SecondsLib.json +124 -0
- package/artifacts/contracts/types/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/types/StateId.sol/StateIdLib.json +2 -2
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +25 -7
- package/artifacts/contracts/types/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/MathLib.json +2 -2
- package/artifacts/contracts/types/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/types/UFixed.sol/UFixedLib.json +2 -2
- package/artifacts/contracts/types/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionLib.json +2 -2
- package/artifacts/contracts/types/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/types/Version.sol/VersionPartLib.json +2 -2
- package/contracts/components/Component.sol +251 -0
- package/contracts/components/Distribution.sol +199 -83
- package/contracts/components/IComponent.sol +74 -0
- package/contracts/components/IDistributionComponent.sol +44 -17
- package/contracts/components/IPoolComponent.sol +88 -41
- package/contracts/components/IProductComponent.sol +10 -5
- package/contracts/components/Pool.sol +209 -182
- package/contracts/components/Product.sol +118 -126
- package/contracts/instance/AccessManagerUpgradeableInitializeable.sol +2 -12
- package/contracts/instance/BundleManager.sol +14 -16
- package/contracts/instance/Cloneable.sol +7 -2
- package/contracts/instance/IInstance.sol +52 -16
- package/contracts/instance/IInstanceService.sol +37 -5
- package/contracts/instance/Instance.sol +126 -75
- package/contracts/instance/InstanceAccessManager.sol +383 -164
- package/contracts/instance/InstanceReader.sol +9 -34
- package/contracts/instance/InstanceService.sol +277 -127
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/ObjectManager.sol +10 -29
- package/contracts/instance/base/ComponentService.sol +134 -0
- package/contracts/instance/base/KeyValueStore.sol +5 -2
- package/contracts/instance/base/Lifecycle.sol +11 -2
- package/contracts/instance/module/IAccess.sol +22 -16
- package/contracts/instance/module/IBundle.sol +2 -1
- package/contracts/instance/module/IComponents.sol +35 -0
- package/contracts/instance/module/IDistribution.sol +2 -0
- package/contracts/instance/module/IPolicy.sol +30 -3
- package/contracts/instance/module/ISetup.sol +7 -20
- package/contracts/instance/service/ApplicationService.sol +350 -0
- package/contracts/instance/service/ApplicationServiceManager.sol +35 -0
- package/contracts/instance/service/BundleService.sol +84 -42
- 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 +393 -46
- package/contracts/instance/service/DistributionServiceManager.sol +1 -1
- package/contracts/instance/service/IApplicationService.sol +82 -0
- package/contracts/instance/service/IBundleService.sol +30 -12
- package/contracts/instance/service/IClaimService.sol +61 -0
- package/contracts/instance/service/IDistributionService.sol +86 -0
- package/contracts/instance/service/IPolicyService.sol +27 -49
- package/contracts/instance/service/IPoolService.sol +17 -2
- package/contracts/instance/service/PolicyService.sol +149 -285
- package/contracts/instance/service/PolicyServiceManager.sol +2 -2
- package/contracts/instance/service/PoolService.sol +136 -61
- package/contracts/instance/service/PoolServiceManager.sol +1 -1
- package/contracts/instance/service/ProductService.sol +62 -34
- package/contracts/instance/service/ProductServiceManager.sol +2 -2
- package/contracts/registry/ChainNft.sol +8 -0
- package/contracts/registry/IRegistry.sol +18 -8
- package/contracts/registry/IRegistryService.sol +19 -10
- package/contracts/registry/ITransferInterceptor.sol +1 -0
- package/contracts/registry/Registry.sol +142 -71
- package/contracts/registry/RegistryAccessManager.sol +31 -25
- package/contracts/registry/RegistryService.sol +94 -130
- package/contracts/registry/RegistryServiceManager.sol +13 -13
- package/contracts/registry/ReleaseManager.sol +94 -120
- package/contracts/registry/TokenRegistry.sol +19 -13
- 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 +2 -0
- package/contracts/shared/IVersionable.sol +4 -47
- package/contracts/shared/NftOwnable.sol +66 -80
- package/contracts/shared/PolicyHolder.sol +81 -0
- package/contracts/shared/ProxyManager.sol +100 -25
- package/contracts/shared/Registerable.sol +16 -32
- package/contracts/shared/RegistryLinked.sol +48 -0
- package/contracts/shared/Service.sol +19 -19
- package/contracts/shared/TokenHandler.sol +11 -5
- package/contracts/shared/Versionable.sol +4 -92
- package/contracts/test/TestRegisterable.sol +1 -1
- package/contracts/test/TestService.sol +1 -1
- package/contracts/types/Blocknumber.sol +1 -0
- package/contracts/types/ClaimId.sol +52 -0
- package/contracts/types/DistributorType.sol +2 -2
- package/contracts/types/Fee.sol +1 -0
- package/contracts/types/NftId.sol +8 -0
- package/contracts/types/ObjectType.sol +10 -5
- package/contracts/types/PayoutId.sol +54 -0
- package/contracts/types/Referral.sol +4 -0
- package/contracts/types/RoleId.sol +18 -11
- package/contracts/types/Seconds.sol +54 -0
- package/contracts/types/StateId.sol +1 -0
- package/contracts/types/Timestamp.sol +13 -13
- package/contracts/types/UFixed.sol +1 -0
- package/contracts/types/Version.sol +1 -0
- package/package.json +3 -3
- package/artifacts/contracts/components/BaseComponent.sol/BaseComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IBaseComponent.sol/IBaseComponent.dbg.json +0 -4
- package/artifacts/contracts/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/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/IInstanceBase.sol/IInstanceBase.json +0 -448
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceBase.sol/InstanceBase.json +0 -763
- package/artifacts/contracts/instance/base/ComponentServiceBase.sol/ComponentServiceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.dbg.json +0 -4
- package/artifacts/contracts/instance/base/IInstanceBase.sol/IInstanceBase.json +0 -113
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/instance/service/ComponentOwnerService.sol/ComponentOwnerService.json +0 -814
- package/artifacts/contracts/instance/service/IComponentOwnerService.sol/IComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.dbg.json +0 -4
- package/artifacts/contracts/shared/RegisterableUpgradable.sol/RegisterableUpgradable.json +0 -442
- package/contracts/components/BaseComponent.sol +0 -159
- package/contracts/components/IBaseComponent.sol +0 -34
- 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/IInstanceBase.sol +0 -26
- package/contracts/instance/InstanceBase.sol +0 -41
- package/contracts/instance/base/ComponentServiceBase.sol +0 -76
- package/contracts/instance/base/IInstanceBase.sol +0 -23
- package/contracts/instance/service/ComponentOwnerService.sol +0 -315
- package/contracts/instance/service/IComponentOwnerService.sol +0 -20
- package/contracts/shared/RegisterableUpgradable.sol +0 -16
@@ -6,35 +6,38 @@ import {IRegistry} from "../../registry/IRegistry.sol";
|
|
6
6
|
import {IInstance} from "../../instance/IInstance.sol";
|
7
7
|
import {IBundle} from "../../instance/module/IBundle.sol";
|
8
8
|
import {TokenHandler} from "../../instance/module/ITreasury.sol";
|
9
|
-
import {
|
9
|
+
import {IComponents} from "../module/IComponents.sol";
|
10
10
|
import {IPolicy} from "../module/IPolicy.sol";
|
11
11
|
|
12
12
|
import {IVersionable} from "../../shared/IVersionable.sol";
|
13
13
|
import {Versionable} from "../../shared/Versionable.sol";
|
14
14
|
import {INftOwnable} from "../../shared/INftOwnable.sol";
|
15
15
|
|
16
|
+
import {Fee, FeeLib} from "../../types/Fee.sol";
|
16
17
|
import {NftId, NftIdLib, zeroNftId} from "../../types/NftId.sol";
|
17
18
|
import {ObjectType, POOL, BUNDLE} from "../../types/ObjectType.sol";
|
18
|
-
import {POOL_OWNER_ROLE, RoleId} from "../../types/RoleId.sol";
|
19
|
+
import {PUBLIC_ROLE, POOL_OWNER_ROLE, POLICY_SERVICE_ROLE, RoleId} from "../../types/RoleId.sol";
|
19
20
|
import {Fee, FeeLib} from "../../types/Fee.sol";
|
20
21
|
import {Version, VersionLib} from "../../types/Version.sol";
|
21
22
|
import {KEEP_STATE, StateId} from "../../types/StateId.sol";
|
22
23
|
import {TimestampLib, zeroTimestamp} from "../../types/Timestamp.sol";
|
24
|
+
import {Version, VersionLib} from "../../types/Version.sol";
|
23
25
|
|
24
26
|
import {IService} from "../../shared/IService.sol";
|
25
27
|
import {Service} from "../../shared/Service.sol";
|
26
28
|
import {BundleManager} from "../BundleManager.sol";
|
27
|
-
import {
|
29
|
+
import {ComponentService} from "../base/ComponentService.sol";
|
28
30
|
import {IPoolService} from "./IPoolService.sol";
|
29
31
|
import {IRegistryService} from "../../registry/IRegistryService.sol";
|
30
32
|
import {InstanceService} from "../InstanceService.sol";
|
31
33
|
import {InstanceReader} from "../InstanceReader.sol";
|
32
|
-
import {
|
34
|
+
import {IComponent} from "../../components/IComponent.sol";
|
35
|
+
import {IPoolComponent} from "../../components/IPoolComponent.sol";
|
33
36
|
|
34
37
|
string constant POOL_SERVICE_NAME = "PoolService";
|
35
38
|
|
36
39
|
contract PoolService is
|
37
|
-
|
40
|
+
ComponentService,
|
38
41
|
IPoolService
|
39
42
|
{
|
40
43
|
using NftIdLib for NftId;
|
@@ -54,92 +57,164 @@ contract PoolService is
|
|
54
57
|
(registryAddress, initialOwner) = abi.decode(data, (address, address));
|
55
58
|
// TODO while PoolService is not deployed in PoolServiceManager constructor
|
56
59
|
// owner is PoolServiceManager deployer
|
57
|
-
|
58
|
-
|
59
|
-
_registerInterface(type(IPoolService).interfaceId);
|
60
|
+
initializeService(registryAddress, owner);
|
61
|
+
registerInterface(type(IPoolService).interfaceId);
|
60
62
|
}
|
61
63
|
|
62
64
|
function getDomain() public pure override(Service, IService) returns(ObjectType) {
|
63
65
|
return POOL();
|
64
66
|
}
|
65
67
|
|
66
|
-
function register(address poolAddress)
|
68
|
+
/*function register(address poolAddress)
|
67
69
|
external
|
68
70
|
returns(NftId poolNftId)
|
69
71
|
{
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
72
|
+
(
|
73
|
+
IComponent component,
|
74
|
+
address owner,
|
75
|
+
IInstance instance,
|
76
|
+
NftId instanceNftId
|
77
|
+
) = _checkComponentForRegistration(
|
78
|
+
poolAddress,
|
79
|
+
POOL(),
|
80
|
+
POOL_OWNER_ROLE());
|
81
|
+
|
82
|
+
IPoolComponent pool = IPoolComponent(poolAddress);
|
83
|
+
IRegistry.ObjectInfo memory registryInfo = getRegistryService().registerPool(pool, owner);
|
84
|
+
pool.linkToRegisteredNftId();
|
85
|
+
poolNftId = registryInfo.nftId;
|
86
|
+
|
87
|
+
instance.createPoolSetup(poolNftId, pool.getSetupInfo());
|
88
|
+
|
89
|
+
bytes4[][] memory selectors = new bytes4[][](2);
|
90
|
+
selectors[0] = new bytes4[](1);
|
91
|
+
selectors[1] = new bytes4[](1);
|
92
|
+
|
93
|
+
selectors[0][0] = IPoolComponent.setFees.selector;
|
94
|
+
selectors[1][0] = IPoolComponent.verifyApplication.selector;
|
87
95
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
(poolName, initialSetup) = _decodeAndVerifyPoolData(data);
|
92
|
-
instance.createPoolSetup(poolNftId, initialSetup);
|
96
|
+
RoleId[] memory roles = new RoleId[](2);
|
97
|
+
roles[0] = POOL_OWNER_ROLE();
|
98
|
+
roles[1] = POLICY_SERVICE_ROLE();
|
93
99
|
|
94
|
-
getInstanceService().
|
100
|
+
getInstanceService().createGifTarget(
|
101
|
+
instanceNftId,
|
102
|
+
poolAddress,
|
103
|
+
pool.getName(),
|
104
|
+
selectors,
|
105
|
+
roles);
|
106
|
+
}*/
|
95
107
|
|
108
|
+
function register(address poolAddress)
|
109
|
+
external
|
110
|
+
returns(NftId poolNftId)
|
111
|
+
{
|
112
|
+
(
|
113
|
+
IComponent component,
|
114
|
+
address owner,
|
115
|
+
IInstance instance,
|
116
|
+
NftId instanceNftId
|
117
|
+
) = _checkComponentForRegistration(
|
118
|
+
poolAddress,
|
119
|
+
POOL(),
|
120
|
+
POOL_OWNER_ROLE());
|
121
|
+
|
122
|
+
IPoolComponent pool = IPoolComponent(poolAddress);
|
123
|
+
IRegistry.ObjectInfo memory registryInfo = getRegistryService().registerPool(pool, owner);
|
96
124
|
pool.linkToRegisteredNftId();
|
125
|
+
poolNftId = registryInfo.nftId;
|
126
|
+
|
127
|
+
// amend component info with pool specific token handler
|
128
|
+
IComponents.ComponentInfo memory componentInfo = pool.getComponentInfo();
|
129
|
+
componentInfo.tokenHandler = new TokenHandler(address(componentInfo.token));
|
130
|
+
|
131
|
+
// save amended component info with instance
|
132
|
+
instance.createPoolSetup(poolNftId, componentInfo);
|
133
|
+
|
134
|
+
bytes4[][] memory selectors = new bytes4[][](2);
|
135
|
+
selectors[0] = new bytes4[](1);
|
136
|
+
selectors[1] = new bytes4[](1);
|
137
|
+
|
138
|
+
selectors[0][0] = IPoolComponent.setFees.selector;
|
139
|
+
selectors[1][0] = IPoolComponent.verifyApplication.selector;
|
140
|
+
|
141
|
+
RoleId[] memory roles = new RoleId[](2);
|
142
|
+
roles[0] = POOL_OWNER_ROLE();
|
143
|
+
roles[1] = POLICY_SERVICE_ROLE();
|
144
|
+
|
145
|
+
getInstanceService().createGifTarget(
|
146
|
+
instanceNftId,
|
147
|
+
poolAddress,
|
148
|
+
pool.getName(),
|
149
|
+
selectors,
|
150
|
+
roles);
|
97
151
|
}
|
98
152
|
|
99
|
-
|
100
|
-
|
101
|
-
|
153
|
+
|
154
|
+
function setMaxCapitalAmount(uint256 maxCapitalAmount)
|
155
|
+
external
|
156
|
+
virtual
|
102
157
|
{
|
103
|
-
(
|
104
|
-
|
105
|
-
|
106
|
-
);
|
158
|
+
(IRegistry.ObjectInfo memory registryInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(POOL());
|
159
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
160
|
+
NftId poolNftId = registryInfo.nftId;
|
107
161
|
|
108
|
-
|
109
|
-
|
162
|
+
IComponents.ComponentInfo memory componentInfo = instanceReader.getComponentInfo(poolNftId);
|
163
|
+
IComponents.PoolInfo memory poolInfo = abi.decode(componentInfo.data, (IComponents.PoolInfo));
|
164
|
+
uint256 previousMaxCapitalAmount = poolInfo.maxCapitalAmount;
|
110
165
|
|
111
|
-
|
112
|
-
|
113
|
-
|
166
|
+
poolInfo.maxCapitalAmount = maxCapitalAmount;
|
167
|
+
componentInfo.data = abi.encode(poolInfo);
|
168
|
+
instance.updatePoolSetup(poolNftId, componentInfo, KEEP_STATE());
|
114
169
|
|
115
|
-
|
170
|
+
emit LogPoolServiceMaxCapitalAmountUpdated(poolNftId, previousMaxCapitalAmount, maxCapitalAmount);
|
171
|
+
}
|
116
172
|
|
117
|
-
|
118
|
-
|
119
|
-
|
173
|
+
function setBundleOwnerRole(RoleId bundleOwnerRole)
|
174
|
+
external
|
175
|
+
virtual
|
176
|
+
{
|
177
|
+
(IRegistry.ObjectInfo memory registryInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(POOL());
|
178
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
179
|
+
NftId poolNftId = registryInfo.nftId;
|
120
180
|
|
121
|
-
|
122
|
-
|
123
|
-
|
181
|
+
IComponents.ComponentInfo memory componentInfo = instanceReader.getComponentInfo(poolNftId);
|
182
|
+
IComponents.PoolInfo memory poolInfo = abi.decode(componentInfo.data, (IComponents.PoolInfo));
|
183
|
+
|
184
|
+
// bundle owner role may only be set once per pool
|
185
|
+
if(poolInfo.bundleOwnerRole != PUBLIC_ROLE()) {
|
186
|
+
revert ErrorPoolServiceBundleOwnerRoleAlreadySet(poolNftId);
|
187
|
+
}
|
188
|
+
|
189
|
+
poolInfo.bundleOwnerRole = bundleOwnerRole;
|
190
|
+
componentInfo.data = abi.encode(poolInfo);
|
191
|
+
instance.updatePoolSetup(poolNftId, componentInfo, KEEP_STATE());
|
192
|
+
|
193
|
+
emit LogPoolServiceBundleOwnerRoleSet(poolNftId, bundleOwnerRole);
|
124
194
|
}
|
125
195
|
|
196
|
+
|
126
197
|
function setFees(
|
127
198
|
Fee memory poolFee,
|
128
199
|
Fee memory stakingFee,
|
129
200
|
Fee memory performanceFee
|
130
201
|
)
|
131
202
|
external
|
132
|
-
|
203
|
+
virtual
|
133
204
|
{
|
134
|
-
(IRegistry.ObjectInfo memory
|
205
|
+
(IRegistry.ObjectInfo memory registryInfo, IInstance instance) = _getAndVerifyComponentInfoAndInstance(POOL());
|
135
206
|
InstanceReader instanceReader = instance.getInstanceReader();
|
136
|
-
NftId poolNftId =
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
207
|
+
NftId poolNftId = registryInfo.nftId;
|
208
|
+
|
209
|
+
IComponents.ComponentInfo memory componentInfo = instanceReader.getComponentInfo(poolNftId);
|
210
|
+
IComponents.PoolInfo memory poolInfo = abi.decode(componentInfo.data, (IComponents.PoolInfo));
|
211
|
+
|
212
|
+
poolInfo.poolFee = poolFee;
|
213
|
+
poolInfo.stakingFee = stakingFee;
|
214
|
+
poolInfo.performanceFee = performanceFee;
|
215
|
+
componentInfo.data = abi.encode(poolInfo);
|
216
|
+
instance.updatePoolSetup(poolNftId, componentInfo, KEEP_STATE());
|
217
|
+
|
218
|
+
// TODO add logging
|
144
219
|
}
|
145
220
|
}
|
@@ -16,7 +16,7 @@ contract PoolServiceManager is ProxyManager {
|
|
16
16
|
constructor(
|
17
17
|
address registryAddress
|
18
18
|
)
|
19
|
-
ProxyManager()
|
19
|
+
ProxyManager(registryAddress)
|
20
20
|
{
|
21
21
|
PoolService poolSrv = new PoolService();
|
22
22
|
bytes memory data = abi.encode(registryAddress, address(this));
|
@@ -4,7 +4,7 @@ pragma solidity ^0.8.19;
|
|
4
4
|
import {IRegistry} from "../../registry/IRegistry.sol";
|
5
5
|
import {IProductComponent} from "../../components/IProductComponent.sol";
|
6
6
|
import {Product} from "../../components/Product.sol";
|
7
|
-
import {
|
7
|
+
import {IComponent} from "../../components/IComponent.sol";
|
8
8
|
import {IPoolComponent} from "../../components/IPoolComponent.sol";
|
9
9
|
import {IDistributionComponent} from "../../components/IDistributionComponent.sol";
|
10
10
|
import {IInstance} from "../IInstance.sol";
|
@@ -35,13 +35,13 @@ import {RoleId, PRODUCT_OWNER_ROLE} from "../../types/RoleId.sol";
|
|
35
35
|
|
36
36
|
import {IService} from "../../shared/IService.sol";
|
37
37
|
import {Service} from "../../shared/Service.sol";
|
38
|
-
import {
|
38
|
+
import {ComponentService} from "../base/ComponentService.sol";
|
39
39
|
import {IProductService} from "./IProductService.sol";
|
40
40
|
import {InstanceReader} from "../InstanceReader.sol";
|
41
41
|
import {IPoolService} from "./PoolService.sol";
|
42
42
|
|
43
43
|
// TODO or name this ProtectionService to have Product be something more generic (loan, savings account, ...)
|
44
|
-
contract ProductService is
|
44
|
+
contract ProductService is ComponentService, IProductService {
|
45
45
|
using NftIdLib for NftId;
|
46
46
|
|
47
47
|
IPoolService internal _poolService;
|
@@ -60,52 +60,80 @@ contract ProductService is ComponentServiceBase, IProductService {
|
|
60
60
|
address initialOwner;
|
61
61
|
(registryAddress, initialOwner) = abi.decode(data, (address, address));
|
62
62
|
|
63
|
-
|
63
|
+
initializeService(registryAddress, owner);
|
64
64
|
|
65
|
-
_poolService = IPoolService(
|
65
|
+
_poolService = IPoolService(getRegistry().getServiceAddress(POOL(), getMajorVersion()));
|
66
66
|
|
67
|
-
|
67
|
+
registerInterface(type(IProductService).interfaceId);
|
68
68
|
}
|
69
69
|
|
70
70
|
|
71
|
-
function getDomain() public pure override(IService, Service) returns(ObjectType) {
|
72
|
-
return PRODUCT();
|
73
|
-
}
|
74
|
-
|
75
71
|
function register(address productAddress)
|
76
72
|
external
|
77
73
|
returns(NftId productNftId)
|
78
74
|
{
|
79
|
-
|
80
|
-
|
75
|
+
(
|
76
|
+
IComponent component,
|
77
|
+
address owner,
|
78
|
+
IInstance instance,
|
79
|
+
NftId instanceNftId
|
80
|
+
) = _checkComponentForRegistration(
|
81
|
+
productAddress,
|
82
|
+
PRODUCT(),
|
83
|
+
PRODUCT_OWNER_ROLE());
|
84
|
+
|
85
|
+
IProductComponent product = IProductComponent(productAddress);
|
86
|
+
IRegistry.ObjectInfo memory productInfo = getRegistryService().registerProduct(product, owner);
|
87
|
+
productNftId = productInfo.nftId;
|
88
|
+
_createProductSetup(
|
89
|
+
instance,
|
90
|
+
product,
|
91
|
+
productNftId);
|
92
|
+
}
|
81
93
|
|
82
|
-
IRegistry.ObjectInfo memory info;
|
83
|
-
bytes memory data;
|
84
|
-
(info, data) = getRegistryService().registerProduct(product, productOwner);
|
85
94
|
|
86
|
-
|
87
|
-
IInstance instance
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
95
|
+
function _createProductSetup(
|
96
|
+
IInstance instance,
|
97
|
+
IProductComponent product,
|
98
|
+
NftId productNftId
|
99
|
+
)
|
100
|
+
internal
|
101
|
+
returns (string memory name)
|
102
|
+
{
|
103
|
+
// wire distribution and pool components to product component
|
104
|
+
ISetup.ProductSetupInfo memory setup = product.getSetupInfo();
|
105
|
+
IComponent distribution = IComponent(getRegistry().getObjectInfo(setup.distributionNftId).objectAddress);
|
106
|
+
IComponent pool = IComponent(getRegistry().getObjectInfo(setup.poolNftId).objectAddress);
|
107
|
+
|
108
|
+
distribution.setProductNftId(productNftId);
|
109
|
+
pool.setProductNftId(productNftId);
|
110
|
+
product.setProductNftId(productNftId);
|
111
|
+
product.linkToRegisteredNftId();
|
92
112
|
|
93
|
-
|
94
|
-
|
95
|
-
}
|
113
|
+
// create product setup in instance
|
114
|
+
instance.createProductSetup(productNftId, product.getSetupInfo());
|
96
115
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
(productName, initialSetup) = _decodeAndVerifyProductData(data);
|
116
|
+
bytes4[][] memory selectors = new bytes4[][](1);
|
117
|
+
selectors[0] = new bytes4[](1);
|
118
|
+
selectors[0][0] = IProductComponent.setFees.selector;
|
101
119
|
|
102
|
-
|
120
|
+
RoleId[] memory roles = new RoleId[](1);
|
121
|
+
roles[0] = PRODUCT_OWNER_ROLE();
|
103
122
|
|
104
|
-
|
123
|
+
// create target for instane access manager
|
124
|
+
getInstanceService().createGifTarget(
|
125
|
+
getRegistry().getNftId(address(instance)),
|
126
|
+
address(product),
|
127
|
+
product.getName(),
|
128
|
+
selectors,
|
129
|
+
roles);
|
130
|
+
}
|
105
131
|
|
106
|
-
|
132
|
+
function getDomain() public pure override(IService, Service) returns(ObjectType) {
|
133
|
+
return PRODUCT();
|
107
134
|
}
|
108
135
|
|
136
|
+
|
109
137
|
function _decodeAndVerifyProductData(bytes memory data)
|
110
138
|
internal
|
111
139
|
returns(string memory name, ISetup.ProductSetupInfo memory setup)
|
@@ -120,13 +148,13 @@ contract ProductService is ComponentServiceBase, IProductService {
|
|
120
148
|
// revert WalletIsZero();
|
121
149
|
// }
|
122
150
|
|
123
|
-
// IRegistry.ObjectInfo memory tokenInfo =
|
151
|
+
// IRegistry.ObjectInfo memory tokenInfo = getRegistry().getObjectInfo(address(info.token));
|
124
152
|
|
125
153
|
// if(tokenInfo.objectType != TOKEN()) {
|
126
154
|
// revert InvalidToken();
|
127
155
|
// }
|
128
156
|
|
129
|
-
// IRegistry.ObjectInfo memory poolInfo =
|
157
|
+
// IRegistry.ObjectInfo memory poolInfo = getRegistry().getObjectInfo(info.poolNftId);
|
130
158
|
|
131
159
|
// if(poolInfo.objectType != POOL()) {
|
132
160
|
// revert InvalidPool();
|
@@ -140,7 +168,7 @@ contract ProductService is ComponentServiceBase, IProductService {
|
|
140
168
|
// //require(tokenInfo.objectAddress == address(poolSetup.token), "ERROR:COS-018:PRODUCT_POOL_TOKEN_MISMATCH");
|
141
169
|
// // TODO pool is not linked
|
142
170
|
|
143
|
-
// IRegistry.ObjectInfo memory distributionInfo =
|
171
|
+
// IRegistry.ObjectInfo memory distributionInfo = getRegistry().getObjectInfo(info.distributionNftId);
|
144
172
|
|
145
173
|
// if(distributionInfo.objectType != DISTRIBUTION()) {
|
146
174
|
// revert InvalidDistribution();
|
@@ -16,7 +16,7 @@ contract ProductServiceManager is ProxyManager {
|
|
16
16
|
constructor(
|
17
17
|
address registryAddress
|
18
18
|
)
|
19
|
-
ProxyManager()
|
19
|
+
ProxyManager(registryAddress)
|
20
20
|
{
|
21
21
|
ProductService svc = new ProductService();
|
22
22
|
bytes memory data = abi.encode(registryAddress, address(this));
|
@@ -39,7 +39,7 @@ contract ProductServiceManager is ProxyManager {
|
|
39
39
|
// address(_productService));
|
40
40
|
|
41
41
|
// implies that after this constructor call only upgrade functionality is available
|
42
|
-
_isDeployed = true;
|
42
|
+
// _isDeployed = true;
|
43
43
|
}
|
44
44
|
|
45
45
|
//--- view functions ----------------------------------------------------//
|
@@ -95,6 +95,10 @@ contract ChainNft is ERC721Enumerable {
|
|
95
95
|
|
96
96
|
_totalMinted++;
|
97
97
|
_safeMint(to, tokenId);
|
98
|
+
|
99
|
+
if(interceptor != address(0)) {
|
100
|
+
ITransferInterceptor(interceptor).nftMint(to, tokenId);
|
101
|
+
}
|
98
102
|
}
|
99
103
|
|
100
104
|
|
@@ -195,6 +199,10 @@ contract ChainNft is ERC721Enumerable {
|
|
195
199
|
_chainIdDigits;
|
196
200
|
}
|
197
201
|
|
202
|
+
function getNextTokenId() external view returns (uint256) {
|
203
|
+
return calculateTokenId(_idNext);
|
204
|
+
}
|
205
|
+
|
198
206
|
function _getNextTokenId() private returns (uint256 id) {
|
199
207
|
id = calculateTokenId(_idNext);
|
200
208
|
_idNext++;
|
@@ -3,7 +3,6 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
5
5
|
|
6
|
-
import {ChainNft} from "./ChainNft.sol";
|
7
6
|
import {NftId} from "../types/NftId.sol";
|
8
7
|
import {ObjectType} from "../types/ObjectType.sol";
|
9
8
|
import {VersionPart} from "../types/Version.sol";
|
@@ -14,13 +13,16 @@ interface IRegistry is IERC165 {
|
|
14
13
|
event LogRegistration(NftId nftId, NftId parentNftId, ObjectType objectType, bool isInterceptor, address objectAddress, address initialOwner);
|
15
14
|
event LogServiceRegistration(VersionPart majorVersion, ObjectType domain);
|
16
15
|
|
16
|
+
// registerService()
|
17
|
+
error CallerNotReleaseManager();
|
18
|
+
error ServiceAlreadyRegistered(address service);
|
19
|
+
|
17
20
|
// register()
|
18
21
|
error CallerNotRegistryService();
|
19
22
|
error ServiceRegistration();
|
20
23
|
|
21
|
-
//
|
22
|
-
error
|
23
|
-
error ServiceAlreadyRegistered(address service);
|
24
|
+
// registerWithCustomTypes()
|
25
|
+
error CoreTypeRegistration();
|
24
26
|
|
25
27
|
// _register()
|
26
28
|
error ZeroParentAddress();
|
@@ -52,11 +54,13 @@ interface IRegistry is IERC165 {
|
|
52
54
|
|
53
55
|
function register(ObjectInfo memory info) external returns (NftId nftId);
|
54
56
|
|
55
|
-
function
|
57
|
+
function registerWithCustomType(ObjectInfo memory info) external returns (NftId nftId);
|
58
|
+
|
59
|
+
function getInitialVersion() external view returns (VersionPart);
|
56
60
|
|
57
|
-
function
|
61
|
+
function getNextVersion() external view returns (VersionPart);
|
58
62
|
|
59
|
-
function
|
63
|
+
function getLatestVersion() external view returns (VersionPart);
|
60
64
|
|
61
65
|
function getReleaseInfo(VersionPart version) external view returns (ReleaseInfo memory);
|
62
66
|
|
@@ -80,12 +84,18 @@ interface IRegistry is IERC165 {
|
|
80
84
|
|
81
85
|
function isRegisteredService(address contractAddress) external view returns (bool);
|
82
86
|
|
87
|
+
function isRegisteredComponent(address object) external view returns (bool);
|
88
|
+
|
89
|
+
function isValidRelease(VersionPart version) external view returns (bool);
|
90
|
+
|
83
91
|
function getServiceAddress(
|
84
92
|
ObjectType serviceDomain,
|
85
93
|
VersionPart releaseVersion
|
86
94
|
) external view returns (address serviceAddress);
|
87
95
|
|
88
|
-
function
|
96
|
+
function getReleaseManagerAddress() external view returns (address);
|
97
|
+
|
98
|
+
function getChainNftAddress() external view returns (address);
|
89
99
|
|
90
100
|
function getOwner() external view returns (address);
|
91
101
|
}
|
@@ -10,7 +10,7 @@ import {IService} from "../shared/IService.sol";
|
|
10
10
|
import {IRegistry} from "./IRegistry.sol";
|
11
11
|
|
12
12
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
13
|
-
import {
|
13
|
+
import {IComponent} from "../components/IComponent.sol";
|
14
14
|
|
15
15
|
interface IRegistryService is
|
16
16
|
IService,
|
@@ -35,21 +35,30 @@ interface IRegistryService is
|
|
35
35
|
struct FunctionConfig
|
36
36
|
{
|
37
37
|
ObjectType serviceDomain;
|
38
|
-
bytes4
|
38
|
+
bytes4[] selectors;
|
39
39
|
}
|
40
40
|
|
41
|
+
function getFunctionConfigs()
|
42
|
+
external
|
43
|
+
pure
|
44
|
+
returns(
|
45
|
+
FunctionConfig[] memory config
|
46
|
+
);
|
47
|
+
|
41
48
|
// TODO used by service -> add owner arg
|
42
|
-
function registerInstance(IRegisterable instance)
|
43
|
-
external returns(IRegistry.ObjectInfo memory info
|
49
|
+
function registerInstance(IRegisterable instance, address owner)
|
50
|
+
external returns(IRegistry.ObjectInfo memory info);
|
51
|
+
|
52
|
+
function registerProduct(IComponent product, address owner)
|
53
|
+
external returns(IRegistry.ObjectInfo memory info);
|
44
54
|
|
45
|
-
function
|
46
|
-
external returns(IRegistry.ObjectInfo memory info
|
55
|
+
function registerPool(IComponent pool, address owner)
|
56
|
+
external returns(IRegistry.ObjectInfo memory info);
|
47
57
|
|
48
|
-
function
|
49
|
-
external returns(IRegistry.ObjectInfo memory info
|
58
|
+
function registerDistribution(IComponent distribution, address owner)
|
59
|
+
external returns(IRegistry.ObjectInfo memory info);
|
50
60
|
|
51
|
-
function
|
52
|
-
external returns(IRegistry.ObjectInfo memory info, bytes memory data);
|
61
|
+
function registerDistributor(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
53
62
|
|
54
63
|
function registerPolicy(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
55
64
|
|