@etherisc/gif-next 0.0.2-e769e2e-077 → 0.0.2-e79d227-681
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +77 -10
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +1293 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.json +24 -0
- 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 +4 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +414 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.json +10 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +1060 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +295 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +167 -0
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +4 -0
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +1196 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +253 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +1324 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +470 -0
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +154 -546
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +380 -229
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +198 -96
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +186 -238
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +223 -47
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.json +22 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +1429 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +502 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +1979 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +470 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.json +376 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +1430 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +1177 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +1606 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2281 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +4 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +808 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +153 -86
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +181 -119
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +174 -215
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1666 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +574 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +876 -160
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +260 -268
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +163 -81
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +506 -338
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +810 -0
- 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/Cloneable.sol/Cloneable.json +0 -53
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +10 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +223 -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/IAccess.sol/IAccess.json +8 -116
- 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 +4 -0
- package/artifacts/contracts/mock/Dip.sol/Dip.json +376 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +961 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +478 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.json +52 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +776 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +709 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +877 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +990 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +766 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +1254 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +502 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +456 -187
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +218 -80
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +264 -26
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +115 -354
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +464 -223
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +152 -682
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +590 -382
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +190 -76
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +147 -161
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +147 -77
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +1148 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +470 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +343 -168
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +200 -90
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +88 -8
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +196 -7
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +364 -121
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +134 -86
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +176 -160
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +4 -0
- package/artifacts/contracts/product/{IProductService.sol/IProductService.json → IRiskService.sol/IRiskService.json} +51 -3
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +475 -294
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +199 -81
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +229 -275
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +172 -102
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +201 -486
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +4 -0
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +638 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +718 -0
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +59 -16
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +412 -35
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +225 -196
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +5 -18
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +761 -87
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +1899 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +278 -306
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +154 -78
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +205 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +1067 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +272 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +185 -135
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +79 -274
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +626 -252
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +209 -99
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +55 -101
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +488 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.json +24 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.json +30 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +74 -79
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +561 -13
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +120 -108
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +45 -13
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +34 -3
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +23 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +16 -30
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +36 -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/IService.sol/IService.json +49 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +4 -0
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +53 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +129 -360
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +55 -98
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +42 -62
- 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 +26 -55
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +20 -124
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +62 -87
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +55 -101
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +697 -25
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +395 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +172 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +462 -634
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +546 -48
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +440 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +613 -871
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +205 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +185 -81
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +587 -0
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +633 -173
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +166 -68
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2283 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +607 -0
- 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 +121 -4
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +40 -2
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +28 -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/Key32Set.sol/LibKey32Set.dbg.json +4 -0
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +33 -0
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +47 -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 +149 -2
- 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/Referral.sol/ReferralLib.json +4 -4
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +204 -0
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +99 -5
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +219 -6
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +124 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +129 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +10 -0
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +15 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +4 -0
- package/artifacts/contracts/type/String.sol/StrLib.json +132 -0
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +36 -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 +71 -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 +618 -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 +616 -0
- package/contracts/authorization/AccessManagerCloneable.sol +16 -0
- package/contracts/authorization/Authorization.sol +289 -0
- package/contracts/authorization/IAccess.sol +49 -0
- package/contracts/authorization/IAccessAdmin.sol +137 -0
- package/contracts/authorization/IAuthorization.sol +60 -0
- package/contracts/authorization/IServiceAuthorization.sol +40 -0
- package/contracts/authorization/ReleaseAccessManager.sol +38 -0
- package/contracts/authorization/ServiceAuthorization.sol +106 -0
- package/contracts/distribution/BasicDistribution.sol +139 -0
- package/contracts/distribution/BasicDistributionAuthorization.sol +47 -0
- package/contracts/distribution/Distribution.sol +145 -124
- package/contracts/distribution/DistributionService.sol +156 -99
- package/contracts/distribution/DistributionServiceManager.sol +13 -25
- package/contracts/distribution/IDistributionComponent.sol +27 -41
- package/contracts/distribution/IDistributionService.sol +29 -10
- package/contracts/examples/fire/DamageLevel.sol +59 -0
- package/contracts/examples/fire/FirePool.sol +86 -0
- package/contracts/examples/fire/FirePoolAuthorization.sol +34 -0
- package/contracts/examples/fire/FireProduct.sol +431 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +44 -0
- package/contracts/examples/fire/FireUSD.sol +26 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +58 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +137 -0
- package/contracts/examples/unpermissioned/SimplePool.sol +108 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +345 -0
- package/contracts/instance/BundleSet.sol +130 -0
- package/contracts/instance/IInstance.sol +39 -44
- package/contracts/instance/IInstanceService.sol +33 -42
- package/contracts/instance/Instance.sol +137 -124
- package/contracts/instance/InstanceAdmin.sol +278 -0
- package/contracts/instance/InstanceAuthorizationV3.sol +217 -0
- package/contracts/instance/InstanceReader.sol +249 -36
- package/contracts/instance/InstanceService.sol +227 -151
- package/contracts/instance/InstanceServiceManager.sol +14 -29
- package/contracts/instance/InstanceStore.sol +85 -57
- package/contracts/instance/RiskSet.sol +119 -0
- package/contracts/instance/base/BalanceStore.sol +12 -7
- package/contracts/instance/base/Cloneable.sol +2 -25
- package/contracts/instance/base/ObjectCounter.sol +21 -0
- package/contracts/instance/base/ObjectLifecycle.sol +111 -0
- package/contracts/instance/base/ObjectSet.sol +78 -0
- package/contracts/instance/module/IAccess.sol +2 -10
- package/contracts/instance/module/IBundle.sol +1 -1
- package/contracts/instance/module/IComponents.sol +11 -13
- package/contracts/instance/module/IDistribution.sol +0 -1
- package/contracts/instance/module/IPolicy.sol +26 -25
- package/contracts/instance/module/IRisk.sol +1 -0
- package/contracts/mock/Dip.sol +26 -0
- package/contracts/oracle/BasicOracle.sol +47 -0
- package/contracts/oracle/BasicOracleAuthorization.sol +46 -0
- package/contracts/oracle/IOracle.sol +36 -0
- package/contracts/oracle/IOracleComponent.sol +33 -0
- package/contracts/oracle/IOracleService.sol +66 -0
- package/contracts/oracle/Oracle.sol +156 -0
- package/contracts/oracle/OracleService.sol +309 -0
- package/contracts/oracle/OracleServiceManager.sol +39 -0
- package/contracts/pool/BasicPool.sol +175 -0
- package/contracts/pool/BasicPoolAuthorization.sol +68 -0
- package/contracts/pool/BundleService.sol +232 -122
- package/contracts/pool/BundleServiceManager.sol +13 -25
- package/contracts/pool/IBundleService.sol +34 -18
- package/contracts/pool/IPoolComponent.sol +20 -70
- package/contracts/pool/IPoolService.sol +57 -51
- package/contracts/pool/Pool.sol +208 -162
- package/contracts/pool/PoolService.sol +372 -181
- package/contracts/pool/PoolServiceManager.sol +12 -24
- package/contracts/product/ApplicationService.sol +90 -84
- package/contracts/product/ApplicationServiceManager.sol +12 -9
- package/contracts/product/BasicProduct.sol +49 -0
- package/contracts/product/BasicProductAuthorization.sol +42 -0
- package/contracts/product/ClaimService.sol +331 -153
- package/contracts/product/ClaimServiceManager.sol +12 -9
- package/contracts/product/IApplicationService.sol +7 -3
- package/contracts/product/IClaimService.sol +35 -5
- package/contracts/product/IPolicyService.sol +47 -35
- package/contracts/product/IPricingService.sol +11 -11
- package/contracts/product/IProductComponent.sol +26 -9
- package/contracts/product/{IProductService.sol → IRiskService.sol} +2 -2
- package/contracts/product/PolicyService.sol +524 -262
- package/contracts/product/PolicyServiceManager.sol +12 -27
- package/contracts/product/PricingService.sol +64 -64
- package/contracts/product/PricingServiceManager.sol +12 -24
- package/contracts/product/Product.sol +189 -139
- package/contracts/product/{ProductService.sol → RiskService.sol} +35 -50
- package/contracts/product/RiskServiceManager.sol +39 -0
- package/contracts/registry/ChainNft.sol +68 -37
- package/contracts/registry/IRegistry.sol +90 -28
- package/contracts/registry/IRegistryService.sol +26 -43
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +424 -228
- package/contracts/registry/RegistryAdmin.sol +451 -0
- package/contracts/registry/RegistryService.sol +63 -149
- package/contracts/registry/RegistryServiceManager.sol +23 -30
- package/contracts/registry/ReleaseLifecycle.sol +30 -0
- package/contracts/registry/ReleaseRegistry.sol +485 -0
- package/contracts/registry/ServiceAuthorizationV3.sol +175 -0
- package/contracts/registry/TokenRegistry.sol +187 -59
- package/contracts/shared/Component.sol +56 -125
- package/contracts/shared/ComponentService.sol +411 -201
- package/contracts/shared/ComponentServiceManager.sol +10 -7
- package/contracts/shared/ComponentVerifyingService.sol +40 -23
- package/contracts/shared/ContractLib.sol +224 -0
- package/contracts/shared/IComponent.sol +11 -18
- package/contracts/shared/IComponentService.sol +52 -13
- package/contracts/shared/IInstanceLinkedComponent.sol +11 -16
- package/contracts/shared/IKeyValueStore.sol +2 -1
- package/contracts/shared/ILifecycle.sol +3 -2
- package/contracts/shared/INftOwnable.sol +3 -1
- package/contracts/shared/IPolicyHolder.sol +12 -17
- package/contracts/shared/IRegisterable.sol +11 -0
- package/contracts/shared/IService.sol +9 -2
- package/contracts/shared/{ERC165.sol → InitializableERC165.sol} +4 -4
- package/contracts/shared/InstanceLinkedComponent.sol +103 -43
- package/contracts/shared/KeyValueStore.sol +30 -68
- package/contracts/shared/Lifecycle.sol +30 -63
- package/contracts/shared/NftIdSet.sol +65 -0
- package/contracts/shared/NftOwnable.sol +31 -22
- package/contracts/shared/PolicyHolder.sol +18 -50
- package/contracts/shared/Registerable.sol +19 -11
- package/contracts/shared/RegistryLinked.sol +9 -14
- package/contracts/shared/Service.sol +44 -37
- package/contracts/shared/TokenHandler.sol +358 -27
- package/contracts/shared/TokenHandlerDeployerLib.sol +20 -0
- package/contracts/staking/IStaking.sol +133 -37
- package/contracts/staking/IStakingService.sol +93 -41
- package/contracts/staking/StakeManagerLib.sol +224 -0
- package/contracts/staking/Staking.sol +394 -101
- package/contracts/staking/StakingLifecycle.sol +23 -0
- package/contracts/staking/StakingManager.sol +24 -18
- package/contracts/staking/StakingReader.sol +190 -0
- package/contracts/staking/StakingService.sol +282 -42
- package/contracts/staking/StakingServiceManager.sol +10 -7
- package/contracts/staking/StakingStore.sol +605 -0
- package/contracts/staking/TargetManagerLib.sol +211 -0
- package/contracts/type/AddressSet.sol +1 -1
- package/contracts/type/Amount.sol +39 -3
- package/contracts/type/Blocknumber.sol +20 -2
- package/contracts/type/ClaimId.sol +6 -1
- package/contracts/type/Fee.sol +1 -1
- package/contracts/type/Key32.sol +2 -2
- package/contracts/type/Key32Set.sol +62 -0
- package/contracts/type/NftId.sol +16 -4
- package/contracts/type/NftIdSet.sol +1 -1
- package/contracts/type/ObjectType.sol +178 -65
- package/contracts/type/PayoutId.sol +10 -10
- package/contracts/type/Referral.sol +2 -1
- package/contracts/type/RequestId.sol +75 -0
- package/contracts/type/RiskId.sol +31 -5
- package/contracts/type/RoleId.sol +98 -74
- package/contracts/type/Seconds.sol +48 -1
- package/contracts/type/Selector.sol +102 -0
- package/contracts/type/StateId.sol +41 -2
- package/contracts/type/String.sol +53 -0
- package/contracts/type/Timestamp.sol +17 -3
- package/contracts/type/UFixed.sol +38 -9
- package/contracts/type/Version.sol +4 -2
- package/contracts/{shared → upgradeability}/ProxyManager.sol +90 -27
- package/contracts/{shared → upgradeability}/UpgradableProxyWithAdmin.sol +1 -3
- package/contracts/{shared → upgradeability}/Versionable.sol +2 -2
- package/package.json +11 -7
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +0 -4
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +0 -778
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAccessManager.sol/InstanceAccessManager.json +0 -1348
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +0 -132
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +0 -256
- 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 -673
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +0 -4
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +0 -636
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.dbg.json +0 -4
- package/artifacts/contracts/registry/RegistryAccessManager.sol/RegistryAccessManager.json +0 -308
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +0 -4
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +0 -688
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.json +0 -137
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerUpgradeableInitializeable.sol/AccessManagerUpgradeableInitializeable.json +0 -1206
- 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/IVersionable.sol/IVersionable.dbg.json +0 -4
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +0 -4
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +0 -569
- 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/instance/BundleManager.sol +0 -126
- package/contracts/instance/InstanceAccessManager.sol +0 -543
- package/contracts/instance/InstanceAuthorizationsLib.sol +0 -336
- package/contracts/instance/base/ObjectManager.sol +0 -82
- package/contracts/product/ProductServiceManager.sol +0 -54
- package/contracts/registry/RegistryAccessManager.sol +0 -213
- package/contracts/registry/ReleaseManager.sol +0 -375
- package/contracts/registry/ServiceAuthorizationsLib.sol +0 -173
- package/contracts/shared/AccessManagerUpgradeableInitializeable.sol +0 -13
- /package/contracts/{shared → upgradeability}/IVersionable.sol +0 -0
@@ -1,9 +1,9 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {IVersionable} from "./IVersionable.sol";
|
5
|
-
import {ProxyManager} from "./ProxyManager.sol";
|
6
4
|
import {ComponentService} from "./ComponentService.sol";
|
5
|
+
import {IVersionable} from "../upgradeability/IVersionable.sol";
|
6
|
+
import {ProxyManager} from "../upgradeability/ProxyManager.sol";
|
7
7
|
|
8
8
|
contract ComponentServiceManager is ProxyManager {
|
9
9
|
|
@@ -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
|
}
|
@@ -5,14 +5,13 @@ import {IInstance} from "../instance/IInstance.sol";
|
|
5
5
|
import {InstanceReader} from "../instance/InstanceReader.sol";
|
6
6
|
import {IRegistry} from "../registry/IRegistry.sol";
|
7
7
|
import {NftId} from "../type/NftId.sol";
|
8
|
-
import {ObjectType, COMPONENT, DISTRIBUTION, ORACLE, POOL, PRODUCT} from "../type/ObjectType.sol";
|
8
|
+
import {ObjectType, COMPONENT, DISTRIBUTION, ORACLE, POOL, PRODUCT, STAKING} from "../type/ObjectType.sol";
|
9
9
|
import {Service} from "../shared/Service.sol";
|
10
10
|
|
11
11
|
|
12
12
|
abstract contract ComponentVerifyingService is
|
13
13
|
Service
|
14
14
|
{
|
15
|
-
|
16
15
|
error ErrorComponentVerifyingServiceComponentTypeInvalid(NftId componentNftId, ObjectType expectedType, ObjectType actualType);
|
17
16
|
error ErrorComponentVerifyingServiceComponentIsLocked(NftId componentNftId);
|
18
17
|
|
@@ -28,17 +27,15 @@ abstract contract ComponentVerifyingService is
|
|
28
27
|
view
|
29
28
|
returns(
|
30
29
|
NftId componentNftId,
|
31
|
-
IRegistry.ObjectInfo memory
|
30
|
+
IRegistry.ObjectInfo memory objectInfo,
|
32
31
|
IInstance instance
|
33
32
|
)
|
34
33
|
{
|
35
|
-
componentNftId = getRegistry().
|
36
|
-
(
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
revert ErrorComponentVerifyingServiceComponentIsLocked(componentNftId);
|
41
|
-
}
|
34
|
+
componentNftId = getRegistry().getNftIdForAddress(msg.sender);
|
35
|
+
(objectInfo, instance) = _getAndVerifyComponentInfo(
|
36
|
+
componentNftId,
|
37
|
+
expectedType,
|
38
|
+
true); // only active
|
42
39
|
}
|
43
40
|
|
44
41
|
|
@@ -48,7 +45,8 @@ abstract contract ComponentVerifyingService is
|
|
48
45
|
/// - the component has the wrong object type
|
49
46
|
function _getAndVerifyComponentInfo(
|
50
47
|
NftId componentNftId,
|
51
|
-
ObjectType expectedType // assume always of `component` type
|
48
|
+
ObjectType expectedType, // assume always of `component` type
|
49
|
+
bool onlyActive
|
52
50
|
)
|
53
51
|
internal
|
54
52
|
virtual
|
@@ -84,28 +82,47 @@ abstract contract ComponentVerifyingService is
|
|
84
82
|
}
|
85
83
|
}
|
86
84
|
|
87
|
-
|
85
|
+
if (info.objectType == STAKING()) {
|
86
|
+
return (info, instance);
|
87
|
+
}
|
88
|
+
|
89
|
+
if (info.objectType == PRODUCT()) {
|
90
|
+
instance = _getInstance(registry, info.parentNftId);
|
91
|
+
} else {
|
92
|
+
instance = _getInstanceForComponent(registry, info.parentNftId);
|
93
|
+
}
|
94
|
+
|
95
|
+
// ensure component is not locked
|
96
|
+
if (onlyActive) {
|
97
|
+
if (instance.getInstanceAdmin().isTargetLocked(info.objectAddress)) {
|
98
|
+
revert ErrorComponentVerifyingServiceComponentIsLocked(componentNftId);
|
99
|
+
}
|
100
|
+
}
|
88
101
|
}
|
89
102
|
|
90
103
|
|
91
|
-
|
92
|
-
function _getProductNftId(
|
93
|
-
InstanceReader instanceReader,
|
94
|
-
NftId componentNftId
|
95
|
-
)
|
104
|
+
function _getInstanceForComponent(IRegistry registry, NftId productNftId)
|
96
105
|
internal
|
97
|
-
virtual
|
98
106
|
view
|
99
|
-
returns (
|
107
|
+
returns (IInstance instance)
|
100
108
|
{
|
101
|
-
return
|
109
|
+
return _getInstance(
|
110
|
+
registry,
|
111
|
+
registry.getObjectInfo(
|
112
|
+
productNftId).parentNftId);
|
113
|
+
}
|
114
|
+
|
115
|
+
|
116
|
+
/// @dev returns the product nft id from the registry.
|
117
|
+
/// assumes the component nft id is valid and represents a product linked component.
|
118
|
+
function _getProductNftId(NftId componentNftId) internal view returns (NftId productNftId) {
|
119
|
+
productNftId = getRegistry().getObjectInfo(componentNftId).parentNftId;
|
102
120
|
}
|
103
121
|
|
104
122
|
|
105
123
|
/// @dev returns an IInstance contract reference for the specified instance nft id
|
106
|
-
function _getInstance(NftId instanceNftId) internal view returns (IInstance) {
|
124
|
+
function _getInstance(IRegistry registry, NftId instanceNftId) internal view returns (IInstance) {
|
107
125
|
return IInstance(
|
108
|
-
|
109
|
-
instanceNftId).objectAddress);
|
126
|
+
registry.getObjectAddress(instanceNftId));
|
110
127
|
}
|
111
128
|
}
|
@@ -0,0 +1,224 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
|
5
|
+
|
6
|
+
// import {InstanceAdmin} from "../instance/InstanceAdmin.sol";
|
7
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
8
|
+
import {IPolicyHolder} from "../shared/IPolicyHolder.sol";
|
9
|
+
import {NftId} from "../type/NftId.sol";
|
10
|
+
import {ObjectType, PRODUCT, DISTRIBUTION, ORACLE, POOL, STAKING} from "../type/ObjectType.sol";
|
11
|
+
|
12
|
+
interface ITargetHelper {
|
13
|
+
function isTargetLocked(address target) external view returns (bool);
|
14
|
+
}
|
15
|
+
|
16
|
+
interface IInstanceAdminHelper {
|
17
|
+
function getInstanceAdmin() external view returns (ITargetHelper);
|
18
|
+
}
|
19
|
+
|
20
|
+
library ContractLib {
|
21
|
+
|
22
|
+
error ErrorContractLibNotRegistered(address target);
|
23
|
+
error ErrorContractLibNotComponent(NftId componentNftId, ObjectType objectType);
|
24
|
+
error ErrorContractLibNotStaking(NftId componentNftId, ObjectType objectType);
|
25
|
+
error ErrorContractLibComponentTypeMismatch(NftId componentNftId, ObjectType expectedType, ObjectType actualType);
|
26
|
+
error ErrorContractLibComponentInactive(NftId componentNftId);
|
27
|
+
|
28
|
+
|
29
|
+
function getAndVerifyComponent(
|
30
|
+
IRegistry registry,
|
31
|
+
address target,
|
32
|
+
ObjectType expectedType,
|
33
|
+
bool onlyActive
|
34
|
+
)
|
35
|
+
external
|
36
|
+
view
|
37
|
+
returns (
|
38
|
+
IRegistry.ObjectInfo memory info,
|
39
|
+
address instance
|
40
|
+
)
|
41
|
+
{
|
42
|
+
// check target is component
|
43
|
+
info = _getObjectInfo(registry, target);
|
44
|
+
if(info.objectType != expectedType) {
|
45
|
+
revert ErrorContractLibComponentTypeMismatch(
|
46
|
+
info.nftId,
|
47
|
+
expectedType,
|
48
|
+
info.objectType);
|
49
|
+
}
|
50
|
+
|
51
|
+
// get instance and check component is active
|
52
|
+
instance = _getInstance(registry, info);
|
53
|
+
_checkComponentActive(instance, target, info.nftId, onlyActive);
|
54
|
+
}
|
55
|
+
|
56
|
+
|
57
|
+
function getInfoAndInstance(
|
58
|
+
IRegistry registry,
|
59
|
+
NftId componentNftId,
|
60
|
+
bool onlyActive
|
61
|
+
)
|
62
|
+
external
|
63
|
+
view
|
64
|
+
returns (
|
65
|
+
IRegistry.ObjectInfo memory info,
|
66
|
+
address instance
|
67
|
+
)
|
68
|
+
{
|
69
|
+
info = registry.getObjectInfo(componentNftId);
|
70
|
+
instance = _getInstance(registry, info);
|
71
|
+
_checkComponentActive(instance, info.objectAddress, info.nftId, onlyActive);
|
72
|
+
}
|
73
|
+
|
74
|
+
|
75
|
+
function getAndVerifyStaking(
|
76
|
+
IRegistry registry,
|
77
|
+
address target
|
78
|
+
)
|
79
|
+
external
|
80
|
+
view
|
81
|
+
returns (
|
82
|
+
IRegistry.ObjectInfo memory info
|
83
|
+
)
|
84
|
+
{
|
85
|
+
// check target is component
|
86
|
+
info = _getObjectInfo(registry, target);
|
87
|
+
if(info.objectType != STAKING()) {
|
88
|
+
revert ErrorContractLibNotStaking(
|
89
|
+
info.nftId,
|
90
|
+
info.objectType);
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
|
95
|
+
function getAndVerifyAnyComponent(
|
96
|
+
IRegistry registry,
|
97
|
+
address target,
|
98
|
+
bool onlyActive
|
99
|
+
)
|
100
|
+
external
|
101
|
+
view
|
102
|
+
returns (
|
103
|
+
IRegistry.ObjectInfo memory info,
|
104
|
+
address instance
|
105
|
+
)
|
106
|
+
{
|
107
|
+
// check target is component
|
108
|
+
info = _getObjectInfo(registry, target);
|
109
|
+
if(!(info.objectType == PRODUCT()
|
110
|
+
|| info.objectType == POOL()
|
111
|
+
|| info.objectType == DISTRIBUTION()
|
112
|
+
|| info.objectType == ORACLE())
|
113
|
+
) {
|
114
|
+
revert ErrorContractLibNotComponent(
|
115
|
+
info.nftId,
|
116
|
+
info.objectType);
|
117
|
+
}
|
118
|
+
|
119
|
+
// get instance and check component is active
|
120
|
+
instance = _getInstance(registry, info);
|
121
|
+
_checkComponentActive(instance, target, info.nftId, onlyActive);
|
122
|
+
}
|
123
|
+
|
124
|
+
|
125
|
+
function getInstanceForComponent(
|
126
|
+
IRegistry registry,
|
127
|
+
NftId componentNftId
|
128
|
+
)
|
129
|
+
public
|
130
|
+
view
|
131
|
+
returns (address instance)
|
132
|
+
{
|
133
|
+
NftId productNftId = registry.getObjectInfo(componentNftId).parentNftId;
|
134
|
+
NftId instanceNftId = registry.getObjectInfo(productNftId).parentNftId;
|
135
|
+
return registry.getObjectInfo(instanceNftId).objectAddress;
|
136
|
+
}
|
137
|
+
|
138
|
+
|
139
|
+
function isPolicyHolder(address target) external view returns (bool) {
|
140
|
+
return ERC165Checker.supportsInterface(target, type(IPolicyHolder).interfaceId);
|
141
|
+
}
|
142
|
+
|
143
|
+
|
144
|
+
function isRegistry(address registry) public view returns (bool) {
|
145
|
+
if (!isContract(registry)) {
|
146
|
+
return false;
|
147
|
+
}
|
148
|
+
|
149
|
+
return supportsInterface(registry, type(IRegistry).interfaceId);
|
150
|
+
}
|
151
|
+
|
152
|
+
|
153
|
+
function isContract(address target) public view returns (bool) {
|
154
|
+
if (target == address(0)) {
|
155
|
+
return false;
|
156
|
+
}
|
157
|
+
|
158
|
+
uint256 size;
|
159
|
+
assembly {
|
160
|
+
size := extcodesize(target)
|
161
|
+
}
|
162
|
+
return size > 0;
|
163
|
+
}
|
164
|
+
|
165
|
+
function supportsInterface(address target, bytes4 interfaceId) public view returns (bool) {
|
166
|
+
return ERC165Checker.supportsInterface(target, interfaceId);
|
167
|
+
}
|
168
|
+
|
169
|
+
|
170
|
+
function _checkComponentActive(
|
171
|
+
address instance,
|
172
|
+
address target,
|
173
|
+
NftId componentNftId,
|
174
|
+
bool onlyActive
|
175
|
+
)
|
176
|
+
internal
|
177
|
+
view
|
178
|
+
{
|
179
|
+
if (onlyActive) {
|
180
|
+
if (IInstanceAdminHelper(
|
181
|
+
instance).getInstanceAdmin().isTargetLocked(
|
182
|
+
target)
|
183
|
+
) {
|
184
|
+
revert ErrorContractLibComponentInactive(componentNftId);
|
185
|
+
}
|
186
|
+
}
|
187
|
+
}
|
188
|
+
|
189
|
+
|
190
|
+
function _getInstance(
|
191
|
+
IRegistry registry,
|
192
|
+
IRegistry.ObjectInfo memory info
|
193
|
+
)
|
194
|
+
internal
|
195
|
+
view
|
196
|
+
returns (address instance)
|
197
|
+
{
|
198
|
+
if (info.objectType == PRODUCT()) {
|
199
|
+
return registry.getObjectAddress(
|
200
|
+
info.parentNftId);
|
201
|
+
}
|
202
|
+
|
203
|
+
return registry.getObjectAddress(
|
204
|
+
registry.getObjectInfo(
|
205
|
+
info.parentNftId).parentNftId);
|
206
|
+
}
|
207
|
+
|
208
|
+
|
209
|
+
function _getObjectInfo(
|
210
|
+
IRegistry registry,
|
211
|
+
address target
|
212
|
+
)
|
213
|
+
internal
|
214
|
+
view
|
215
|
+
returns (IRegistry.ObjectInfo memory info)
|
216
|
+
{
|
217
|
+
NftId componentNftId = registry.getNftIdForAddress(target);
|
218
|
+
if (componentNftId.eqz()) {
|
219
|
+
revert ErrorContractLibNotRegistered(target);
|
220
|
+
}
|
221
|
+
|
222
|
+
info = registry.getObjectInfo(componentNftId);
|
223
|
+
}
|
224
|
+
}
|
@@ -4,14 +4,10 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
5
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
6
6
|
|
7
|
+
import {Amount} from "../type/Amount.sol";
|
7
8
|
import {IComponents} from "../instance/module/IComponents.sol";
|
8
|
-
import {IInstance} from "../instance/IInstance.sol";
|
9
|
-
import {IInstanceService} from "../instance/IInstanceService.sol";
|
10
|
-
import {IProductService} from "../product/IProductService.sol";
|
11
9
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
12
10
|
import {ITransferInterceptor} from "../registry/ITransferInterceptor.sol";
|
13
|
-
import {NftId} from "../type/NftId.sol";
|
14
|
-
import {ObjectType} from "../type/ObjectType.sol";
|
15
11
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
16
12
|
|
17
13
|
/// @dev component base class
|
@@ -21,29 +17,26 @@ interface IComponent is
|
|
21
17
|
IRegisterable,
|
22
18
|
ITransferInterceptor
|
23
19
|
{
|
20
|
+
error ErrorComponentProductNftIdZero();
|
21
|
+
error ErrorComponentProductNftIdNonzero();
|
22
|
+
error ErrorComponentNameLengthZero();
|
23
|
+
|
24
24
|
error ErrorComponentNotChainNft(address caller);
|
25
25
|
|
26
|
+
error ErrorComponentTokenAddressNonzero();
|
26
27
|
error ErrorComponentTokenAddressZero();
|
27
|
-
error ErrorComponentNameLengthZero();
|
28
28
|
error ErrorComponentWalletAddressZero();
|
29
29
|
error ErrorComponentWalletAddressIsSameAsCurrent();
|
30
|
-
error ErrorComponentWalletAllowanceTooSmall(address oldWallet, address newWallet, uint256 allowance, uint256 balance);
|
31
30
|
error ErrorComponentWalletNotComponent();
|
32
31
|
|
33
32
|
event LogComponentWalletAddressChanged(address oldWallet, address newWallet);
|
34
33
|
event LogComponentWalletTokensTransferred(address from, address to, uint256 amount);
|
35
|
-
event LogComponentTokenHandlerApproved(address token,
|
36
|
-
|
37
|
-
/// @dev approves token hanlder to spend up to the specified amount of tokens
|
38
|
-
/// reverts if component wallet is not component itself
|
39
|
-
/// only component owner (nft holder) is authorizes to call this function
|
40
|
-
function approveTokenHandler(uint256 spendingLimitAmount) external;
|
34
|
+
event LogComponentTokenHandlerApproved(address tokenHandler, address token, Amount limit, bool isMaxAmount);
|
41
35
|
|
42
|
-
/// @dev
|
43
|
-
/// if
|
44
|
-
///
|
45
|
-
|
46
|
-
function setWallet(address walletAddress) external;
|
36
|
+
/// @dev Approves token hanlder to spend up to the specified amount of tokens.
|
37
|
+
/// Reverts if component wallet is not token handler itself.
|
38
|
+
/// Only component owner (nft holder) is authorizes to call this function.
|
39
|
+
function approveTokenHandler(IERC20Metadata token, Amount spendingLimitAmount) external;
|
47
40
|
|
48
41
|
/// @dev returns the name of this component
|
49
42
|
/// to successfully register the component with an instance the name MUST be unique in the linked instance
|
@@ -1,33 +1,51 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
4
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
6
5
|
|
7
6
|
import {Amount} from "../type/Amount.sol";
|
8
7
|
import {Fee} from "../type/Fee.sol";
|
9
|
-
import {IComponents} from "../instance/module/IComponents.sol";
|
10
|
-
import {IInstance} from "../instance/IInstance.sol";
|
11
|
-
import {IInstanceService} from "../instance/IInstanceService.sol";
|
12
8
|
import {InstanceStore} from "../instance/InstanceStore.sol";
|
13
|
-
import {IProductService} from "../product/IProductService.sol";
|
14
|
-
import {IRegisterable} from "../shared/IRegisterable.sol";
|
15
9
|
import {IService} from "../shared/IService.sol";
|
16
10
|
import {NftId} from "../type/NftId.sol";
|
17
11
|
import {ObjectType} from "../type/ObjectType.sol";
|
18
|
-
import {TokenHandler} from "../shared/TokenHandler.sol";
|
19
12
|
import {UFixed} from "../type/UFixed.sol";
|
13
|
+
import {VersionPart} from "../type/Version.sol";
|
20
14
|
|
21
15
|
/// @dev component base class
|
22
16
|
/// component examples are staking, product, distribution, pool and oracle
|
23
17
|
interface IComponentService is
|
24
18
|
IService
|
25
19
|
{
|
20
|
+
error ErrorComponentServiceNotInstanceLinkedComponent(address component);
|
21
|
+
error ErrorComponentServiceSenderNotRegistered(address sender);
|
22
|
+
error ErrorComponentServiceNotComponent(address component);
|
23
|
+
error ErrorComponentServiceTypeNotSupported(address component, ObjectType invalidType);
|
24
|
+
error ErrorComponentServiceInvalidType(address component, ObjectType requiredType, ObjectType componentType);
|
25
|
+
error ErrorComponentServiceAlreadyRegistered(address component);
|
26
|
+
error ErrorComponentServiceReleaseMismatch(address component, VersionPart componentRelease, VersionPart parentRelease);
|
27
|
+
error ErrorComponentServiceSenderNotComponentParent(NftId senderNftId, NftId compnentParentNftId);
|
28
|
+
error ErrorComponentServiceParentNotInstance(NftId nftId, ObjectType objectType);
|
29
|
+
error ErrorComponentServiceParentNotProduct(NftId nftId, ObjectType objectType);
|
30
|
+
|
31
|
+
error ErrorProductServiceNoDistributionExpected(NftId productNftId);
|
32
|
+
error ErrorProductServiceDistributionAlreadyRegistered(NftId productNftId, NftId distributionNftId);
|
33
|
+
error ErrorProductServiceNoOraclesExpected(NftId productNftId);
|
34
|
+
error ErrorProductServiceOraclesAlreadyRegistered(NftId productNftId, uint8 expectedOracles);
|
35
|
+
error ErrorProductServicePoolAlreadyRegistered(NftId productNftId, NftId poolNftId);
|
36
|
+
|
26
37
|
error ErrorComponentServiceNewWalletAddressZero();
|
27
38
|
error ErrorComponentServiceWalletAddressZero();
|
28
39
|
error ErrorComponentServiceWalletAddressIsSameAsCurrent();
|
29
40
|
|
41
|
+
error ErrorComponentServiceWithdrawAmountIsZero();
|
42
|
+
error ErrorComponentServiceWithdrawAmountExceedsLimit(Amount withdrawnAmount, Amount withdrawLimit);
|
43
|
+
error ErrorComponentServiceWalletAllowanceTooSmall(address wallet, address spender, uint256 allowance, uint256 amount);
|
44
|
+
|
45
|
+
event LogComponentServiceRegistered(NftId instanceNftId, NftId componentNftId, ObjectType componentType, address component, address token, address initialOwner);
|
30
46
|
event LogComponentServiceWalletAddressChanged(NftId componentNftId, address currentWallet, address newWallet);
|
47
|
+
event LogComponentServiceWalletTokensTransferred(NftId componentNftId, address currentWallet, address newWallet, uint256 currentBalance);
|
48
|
+
event LogComponentServiceComponentFeesWithdrawn(NftId componentNftId, address recipient, address token, Amount withdrawnAmount);
|
31
49
|
event LogComponentServiceProductFeesUpdated(NftId productNftId);
|
32
50
|
event LogComponentServiceDistributionFeesUpdated(NftId distributionNftId);
|
33
51
|
event LogComponentServicePoolFeesUpdated(NftId poolNftId);
|
@@ -42,17 +60,35 @@ interface IComponentService is
|
|
42
60
|
|
43
61
|
//-------- component ----------------------------------------------------//
|
44
62
|
|
45
|
-
/// @dev
|
63
|
+
/// @dev Approves the callers token handler to spend up to the specified amount of tokens.
|
64
|
+
/// Reverts if the component's token handler wallet is not the token handler itself.
|
65
|
+
function approveTokenHandler(IERC20Metadata token, Amount amount) external;
|
66
|
+
|
67
|
+
/// @dev Approves the staking token handler.
|
68
|
+
/// Reverts if the staking token handler wallet is not the token handler itself.
|
69
|
+
function approveStakingTokenHandler(IERC20Metadata token, Amount amount) external;
|
70
|
+
|
71
|
+
/// @dev Sets the components associated wallet address
|
46
72
|
function setWallet(address newWallet) external;
|
47
73
|
|
48
|
-
/// @dev
|
74
|
+
/// @dev Locks the component associated with the caller
|
49
75
|
function lock() external;
|
50
76
|
|
51
|
-
/// @dev
|
77
|
+
/// @dev Unlocks the component associated with the caller
|
52
78
|
function unlock() external;
|
53
79
|
|
80
|
+
/// @dev Withdraw fees from the distribution component. Only component owner is allowed to withdraw fees.
|
81
|
+
/// @param withdrawAmount the amount to withdraw
|
82
|
+
/// @return withdrawnAmount the amount that was actually withdrawn
|
83
|
+
function withdrawFees(Amount withdrawAmount) external returns (Amount withdrawnAmount);
|
84
|
+
|
85
|
+
/// @dev Registers the provided component with the product (sender)
|
86
|
+
function registerComponent(address component) external returns (NftId componentNftId);
|
87
|
+
|
54
88
|
//-------- product ------------------------------------------------------//
|
55
|
-
|
89
|
+
|
90
|
+
/// @dev Registers the specified product component for the instance (sender)
|
91
|
+
function registerProduct(address product) external returns (NftId productNftId);
|
56
92
|
|
57
93
|
function setProductFees(
|
58
94
|
Fee memory productFee, // product fee on net premium
|
@@ -63,7 +99,6 @@ interface IComponentService is
|
|
63
99
|
function decreaseProductFees(InstanceStore instanceStore, NftId productNftId, Amount feeAmount) external;
|
64
100
|
|
65
101
|
//-------- distribution -------------------------------------------------//
|
66
|
-
function registerDistribution() external;
|
67
102
|
|
68
103
|
function setDistributionFees(
|
69
104
|
Fee memory distributionFee, // distribution fee for sales that do not include commissions
|
@@ -73,8 +108,11 @@ interface IComponentService is
|
|
73
108
|
function increaseDistributionBalance(InstanceStore instanceStore, NftId distributionNftId, Amount amount, Amount feeAmount) external;
|
74
109
|
function decreaseDistributionBalance(InstanceStore instanceStore, NftId distributionNftId, Amount amount, Amount feeAmount) external;
|
75
110
|
|
111
|
+
//-------- distributor --------------------------------------------------//
|
112
|
+
function increaseDistributorBalance(InstanceStore instanceStore, NftId distributorNftId, Amount amount, Amount feeAmount) external;
|
113
|
+
function decreaseDistributorBalance(InstanceStore instanceStore, NftId distributorNftId, Amount amount, Amount feeAmount) external;
|
114
|
+
|
76
115
|
//-------- pool ---------------------------------------------------------//
|
77
|
-
function registerPool() external;
|
78
116
|
|
79
117
|
function setPoolFees(
|
80
118
|
Fee memory poolFee, // pool fee on net premium
|
@@ -88,4 +126,5 @@ interface IComponentService is
|
|
88
126
|
//-------- bundle -------------------------------------------------------//
|
89
127
|
function increaseBundleBalance(InstanceStore instanceStore, NftId bundleNftId, Amount amount, Amount feeAmount) external;
|
90
128
|
function decreaseBundleBalance(InstanceStore instanceStore, NftId bundleNftId, Amount amount, Amount feeAmount) external;
|
129
|
+
|
91
130
|
}
|
@@ -4,29 +4,20 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
5
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
6
6
|
|
7
|
+
import {Amount} from "../type/Amount.sol";
|
7
8
|
import {IComponent} from "../shared/IComponent.sol";
|
8
|
-
import {
|
9
|
+
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
9
10
|
import {IInstance} from "../instance/IInstance.sol";
|
10
|
-
import {IInstanceService} from "../instance/IInstanceService.sol";
|
11
|
-
import {IProductService} from "../product/IProductService.sol";
|
12
|
-
import {IRegisterable} from "../shared/IRegisterable.sol";
|
13
11
|
import {NftId} from "../type/NftId.sol";
|
14
12
|
import {ObjectType} from "../type/ObjectType.sol";
|
15
|
-
import {TokenHandler} from "../shared/TokenHandler.sol";
|
16
13
|
|
17
14
|
/// @dev component base class
|
18
15
|
/// component examples are product, distribution, pool and oracle
|
19
16
|
interface IInstanceLinkedComponent is
|
20
17
|
IComponent
|
21
18
|
{
|
22
|
-
error
|
23
|
-
error
|
24
|
-
error ErrorComponentProductNftAlreadySet();
|
25
|
-
|
26
|
-
/// @dev registers this component with the registry and instance.
|
27
|
-
/// a component may only be linked once
|
28
|
-
/// only initial component owner (nft holder) is authorizes to call this function
|
29
|
-
function register() external;
|
19
|
+
error ErrorInstanceLinkedComponentTypeMismatch(ObjectType requiredType, ObjectType objectType);
|
20
|
+
error ErrorInstanceLinkedComponentNotProduct(NftId nftId, ObjectType objectType);
|
30
21
|
|
31
22
|
/// @dev locks component to disable functions that may change state related to this component, the only exception is function "unlock"
|
32
23
|
/// only component owner (nft holder) is authorizes to call this function
|
@@ -36,11 +27,15 @@ interface IInstanceLinkedComponent is
|
|
36
27
|
/// only component owner (nft holder) is authorizes to call this function
|
37
28
|
function unlock() external;
|
38
29
|
|
30
|
+
/// @dev Withdraw fees from the distribution component. Only component owner is allowed to withdraw fees.
|
31
|
+
/// @param amount the amount to withdraw
|
32
|
+
/// @return withdrawnAmount the amount that was actually withdrawn
|
33
|
+
function withdrawFees(Amount amount) external returns (Amount withdrawnAmount);
|
34
|
+
|
39
35
|
/// @dev defines the instance to which this component is linked to
|
40
36
|
function getInstance() external view returns (IInstance instance);
|
41
37
|
|
42
|
-
/// @dev
|
43
|
-
|
44
|
-
function getProductNftId() external view returns (NftId productNftId);
|
38
|
+
/// @dev returns the initial component authorization specification.
|
39
|
+
function getAuthorization() external view returns (IAuthorization authorization);
|
45
40
|
|
46
41
|
}
|
@@ -13,6 +13,7 @@ interface IKeyValueStore is ILifecycle {
|
|
13
13
|
|
14
14
|
error ErrorKeyValueStoreTypeUndefined(ObjectType objectType);
|
15
15
|
error ErrorKeyValueStoreAlreadyCreated(Key32 key, ObjectType objectType);
|
16
|
+
error ErrorKeyValueStoreNoLifecycle(ObjectType objectType);
|
16
17
|
error ErrorKeyValueStoreStateZero(Key32 key);
|
17
18
|
error ErrorKeyValueStoreNotExisting(Key32 key);
|
18
19
|
|
@@ -32,7 +33,7 @@ interface IKeyValueStore is ILifecycle {
|
|
32
33
|
// eg account outside gif objects that initiated the tx
|
33
34
|
// implies the caller needs to be propagated through all calls up to key values store itself
|
34
35
|
// to always have the instance address there doesn't seem to make sense
|
35
|
-
address updatedBy;
|
36
|
+
// address updatedBy;
|
36
37
|
Blocknumber updatedIn;
|
37
38
|
Blocknumber createdIn;
|
38
39
|
}
|
@@ -1,14 +1,15 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {NftId} from "../type/NftId.sol";
|
5
4
|
import {ObjectType} from "../type/ObjectType.sol";
|
6
5
|
import {StateId} from "../type/StateId.sol";
|
7
6
|
|
8
7
|
interface ILifecycle {
|
9
8
|
|
10
|
-
error ErrorNoLifecycle(
|
9
|
+
error ErrorNoLifecycle(address contractAddress, ObjectType objectType);
|
10
|
+
error ErrorFromStateMissmatch(address contractAddress, ObjectType objectType, StateId actual, StateId required);
|
11
11
|
error ErrorInvalidStateTransition(
|
12
|
+
address contractAddress,
|
12
13
|
ObjectType objectType,
|
13
14
|
StateId fromStateId,
|
14
15
|
StateId toStateId
|
@@ -5,6 +5,7 @@ import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
|
5
5
|
|
6
6
|
import {IRegistryLinked} from "./IRegistryLinked.sol";
|
7
7
|
import {NftId} from "../type/NftId.sol";
|
8
|
+
import {ObjectType} from "../type/ObjectType.sol";
|
8
9
|
|
9
10
|
interface INftOwnable is
|
10
11
|
IERC165,
|
@@ -12,11 +13,12 @@ interface INftOwnable is
|
|
12
13
|
{
|
13
14
|
error ErrorNftOwnableInitialOwnerZero();
|
14
15
|
error ErrorNftOwnableNotOwner(address account);
|
16
|
+
error ErrorNftOwnableInvalidType(NftId nftId, ObjectType expectedObjectType);
|
15
17
|
|
16
18
|
error ErrorNftOwnableAlreadyLinked(NftId nftId);
|
17
19
|
error ErrorNftOwnableContractNotRegistered(address contractAddress);
|
18
20
|
|
19
|
-
function linkToRegisteredNftId() external;
|
21
|
+
function linkToRegisteredNftId() external returns (NftId);
|
20
22
|
|
21
23
|
function getNftId() external view returns (NftId);
|
22
24
|
function getOwner() external view returns (address);
|