@etherisc/gif-next 0.0.2-ab82da8-607 → 0.0.2-abde86b-349
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +26 -45
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +2 -2
- 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/IAccessAdmin.sol/IAccessAdmin.json +0 -19
- 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/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +2 -2
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +2 -2
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +16 -16
- 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 +13 -8
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +92 -61
- 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/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +16 -16
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +11 -11
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +60 -32
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +71 -69
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +2 -2
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +88 -91
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +2 -2
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +291 -66
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +17 -12
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +69 -38
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +71 -51
- 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 +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
- 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/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +2 -2
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +18 -18
- 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 +31 -26
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +68 -37
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +28 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +16 -16
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +15 -10
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +90 -59
- 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/IPoolComponent.sol/IPoolComponent.json +28 -0
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +73 -4
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +28 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +170 -43
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +95 -40
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +31 -26
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +65 -34
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +28 -26
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +16 -16
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +103 -82
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +97 -58
- 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/IClaimService.sol/IClaimService.json +8 -8
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +82 -0
- 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/IProductComponent.sol/IProductComponent.json +28 -26
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +167 -48
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +92 -45
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +39 -34
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +76 -45
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +28 -26
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +11 -6
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +62 -31
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +19 -0
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/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 +55 -36
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +108 -111
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +23 -201
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +60 -29
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +2 -2
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +2 -2
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
- 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 +39 -34
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +97 -56
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +5 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +92 -0
- 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/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- 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/IPolicyHolder.sol/IPolicyHolder.json +16 -6
- 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 +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/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +18 -8
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +2 -2
- 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/Service.sol/Service.json +5 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
- 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 +2 -2
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +2 -2
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +78 -42
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +2 -2
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +11 -6
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +64 -33
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2 -2
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +2 -2
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +2 -2
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +2 -2
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +19 -19
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- 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 +15 -2
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +47 -27
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/authorization/AccessAdmin.sol +24 -21
- package/contracts/authorization/Authorization.sol +5 -1
- package/contracts/authorization/IAccessAdmin.sol +0 -1
- package/contracts/distribution/DistributionService.sol +7 -7
- package/contracts/distribution/DistributionServiceManager.sol +6 -6
- package/contracts/instance/InstanceAdmin.sol +6 -3
- package/contracts/instance/InstanceReader.sol +93 -4
- package/contracts/instance/InstanceService.sol +3 -5
- package/contracts/instance/InstanceServiceManager.sol +6 -7
- package/contracts/instance/module/IComponents.sol +3 -1
- package/contracts/instance/module/IPolicy.sol +2 -2
- package/contracts/oracle/OracleService.sol +8 -6
- package/contracts/oracle/OracleServiceManager.sol +6 -6
- package/contracts/pool/BundleService.sol +6 -6
- package/contracts/pool/BundleServiceManager.sol +6 -6
- package/contracts/pool/IPoolComponent.sol +18 -8
- package/contracts/pool/IPoolService.sol +19 -8
- package/contracts/pool/Pool.sol +37 -10
- package/contracts/pool/PoolService.sol +61 -22
- package/contracts/pool/PoolServiceManager.sol +4 -4
- package/contracts/product/ApplicationService.sol +10 -7
- package/contracts/product/ApplicationServiceManager.sol +4 -4
- package/contracts/product/ClaimService.sol +147 -61
- package/contracts/product/ClaimServiceManager.sol +4 -4
- package/contracts/product/IClaimService.sol +1 -1
- package/contracts/product/IPolicyService.sol +7 -3
- package/contracts/product/IProductComponent.sol +17 -3
- package/contracts/product/PolicyService.sol +93 -20
- package/contracts/product/PolicyServiceManager.sol +4 -4
- package/contracts/product/PricingService.sol +2 -3
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +25 -18
- package/contracts/product/RiskService.sol +2 -3
- package/contracts/product/RiskServiceManager.sol +4 -4
- package/contracts/registry/IRegistry.sol +2 -0
- package/contracts/registry/IRegistryService.sol +0 -9
- package/contracts/registry/Registry.sol +7 -2
- package/contracts/registry/RegistryService.sol +53 -46
- package/contracts/registry/RegistryServiceManager.sol +2 -2
- package/contracts/shared/ComponentService.sol +5 -5
- package/contracts/shared/ComponentServiceManager.sol +8 -5
- package/contracts/shared/ComponentVerifyingService.sol +1 -2
- package/contracts/shared/ContractLib.sol +38 -0
- package/contracts/shared/IPolicyHolder.sol +12 -13
- package/contracts/shared/InstanceLinkedComponent.sol +1 -2
- package/contracts/shared/PolicyHolder.sol +11 -5
- package/contracts/shared/Service.sol +12 -7
- package/contracts/staking/Staking.sol +1 -1
- package/contracts/staking/StakingManager.sol +8 -6
- package/contracts/staking/StakingServiceManager.sol +2 -2
- package/contracts/type/PayoutId.sol +10 -10
- package/contracts/type/UFixed.sol +4 -0
- package/contracts/upgradeability/ProxyManager.sol +67 -34
- package/contracts/upgradeability/Versionable.sol +2 -2
- package/package.json +1 -1
@@ -2,6 +2,7 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {Amount} from "../type/Amount.sol";
|
5
|
+
import {ClaimId} from "../type/ClaimId.sol";
|
5
6
|
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
6
7
|
import {IComponents} from "../instance/module/IComponents.sol";
|
7
8
|
import {NftId} from "../type/NftId.sol";
|
@@ -13,6 +14,18 @@ interface IProductComponent is
|
|
13
14
|
IInstanceLinkedComponent
|
14
15
|
{
|
15
16
|
|
17
|
+
/// @dev Callback function to inform product compnent about arrival of funding for a claim.
|
18
|
+
/// The callback is called by the pool service after the corresponding pool triggers this function.
|
19
|
+
/// The callback is only called when the product's property isProcessingFundedClaims is set.
|
20
|
+
function processFundedClaim(
|
21
|
+
NftId policyNftId,
|
22
|
+
ClaimId claimId,
|
23
|
+
Amount availableAmount
|
24
|
+
) external;
|
25
|
+
|
26
|
+
|
27
|
+
/// @dev Calculates the premium amount for the provided application data.
|
28
|
+
/// The returned premium amounts takes into account potential discounts and fees.
|
16
29
|
function calculatePremium(
|
17
30
|
Amount sumInsuredAmount,
|
18
31
|
RiskId riskId,
|
@@ -22,6 +35,10 @@ interface IProductComponent is
|
|
22
35
|
ReferralId referralId
|
23
36
|
) external view returns (Amount premiumAmount);
|
24
37
|
|
38
|
+
|
39
|
+
/// @dev Calculates the net premium amount for the provided application data.
|
40
|
+
/// The returned net premium amounts only covers the cost of collateralizing the application.
|
41
|
+
/// This amount purely depends on the use case specific risk and does not include any fees/commission.
|
25
42
|
function calculateNetPremium(
|
26
43
|
Amount sumInsuredAmount,
|
27
44
|
RiskId riskId,
|
@@ -29,9 +46,6 @@ interface IProductComponent is
|
|
29
46
|
bytes memory applicationData
|
30
47
|
) external view returns (Amount netPremiumAmount);
|
31
48
|
|
32
|
-
function getPoolNftId() external view returns (NftId poolNftId);
|
33
|
-
function getDistributionNftId() external view returns (NftId distributionNftId);
|
34
|
-
|
35
49
|
|
36
50
|
/// @dev returns initial pool specific infos for this pool
|
37
51
|
function getInitialProductInfo() external view returns (IComponents.ProductInfo memory info);
|
@@ -21,6 +21,7 @@ import {StateId} from "../type/StateId.sol";
|
|
21
21
|
import {VersionPart} from "../type/Version.sol";
|
22
22
|
|
23
23
|
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
24
|
+
import {ContractLib} from "../shared/ContractLib.sol";
|
24
25
|
import {IApplicationService} from "./IApplicationService.sol";
|
25
26
|
import {IBundleService} from "../pool/IBundleService.sol";
|
26
27
|
import {IClaimService} from "./IClaimService.sol";
|
@@ -28,6 +29,7 @@ import {IComponentService} from "../shared/IComponentService.sol";
|
|
28
29
|
import {IDistributionService} from "../distribution/IDistributionService.sol";
|
29
30
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
30
31
|
import {InstanceStore} from "../instance/InstanceStore.sol";
|
32
|
+
import {IPolicyHolder} from "../shared/IPolicyHolder.sol";
|
31
33
|
import {IPolicyService} from "./IPolicyService.sol";
|
32
34
|
import {IPoolService} from "../pool/IPoolService.sol";
|
33
35
|
import {IPricingService} from "./IPricingService.sol";
|
@@ -56,10 +58,9 @@ contract PolicyService is
|
|
56
58
|
initializer
|
57
59
|
{
|
58
60
|
(
|
59
|
-
address registryAddress
|
60
|
-
//address managerAddress
|
61
|
+
address registryAddress,
|
61
62
|
address authority
|
62
|
-
) = abi.decode(data, (address, address
|
63
|
+
) = abi.decode(data, (address, address));
|
63
64
|
|
64
65
|
_initializeService(registryAddress, authority, owner);
|
65
66
|
|
@@ -80,7 +81,8 @@ contract PolicyService is
|
|
80
81
|
NftId applicationNftId // = policyNftId
|
81
82
|
)
|
82
83
|
external
|
83
|
-
virtual
|
84
|
+
virtual
|
85
|
+
nonReentrant()
|
84
86
|
{
|
85
87
|
(NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
86
88
|
InstanceReader instanceReader = instance.getInstanceReader();
|
@@ -115,7 +117,8 @@ contract PolicyService is
|
|
115
117
|
Timestamp activateAt
|
116
118
|
)
|
117
119
|
external
|
118
|
-
virtual
|
120
|
+
virtual
|
121
|
+
nonReentrant()
|
119
122
|
{
|
120
123
|
// check caller is registered product
|
121
124
|
(NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
@@ -179,12 +182,14 @@ contract PolicyService is
|
|
179
182
|
productInfo.distributionNftId,
|
180
183
|
applicationInfo.referralId);
|
181
184
|
}
|
182
|
-
|
183
|
-
// TODO add calling pool contract if it needs to validate application
|
184
185
|
|
185
|
-
//
|
186
|
+
// log policy creation before interactions with token and policy holder
|
187
|
+
emit LogPolicyServicePolicyCreated(applicationNftId, premium.premiumAmount, activateAt);
|
186
188
|
|
187
|
-
// TODO
|
189
|
+
// TODO add calling pool contract if it needs to validate application
|
190
|
+
|
191
|
+
// callback to policy holder if applicable
|
192
|
+
_policyHolderPolicyActivated(applicationNftId, activateAt);
|
188
193
|
}
|
189
194
|
|
190
195
|
|
@@ -195,6 +200,7 @@ contract PolicyService is
|
|
195
200
|
)
|
196
201
|
external
|
197
202
|
virtual
|
203
|
+
nonReentrant()
|
198
204
|
{
|
199
205
|
// check caller is registered product
|
200
206
|
(,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
@@ -228,15 +234,18 @@ contract PolicyService is
|
|
228
234
|
instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
|
229
235
|
instance.getInstanceStore().updatePremiumState(policyNftId, PAID());
|
230
236
|
|
231
|
-
//
|
237
|
+
// log premium collection before interactions with token
|
238
|
+
emit LogPolicyServicePolicyPremiumCollected(policyNftId, premium.premiumAmount);
|
232
239
|
|
233
240
|
_transferFunds(instanceReader, policyNftId, policyInfo.productNftId, premium);
|
234
|
-
|
235
|
-
// TODO: add callback IPolicyHolder.policyActivated() if applicable
|
236
241
|
}
|
237
242
|
|
238
243
|
/// @inheritdoc IPolicyService
|
239
|
-
function activate(NftId policyNftId, Timestamp activateAt)
|
244
|
+
function activate(NftId policyNftId, Timestamp activateAt)
|
245
|
+
external
|
246
|
+
virtual
|
247
|
+
nonReentrant()
|
248
|
+
{
|
240
249
|
// check caller is registered product
|
241
250
|
(,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
242
251
|
InstanceReader instanceReader = instance.getInstanceReader();
|
@@ -246,9 +255,11 @@ contract PolicyService is
|
|
246
255
|
|
247
256
|
instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
|
248
257
|
|
249
|
-
//
|
258
|
+
// log policy activation before interactions with policy holder
|
259
|
+
emit LogPolicyServicePolicyActivated(policyNftId, activateAt);
|
250
260
|
|
251
|
-
//
|
261
|
+
// callback to policy holder if applicable
|
262
|
+
_policyHolderPolicyActivated(policyNftId, activateAt);
|
252
263
|
}
|
253
264
|
|
254
265
|
|
@@ -258,8 +269,8 @@ contract PolicyService is
|
|
258
269
|
Timestamp expireAt
|
259
270
|
)
|
260
271
|
external
|
261
|
-
override
|
262
272
|
virtual
|
273
|
+
nonReentrant()
|
263
274
|
returns (Timestamp expiredAt)
|
264
275
|
{
|
265
276
|
(NftId productNftId,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
@@ -297,12 +308,14 @@ contract PolicyService is
|
|
297
308
|
}
|
298
309
|
|
299
310
|
// update policyInfo with new expiredAt timestamp
|
311
|
+
Timestamp originalExpiredAt = policyInfo.expiredAt;
|
300
312
|
policyInfo.expiredAt = expiredAt;
|
301
313
|
instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, KEEP_STATE());
|
302
314
|
|
303
|
-
emit LogPolicyServicePolicyExpirationUpdated(policyNftId, expiredAt);
|
315
|
+
emit LogPolicyServicePolicyExpirationUpdated(policyNftId, originalExpiredAt, expiredAt);
|
304
316
|
|
305
|
-
//
|
317
|
+
// callback to policy holder if applicable
|
318
|
+
_policyHolderPolicyExpired(policyNftId, expiredAt);
|
306
319
|
}
|
307
320
|
|
308
321
|
|
@@ -310,7 +323,8 @@ contract PolicyService is
|
|
310
323
|
NftId policyNftId
|
311
324
|
)
|
312
325
|
external
|
313
|
-
|
326
|
+
virtual
|
327
|
+
nonReentrant()
|
314
328
|
{
|
315
329
|
(,, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
316
330
|
InstanceReader instanceReader = instance.getInstanceReader();
|
@@ -351,7 +365,7 @@ contract PolicyService is
|
|
351
365
|
policyInfo.closedAt = TimestampLib.blockTimestamp();
|
352
366
|
instance.getInstanceStore().updatePolicy(policyNftId, policyInfo, CLOSED());
|
353
367
|
|
354
|
-
|
368
|
+
emit LogPolicyServicePolicyClosed(policyNftId);
|
355
369
|
}
|
356
370
|
|
357
371
|
|
@@ -525,6 +539,64 @@ contract PolicyService is
|
|
525
539
|
}
|
526
540
|
|
527
541
|
|
542
|
+
function _policyHolderPolicyActivated(
|
543
|
+
NftId policyNftId,
|
544
|
+
Timestamp activateAt
|
545
|
+
)
|
546
|
+
internal
|
547
|
+
virtual
|
548
|
+
{
|
549
|
+
// immediately return if policy is not activated
|
550
|
+
if (activateAt.eqz()) {
|
551
|
+
return;
|
552
|
+
}
|
553
|
+
|
554
|
+
// get policy holder address
|
555
|
+
IPolicyHolder policyHolder = _getPolicyHolder(policyNftId);
|
556
|
+
|
557
|
+
// execute callback if policy holder implements IPolicyHolder
|
558
|
+
if (address(policyHolder) != address(0)) {
|
559
|
+
policyHolder.policyActivated(policyNftId, activateAt);
|
560
|
+
}
|
561
|
+
}
|
562
|
+
|
563
|
+
|
564
|
+
function _policyHolderPolicyExpired(
|
565
|
+
NftId policyNftId,
|
566
|
+
Timestamp expiredAt
|
567
|
+
)
|
568
|
+
internal
|
569
|
+
virtual
|
570
|
+
{
|
571
|
+
// immediately return if policy is not activated
|
572
|
+
if (expiredAt.eqz()) {
|
573
|
+
return;
|
574
|
+
}
|
575
|
+
|
576
|
+
// get policy holder address
|
577
|
+
IPolicyHolder policyHolder = _getPolicyHolder(policyNftId);
|
578
|
+
|
579
|
+
// execute callback if policy holder implements IPolicyHolder
|
580
|
+
if (address(policyHolder) != address(0)) {
|
581
|
+
policyHolder.policyExpired(policyNftId, expiredAt);
|
582
|
+
}
|
583
|
+
}
|
584
|
+
|
585
|
+
|
586
|
+
function _getPolicyHolder(NftId policyNftId)
|
587
|
+
internal
|
588
|
+
view
|
589
|
+
returns (IPolicyHolder policyHolder)
|
590
|
+
{
|
591
|
+
address policyHolderAddress = getRegistry().ownerOf(policyNftId);
|
592
|
+
policyHolder = IPolicyHolder(policyHolderAddress);
|
593
|
+
|
594
|
+
if (!ContractLib.isPolicyHolder(policyHolderAddress)) {
|
595
|
+
policyHolder = IPolicyHolder(address(0));
|
596
|
+
}
|
597
|
+
}
|
598
|
+
|
599
|
+
|
528
600
|
function _getTokenHandler(
|
529
601
|
InstanceReader instanceReader,
|
530
602
|
NftId productNftId
|
@@ -539,6 +611,7 @@ contract PolicyService is
|
|
539
611
|
tokenHandler = instanceReader.getComponentInfo(productNftId).tokenHandler;
|
540
612
|
}
|
541
613
|
|
614
|
+
|
542
615
|
function _getDistributionNftAndWallets(
|
543
616
|
InstanceReader instanceReader,
|
544
617
|
NftId productNftId
|
@@ -12,14 +12,14 @@ contract PolicyServiceManager is ProxyManager {
|
|
12
12
|
/// @dev initializes proxy manager with product service implementation
|
13
13
|
constructor(
|
14
14
|
address authority,
|
15
|
-
address
|
15
|
+
address registry,
|
16
16
|
bytes32 salt
|
17
17
|
)
|
18
|
-
ProxyManager(registryAddress)
|
19
18
|
{
|
20
19
|
PolicyService svc = new PolicyService{salt: salt}();
|
21
|
-
bytes memory data = abi.encode(
|
22
|
-
IVersionable versionable =
|
20
|
+
bytes memory data = abi.encode(registry, authority);
|
21
|
+
IVersionable versionable = initialize(
|
22
|
+
registry,
|
23
23
|
address(svc),
|
24
24
|
data,
|
25
25
|
salt);
|
@@ -45,10 +45,9 @@ contract PricingService is
|
|
45
45
|
initializer()
|
46
46
|
{
|
47
47
|
(
|
48
|
-
address registryAddress
|
49
|
-
//address managerAddress
|
48
|
+
address registryAddress,
|
50
49
|
address authority
|
51
|
-
) = abi.decode(data, (address, address
|
50
|
+
) = abi.decode(data, (address, address));
|
52
51
|
|
53
52
|
_initializeService(registryAddress, authority, owner);
|
54
53
|
_registerInterface(type(IPricingService).interfaceId);
|
@@ -15,11 +15,11 @@ contract PricingServiceManager is ProxyManager {
|
|
15
15
|
address registryAddress,
|
16
16
|
bytes32 salt
|
17
17
|
)
|
18
|
-
ProxyManager(registryAddress)
|
19
18
|
{
|
20
19
|
PricingService pricingSrv = new PricingService{salt: salt}();
|
21
|
-
bytes memory data = abi.encode(registryAddress,
|
22
|
-
IVersionable versionable =
|
20
|
+
bytes memory data = abi.encode(registryAddress, authority);
|
21
|
+
IVersionable versionable = initialize(
|
22
|
+
registryAddress,
|
23
23
|
address(pricingSrv),
|
24
24
|
data,
|
25
25
|
salt);
|
@@ -49,6 +49,29 @@ abstract contract Product is
|
|
49
49
|
}
|
50
50
|
|
51
51
|
|
52
|
+
function register()
|
53
|
+
external
|
54
|
+
virtual
|
55
|
+
onlyOwner()
|
56
|
+
{
|
57
|
+
_getProductStorage()._componentService.registerProduct();
|
58
|
+
_approveTokenHandler(type(uint256).max);
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
function processFundedClaim(
|
63
|
+
NftId policyNftId,
|
64
|
+
ClaimId claimId,
|
65
|
+
Amount availableAmount
|
66
|
+
)
|
67
|
+
external
|
68
|
+
virtual
|
69
|
+
restricted() // pool service role
|
70
|
+
{
|
71
|
+
// default implementation does nothing
|
72
|
+
}
|
73
|
+
|
74
|
+
|
52
75
|
function calculatePremium(
|
53
76
|
Amount sumInsuredAmount,
|
54
77
|
RiskId riskId,
|
@@ -91,16 +114,6 @@ abstract contract Product is
|
|
91
114
|
}
|
92
115
|
|
93
116
|
|
94
|
-
function register()
|
95
|
-
external
|
96
|
-
virtual
|
97
|
-
onlyOwner()
|
98
|
-
{
|
99
|
-
_getProductStorage()._componentService.registerProduct();
|
100
|
-
_approveTokenHandler(type(uint256).max);
|
101
|
-
}
|
102
|
-
|
103
|
-
|
104
117
|
function getInitialProductInfo()
|
105
118
|
public
|
106
119
|
virtual
|
@@ -112,6 +125,7 @@ abstract contract Product is
|
|
112
125
|
return IComponents.ProductInfo({
|
113
126
|
distributionNftId: $._distributionNftId,
|
114
127
|
poolNftId: $._poolNftId,
|
128
|
+
isProcessingFundedClaims: false,
|
115
129
|
productFee: FeeLib.zero(),
|
116
130
|
processingFee: FeeLib.zero(),
|
117
131
|
distributionFee: FeeLib.zero(),
|
@@ -122,13 +136,6 @@ abstract contract Product is
|
|
122
136
|
});
|
123
137
|
}
|
124
138
|
|
125
|
-
function getPoolNftId() external view override returns (NftId poolNftId) {
|
126
|
-
return getRegistry().getNftIdForAddress(address(_getProductStorage()._pool));
|
127
|
-
}
|
128
|
-
|
129
|
-
function getDistributionNftId() external view override returns (NftId distributionNftId) {
|
130
|
-
return getRegistry().getNftIdForAddress(address(_getProductStorage()._distribution));
|
131
|
-
}
|
132
139
|
|
133
140
|
function _initializeProduct(
|
134
141
|
address registry,
|
@@ -413,7 +420,7 @@ abstract contract Product is
|
|
413
420
|
return RiskIdLib.toRiskId(riskName);
|
414
421
|
}
|
415
422
|
|
416
|
-
function _getProductStorage()
|
423
|
+
function _getProductStorage() internal pure returns (ProductStorage storage $) {
|
417
424
|
assembly {
|
418
425
|
$.slot := PRODUCT_STORAGE_LOCATION_V1
|
419
426
|
}
|
@@ -33,10 +33,9 @@ contract RiskService is
|
|
33
33
|
virtual override
|
34
34
|
{
|
35
35
|
(
|
36
|
-
address registryAddress
|
37
|
-
//address managerAddress
|
36
|
+
address registryAddress,
|
38
37
|
address authority
|
39
|
-
) = abi.decode(data, (address, address
|
38
|
+
) = abi.decode(data, (address, address));
|
40
39
|
|
41
40
|
_initializeService(registryAddress, authority, owner);
|
42
41
|
|
@@ -12,14 +12,14 @@ contract RiskServiceManager is ProxyManager {
|
|
12
12
|
/// @dev initializes proxy manager with product service implementation
|
13
13
|
constructor(
|
14
14
|
address authority,
|
15
|
-
address
|
15
|
+
address registry,
|
16
16
|
bytes32 salt
|
17
17
|
)
|
18
|
-
ProxyManager(registryAddress)
|
19
18
|
{
|
20
19
|
RiskService svc = new RiskService{salt: salt}();
|
21
|
-
bytes memory data = abi.encode(
|
22
|
-
IVersionable versionable =
|
20
|
+
bytes memory data = abi.encode(registry, authority);
|
21
|
+
IVersionable versionable = initialize(
|
22
|
+
registry,
|
23
23
|
address(svc),
|
24
24
|
data,
|
25
25
|
salt);
|
@@ -128,6 +128,8 @@ interface IRegistry is IERC165 {
|
|
128
128
|
|
129
129
|
function getObjectInfo(NftId nftId) external view returns (ObjectInfo memory info);
|
130
130
|
|
131
|
+
function getObjectAddress(NftId nftId) external view returns (address objectAddress);
|
132
|
+
|
131
133
|
/// @dev Returns the object info for the specified object address.
|
132
134
|
// MUST not be used with chain registry address (resides on different chan id)
|
133
135
|
function getObjectInfo(address object) external view returns (ObjectInfo memory info);
|
@@ -50,15 +50,6 @@ 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
|
-
// external returns(IRegistry.ObjectInfo memory info);
|
55
|
-
|
56
|
-
// function registerPool(IComponent pool, address owner)
|
57
|
-
// external returns(IRegistry.ObjectInfo memory info);
|
58
|
-
|
59
|
-
// function registerDistribution(IComponent distribution, address owner)
|
60
|
-
// external returns(IRegistry.ObjectInfo memory info);
|
61
|
-
|
62
53
|
function registerDistributor(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
63
54
|
|
64
55
|
function registerPolicy(IRegistry.ObjectInfo memory info) external returns(NftId nftId);
|
@@ -243,6 +243,9 @@ contract Registry is
|
|
243
243
|
{
|
244
244
|
address objectAddress = info.objectAddress;
|
245
245
|
ObjectType objectType = info.objectType;
|
246
|
+
|
247
|
+
// this indidirectly enforces that the parent is registered
|
248
|
+
// parentType would be zero for a non-registered parent which is never a valid type combination
|
246
249
|
ObjectType parentType = _info[info.parentNftId].objectType;
|
247
250
|
|
248
251
|
// check type combinations for core objects
|
@@ -347,6 +350,10 @@ contract Registry is
|
|
347
350
|
return _info[nftId];
|
348
351
|
}
|
349
352
|
|
353
|
+
function getObjectAddress(NftId nftId) external view returns (address) {
|
354
|
+
return _info[nftId].objectAddress;
|
355
|
+
}
|
356
|
+
|
350
357
|
function getObjectInfo(address object) external view returns (ObjectInfo memory) {
|
351
358
|
return _info[_nftIdByAddress[object]];
|
352
359
|
}
|
@@ -374,8 +381,6 @@ contract Registry is
|
|
374
381
|
}
|
375
382
|
|
376
383
|
function getStakingAddress() external view returns (address staking) {
|
377
|
-
//return getObjectInfo(_stakingNftId).objectAddress;
|
378
|
-
//return _info[_stakingNftId].objectAddress;
|
379
384
|
return _stakingAddress;
|
380
385
|
}
|
381
386
|
|
@@ -75,21 +75,21 @@ contract RegistryService is
|
|
75
75
|
instance.linkToRegisteredNftId(); // asume safe
|
76
76
|
}
|
77
77
|
|
78
|
-
function registerProduct(IComponent product, address owner)
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
{
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
}
|
78
|
+
// function registerProduct(IComponent product, address owner)
|
79
|
+
// external
|
80
|
+
// restricted
|
81
|
+
// returns(
|
82
|
+
// IRegistry.ObjectInfo memory info
|
83
|
+
// )
|
84
|
+
// {
|
85
|
+
// // CAN revert if no ERC165 support -> will revert with empty message
|
86
|
+
// if(!product.supportsInterface(type(IProductComponent).interfaceId)) {
|
87
|
+
// revert ErrorRegistryServiceNotProduct(address(product));
|
88
|
+
// }
|
89
|
+
|
90
|
+
// info = _getAndVerifyContractInfo(product, PRODUCT(), owner);
|
91
|
+
// info.nftId = getRegistry().register(info);
|
92
|
+
// }
|
93
93
|
|
94
94
|
function registerComponent(
|
95
95
|
IComponent component,
|
@@ -111,35 +111,35 @@ contract RegistryService is
|
|
111
111
|
info.nftId = getRegistry().register(info);
|
112
112
|
}
|
113
113
|
|
114
|
-
function registerPool(IComponent pool, address owner)
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
{
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
}
|
128
|
-
|
129
|
-
function registerDistribution(IComponent distribution, address owner)
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
{
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
}
|
114
|
+
// function registerPool(IComponent pool, address owner)
|
115
|
+
// external
|
116
|
+
// restricted
|
117
|
+
// returns(
|
118
|
+
// IRegistry.ObjectInfo memory info
|
119
|
+
// )
|
120
|
+
// {
|
121
|
+
// if(!pool.supportsInterface(type(IPoolComponent).interfaceId)) {
|
122
|
+
// revert ErrorRegistryServiceNotPool(address(pool));
|
123
|
+
// }
|
124
|
+
|
125
|
+
// info = _getAndVerifyContractInfo(pool, POOL(), owner);
|
126
|
+
// info.nftId = getRegistry().register(info);
|
127
|
+
// }
|
128
|
+
|
129
|
+
// function registerDistribution(IComponent distribution, address owner)
|
130
|
+
// external
|
131
|
+
// restricted
|
132
|
+
// returns(
|
133
|
+
// IRegistry.ObjectInfo memory info
|
134
|
+
// )
|
135
|
+
// {
|
136
|
+
// if(!distribution.supportsInterface(type(IDistributionComponent).interfaceId)) {
|
137
|
+
// revert ErrorRegistryServiceNotDistribution(address(distribution));
|
138
|
+
// }
|
139
|
+
|
140
|
+
// info = _getAndVerifyContractInfo(distribution, DISTRIBUTION(), owner);
|
141
|
+
// info.nftId = getRegistry().register(info);
|
142
|
+
// }
|
143
143
|
|
144
144
|
function registerDistributor(IRegistry.ObjectInfo memory info)
|
145
145
|
external
|
@@ -240,8 +240,15 @@ contract RegistryService is
|
|
240
240
|
revert ErrorRegistryServiceObjectOwnerZero(info.objectType);
|
241
241
|
}
|
242
242
|
|
243
|
-
if(
|
244
|
-
revert
|
243
|
+
if(owner == msg.sender) {
|
244
|
+
revert ErrorRegistryServiceInvalidInitialOwner(owner);
|
245
|
+
}
|
246
|
+
|
247
|
+
if(getRegistry().isRegistered(owner)) {
|
248
|
+
ObjectType ownerType = getRegistry().getObjectInfo(owner).objectType;
|
249
|
+
if(ownerType == REGISTRY() || ownerType == STAKING() || ownerType == SERVICE() || ownerType == INSTANCE()) {
|
250
|
+
revert ErrorRegistryServiceObjectOwnerRegistered(info.objectType, owner);
|
251
|
+
}
|
245
252
|
}
|
246
253
|
}
|
247
254
|
|
@@ -21,7 +21,6 @@ contract RegistryServiceManager is
|
|
21
21
|
address registry, // used by implementation
|
22
22
|
bytes32 salt
|
23
23
|
)
|
24
|
-
ProxyManager(registry)
|
25
24
|
{
|
26
25
|
if(authority == address(0)) {
|
27
26
|
revert ErrorRegistryAccessManagerAuthorityZero();
|
@@ -33,7 +32,8 @@ contract RegistryServiceManager is
|
|
33
32
|
|
34
33
|
RegistryService srv = new RegistryService{ salt: salt }();
|
35
34
|
bytes memory data = abi.encode(registry, authority);
|
36
|
-
IVersionable versionable =
|
35
|
+
IVersionable versionable = initialize(
|
36
|
+
registry,
|
37
37
|
address(srv),
|
38
38
|
data,
|
39
39
|
salt);
|
@@ -48,12 +48,12 @@ contract ComponentService is
|
|
48
48
|
virtual override
|
49
49
|
initializer()
|
50
50
|
{
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
51
|
+
(
|
52
|
+
address registryAddress,
|
53
|
+
address authority
|
54
|
+
) = abi.decode(data, (address, address));
|
55
55
|
|
56
|
-
_initializeService(registryAddress,
|
56
|
+
_initializeService(registryAddress, authority, owner);
|
57
57
|
|
58
58
|
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
59
59
|
_instanceService = IInstanceService(_getServiceAddress(INSTANCE()));
|
@@ -11,15 +11,18 @@ contract ComponentServiceManager is ProxyManager {
|
|
11
11
|
|
12
12
|
/// @dev initializes proxy manager with service implementation
|
13
13
|
constructor(
|
14
|
-
address
|
14
|
+
address authority,
|
15
|
+
address registry,
|
16
|
+
bytes32 salt
|
15
17
|
)
|
16
|
-
ProxyManager(registryAddress)
|
17
18
|
{
|
18
19
|
ComponentService svc = new ComponentService();
|
19
|
-
bytes memory data = abi.encode(
|
20
|
-
IVersionable versionable =
|
20
|
+
bytes memory data = abi.encode(registry, authority);
|
21
|
+
IVersionable versionable = initialize(
|
22
|
+
registry,
|
21
23
|
address(svc),
|
22
|
-
data
|
24
|
+
data,
|
25
|
+
salt);
|
23
26
|
|
24
27
|
_componentService = ComponentService(address(versionable));
|
25
28
|
}
|