@etherisc/gif-next 0.0.2-e8b06c8-540 → 0.0.2-e8ea17d-715
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +13 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +38 -33
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +1206 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +8 -8
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +19 -0
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +8 -8
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +23 -4
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +26 -26
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +19 -19
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +74 -74
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +55 -55
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +4 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +703 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +7 -7
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +10 -5
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +19 -19
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1208 -290
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +31 -31
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +58 -58
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +44 -39
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +35 -35
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +83 -84
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +182 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +181 -0
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- 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/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.json +2 -2
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +16 -16
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +21 -21
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +32 -32
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +34 -34
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +19 -19
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +55 -55
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +40 -40
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +36 -36
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +36 -36
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +32 -32
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +34 -34
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +19 -19
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +72 -72
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +54 -54
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +50 -50
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +43 -43
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +58 -58
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +47 -47
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +20 -20
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +28 -28
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +50 -46
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +0 -183
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +101 -73
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +100 -95
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +18 -18
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +27 -27
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +164 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +1159 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +26 -7
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +4 -4
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +62 -62
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +49 -49
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.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/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +11 -5
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +0 -5
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- 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/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +15 -89
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +4 -65
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +4 -0
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +306 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +6 -6
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +6 -6
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +14 -14
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +8 -8
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +6 -6
- 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/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +32 -32
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +44 -44
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +164 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +40 -40
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +6 -6
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +26 -26
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +31 -31
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +145 -169
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +22 -22
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.json +2 -2
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +8 -8
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +2 -2
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +4 -4
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +4 -4
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +12 -12
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +4 -4
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +2 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +4 -4
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +4 -4
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +4 -4
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +4 -4
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +14 -14
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +2 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +2 -2
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +2 -2
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +2 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.json +2 -2
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +4 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +2 -2
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +2 -2
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -2
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +21 -2
- package/contracts/authorization/AccessAdmin.sol +8 -39
- package/contracts/authorization/AccessManagerCloneable.sol +16 -0
- package/contracts/authorization/IServiceAuthorization.sol +3 -0
- package/contracts/authorization/ModuleAuthorization.sol +0 -125
- package/contracts/authorization/ServiceAuthorization.sol +4 -0
- package/contracts/distribution/DistributionService.sol +0 -1
- package/contracts/distribution/IDistributionComponent.sol +0 -30
- package/contracts/instance/{BundleManager.sol → BundleSet.sol} +23 -23
- package/contracts/instance/IInstance.sol +7 -7
- package/contracts/instance/IInstanceService.sol +6 -5
- package/contracts/instance/Instance.sol +8 -47
- package/contracts/instance/InstanceAdmin.sol +201 -269
- package/contracts/instance/InstanceAuthorizationV3.sol +14 -25
- package/contracts/instance/InstanceReader.sol +0 -5
- package/contracts/instance/InstanceService.sol +30 -103
- package/contracts/instance/InstanceStore.sol +6 -3
- package/contracts/instance/base/ObjectLifecycle.sol +106 -0
- package/contracts/instance/base/{ObjectManager.sol → ObjectSet.sol} +5 -5
- package/contracts/pool/BundleService.sol +8 -8
- package/contracts/pool/PoolService.sol +0 -1
- package/contracts/registry/IRegistry.sol +26 -16
- package/contracts/registry/IRegistryService.sol +6 -6
- package/contracts/registry/Registry.sol +80 -86
- package/contracts/registry/RegistryAdmin.sol +24 -22
- package/contracts/registry/ReleaseLifecycle.sol +27 -0
- package/contracts/registry/{ReleaseManager.sol → ReleaseRegistry.sol} +148 -191
- package/contracts/registry/ServiceAuthorizationV3.sol +5 -7
- package/contracts/registry/TokenRegistry.sol +2 -2
- package/contracts/shared/ComponentService.sol +2 -47
- package/contracts/shared/IKeyValueStore.sol +1 -0
- package/contracts/shared/ILifecycle.sol +1 -2
- package/contracts/shared/InstanceLinkedComponent.sol +0 -1
- package/contracts/shared/KeyValueStore.sol +6 -2
- package/contracts/shared/Lifecycle.sol +16 -69
- package/contracts/shared/{NftIdSetManager.sol → NftIdSet.sol} +1 -1
- package/contracts/staking/IStaking.sol +0 -1
- package/contracts/staking/IStakingService.sol +12 -5
- package/contracts/staking/Staking.sol +1 -3
- package/contracts/staking/StakingLifecycle.sol +23 -0
- package/contracts/staking/StakingManager.sol +0 -1
- package/contracts/staking/StakingReader.sol +6 -7
- package/contracts/staking/StakingStore.sol +10 -8
- package/contracts/type/ObjectType.sol +3 -7
- package/contracts/type/RoleId.sol +10 -38
- package/contracts/type/Version.sol +3 -1
- package/package.json +3 -3
- package/artifacts/contracts/authorization/InstanceAdmin.sol/InstanceAdmin.dbg.json +0 -4
- package/artifacts/contracts/authorization/InstanceAdmin.sol/InstanceAdmin.json +0 -1385
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +0 -4
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +0 -703
- package/artifacts/contracts/instance/InstanceAdminNew.sol/InstanceAdminNew.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAdminNew.sol/InstanceAdminNew.json +0 -1616
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +0 -228
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +0 -181
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +0 -4
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +0 -1237
- package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.json +0 -1193
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.json +0 -1747
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.json +0 -1760
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.json +0 -1838
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.json +0 -1856
- package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.dbg.json +0 -4
- package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.json +0 -1562
- package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.dbg.json +0 -4
- package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.json +0 -1600
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.dbg.json +0 -4
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +0 -306
- package/contracts/authorization/InstanceAdmin.sol +0 -108
- package/contracts/instance/InstanceAdminNew.sol +0 -261
- package/contracts/instance/InstanceAuthorizationsLib.sol +0 -422
- package/contracts/shared/AccessManagerCustom.sol +0 -741
- package/contracts/shared/AccessManagerExtended.sol +0 -481
- package/contracts/shared/AccessManagerExtendedInitializeable.sol +0 -13
- package/contracts/shared/AccessManagerExtendedWithDisable.sol +0 -137
- package/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol +0 -14
- package/contracts/shared/IAccessManagerExtended.sol +0 -74
- package/contracts/shared/IAccessManagerExtendedWithDisable.sol +0 -18
@@ -4,8 +4,9 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
|
5
5
|
import {ShortString, ShortStrings} from "@openzeppelin/contracts/utils/ShortStrings.sol";
|
6
6
|
|
7
|
+
import {AccessManagerCloneable} from "../authorization/AccessManagerCloneable.sol";
|
7
8
|
import {Amount} from "../type/Amount.sol";
|
8
|
-
import {
|
9
|
+
import {BundleSet} from "./BundleSet.sol";
|
9
10
|
import {ChainNft} from "../registry/ChainNft.sol";
|
10
11
|
import {NftId} from "../type/NftId.sol";
|
11
12
|
import {RoleId} from "../type/RoleId.sol";
|
@@ -30,13 +31,10 @@ import {TargetManagerLib} from "../staking/TargetManagerLib.sol";
|
|
30
31
|
import {Instance} from "./Instance.sol";
|
31
32
|
import {IModuleAuthorization} from "../authorization/IModuleAuthorization.sol";
|
32
33
|
import {IInstance} from "./IInstance.sol";
|
33
|
-
// TODO cleanup
|
34
34
|
import {InstanceAdmin} from "./InstanceAdmin.sol";
|
35
|
-
import {InstanceAdminNew} from "./InstanceAdminNew.sol";
|
36
35
|
import {IInstanceService} from "./IInstanceService.sol";
|
37
36
|
import {InstanceReader} from "./InstanceReader.sol";
|
38
37
|
import {InstanceStore} from "./InstanceStore.sol";
|
39
|
-
import {InstanceAuthorizationsLib} from "./InstanceAuthorizationsLib.sol";
|
40
38
|
import {Seconds} from "../type/Seconds.sol";
|
41
39
|
import {VersionPart, VersionPartLib} from "../type/Version.sol";
|
42
40
|
|
@@ -52,10 +50,11 @@ contract InstanceService is
|
|
52
50
|
IRegistryService internal _registryService;
|
53
51
|
IStakingService internal _stakingService;
|
54
52
|
|
53
|
+
address internal _masterAccessManager;
|
55
54
|
address internal _masterInstanceAdmin;
|
56
55
|
address internal _masterInstance;
|
57
56
|
address internal _masterInstanceReader;
|
58
|
-
address internal
|
57
|
+
address internal _masterInstanceBundleSet;
|
59
58
|
address internal _masterInstanceStore;
|
60
59
|
|
61
60
|
|
@@ -95,7 +94,7 @@ contract InstanceService is
|
|
95
94
|
_;
|
96
95
|
}
|
97
96
|
|
98
|
-
function
|
97
|
+
function createInstance()
|
99
98
|
external
|
100
99
|
returns (
|
101
100
|
Instance clonedInstance,
|
@@ -105,12 +104,21 @@ contract InstanceService is
|
|
105
104
|
// tx sender will become instance owner
|
106
105
|
address instanceOwner = msg.sender;
|
107
106
|
|
108
|
-
// start with setting up
|
109
|
-
|
110
|
-
|
107
|
+
// start with setting up a new OZ access manager
|
108
|
+
AccessManagerCloneable clonedAccessManager = AccessManagerCloneable(
|
109
|
+
Clones.clone(_masterAccessManager));
|
110
|
+
|
111
|
+
// set up the instance admin
|
112
|
+
InstanceAdmin clonedInstanceAdmin = InstanceAdmin(Clones.clone(_masterInstanceAdmin));
|
113
|
+
clonedAccessManager.initialize(
|
114
|
+
address(clonedInstanceAdmin)); // grant ADMIN_ROLE to instance admin
|
115
|
+
|
116
|
+
clonedInstanceAdmin.initialize(
|
117
|
+
clonedAccessManager,
|
118
|
+
InstanceAdmin(_masterInstanceAdmin).getInstanceAuthorization());
|
111
119
|
|
112
120
|
InstanceStore clonedInstanceStore = InstanceStore(Clones.clone(address(_masterInstanceStore)));
|
113
|
-
|
121
|
+
BundleSet clonedBundleSet = BundleSet(Clones.clone(_masterInstanceBundleSet));
|
114
122
|
InstanceReader clonedInstanceReader = InstanceReader(Clones.clone(address(_masterInstanceReader)));
|
115
123
|
|
116
124
|
// clone instance
|
@@ -118,25 +126,11 @@ contract InstanceService is
|
|
118
126
|
clonedInstance.initialize(
|
119
127
|
clonedInstanceAdmin,
|
120
128
|
clonedInstanceStore,
|
121
|
-
|
129
|
+
clonedBundleSet,
|
122
130
|
clonedInstanceReader,
|
123
131
|
getRegistry(),
|
124
132
|
instanceOwner);
|
125
133
|
|
126
|
-
// TODO cleanup
|
127
|
-
// // initialize and set before instance reader
|
128
|
-
// InstanceStore clonedInstanceStore = InstanceStore(Clones.clone(address(_masterInstanceStore)));
|
129
|
-
// clonedInstanceStore.initialize(address(clonedInstance));
|
130
|
-
// clonedInstance.setInstanceStore(clonedInstanceStore);
|
131
|
-
|
132
|
-
// InstanceReader clonedInstanceReader = InstanceReader(Clones.clone(address(_masterInstanceReader)));
|
133
|
-
// clonedInstanceReader.initialize(address(clonedInstance));
|
134
|
-
// clonedInstance.setInstanceReader(clonedInstanceReader);
|
135
|
-
|
136
|
-
// BundleManager clonedBundleManager = BundleManager(Clones.clone(_masterInstanceBundleManager));
|
137
|
-
// clonedBundleManager.initialize(address(clonedInstance));
|
138
|
-
// clonedInstance.setBundleManager(clonedBundleManager);
|
139
|
-
|
140
134
|
// register cloned instance with registry
|
141
135
|
clonedInstanceNftId = _registryService.registerInstance(
|
142
136
|
clonedInstance, instanceOwner).nftId;
|
@@ -155,76 +149,6 @@ contract InstanceService is
|
|
155
149
|
address(clonedInstance));
|
156
150
|
}
|
157
151
|
|
158
|
-
// TODO cleanup/remove
|
159
|
-
// function _createInstanceCloneOld()
|
160
|
-
// external
|
161
|
-
// returns (
|
162
|
-
// Instance clonedInstance,
|
163
|
-
// NftId clonedInstanceNftId
|
164
|
-
// )
|
165
|
-
// {
|
166
|
-
// address instanceOwner = msg.sender;
|
167
|
-
// AccessManagerExtendedInitializeable clonedAccessManager = AccessManagerExtendedInitializeable(
|
168
|
-
// Clones.clone(_masterAccessManager));
|
169
|
-
|
170
|
-
// // initially grants ADMIN_ROLE to this (being the instance service).
|
171
|
-
// // This will allow the instance service to bootstrap the authorizations of the instance.
|
172
|
-
// // Instance service will renounce ADMIN_ROLE when bootstraping is finished
|
173
|
-
// clonedAccessManager.initialize(address(this));
|
174
|
-
|
175
|
-
// clonedInstance = Instance(Clones.clone(_masterInstance));
|
176
|
-
// // clonedInstance.initialize(
|
177
|
-
// // address(clonedAccessManager),
|
178
|
-
// // address(getRegistry()),
|
179
|
-
// // instanceOwner);
|
180
|
-
// // initialize and set before instance reader
|
181
|
-
// InstanceStore clonedInstanceStore = InstanceStore(Clones.clone(address(_masterInstanceStore)));
|
182
|
-
// // clonedInstanceStore.initialize(address(clonedInstance));
|
183
|
-
// clonedInstance.setInstanceStore(clonedInstanceStore);
|
184
|
-
|
185
|
-
// InstanceReader clonedInstanceReader = InstanceReader(Clones.clone(address(_masterInstanceReader)));
|
186
|
-
// // clonedInstanceReader.initialize(address(clonedInstance));
|
187
|
-
// clonedInstance.setInstanceReader(clonedInstanceReader);
|
188
|
-
|
189
|
-
// BundleManager clonedBundleManager = BundleManager(Clones.clone(_masterInstanceBundleManager));
|
190
|
-
// // clonedBundleManager.initialize(address(clonedInstance));
|
191
|
-
// clonedInstance.setBundleManager(clonedBundleManager);
|
192
|
-
|
193
|
-
// InstanceAdmin clonedInstanceAdmin = InstanceAdmin(Clones.clone(_masterInstanceAdmin));
|
194
|
-
// clonedAccessManager.grantRole(ADMIN_ROLE().toInt(), address(clonedInstanceAdmin), 0);
|
195
|
-
// // clonedInstanceAdmin.initialize(address(clonedInstance));
|
196
|
-
// // clonedInstance.setInstanceAdmin(clonedInstanceAdmin);
|
197
|
-
|
198
|
-
// // TODO amend setters with instance specific , policy manager ...
|
199
|
-
|
200
|
-
// // TODO library does external calls -> but it is registry and access manager -> find out is it best practice
|
201
|
-
// InstanceAuthorizationsLib.grantInitialAuthorizations(
|
202
|
-
// clonedAccessManager,
|
203
|
-
// clonedInstanceAdmin,
|
204
|
-
// clonedInstance,
|
205
|
-
// clonedBundleManager,
|
206
|
-
// clonedInstanceStore,
|
207
|
-
// instanceOwner,
|
208
|
-
// getRegistry(),
|
209
|
-
// getVersion().toMajorPart());
|
210
|
-
|
211
|
-
// clonedAccessManager.renounceRole(ADMIN_ROLE().toInt(), address(this));
|
212
|
-
|
213
|
-
// // register new instance with registry
|
214
|
-
// IRegistry.ObjectInfo memory info = _registryService.registerInstance(clonedInstance, instanceOwner);
|
215
|
-
// clonedInstanceNftId = info.nftId;
|
216
|
-
|
217
|
-
// // create corresponding staking target
|
218
|
-
// _stakingService.createInstanceTarget(
|
219
|
-
// clonedInstanceNftId,
|
220
|
-
// TargetManagerLib.getDefaultLockingPeriod(),
|
221
|
-
// TargetManagerLib.getDefaultRewardRate());
|
222
|
-
|
223
|
-
// emit LogInstanceCloned(
|
224
|
-
// clonedInstanceNftId,
|
225
|
-
// address(clonedInstance));
|
226
|
-
// }
|
227
|
-
|
228
152
|
|
229
153
|
function setStakingLockingPeriod(Seconds stakeLockingPeriod)
|
230
154
|
external
|
@@ -314,35 +238,38 @@ contract InstanceService is
|
|
314
238
|
{
|
315
239
|
if(_masterInstance != address(0)) { revert ErrorInstanceServiceMasterInstanceAlreadySet(); }
|
316
240
|
if(_masterInstanceAdmin != address(0)) { revert ErrorInstanceServiceMasterInstanceAdminAlreadySet(); }
|
317
|
-
if(
|
241
|
+
if(_masterInstanceBundleSet != address(0)) { revert ErrorInstanceServiceMasterBundleSetAlreadySet(); }
|
318
242
|
|
319
243
|
if(instanceAddress == address(0)) { revert ErrorInstanceServiceInstanceAddressZero(); }
|
320
244
|
|
321
245
|
IInstance instance = IInstance(instanceAddress);
|
322
|
-
|
246
|
+
address accessManagerAddress = instance.authority();
|
247
|
+
InstanceAdmin instanceAdmin = instance.getInstanceAdmin();
|
323
248
|
address instanceAdminAddress = address(instanceAdmin);
|
324
249
|
InstanceReader instanceReader = instance.getInstanceReader();
|
325
250
|
address instanceReaderAddress = address(instanceReader);
|
326
|
-
|
251
|
+
BundleSet bundleManager = instance.getBundleSet();
|
327
252
|
address bundleManagerAddress = address(bundleManager);
|
328
253
|
InstanceStore instanceStore = instance.getInstanceStore();
|
329
254
|
address instanceStoreAddress = address(instanceStore);
|
330
255
|
|
256
|
+
if(accessManagerAddress == address(0)) { revert ErrorInstanceServiceAccessManagerZero(); }
|
331
257
|
if(instanceAdminAddress == address(0)) { revert ErrorInstanceServiceInstanceAdminZero(); }
|
332
258
|
if(instanceReaderAddress == address(0)) { revert ErrorInstanceServiceInstanceReaderZero(); }
|
333
|
-
if(bundleManagerAddress == address(0)) { revert
|
259
|
+
if(bundleManagerAddress == address(0)) { revert ErrorInstanceServiceBundleSetZero(); }
|
334
260
|
if(instanceStoreAddress == address(0)) { revert ErrorInstanceServiceInstanceStoreZero(); }
|
335
261
|
|
336
262
|
if(instance.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceInstanceAuthorityMismatch(); }
|
337
|
-
if(bundleManager.authority() != instanceAdmin.authority()) { revert
|
263
|
+
if(bundleManager.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceBundleSetAuthorityMismatch(); }
|
338
264
|
if(instanceStore.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceInstanceStoreAuthorityMismatch(); }
|
339
265
|
if(bundleManager.getInstance() != instance) { revert ErrorInstanceServiceBundleMangerInstanceMismatch(); }
|
340
266
|
if(instanceReader.getInstance() != instance) { revert ErrorInstanceServiceInstanceReaderInstanceMismatch2(); }
|
341
267
|
|
268
|
+
_masterAccessManager = accessManagerAddress;
|
342
269
|
_masterInstanceAdmin = instanceAdminAddress;
|
343
270
|
_masterInstance = instanceAddress;
|
344
271
|
_masterInstanceReader = instanceReaderAddress;
|
345
|
-
|
272
|
+
_masterInstanceBundleSet = bundleManagerAddress;
|
346
273
|
_masterInstanceStore = instanceStoreAddress;
|
347
274
|
|
348
275
|
IInstance masterInstance = IInstance(_masterInstance);
|
@@ -408,7 +335,7 @@ contract InstanceService is
|
|
408
335
|
instanceNftId,
|
409
336
|
address(component));
|
410
337
|
|
411
|
-
|
338
|
+
InstanceAdmin instanceAdmin = instance.getInstanceAdmin();
|
412
339
|
instanceAdmin.initializeComponentAuthorization(
|
413
340
|
address(component),
|
414
341
|
component.getAuthorization());
|
@@ -453,7 +380,7 @@ contract InstanceService is
|
|
453
380
|
// or targetInfo
|
454
381
|
) = _validateInstanceAndComponent(instanceNftId, targetAddress);
|
455
382
|
|
456
|
-
|
383
|
+
InstanceAdmin instanceAdmin = instance.getInstanceAdmin();
|
457
384
|
|
458
385
|
// TODO refactor/implement
|
459
386
|
// instanceAdmin.createGifTarget(targetAddress, targetName);
|
@@ -27,12 +27,15 @@ import {IPolicy} from "./module/IPolicy.sol";
|
|
27
27
|
import {IOracle} from "../oracle/IOracle.sol";
|
28
28
|
import {IRisk} from "./module/IRisk.sol";
|
29
29
|
|
30
|
+
import {ObjectLifecycle} from "./base/ObjectLifecycle.sol";
|
31
|
+
|
30
32
|
|
31
33
|
contract InstanceStore is
|
32
34
|
AccessManagedUpgradeable,
|
33
35
|
BalanceStore,
|
34
36
|
KeyValueStore,
|
35
|
-
ObjectCounter
|
37
|
+
ObjectCounter,
|
38
|
+
ObjectLifecycle
|
36
39
|
{
|
37
40
|
|
38
41
|
/// @dev This initializer needs to be called from the instance itself.
|
@@ -44,8 +47,8 @@ contract InstanceStore is
|
|
44
47
|
address authority = IInstance(instance).authority();
|
45
48
|
|
46
49
|
__AccessManaged_init(authority);
|
47
|
-
|
48
|
-
|
50
|
+
// double initialization, safe
|
51
|
+
_initializeLifecycle();
|
49
52
|
}
|
50
53
|
|
51
54
|
//--- Component ---------------------------------------------------------//
|
@@ -0,0 +1,106 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
5
|
+
|
6
|
+
import {COMPONENT, BUNDLE, POLICY, REQUEST, RISK, CLAIM, PAYOUT, POOL, PRODUCT, DISTRIBUTION, DISTRIBUTOR, DISTRIBUTOR_TYPE, REFERRAL} from "../../type/ObjectType.sol";
|
7
|
+
import {ACTIVE, PAUSED, ARCHIVED, CLOSED, APPLIED, COLLATERALIZED, REVOKED, SUBMITTED, CONFIRMED, DECLINED, EXPECTED, PAID, FULFILLED, FAILED, CANCELLED} from "../../type/StateId.sol";
|
8
|
+
import {Lifecycle} from "../../shared/Lifecycle.sol";
|
9
|
+
|
10
|
+
contract ObjectLifecycle is
|
11
|
+
Lifecycle,
|
12
|
+
Initializable
|
13
|
+
{
|
14
|
+
function _initializeLifecycle() internal onlyInitializing
|
15
|
+
{
|
16
|
+
_setupLifecycle();
|
17
|
+
}
|
18
|
+
|
19
|
+
function _setupLifecycle()
|
20
|
+
internal
|
21
|
+
override
|
22
|
+
{
|
23
|
+
_setupBundleLifecycle();
|
24
|
+
_setupComponentLifecycle();
|
25
|
+
_setupPolicyLifecycle();
|
26
|
+
_setupClaimLifecycle();
|
27
|
+
_setupPayoutLifecycle();
|
28
|
+
_setupRiskLifecycle();
|
29
|
+
_setupRequestLifecycle();
|
30
|
+
|
31
|
+
// setup dummy lifecycles to manage with key value store
|
32
|
+
_setUpPoolLifecycle();
|
33
|
+
_setUpProductLifecycle();
|
34
|
+
_setUpDistributionLifecycle();
|
35
|
+
}
|
36
|
+
|
37
|
+
function _setupComponentLifecycle() private {
|
38
|
+
setInitialState(COMPONENT(), ACTIVE());
|
39
|
+
setStateTransition(COMPONENT(), ACTIVE(), PAUSED());
|
40
|
+
setStateTransition(COMPONENT(), PAUSED(), ACTIVE());
|
41
|
+
setStateTransition(COMPONENT(), PAUSED(), ARCHIVED());
|
42
|
+
}
|
43
|
+
|
44
|
+
function _setupBundleLifecycle() private {
|
45
|
+
setInitialState(BUNDLE(), ACTIVE());
|
46
|
+
setStateTransition(BUNDLE(), ACTIVE(), PAUSED());
|
47
|
+
setStateTransition(BUNDLE(), ACTIVE(), CLOSED());
|
48
|
+
setStateTransition(BUNDLE(), PAUSED(), ACTIVE());
|
49
|
+
setStateTransition(BUNDLE(), PAUSED(), CLOSED());
|
50
|
+
}
|
51
|
+
|
52
|
+
function _setupPolicyLifecycle() private {
|
53
|
+
setInitialState(POLICY(), APPLIED());
|
54
|
+
setStateTransition(POLICY(), APPLIED(), REVOKED());
|
55
|
+
setStateTransition(POLICY(), APPLIED(), DECLINED());
|
56
|
+
setStateTransition(POLICY(), APPLIED(), COLLATERALIZED());
|
57
|
+
setStateTransition(POLICY(), APPLIED(), ACTIVE());
|
58
|
+
setStateTransition(POLICY(), COLLATERALIZED(), ACTIVE());
|
59
|
+
setStateTransition(POLICY(), ACTIVE(), CLOSED());
|
60
|
+
}
|
61
|
+
|
62
|
+
function _setupClaimLifecycle() private {
|
63
|
+
setInitialState(CLAIM(), SUBMITTED());
|
64
|
+
setStateTransition(CLAIM(), SUBMITTED(), CONFIRMED());
|
65
|
+
setStateTransition(CLAIM(), SUBMITTED(), DECLINED());
|
66
|
+
setStateTransition(CLAIM(), CONFIRMED(), CLOSED());
|
67
|
+
}
|
68
|
+
|
69
|
+
function _setupPayoutLifecycle() private {
|
70
|
+
setInitialState(PAYOUT(), EXPECTED());
|
71
|
+
setStateTransition(PAYOUT(), EXPECTED(), PAID());
|
72
|
+
}
|
73
|
+
|
74
|
+
function _setupRiskLifecycle() private {
|
75
|
+
setInitialState(RISK(), ACTIVE());
|
76
|
+
setStateTransition(RISK(), ACTIVE(), PAUSED());
|
77
|
+
setStateTransition(RISK(), PAUSED(), ACTIVE());
|
78
|
+
setStateTransition(RISK(), PAUSED(), ARCHIVED());
|
79
|
+
}
|
80
|
+
|
81
|
+
function _setupRequestLifecycle() private {
|
82
|
+
setInitialState(REQUEST(), ACTIVE());
|
83
|
+
setStateTransition(REQUEST(), ACTIVE(), FULFILLED());
|
84
|
+
setStateTransition(REQUEST(), ACTIVE(), FAILED());
|
85
|
+
setStateTransition(REQUEST(), FAILED(), FULFILLED());
|
86
|
+
setStateTransition(REQUEST(), ACTIVE(), CANCELLED());
|
87
|
+
}
|
88
|
+
|
89
|
+
// dummy lifecycle only
|
90
|
+
function _setUpPoolLifecycle() private {
|
91
|
+
setInitialState(POOL(), ACTIVE());
|
92
|
+
}
|
93
|
+
|
94
|
+
// dummy lifecycle only
|
95
|
+
function _setUpProductLifecycle() private {
|
96
|
+
setInitialState(PRODUCT(), ACTIVE());
|
97
|
+
}
|
98
|
+
|
99
|
+
// dummy lifecycles only
|
100
|
+
function _setUpDistributionLifecycle() private {
|
101
|
+
setInitialState(DISTRIBUTION(), ACTIVE());
|
102
|
+
setInitialState(DISTRIBUTOR(), ACTIVE());
|
103
|
+
setInitialState(DISTRIBUTOR_TYPE(), ACTIVE());
|
104
|
+
setInitialState(REFERRAL(), ACTIVE());
|
105
|
+
}
|
106
|
+
}
|
@@ -10,17 +10,17 @@ import {IRegistry} from "../../registry/IRegistry.sol";
|
|
10
10
|
import {LibNftIdSet} from "../../type/NftIdSet.sol";
|
11
11
|
import {NftId} from "../../type/NftId.sol";
|
12
12
|
|
13
|
-
contract
|
13
|
+
contract ObjectSet is
|
14
14
|
Cloneable
|
15
15
|
{
|
16
16
|
|
17
|
-
event
|
17
|
+
event LogObjectSetInitialized(address instance);
|
18
18
|
|
19
|
-
error
|
19
|
+
error ErrorObjectSetNftIdInvalid(NftId instanceNftId);
|
20
20
|
|
21
21
|
mapping(NftId compnentNftId => LibNftIdSet.Set objects) internal _activeObjects;
|
22
22
|
mapping(NftId compnentNftId => LibNftIdSet.Set objects) internal _allObjects;
|
23
|
-
IInstance internal _instance; // store instance address -> more flexible, instance may not be registered during
|
23
|
+
IInstance internal _instance; // store instance address -> more flexible, instance may not be registered during ObjectSet initialization
|
24
24
|
|
25
25
|
/// @dev This initializer needs to be called from the instance itself.
|
26
26
|
function initialize()
|
@@ -30,7 +30,7 @@ contract ObjectManager is
|
|
30
30
|
_instance = IInstance(msg.sender);
|
31
31
|
__Cloneable_init(_instance.authority(), address(_instance.getRegistry()));
|
32
32
|
|
33
|
-
emit
|
33
|
+
emit LogObjectSetInitialized(address(_instance));
|
34
34
|
}
|
35
35
|
|
36
36
|
function getInstance() external view returns (IInstance) {
|
@@ -26,7 +26,7 @@ import {Versionable} from "../shared/Versionable.sol";
|
|
26
26
|
|
27
27
|
import {IService} from "../shared/IService.sol";
|
28
28
|
import {Service} from "../shared/Service.sol";
|
29
|
-
import {
|
29
|
+
import {BundleSet} from "../instance/BundleSet.sol";
|
30
30
|
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
31
31
|
import {IBundleService} from "./IBundleService.sol";
|
32
32
|
import {IRegistryService} from "../registry/IRegistryService.sol";
|
@@ -139,7 +139,7 @@ contract BundleService is
|
|
139
139
|
AmountLib.zero()); // fee amount
|
140
140
|
|
141
141
|
// put bundle under bundle managemet
|
142
|
-
|
142
|
+
BundleSet bundleManager = instance.getBundleSet();
|
143
143
|
bundleManager.add(bundleNftId);
|
144
144
|
|
145
145
|
// TODO add logging
|
@@ -197,7 +197,7 @@ contract BundleService is
|
|
197
197
|
instance.getInstanceStore().updateBundleState(bundleNftId, PAUSED());
|
198
198
|
|
199
199
|
// update set of active bundles
|
200
|
-
|
200
|
+
BundleSet bundleManager = instance.getBundleSet();
|
201
201
|
bundleManager.lock(bundleNftId);
|
202
202
|
|
203
203
|
emit LogBundleServiceBundleLocked(bundleNftId);
|
@@ -214,7 +214,7 @@ contract BundleService is
|
|
214
214
|
instance.getInstanceStore().updateBundleState(bundleNftId, ACTIVE());
|
215
215
|
|
216
216
|
// update set of active bundles
|
217
|
-
|
217
|
+
BundleSet bundleManager = instance.getBundleSet();
|
218
218
|
bundleManager.unlock(bundleNftId);
|
219
219
|
|
220
220
|
emit LogBundleServiceBundleActivated(bundleNftId);
|
@@ -233,7 +233,7 @@ contract BundleService is
|
|
233
233
|
instance.getInstanceStore().updateBundleState(bundleNftId, CLOSED());
|
234
234
|
|
235
235
|
// ensure no open policies attached to bundle
|
236
|
-
|
236
|
+
BundleSet bundleManager = instance.getBundleSet();
|
237
237
|
uint256 openPolicies = bundleManager.activePolicies(bundleNftId);
|
238
238
|
if(openPolicies > 0) {
|
239
239
|
revert ErrorBundleServiceBundleWithOpenPolicies(bundleNftId, openPolicies);
|
@@ -271,7 +271,7 @@ contract BundleService is
|
|
271
271
|
revert ErrorBundleServicePolicyNotCloseable(policyNftId);
|
272
272
|
}
|
273
273
|
|
274
|
-
instance.
|
274
|
+
instance.getBundleSet().unlinkPolicy(policyNftId);
|
275
275
|
}
|
276
276
|
|
277
277
|
/// @dev links policy to bundle
|
@@ -283,10 +283,10 @@ contract BundleService is
|
|
283
283
|
|
284
284
|
// ensure policy has not yet been activated in a previous tx already
|
285
285
|
if (policyInfo.activatedAt.gtz() && policyInfo.activatedAt < TimestampLib.blockTimestamp()) {
|
286
|
-
revert
|
286
|
+
revert BundleSet.ErrorBundleSetPolicyAlreadyActivated(policyNftId);
|
287
287
|
}
|
288
288
|
|
289
|
-
|
289
|
+
BundleSet bundleManager = instance.getBundleSet();
|
290
290
|
bundleManager.linkPolicy(policyNftId);
|
291
291
|
}
|
292
292
|
|
@@ -28,7 +28,6 @@ import {Version, VersionLib} from "../type/Version.sol";
|
|
28
28
|
|
29
29
|
import {IService} from "../shared/IService.sol";
|
30
30
|
import {Service} from "../shared/Service.sol";
|
31
|
-
import {BundleManager} from "../instance/BundleManager.sol";
|
32
31
|
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
33
32
|
import {IBundleService} from "./IBundleService.sol";
|
34
33
|
import {IComponentService} from "../shared/IComponentService.sol";
|
@@ -7,21 +7,29 @@ import {NftId} from "../type/NftId.sol";
|
|
7
7
|
import {ObjectType} from "../type/ObjectType.sol";
|
8
8
|
import {VersionPart} from "../type/Version.sol";
|
9
9
|
import {Timestamp} from "../type/Timestamp.sol";
|
10
|
-
import {RoleId} from "../type/RoleId.sol";
|
11
10
|
|
11
|
+
/// @title Chain Registry interface.
|
12
|
+
/// A chain registry holds all protocol relevant objects with basic metadata.
|
13
|
+
/// Registered objects include services, instances, products, pools, policies, bundles, stakes and more.
|
14
|
+
/// Registered objects are represented by NFTs.
|
12
15
|
interface IRegistry is IERC165 {
|
13
16
|
|
14
17
|
event LogRegistration(NftId nftId, NftId parentNftId, ObjectType objectType, bool isInterceptor, address objectAddress, address initialOwner);
|
15
18
|
event LogServiceRegistration(VersionPart majorVersion, ObjectType domain);
|
16
19
|
|
20
|
+
// register()
|
21
|
+
error ErrorRegistryCallerNotRegistryService();
|
22
|
+
error ErrorRegistryService(address service);
|
23
|
+
|
17
24
|
// registerService()
|
18
|
-
error
|
25
|
+
error ErrorRegistryCallerNotReleaseRegistry();
|
26
|
+
error ErrorRegistryServiceAddressZero();
|
27
|
+
error ErrorRegistryServiceVersionZero();
|
28
|
+
error ErrorRegistryNotService(address service, ObjectType objectType);
|
29
|
+
error ErrorRegistryServiceParentNotRegistry(NftId parentNftId);
|
19
30
|
error ErrorRegistryDomainZero(address service);
|
20
31
|
error ErrorRegistryDomainAlreadyRegistered(address service, VersionPart version, ObjectType domain);
|
21
32
|
|
22
|
-
// register()
|
23
|
-
error ErrorRegistryCallerNotRegistryService();
|
24
|
-
|
25
33
|
// registerWithCustomTypes()
|
26
34
|
error ErrorRegistryCoreTypeRegistration();
|
27
35
|
|
@@ -40,30 +48,34 @@ interface IRegistry is IERC165 {
|
|
40
48
|
bytes data;
|
41
49
|
}
|
42
50
|
|
43
|
-
// TODO cleanup
|
44
51
|
struct ReleaseInfo {
|
45
52
|
VersionPart version;
|
46
53
|
bytes32 salt;
|
47
54
|
address[] addresses;
|
48
55
|
string[] names;
|
49
|
-
RoleId[][] serviceRoles;
|
50
|
-
string[][] serviceRoleNames;
|
51
|
-
RoleId[][] functionRoles;
|
52
|
-
string[][] functionRoleNames;
|
53
|
-
bytes4[][][] selectors;
|
54
56
|
ObjectType[] domains;
|
55
57
|
Timestamp activatedAt;
|
56
58
|
Timestamp disabledAt;
|
57
59
|
}
|
58
60
|
|
61
|
+
/// @dev Register an object with a known core type.
|
62
|
+
/// The function returns a newly minted object NFT ID.
|
63
|
+
/// May not be used to register services.
|
64
|
+
function register(ObjectInfo memory info) external returns (NftId nftId);
|
65
|
+
|
66
|
+
/// @dev Register a service with using the provided domain and version.
|
67
|
+
/// The function returns a newly minted service NFT ID.
|
68
|
+
/// May only be used to register services.
|
59
69
|
function registerService(
|
60
70
|
ObjectInfo memory serviceInfo,
|
61
71
|
VersionPart serviceVersion,
|
62
72
|
ObjectType serviceDomain
|
63
73
|
) external returns(NftId nftId);
|
64
74
|
|
65
|
-
|
66
|
-
|
75
|
+
/// @dev Register an object with a custom type.
|
76
|
+
/// The function returns a newly minted object NFT ID.
|
77
|
+
/// This function is reserved for GIF releases > 3.
|
78
|
+
/// May not be used to register known core types.
|
67
79
|
function registerWithCustomType(ObjectInfo memory info) external returns (NftId nftId);
|
68
80
|
|
69
81
|
function getInitialVersion() external view returns (VersionPart);
|
@@ -110,9 +122,7 @@ interface IRegistry is IERC165 {
|
|
110
122
|
// TODO refactor the address getters below to contract getters
|
111
123
|
function getChainNftAddress() external view returns (address);
|
112
124
|
|
113
|
-
function
|
114
|
-
|
115
|
-
function getReleaseAccessManagerAddress(VersionPart version) external view returns (address);
|
125
|
+
function getReleaseRegistryAddress() external view returns (address);
|
116
126
|
|
117
127
|
function getStakingAddress() external view returns (address);
|
118
128
|
|
@@ -50,14 +50,14 @@ interface IRegistryService is
|
|
50
50
|
function registerComponent(IComponent component, ObjectType objectType, address owner)
|
51
51
|
external returns(IRegistry.ObjectInfo memory info);
|
52
52
|
|
53
|
-
function registerProduct(IComponent product, address owner)
|
54
|
-
|
53
|
+
// function registerProduct(IComponent product, address owner)
|
54
|
+
// external returns(IRegistry.ObjectInfo memory info);
|
55
55
|
|
56
|
-
function registerPool(IComponent pool, address owner)
|
57
|
-
|
56
|
+
// function registerPool(IComponent pool, address owner)
|
57
|
+
// external returns(IRegistry.ObjectInfo memory info);
|
58
58
|
|
59
|
-
function registerDistribution(IComponent distribution, address owner)
|
60
|
-
|
59
|
+
// function registerDistribution(IComponent distribution, address owner)
|
60
|
+
// external returns(IRegistry.ObjectInfo memory info);
|
61
61
|
|
62
62
|
function registerDistributor(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
63
63
|
|