@etherisc/gif-next 0.0.2-e8b06c8-540 → 0.0.2-e8ea5fe-337
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +32 -3
- 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 +85 -101
- 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/Distribution.sol/Distribution.json +43 -75
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +223 -105
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +67 -55
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +43 -37
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +120 -31
- 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 +238 -123
- 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 +226 -231
- 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 +59 -88
- 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/IOracleComponent.sol/IOracleComponent.json +30 -37
- 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/Oracle.sol/Oracle.json +27 -72
- 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/BasicPool.sol/BasicPool.json +55 -137
- 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 +402 -62
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +111 -43
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +205 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +45 -95
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +220 -100
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +45 -133
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +264 -136
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +40 -36
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +31 -50
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +31 -43
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +22 -78
- 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 +194 -72
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +58 -54
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +5 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +114 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +184 -119
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +43 -43
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +19 -37
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +4 -0
- package/artifacts/contracts/product/{IProductService.sol/IProductService.json → IRiskService.sol/IRiskService.json} +2 -2
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +242 -209
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +55 -55
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +113 -153
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +55 -75
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +22 -78
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +4 -0
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +695 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +702 -0
- 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 +51 -47
- 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 +102 -74
- 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/Component.sol/Component.json +0 -64
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +255 -62
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +69 -49
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +0 -26
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +153 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +19 -37
- 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/InitializableCustom.sol/InitializableCustom.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +4 -0
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +73 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +19 -75
- 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/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 +330 -11
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +108 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +27 -27
- 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 +85 -105
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +84 -114
- 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 +47 -43
- 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 +146 -165
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +58 -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 +37 -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 +17 -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 +50 -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 +23 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +9 -3
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +39 -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/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +4 -0
- package/artifacts/contracts/{shared → upgradeability}/IVersionable.sol/IVersionable.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +617 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +129 -0
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +4 -0
- package/artifacts/contracts/{shared → upgradeability}/Versionable.sol/Versionable.json +1 -1
- package/contracts/authorization/AccessAdmin.sol +8 -39
- package/contracts/authorization/AccessManagerCloneable.sol +16 -0
- package/contracts/authorization/Authorization.sol +0 -1
- package/contracts/authorization/IServiceAuthorization.sol +3 -0
- package/contracts/authorization/ModuleAuthorization.sol +0 -125
- package/contracts/authorization/ServiceAuthorization.sol +4 -0
- package/contracts/distribution/BasicDistribution.sol +4 -15
- package/contracts/distribution/BasicDistributionAuthorization.sol +5 -1
- package/contracts/distribution/Distribution.sol +22 -10
- package/contracts/distribution/DistributionService.sol +67 -34
- package/contracts/distribution/DistributionServiceManager.sol +2 -5
- package/contracts/distribution/IDistributionComponent.sol +8 -34
- package/contracts/distribution/IDistributionService.sol +18 -2
- package/contracts/instance/{BundleManager.sol → BundleSet.sol} +23 -23
- package/contracts/instance/IInstance.sol +12 -35
- package/contracts/instance/IInstanceService.sol +6 -5
- package/contracts/instance/Instance.sol +15 -79
- package/contracts/instance/InstanceAdmin.sol +220 -269
- package/contracts/instance/InstanceAuthorizationV3.sol +19 -28
- package/contracts/instance/InstanceReader.sol +32 -12
- package/contracts/instance/InstanceService.sol +73 -122
- package/contracts/instance/InstanceServiceManager.sol +2 -6
- package/contracts/instance/InstanceStore.sol +18 -4
- package/contracts/instance/base/ObjectLifecycle.sol +111 -0
- package/contracts/instance/base/{ObjectManager.sol → ObjectSet.sol} +5 -5
- package/contracts/instance/module/IBundle.sol +1 -1
- package/contracts/instance/module/IComponents.sol +1 -7
- package/contracts/instance/module/IDistribution.sol +0 -1
- package/contracts/instance/module/IPolicy.sol +22 -22
- package/contracts/mock/Dip.sol +1 -1
- package/contracts/oracle/IOracleComponent.sol +2 -1
- package/contracts/oracle/Oracle.sol +16 -6
- package/contracts/oracle/OracleService.sol +1 -0
- package/contracts/oracle/OracleServiceManager.sol +2 -5
- package/contracts/pool/BasicPool.sol +7 -5
- package/contracts/pool/BasicPoolAuthorization.sol +11 -2
- package/contracts/pool/BundleService.sol +189 -47
- package/contracts/pool/BundleServiceManager.sol +2 -5
- package/contracts/pool/IBundleService.sol +33 -5
- package/contracts/pool/IPoolComponent.sol +6 -0
- package/contracts/pool/IPoolService.sol +36 -26
- package/contracts/pool/Pool.sol +39 -24
- package/contracts/pool/PoolService.sol +161 -104
- package/contracts/pool/PoolServiceManager.sol +2 -5
- package/contracts/product/ApplicationService.sol +51 -57
- package/contracts/product/ApplicationServiceManager.sol +2 -2
- package/contracts/product/BasicProduct.sol +3 -32
- package/contracts/product/BasicProductAuthorization.sol +3 -0
- package/contracts/product/ClaimService.sol +118 -73
- package/contracts/product/ClaimServiceManager.sol +2 -2
- package/contracts/product/IApplicationService.sol +1 -0
- package/contracts/product/IClaimService.sol +28 -5
- package/contracts/product/IPolicyService.sol +27 -32
- package/contracts/product/IPricingService.sol +7 -7
- package/contracts/product/IProductComponent.sol +1 -1
- package/contracts/product/{IProductService.sol → IRiskService.sol} +1 -1
- package/contracts/product/PolicyService.sol +278 -180
- package/contracts/product/PolicyServiceManager.sol +2 -5
- package/contracts/product/PricingService.sol +42 -41
- package/contracts/product/PricingServiceManager.sol +2 -5
- package/contracts/product/Product.sol +67 -34
- package/contracts/product/{ProductService.sol → RiskService.sol} +10 -37
- package/contracts/product/RiskServiceManager.sol +39 -0
- package/contracts/registry/IRegistry.sol +27 -17
- package/contracts/registry/IRegistryService.sol +6 -6
- package/contracts/registry/Registry.sol +81 -87
- package/contracts/registry/RegistryAdmin.sol +34 -23
- package/contracts/registry/RegistryService.sol +4 -18
- package/contracts/registry/RegistryServiceManager.sol +2 -2
- package/contracts/registry/ReleaseLifecycle.sol +27 -0
- package/contracts/registry/{ReleaseManager.sol → ReleaseRegistry.sol} +149 -194
- package/contracts/registry/ServiceAuthorizationV3.sol +7 -10
- package/contracts/registry/TokenRegistry.sol +2 -2
- package/contracts/shared/Component.sol +25 -38
- package/contracts/shared/ComponentService.sol +84 -69
- package/contracts/shared/ComponentServiceManager.sol +2 -2
- package/contracts/shared/ComponentVerifyingService.sol +1 -1
- package/contracts/shared/IComponent.sol +4 -4
- package/contracts/shared/IComponentService.sol +15 -9
- package/contracts/shared/IInstanceLinkedComponent.sol +9 -10
- package/contracts/shared/IKeyValueStore.sol +1 -0
- package/contracts/shared/ILifecycle.sol +1 -2
- package/contracts/shared/IService.sol +1 -1
- package/contracts/shared/{ERC165.sol → InitializableERC165.sol} +1 -1
- package/contracts/shared/InstanceLinkedComponent.sol +22 -2
- 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/shared/NftOwnable.sol +3 -3
- package/contracts/shared/PolicyHolder.sol +2 -5
- package/contracts/shared/Service.sol +3 -4
- package/contracts/shared/TokenHandler.sol +100 -19
- package/contracts/shared/TokenHandlerDeployerLib.sol +12 -0
- package/contracts/staking/IStaking.sol +3 -3
- package/contracts/staking/IStakingService.sol +12 -5
- package/contracts/staking/StakeManagerLib.sol +18 -25
- package/contracts/staking/Staking.sol +24 -39
- package/contracts/staking/StakingLifecycle.sol +23 -0
- package/contracts/staking/StakingManager.sol +2 -6
- package/contracts/staking/StakingReader.sol +12 -16
- package/contracts/staking/StakingService.sol +8 -12
- package/contracts/staking/StakingServiceManager.sol +2 -2
- package/contracts/staking/StakingStore.sol +15 -23
- package/contracts/staking/TargetManagerLib.sol +7 -3
- package/contracts/type/Amount.sol +12 -5
- package/contracts/type/Blocknumber.sol +7 -1
- package/contracts/type/ObjectType.sol +18 -18
- package/contracts/type/Referral.sol +1 -0
- package/contracts/type/RoleId.sol +10 -38
- package/contracts/type/Seconds.sol +21 -1
- package/contracts/type/StateId.sol +1 -0
- package/contracts/type/Timestamp.sol +11 -1
- package/contracts/type/UFixed.sol +29 -10
- package/contracts/type/Version.sol +3 -1
- package/contracts/{shared → upgradeability}/ProxyManager.sol +3 -4
- package/contracts/{shared → upgradeability}/UpgradableProxyWithAdmin.sol +1 -3
- 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/product/IProductService.sol/IProductService.dbg.json +0 -4
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +0 -4
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +0 -708
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +0 -4
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +0 -702
- 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/ERC165.sol/ERC165.dbg.json +0 -4
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +0 -73
- 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/IVersionable.sol/IVersionable.dbg.json +0 -4
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.dbg.json +0 -4
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +0 -306
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +0 -4
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +0 -617
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +0 -4
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +0 -129
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +0 -4
- package/contracts/authorization/InstanceAdmin.sol +0 -108
- package/contracts/instance/InstanceAdminNew.sol +0 -261
- package/contracts/instance/InstanceAuthorizationsLib.sol +0 -422
- package/contracts/product/ProductServiceManager.sol +0 -42
- 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
- /package/contracts/{shared → upgradeability}/IVersionable.sol +0 -0
- /package/contracts/{shared → upgradeability}/Versionable.sol +0 -0
@@ -6,17 +6,15 @@ import {
|
|
6
6
|
} from "../../contracts/type/ObjectType.sol";
|
7
7
|
|
8
8
|
import {
|
9
|
-
|
9
|
+
DISTRIBUTION_OWNER_ROLE, ORACLE_OWNER_ROLE, POOL_OWNER_ROLE, PRODUCT_OWNER_ROLE
|
10
10
|
} from "../../contracts/type/RoleId.sol";
|
11
11
|
|
12
|
-
import {
|
12
|
+
import {BundleSet} from "../instance/BundleSet.sol";
|
13
13
|
import {IAccess} from "../authorization/IAccess.sol";
|
14
14
|
import {Instance} from "../instance/Instance.sol";
|
15
|
-
import {
|
15
|
+
import {InstanceAdmin} from "../instance/InstanceAdmin.sol";
|
16
16
|
import {InstanceStore} from "../instance/InstanceStore.sol";
|
17
17
|
import {ModuleAuthorization} from "../authorization/ModuleAuthorization.sol";
|
18
|
-
import {RoleId} from "../type/RoleId.sol";
|
19
|
-
import {VersionPart, VersionPartLib} from "../type/Version.sol";
|
20
18
|
|
21
19
|
|
22
20
|
contract InstanceAuthorizationV3
|
@@ -26,7 +24,7 @@ contract InstanceAuthorizationV3
|
|
26
24
|
string public constant INSTANCE_TARGET_NAME = "Instance";
|
27
25
|
string public constant INSTANCE_STORE_TARGET_NAME = "InstanceStore";
|
28
26
|
string public constant INSTANCE_ADMIN_TARGET_NAME = "InstanceAdmin";
|
29
|
-
string public constant
|
27
|
+
string public constant BUNDLE_SET_TARGET_NAME = "BundleSet";
|
30
28
|
|
31
29
|
string public constant INSTANCE_ROLE_NAME = "InstanceRole";
|
32
30
|
string public constant DISTRIBUTION_OWNER_ROLE_NAME = "DistributionOwnerRole";
|
@@ -61,7 +59,7 @@ contract InstanceAuthorizationV3
|
|
61
59
|
// instance supporting targets
|
62
60
|
_addTarget(INSTANCE_STORE_TARGET_NAME);
|
63
61
|
_addTarget(INSTANCE_ADMIN_TARGET_NAME);
|
64
|
-
_addTarget(
|
62
|
+
_addTarget(BUNDLE_SET_TARGET_NAME);
|
65
63
|
|
66
64
|
// service targets relevant to instance
|
67
65
|
_addServiceTargetWithRole(INSTANCE());
|
@@ -84,22 +82,22 @@ contract InstanceAuthorizationV3
|
|
84
82
|
_setupInstanceAuthorization();
|
85
83
|
_setupInstanceAdminAuthorization();
|
86
84
|
_setupInstanceStoreAuthorization();
|
87
|
-
|
85
|
+
_setupBundleSetAuthorization();
|
88
86
|
}
|
89
87
|
|
90
88
|
|
91
|
-
function
|
89
|
+
function _setupBundleSetAuthorization()
|
92
90
|
internal
|
93
91
|
{
|
94
92
|
IAccess.FunctionInfo[] storage functions;
|
95
93
|
|
96
94
|
// authorize bundle service role
|
97
|
-
functions = _authorizeForTarget(
|
98
|
-
_authorize(functions,
|
99
|
-
_authorize(functions,
|
100
|
-
_authorize(functions,
|
101
|
-
_authorize(functions,
|
102
|
-
_authorize(functions,
|
95
|
+
functions = _authorizeForTarget(BUNDLE_SET_TARGET_NAME, getServiceRole(BUNDLE()));
|
96
|
+
_authorize(functions, BundleSet.linkPolicy.selector, "linkPolicy");
|
97
|
+
_authorize(functions, BundleSet.unlinkPolicy.selector, "unlinkPolicy");
|
98
|
+
_authorize(functions, BundleSet.add.selector, "add");
|
99
|
+
_authorize(functions, BundleSet.lock.selector, "lock");
|
100
|
+
_authorize(functions, BundleSet.unlock.selector, "unlock");
|
103
101
|
}
|
104
102
|
|
105
103
|
|
@@ -108,12 +106,8 @@ contract InstanceAuthorizationV3
|
|
108
106
|
{
|
109
107
|
IAccess.FunctionInfo[] storage functions;
|
110
108
|
|
111
|
-
// TODO cleanup
|
112
109
|
// authorize instance service role
|
113
110
|
functions = _authorizeForTarget(INSTANCE_TARGET_NAME, getServiceRole(INSTANCE()));
|
114
|
-
// _authorize(functions, Instance.setInstanceAdmin.selector, "setInstanceAdmin");
|
115
|
-
// _authorize(functions, Instance.setInstanceStore.selector, "setInstanceStore");
|
116
|
-
// _authorize(functions, Instance.setBundleManager.selector, "setBundleManager");
|
117
111
|
_authorize(functions, Instance.setInstanceReader.selector, "setInstanceReader");
|
118
112
|
}
|
119
113
|
|
@@ -125,17 +119,10 @@ contract InstanceAuthorizationV3
|
|
125
119
|
|
126
120
|
// authorize instance role
|
127
121
|
functions = _authorizeForTarget(INSTANCE_ADMIN_TARGET_NAME, _getTargetRoleId(INSTANCE()));
|
128
|
-
|
129
|
-
_authorize(functions, InstanceAdminNew.grantRole.selector, "grantRole");
|
130
|
-
// _authorize(functions, InstanceAdminNew.createTarget.selector, "createTarget");
|
131
|
-
// _authorize(functions, InstanceAdminNew.setTargetFunctionRoleByInstance.selector, "setTargetFunctionRoleByInstance");
|
132
|
-
// _authorize(functions, InstanceAdminNew.setTargetLockedByInstance.selector, "setTargetLockedByInstance");
|
122
|
+
_authorize(functions, InstanceAdmin.grantRole.selector, "grantRole");
|
133
123
|
|
134
124
|
// authorize instance service role
|
135
|
-
functions = _authorizeForTarget(INSTANCE_ADMIN_TARGET_NAME, getServiceRole(INSTANCE()));
|
136
|
-
// _authorize(functions, InstanceAdminNew.createGifTarget.selector, "createGifTarget");
|
137
|
-
// _authorize(functions, InstanceAdminNew.setTargetLockedByService.selector, "setTargetLockedByService");
|
138
|
-
// _authorize(functions, InstanceAdminNew.setTargetFunctionRoleByService.selector, "setTargetFunctionRoleByService");
|
125
|
+
// functions = _authorizeForTarget(INSTANCE_ADMIN_TARGET_NAME, getServiceRole(INSTANCE()));
|
139
126
|
}
|
140
127
|
|
141
128
|
|
@@ -152,7 +139,9 @@ contract InstanceAuthorizationV3
|
|
152
139
|
_authorize(functions, InstanceStore.createProduct.selector, "createProduct");
|
153
140
|
_authorize(functions, InstanceStore.updateProduct.selector, "updateProduct");
|
154
141
|
_authorize(functions, InstanceStore.increaseBalance.selector, "increaseBalance");
|
142
|
+
_authorize(functions, InstanceStore.decreaseBalance.selector, "decreaseBalance");
|
155
143
|
_authorize(functions, InstanceStore.increaseFees.selector, "increaseFees");
|
144
|
+
_authorize(functions, InstanceStore.decreaseFees.selector, "decreaseFees");
|
156
145
|
|
157
146
|
// authorize distribution service role
|
158
147
|
functions = _authorizeForTarget(INSTANCE_STORE_TARGET_NAME, getServiceRole(DISTRIBUTION()));
|
@@ -200,6 +189,8 @@ contract InstanceAuthorizationV3
|
|
200
189
|
functions = _authorizeForTarget(INSTANCE_STORE_TARGET_NAME, getServiceRole(POLICY()));
|
201
190
|
_authorize(functions, InstanceStore.updatePolicy.selector, "updatePolicy");
|
202
191
|
_authorize(functions, InstanceStore.updatePolicyState.selector, "updatePolicyState");
|
192
|
+
_authorize(functions, InstanceStore.createPremium.selector, "createPremium");
|
193
|
+
_authorize(functions, InstanceStore.updatePremiumState.selector, "updatePremiumState");
|
203
194
|
|
204
195
|
// authorize claim service role
|
205
196
|
functions = _authorizeForTarget(INSTANCE_STORE_TARGET_NAME, getServiceRole(CLAIM()));
|
@@ -1,25 +1,20 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
|
-
|
6
4
|
import {Amount} from "../type/Amount.sol";
|
7
5
|
import {ClaimId} from "../type/ClaimId.sol";
|
8
6
|
import {DistributorType} from "../type/DistributorType.sol";
|
9
|
-
import {Fee, FeeLib} from "../type/Fee.sol";
|
10
7
|
import {Key32} from "../type/Key32.sol";
|
11
8
|
import {NftId} from "../type/NftId.sol";
|
12
|
-
import {
|
9
|
+
import {COMPONENT, DISTRIBUTOR, DISTRIBUTION, PREMIUM, PRODUCT, POLICY, POOL, BUNDLE} from "../type/ObjectType.sol";
|
13
10
|
import {PayoutId} from "../type/PayoutId.sol";
|
14
11
|
import {ReferralId, ReferralStatus, ReferralLib, REFERRAL_OK, REFERRAL_ERROR_UNKNOWN, REFERRAL_ERROR_EXPIRED, REFERRAL_ERROR_EXHAUSTED} from "../type/Referral.sol";
|
15
12
|
import {RequestId} from "../type/RequestId.sol";
|
16
13
|
import {RiskId} from "../type/RiskId.sol";
|
17
14
|
import {RoleId} from "../type/RoleId.sol";
|
18
15
|
import {StateId} from "../type/StateId.sol";
|
19
|
-
import {UFixed,
|
20
|
-
import {Version} from "../type/Version.sol";
|
16
|
+
import {UFixed, UFixedLib} from "../type/UFixed.sol";
|
21
17
|
|
22
|
-
import {IRegistry} from "../registry/IRegistry.sol";
|
23
18
|
import {IBundle} from "../instance/module/IBundle.sol";
|
24
19
|
import {IComponents} from "../instance/module/IComponents.sol";
|
25
20
|
import {IDistribution} from "../instance/module/IDistribution.sol";
|
@@ -49,11 +44,6 @@ contract InstanceReader {
|
|
49
44
|
revert ErrorInstanceReaderAlreadyInitialized();
|
50
45
|
}
|
51
46
|
|
52
|
-
// TODO cleanup
|
53
|
-
// _initialized = true;
|
54
|
-
// _instance = IInstance(msg.sender);
|
55
|
-
// _store = _instance.getInstanceStore();
|
56
|
-
|
57
47
|
initializeWithInstance(msg.sender);
|
58
48
|
}
|
59
49
|
|
@@ -90,6 +80,33 @@ contract InstanceReader {
|
|
90
80
|
return _store.getState(toPolicyKey(policyNftId));
|
91
81
|
}
|
92
82
|
|
83
|
+
function getPremiumInfo(NftId policyNftId)
|
84
|
+
public
|
85
|
+
view
|
86
|
+
returns (IPolicy.PremiumInfo memory info)
|
87
|
+
{
|
88
|
+
bytes memory data = _store.getData(toPremiumKey(policyNftId));
|
89
|
+
if (data.length > 0) {
|
90
|
+
return abi.decode(data, (IPolicy.PremiumInfo));
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
function getPremiumInfoState(NftId policyNftId)
|
95
|
+
public
|
96
|
+
view
|
97
|
+
returns (StateId state)
|
98
|
+
{
|
99
|
+
return _store.getState(toPremiumKey(policyNftId));
|
100
|
+
}
|
101
|
+
|
102
|
+
function getBundleState(NftId bundleNftId)
|
103
|
+
public
|
104
|
+
view
|
105
|
+
returns (StateId state)
|
106
|
+
{
|
107
|
+
return _store.getState(toBundleKey(bundleNftId));
|
108
|
+
}
|
109
|
+
|
93
110
|
/// @dev returns true iff policy may be closed
|
94
111
|
/// a policy can be closed all conditions below are met
|
95
112
|
/// - policy exists
|
@@ -366,6 +383,9 @@ contract InstanceReader {
|
|
366
383
|
return policyNftId.toKey32(POLICY());
|
367
384
|
}
|
368
385
|
|
386
|
+
function toPremiumKey(NftId policyNftId) public pure returns (Key32) {
|
387
|
+
return policyNftId.toKey32(PREMIUM());
|
388
|
+
}
|
369
389
|
|
370
390
|
function toDistributorKey(NftId distributorNftId) public pure returns (Key32) {
|
371
391
|
return distributorNftId.toKey32(DISTRIBUTOR());
|
@@ -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,16 +50,17 @@ 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
|
|
62
61
|
modifier onlyInstance() {
|
63
62
|
address instanceAddress = msg.sender;
|
64
|
-
NftId instanceNftId = getRegistry().
|
63
|
+
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
65
64
|
if (instanceNftId.eqz()) {
|
66
65
|
revert ErrorInstanceServiceNotRegistered(instanceAddress);
|
67
66
|
}
|
@@ -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,37 +104,9 @@ contract InstanceService is
|
|
105
104
|
// tx sender will become instance owner
|
106
105
|
address instanceOwner = msg.sender;
|
107
106
|
|
108
|
-
//
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
InstanceStore clonedInstanceStore = InstanceStore(Clones.clone(address(_masterInstanceStore)));
|
113
|
-
BundleManager clonedBundleManager = BundleManager(Clones.clone(_masterInstanceBundleManager));
|
114
|
-
InstanceReader clonedInstanceReader = InstanceReader(Clones.clone(address(_masterInstanceReader)));
|
115
|
-
|
116
|
-
// clone instance
|
117
|
-
clonedInstance = Instance(Clones.clone(_masterInstance));
|
118
|
-
clonedInstance.initialize(
|
119
|
-
clonedInstanceAdmin,
|
120
|
-
clonedInstanceStore,
|
121
|
-
clonedBundleManager,
|
122
|
-
clonedInstanceReader,
|
123
|
-
getRegistry(),
|
124
|
-
instanceOwner);
|
125
|
-
|
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);
|
107
|
+
// create instance admin and instance
|
108
|
+
InstanceAdmin instanceAdmin = _createInstanceAdmin();
|
109
|
+
clonedInstance = _createInstance(instanceAdmin, instanceOwner);
|
139
110
|
|
140
111
|
// register cloned instance with registry
|
141
112
|
clonedInstanceNftId = _registryService.registerInstance(
|
@@ -148,90 +119,20 @@ contract InstanceService is
|
|
148
119
|
TargetManagerLib.getDefaultRewardRate());
|
149
120
|
|
150
121
|
// MUST be set after instance is set up and registered
|
151
|
-
|
122
|
+
instanceAdmin.initializeInstanceAuthorization(address(clonedInstance));
|
152
123
|
|
153
124
|
emit LogInstanceCloned(
|
154
125
|
clonedInstanceNftId,
|
155
126
|
address(clonedInstance));
|
156
127
|
}
|
157
128
|
|
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
129
|
|
229
130
|
function setStakingLockingPeriod(Seconds stakeLockingPeriod)
|
230
131
|
external
|
231
132
|
virtual
|
232
133
|
onlyInstance()
|
233
134
|
{
|
234
|
-
NftId instanceNftId = getRegistry().
|
135
|
+
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
235
136
|
_stakingService.setInstanceLockingPeriod(
|
236
137
|
instanceNftId,
|
237
138
|
stakeLockingPeriod);
|
@@ -243,7 +144,7 @@ contract InstanceService is
|
|
243
144
|
virtual
|
244
145
|
onlyInstance()
|
245
146
|
{
|
246
|
-
NftId instanceNftId = getRegistry().
|
147
|
+
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
247
148
|
_stakingService.setInstanceRewardRate(
|
248
149
|
instanceNftId,
|
249
150
|
rewardRate);
|
@@ -255,7 +156,7 @@ contract InstanceService is
|
|
255
156
|
virtual
|
256
157
|
onlyInstance()
|
257
158
|
{
|
258
|
-
NftId instanceNftId = getRegistry().
|
159
|
+
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
259
160
|
_stakingService.refillInstanceRewardReserves(
|
260
161
|
instanceNftId,
|
261
162
|
rewardProvider,
|
@@ -269,7 +170,7 @@ contract InstanceService is
|
|
269
170
|
onlyInstance()
|
270
171
|
returns (Amount newBalance)
|
271
172
|
{
|
272
|
-
NftId instanceNftId = getRegistry().
|
173
|
+
NftId instanceNftId = getRegistry().getNftIdForAddress(msg.sender);
|
273
174
|
_stakingService.withdrawInstanceRewardReserves(
|
274
175
|
instanceNftId,
|
275
176
|
dipAmount);
|
@@ -314,35 +215,38 @@ contract InstanceService is
|
|
314
215
|
{
|
315
216
|
if(_masterInstance != address(0)) { revert ErrorInstanceServiceMasterInstanceAlreadySet(); }
|
316
217
|
if(_masterInstanceAdmin != address(0)) { revert ErrorInstanceServiceMasterInstanceAdminAlreadySet(); }
|
317
|
-
if(
|
218
|
+
if(_masterInstanceBundleSet != address(0)) { revert ErrorInstanceServiceMasterBundleSetAlreadySet(); }
|
318
219
|
|
319
220
|
if(instanceAddress == address(0)) { revert ErrorInstanceServiceInstanceAddressZero(); }
|
320
221
|
|
321
222
|
IInstance instance = IInstance(instanceAddress);
|
322
|
-
|
223
|
+
address accessManagerAddress = instance.authority();
|
224
|
+
InstanceAdmin instanceAdmin = instance.getInstanceAdmin();
|
323
225
|
address instanceAdminAddress = address(instanceAdmin);
|
324
226
|
InstanceReader instanceReader = instance.getInstanceReader();
|
325
227
|
address instanceReaderAddress = address(instanceReader);
|
326
|
-
|
228
|
+
BundleSet bundleManager = instance.getBundleSet();
|
327
229
|
address bundleManagerAddress = address(bundleManager);
|
328
230
|
InstanceStore instanceStore = instance.getInstanceStore();
|
329
231
|
address instanceStoreAddress = address(instanceStore);
|
330
232
|
|
233
|
+
if(accessManagerAddress == address(0)) { revert ErrorInstanceServiceAccessManagerZero(); }
|
331
234
|
if(instanceAdminAddress == address(0)) { revert ErrorInstanceServiceInstanceAdminZero(); }
|
332
235
|
if(instanceReaderAddress == address(0)) { revert ErrorInstanceServiceInstanceReaderZero(); }
|
333
|
-
if(bundleManagerAddress == address(0)) { revert
|
236
|
+
if(bundleManagerAddress == address(0)) { revert ErrorInstanceServiceBundleSetZero(); }
|
334
237
|
if(instanceStoreAddress == address(0)) { revert ErrorInstanceServiceInstanceStoreZero(); }
|
335
238
|
|
336
239
|
if(instance.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceInstanceAuthorityMismatch(); }
|
337
|
-
if(bundleManager.authority() != instanceAdmin.authority()) { revert
|
240
|
+
if(bundleManager.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceBundleSetAuthorityMismatch(); }
|
338
241
|
if(instanceStore.authority() != instanceAdmin.authority()) { revert ErrorInstanceServiceInstanceStoreAuthorityMismatch(); }
|
339
242
|
if(bundleManager.getInstance() != instance) { revert ErrorInstanceServiceBundleMangerInstanceMismatch(); }
|
340
243
|
if(instanceReader.getInstance() != instance) { revert ErrorInstanceServiceInstanceReaderInstanceMismatch2(); }
|
341
244
|
|
245
|
+
_masterAccessManager = accessManagerAddress;
|
342
246
|
_masterInstanceAdmin = instanceAdminAddress;
|
343
247
|
_masterInstance = instanceAddress;
|
344
248
|
_masterInstanceReader = instanceReaderAddress;
|
345
|
-
|
249
|
+
_masterInstanceBundleSet = bundleManagerAddress;
|
346
250
|
_masterInstanceStore = instanceStoreAddress;
|
347
251
|
|
348
252
|
IInstance masterInstance = IInstance(_masterInstance);
|
@@ -408,9 +312,9 @@ contract InstanceService is
|
|
408
312
|
instanceNftId,
|
409
313
|
address(component));
|
410
314
|
|
411
|
-
|
315
|
+
InstanceAdmin instanceAdmin = instance.getInstanceAdmin();
|
412
316
|
instanceAdmin.initializeComponentAuthorization(
|
413
|
-
|
317
|
+
component,
|
414
318
|
component.getAuthorization());
|
415
319
|
}
|
416
320
|
|
@@ -435,6 +339,53 @@ contract InstanceService is
|
|
435
339
|
);
|
436
340
|
}
|
437
341
|
|
342
|
+
/// @dev create new cloned instance admin
|
343
|
+
/// function used to setup a new instance
|
344
|
+
function _createInstanceAdmin()
|
345
|
+
internal
|
346
|
+
virtual
|
347
|
+
returns (InstanceAdmin clonedInstanceAdmin)
|
348
|
+
{
|
349
|
+
// start with setting up a new OZ access manager
|
350
|
+
AccessManagerCloneable clonedAccessManager = AccessManagerCloneable(
|
351
|
+
Clones.clone(_masterAccessManager));
|
352
|
+
|
353
|
+
// set up the instance admin
|
354
|
+
clonedInstanceAdmin = InstanceAdmin(Clones.clone(_masterInstanceAdmin));
|
355
|
+
clonedAccessManager.initialize(
|
356
|
+
address(clonedInstanceAdmin)); // grant ADMIN_ROLE to instance admin
|
357
|
+
|
358
|
+
clonedInstanceAdmin.initialize(
|
359
|
+
clonedAccessManager,
|
360
|
+
InstanceAdmin(_masterInstanceAdmin).getInstanceAuthorization());
|
361
|
+
}
|
362
|
+
|
363
|
+
|
364
|
+
/// @dev create new cloned instance
|
365
|
+
/// function used to setup a new instance
|
366
|
+
function _createInstance(
|
367
|
+
InstanceAdmin instanceAdmin,
|
368
|
+
address instanceOwner
|
369
|
+
)
|
370
|
+
internal
|
371
|
+
virtual
|
372
|
+
returns (Instance clonedInstance)
|
373
|
+
{
|
374
|
+
InstanceStore clonedInstanceStore = InstanceStore(Clones.clone(address(_masterInstanceStore)));
|
375
|
+
BundleSet clonedBundleSet = BundleSet(Clones.clone(_masterInstanceBundleSet));
|
376
|
+
InstanceReader clonedInstanceReader = InstanceReader(Clones.clone(address(_masterInstanceReader)));
|
377
|
+
|
378
|
+
// clone instance
|
379
|
+
clonedInstance = Instance(Clones.clone(_masterInstance));
|
380
|
+
clonedInstance.initialize(
|
381
|
+
instanceAdmin,
|
382
|
+
clonedInstanceStore,
|
383
|
+
clonedBundleSet,
|
384
|
+
clonedInstanceReader,
|
385
|
+
getRegistry(),
|
386
|
+
instanceOwner);
|
387
|
+
}
|
388
|
+
|
438
389
|
|
439
390
|
/// all gif targets MUST be children of instanceNftId
|
440
391
|
function _createGifTarget(
|
@@ -453,7 +404,7 @@ contract InstanceService is
|
|
453
404
|
// or targetInfo
|
454
405
|
) = _validateInstanceAndComponent(instanceNftId, targetAddress);
|
455
406
|
|
456
|
-
|
407
|
+
InstanceAdmin instanceAdmin = instance.getInstanceAdmin();
|
457
408
|
|
458
409
|
// TODO refactor/implement
|
459
410
|
// instanceAdmin.createGifTarget(targetAddress, targetName);
|
@@ -1,13 +1,9 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {ProxyManager} from "../shared/ProxyManager.sol";
|
4
|
+
import {IVersionable} from "../upgradeability/IVersionable.sol";
|
5
|
+
import {ProxyManager} from "../upgradeability/ProxyManager.sol";
|
7
6
|
import {InstanceService} from "./InstanceService.sol";
|
8
|
-
import {Registry} from "../registry/Registry.sol";
|
9
|
-
import {RegistryService} from "../registry/RegistryService.sol";
|
10
|
-
import {REGISTRY} from "../type/ObjectType.sol";
|
11
7
|
|
12
8
|
contract InstanceServiceManager is ProxyManager {
|
13
9
|
|
@@ -7,7 +7,7 @@ import {Amount} from "../type/Amount.sol";
|
|
7
7
|
import {Key32} from "../type/Key32.sol";
|
8
8
|
import {NftId} from "../type/NftId.sol";
|
9
9
|
import {ClaimId} from "../type/ClaimId.sol";
|
10
|
-
import {ObjectType, BUNDLE, POLICY, POOL, PRODUCT, COMPONENT, DISTRIBUTOR
|
10
|
+
import {ObjectType, BUNDLE, POLICY, POOL, PREMIUM, PRODUCT, COMPONENT, DISTRIBUTOR} from "../type/ObjectType.sol";
|
11
11
|
import {RequestId} from "../type/RequestId.sol";
|
12
12
|
import {RiskId} from "../type/RiskId.sol";
|
13
13
|
import {StateId} from "../type/StateId.sol";
|
@@ -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 ---------------------------------------------------------//
|
@@ -113,6 +116,7 @@ contract InstanceStore is
|
|
113
116
|
|
114
117
|
//--- Distributor -------------------------------------------------------//
|
115
118
|
function createDistributor(NftId distributorNftId, IDistribution.DistributorInfo memory info) external restricted() {
|
119
|
+
_registerBalanceTarget(distributorNftId);
|
116
120
|
_create(_toNftKey32(distributorNftId, DISTRIBUTOR()), abi.encode(info));
|
117
121
|
}
|
118
122
|
|
@@ -191,6 +195,16 @@ contract InstanceStore is
|
|
191
195
|
_updateState(_toNftKey32(policyNftId, POLICY()), newState);
|
192
196
|
}
|
193
197
|
|
198
|
+
|
199
|
+
//--- Premium (Policy) ----------------------------------------------//
|
200
|
+
function createPremium(NftId policyNftId, IPolicy.PremiumInfo memory premium) external restricted() {
|
201
|
+
_create(_toNftKey32(policyNftId, PREMIUM()), abi.encode(premium));
|
202
|
+
}
|
203
|
+
|
204
|
+
function updatePremiumState(NftId policyNftId, StateId newState) external restricted() {
|
205
|
+
_updateState(_toNftKey32(policyNftId, PREMIUM()), newState);
|
206
|
+
}
|
207
|
+
|
194
208
|
//--- Claim -------------------------------------------------------------//
|
195
209
|
function createClaim(NftId policyNftId, ClaimId claimId, IPolicy.ClaimInfo memory claim) external restricted() {
|
196
210
|
_create(_toClaimKey32(policyNftId, claimId), abi.encode(claim));
|