@etherisc/gif-next 0.0.2-c16a73d-613 → 0.0.2-c2496d8-605
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +81 -7
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1023 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +752 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +791 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +454 -253
- 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/AccessAdminLib.sol/AccessAdminLib.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +673 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +202 -5
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +227 -26
- 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 +353 -189
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +105 -18
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +113 -290
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +212 -38
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +45 -163
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +341 -200
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +124 -70
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +32 -132
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +181 -71
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +121 -198
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +212 -38
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +287 -341
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +212 -38
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.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 +184 -251
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +644 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +76 -155
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +239 -203
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +644 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +672 -362
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +644 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +193 -45
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +198 -23
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +120 -14
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +240 -40
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +705 -322
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +206 -51
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +704 -304
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +146 -87
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +59 -47
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +676 -570
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +853 -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/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/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +16 -5
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +168 -0
- 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 +66 -167
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +194 -40
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +36 -71
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +27 -3
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +50 -103
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +128 -81
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +91 -41
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +69 -137
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +212 -38
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +165 -337
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +85 -87
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +62 -142
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +44 -118
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +182 -235
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +57 -149
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +472 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +350 -369
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +121 -63
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +167 -67
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +80 -38
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +182 -215
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +212 -38
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +260 -179
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +96 -78
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +103 -10
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +142 -20
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +112 -56
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +48 -3
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +163 -178
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +58 -7
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +233 -194
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +727 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +103 -73
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +115 -119
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +69 -55
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +176 -209
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +143 -77
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +80 -38
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +60 -12
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +31 -7
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +4 -0
- package/artifacts/contracts/registry/IRelease.sol/IRelease.json +24 -0
- 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 +98 -50
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +561 -429
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +878 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +69 -46
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +56 -34
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +1954 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +334 -64
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +15 -15
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +49 -88
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +239 -520
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +77 -75
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +573 -4
- 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/ContractLib.sol/ITokenRegistryHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.json +40 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +36 -57
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +139 -347
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +36 -71
- 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/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +120 -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 +27 -3
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -2
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +49 -102
- 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/NftIdSet.sol/NftIdSet.json +2 -2
- 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 +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +118 -62
- 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 +27 -16
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +327 -73
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +484 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +88 -24
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +125 -99
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +134 -10
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +225 -209
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +469 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +83 -59
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +40 -67
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +203 -56
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +73 -39
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +163 -149
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +60 -50
- 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 +11 -11
- 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/ClaimId.sol/ClaimIdLib.json +2 -2
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +94 -38
- 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 +23 -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 +33 -31
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +69 -7
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +79 -15
- 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/SelectorLib.json +21 -2
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +2 -2
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +2 -2
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +61 -37
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -21
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +101 -2
- 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 +32 -16
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +15 -2
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/accounting/AccountingService.sol +261 -0
- package/contracts/accounting/AccountingServiceManager.sol +38 -0
- package/contracts/accounting/IAccountingService.sol +45 -0
- package/contracts/authorization/AccessAdmin.sol +300 -192
- package/contracts/authorization/AccessAdminLib.sol +183 -0
- package/contracts/authorization/AccessManagerCloneable.sol +146 -4
- package/contracts/authorization/Authorization.sol +307 -231
- package/contracts/authorization/IAccess.sol +13 -5
- package/contracts/authorization/IAccessAdmin.sol +69 -36
- package/contracts/authorization/IAuthorization.sol +21 -1
- package/contracts/distribution/BasicDistribution.sol +18 -16
- package/contracts/distribution/BasicDistributionAuthorization.sol +22 -9
- package/contracts/distribution/Distribution.sol +36 -77
- package/contracts/distribution/DistributionService.sol +133 -90
- package/contracts/distribution/DistributionServiceManager.sol +1 -1
- package/contracts/distribution/IDistributionComponent.sol +0 -9
- package/contracts/distribution/IDistributionService.sol +22 -20
- package/contracts/examples/fire/FirePool.sol +21 -8
- package/contracts/examples/fire/FirePoolAuthorization.sol +2 -1
- package/contracts/examples/fire/FireProduct.sol +32 -14
- package/contracts/examples/fire/FireProductAuthorization.sol +2 -1
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +39 -8
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -8
- package/contracts/examples/unpermissioned/SimplePool.sol +32 -6
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +49 -27
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BundleSet.sol +42 -38
- package/contracts/instance/IInstance.sol +57 -17
- package/contracts/instance/IInstanceService.sol +27 -11
- package/contracts/instance/Instance.sol +102 -30
- package/contracts/instance/InstanceAdmin.sol +279 -106
- package/contracts/instance/InstanceAuthorizationV3.sol +87 -46
- package/contracts/instance/InstanceReader.sol +187 -32
- package/contracts/instance/InstanceService.sol +174 -126
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/InstanceStore.sol +13 -2
- package/contracts/instance/RiskSet.sol +118 -0
- package/contracts/instance/base/BalanceStore.sol +3 -5
- package/contracts/instance/base/ObjectCounter.sol +1 -2
- package/contracts/instance/base/ObjectLifecycle.sol +4 -2
- package/contracts/instance/base/ObjectSet.sol +31 -33
- package/contracts/instance/base/ObjectSetHelperLib.sol +30 -0
- package/contracts/instance/module/IBundle.sol +6 -5
- package/contracts/instance/module/IComponents.sol +20 -9
- package/contracts/instance/module/IDistribution.sol +21 -8
- package/contracts/instance/module/IPolicy.sol +28 -7
- package/contracts/instance/module/IRisk.sol +5 -0
- package/contracts/oracle/BasicOracle.sol +1 -3
- package/contracts/oracle/BasicOracleAuthorization.sol +3 -12
- package/contracts/oracle/IOracle.sol +9 -4
- package/contracts/oracle/Oracle.sol +1 -3
- package/contracts/oracle/OracleService.sol +96 -77
- package/contracts/oracle/OracleServiceManager.sol +1 -1
- package/contracts/pool/BasicPool.sol +23 -4
- package/contracts/pool/BasicPoolAuthorization.sol +27 -8
- package/contracts/pool/BundleService.sol +55 -152
- package/contracts/pool/BundleServiceManager.sol +1 -1
- package/contracts/pool/IBundleService.sol +15 -43
- package/contracts/pool/IPoolComponent.sol +1 -7
- package/contracts/pool/IPoolService.sol +58 -60
- package/contracts/pool/Pool.sol +106 -98
- package/contracts/pool/PoolLib.sol +309 -0
- package/contracts/pool/PoolService.sol +271 -228
- package/contracts/pool/PoolServiceManager.sol +1 -1
- package/contracts/product/ApplicationService.sol +60 -19
- package/contracts/product/ApplicationServiceManager.sol +1 -1
- package/contracts/product/BasicProduct.sol +8 -12
- package/contracts/product/BasicProductAuthorization.sol +24 -10
- package/contracts/product/ClaimService.sol +165 -137
- package/contracts/product/ClaimServiceManager.sol +1 -1
- package/contracts/product/IApplicationService.sol +8 -2
- package/contracts/product/IClaimService.sol +14 -2
- package/contracts/product/IPolicyService.sol +26 -11
- package/contracts/product/IPricingService.sol +1 -0
- package/contracts/product/IProductComponent.sol +4 -1
- package/contracts/product/IRiskService.sol +7 -7
- package/contracts/product/PolicyService.sol +242 -293
- package/contracts/product/PolicyServiceLib.sol +119 -0
- package/contracts/product/PolicyServiceManager.sol +1 -1
- package/contracts/product/PricingService.sol +36 -26
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +65 -53
- package/contracts/product/RiskService.sol +89 -31
- package/contracts/product/RiskServiceManager.sol +1 -1
- package/contracts/registry/ChainNft.sol +4 -2
- package/contracts/registry/IRegistry.sol +14 -15
- package/contracts/registry/IRelease.sol +29 -0
- package/contracts/registry/Registry.sol +16 -3
- package/contracts/registry/RegistryAdmin.sol +145 -335
- package/contracts/registry/RegistryAuthorization.sol +267 -0
- package/contracts/registry/RegistryService.sol +3 -3
- package/contracts/registry/RegistryServiceManager.sol +1 -1
- package/contracts/registry/ReleaseAdmin.sol +253 -0
- package/contracts/registry/ReleaseLifecycle.sol +2 -0
- package/contracts/registry/ReleaseRegistry.sol +150 -134
- package/contracts/registry/ServiceAuthorizationV3.sol +178 -40
- package/contracts/registry/TokenRegistry.sol +10 -9
- package/contracts/shared/Component.sol +52 -107
- package/contracts/shared/ComponentService.sol +336 -420
- package/contracts/shared/ComponentServiceManager.sol +1 -1
- package/contracts/shared/ContractLib.sol +312 -3
- package/contracts/shared/IComponent.sol +1 -17
- package/contracts/shared/IComponentService.sol +27 -37
- package/contracts/shared/IInstanceLinkedComponent.sol +0 -11
- package/contracts/shared/IRegisterable.sol +15 -4
- package/contracts/shared/IService.sol +3 -5
- package/contracts/shared/InitializableERC165.sol +9 -1
- package/contracts/shared/InstanceLinkedComponent.sol +4 -23
- package/contracts/shared/NftOwnable.sol +6 -6
- package/contracts/shared/PolicyHolder.sol +1 -1
- package/contracts/shared/Registerable.sol +41 -20
- package/contracts/shared/RegistryLinked.sol +7 -13
- package/contracts/shared/Service.sol +8 -27
- package/contracts/shared/TokenHandler.sol +275 -72
- package/contracts/shared/TokenHandlerDeployerLib.sol +10 -2
- package/contracts/staking/IStaking.sol +23 -12
- package/contracts/staking/IStakingService.sol +19 -1
- package/contracts/staking/Staking.sol +95 -46
- package/contracts/staking/{StakeManagerLib.sol → StakingLib.sol} +80 -23
- package/contracts/staking/StakingReader.sol +6 -16
- package/contracts/staking/StakingService.sol +74 -14
- package/contracts/staking/StakingServiceManager.sol +5 -4
- package/contracts/staking/StakingStore.sol +2 -1
- package/contracts/type/Fee.sol +8 -8
- package/contracts/type/Key32.sol +2 -2
- package/contracts/type/Key32Set.sol +62 -0
- package/contracts/type/NftId.sol +6 -0
- package/contracts/type/ObjectType.sol +53 -35
- package/contracts/type/RiskId.sol +26 -8
- package/contracts/type/RoleId.sol +24 -4
- package/contracts/type/Selector.sol +5 -0
- package/contracts/type/Timestamp.sol +0 -5
- package/contracts/type/UFixed.sol +34 -127
- package/contracts/type/Version.sol +54 -5
- package/contracts/upgradeability/ProxyManager.sol +12 -10
- package/contracts/upgradeability/UpgradableProxyWithAdmin.sol +7 -1
- package/package.json +4 -4
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +0 -4
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +0 -1196
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +0 -4
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +0 -129
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +0 -4
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +0 -474
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -440
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +0 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +0 -16
- package/contracts/authorization/ReleaseAccessManager.sol +0 -38
- package/contracts/instance/module/IAccess.sol +0 -46
- package/contracts/shared/ComponentVerifyingService.sol +0 -126
@@ -2,16 +2,23 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {
|
5
|
-
ALL, REGISTRY,
|
5
|
+
ALL, ACCOUNTING, REGISTRY, RISK, ORACLE, POOL, INSTANCE, COMPONENT, DISTRIBUTION, APPLICATION, POLICY, CLAIM, BUNDLE, STAKING, PRICE
|
6
6
|
} from "../../contracts/type/ObjectType.sol";
|
7
7
|
|
8
8
|
import {IAccess} from "../authorization/IAccess.sol";
|
9
|
+
import {IAccountingService} from "../accounting/IAccountingService.sol";
|
10
|
+
import {IApplicationService} from "../product/IApplicationService.sol";
|
9
11
|
import {IBundleService} from "../pool/IBundleService.sol";
|
12
|
+
import {IClaimService} from "../product/IClaimService.sol";
|
13
|
+
import {IComponentService} from "../shared/IComponentService.sol";
|
10
14
|
import {IDistributionService} from "../distribution/IDistributionService.sol";
|
11
15
|
import {IInstanceService} from "../instance/IInstanceService.sol";
|
16
|
+
import {IOracleService} from "../oracle/IOracleService.sol";
|
17
|
+
import {IPolicyService} from "../product/IPolicyService.sol";
|
12
18
|
import {IPoolService} from "../pool/IPoolService.sol";
|
13
19
|
import {IStakingService} from "../staking/IStakingService.sol";
|
14
20
|
import {IRegistryService} from "./IRegistryService.sol";
|
21
|
+
import {IRiskService} from "../product/IRiskService.sol";
|
15
22
|
import {ServiceAuthorization} from "../authorization/ServiceAuthorization.sol";
|
16
23
|
|
17
24
|
|
@@ -30,16 +37,17 @@ contract ServiceAuthorizationV3
|
|
30
37
|
_authorizeDomain(REGISTRY(), address(1));
|
31
38
|
_authorizeDomain(STAKING(), address(2));
|
32
39
|
_authorizeDomain(INSTANCE(), address(3));
|
33
|
-
_authorizeDomain(
|
34
|
-
_authorizeDomain(
|
35
|
-
_authorizeDomain(
|
36
|
-
_authorizeDomain(
|
37
|
-
_authorizeDomain(
|
38
|
-
_authorizeDomain(
|
39
|
-
_authorizeDomain(
|
40
|
-
_authorizeDomain(
|
41
|
-
_authorizeDomain(
|
42
|
-
_authorizeDomain(
|
40
|
+
_authorizeDomain(ACCOUNTING(), address(4));
|
41
|
+
_authorizeDomain(COMPONENT(), address(5));
|
42
|
+
_authorizeDomain(DISTRIBUTION(), address(6));
|
43
|
+
_authorizeDomain(PRICE(), address(7));
|
44
|
+
_authorizeDomain(BUNDLE(), address(8));
|
45
|
+
_authorizeDomain(POOL(), address(9));
|
46
|
+
_authorizeDomain(ORACLE(), address(10));
|
47
|
+
_authorizeDomain(RISK(), address(11));
|
48
|
+
_authorizeDomain(POLICY(), address(12));
|
49
|
+
_authorizeDomain(CLAIM(), address(13));
|
50
|
+
_authorizeDomain(APPLICATION(), address(14));
|
43
51
|
}
|
44
52
|
|
45
53
|
|
@@ -50,10 +58,17 @@ contract ServiceAuthorizationV3
|
|
50
58
|
_setupIRegistryServiceAuthorization();
|
51
59
|
_setupStakingServiceAuthorization();
|
52
60
|
_setupInstanceServiceAuthorization();
|
61
|
+
_setupInstanceServiceAuthorization();
|
62
|
+
_setupAccountingServiceAuthorization();
|
53
63
|
_setupComponentServiceAuthorization();
|
64
|
+
_setupClaimServiceAuthorization();
|
65
|
+
_setupRiskServiceAuthorization();
|
54
66
|
_setupDistributionServiceAuthorization();
|
55
67
|
_setupPoolServiceAuthorization();
|
56
68
|
_setupBundleServiceAuthorization();
|
69
|
+
_setupOracleServiceAuthorization();
|
70
|
+
_setupApplicationServiceAuthorization();
|
71
|
+
_setupPolicyServiceAuthorization();
|
57
72
|
}
|
58
73
|
|
59
74
|
|
@@ -96,6 +111,7 @@ contract ServiceAuthorizationV3
|
|
96
111
|
_authorize(functions, IStakingService.createInstanceTarget.selector, "createInstanceTarget");
|
97
112
|
_authorize(functions, IStakingService.setInstanceLockingPeriod.selector, "setInstanceLockingPeriod");
|
98
113
|
_authorize(functions, IStakingService.setInstanceRewardRate.selector, "setInstanceRewardRate");
|
114
|
+
_authorize(functions, IStakingService.setInstanceMaxStakedAmount.selector, "setInstanceMaxStakedAmount");
|
99
115
|
_authorize(functions, IStakingService.refillInstanceRewardReserves.selector, "refillInstanceRewardReserves");
|
100
116
|
_authorize(functions, IStakingService.withdrawInstanceRewardReserves.selector, "withdrawInstanceRewardReserves");
|
101
117
|
|
@@ -113,11 +129,50 @@ contract ServiceAuthorizationV3
|
|
113
129
|
function _setupInstanceServiceAuthorization()
|
114
130
|
internal
|
115
131
|
{
|
116
|
-
|
117
|
-
|
132
|
+
IAccess.FunctionInfo[] storage functions;
|
133
|
+
functions = _authorizeForService(INSTANCE(), ALL());
|
134
|
+
_authorize(functions, IInstanceService.setInstanceLocked.selector, "setInstanceLocked");
|
135
|
+
_authorize(functions, IInstanceService.setTargetLocked.selector, "setTargetLocked");
|
136
|
+
|
137
|
+
_authorize(functions, IInstanceService.createInstance.selector, "createInstance");
|
138
|
+
_authorize(functions, IInstanceService.upgradeInstanceReader.selector, "upgradeInstanceReader");
|
139
|
+
_authorize(functions, IInstanceService.upgradeMasterInstanceReader.selector, "upgradeMasterInstanceReader");
|
140
|
+
|
141
|
+
_authorize(functions, IInstanceService.setStakingLockingPeriod.selector, "setStakingLockingPeriod");
|
142
|
+
_authorize(functions, IInstanceService.setStakingRewardRate.selector, "setStakingRewardRate");
|
143
|
+
_authorize(functions, IInstanceService.setStakingMaxAmount.selector, "setStakingMaxAmount");
|
144
|
+
_authorize(functions, IInstanceService.refillStakingRewardReserves.selector, "refillStakingRewardReserves");
|
145
|
+
_authorize(functions, IInstanceService.withdrawStakingRewardReserves.selector, "withdrawStakingRewardReserves");
|
146
|
+
}
|
147
|
+
|
148
|
+
/// @dev Accounting service function authorization.
|
149
|
+
function _setupAccountingServiceAuthorization()
|
150
|
+
internal
|
151
|
+
{
|
152
|
+
IAccess.FunctionInfo[] storage functions;
|
153
|
+
|
154
|
+
functions = _authorizeForService(ACCOUNTING(), BUNDLE());
|
155
|
+
_authorize(functions, IAccountingService.increaseBundleBalance.selector, "increaseBundleBalance");
|
156
|
+
_authorize(functions, IAccountingService.decreaseBundleBalance.selector, "decreaseBundleBalance");
|
157
|
+
|
158
|
+
functions = _authorizeForService(ACCOUNTING(), COMPONENT());
|
159
|
+
_authorize(functions, IAccountingService.decreaseComponentFees.selector, "decreaseComponentFees");
|
160
|
+
|
161
|
+
functions = _authorizeForService(ACCOUNTING(), DISTRIBUTION());
|
162
|
+
_authorize(functions, IAccountingService.increaseDistributionBalance.selector, "increaseDistributionBalance");
|
163
|
+
_authorize(functions, IAccountingService.decreaseDistributionBalance.selector, "decreaseDistributionBalance");
|
164
|
+
_authorize(functions, IAccountingService.increaseDistributorBalance.selector, "increaseDistributorBalance");
|
165
|
+
_authorize(functions, IAccountingService.decreaseDistributorBalance.selector, "decreaseDistributorBalance");
|
166
|
+
|
167
|
+
functions = _authorizeForService(ACCOUNTING(), POLICY());
|
168
|
+
_authorize(functions, IAccountingService.increaseProductFees.selector, "increaseProductFees");
|
169
|
+
|
170
|
+
functions = _authorizeForService(ACCOUNTING(), POOL());
|
171
|
+
_authorize(functions, IAccountingService.increasePoolBalance.selector, "increasePoolBalance");
|
172
|
+
_authorize(functions, IAccountingService.decreasePoolBalance.selector, "decreasePoolBalance");
|
173
|
+
_authorize(functions, IAccountingService.increaseBundleBalanceForPool.selector, "increaseBundleBalanceForPool");
|
174
|
+
_authorize(functions, IAccountingService.decreaseBundleBalanceForPool.selector, "decreaseBundleBalanceForPool");
|
118
175
|
|
119
|
-
// functions = _authorizeForService(INSTANCE(), COMPONENT());
|
120
|
-
// _authorize(functions, IInstanceService.initializeAuthorization.selector, "initializeAuthorization");
|
121
176
|
}
|
122
177
|
|
123
178
|
|
@@ -125,39 +180,64 @@ contract ServiceAuthorizationV3
|
|
125
180
|
function _setupComponentServiceAuthorization()
|
126
181
|
internal
|
127
182
|
{
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
183
|
+
IAccess.FunctionInfo[] storage functions;
|
184
|
+
|
185
|
+
functions = _authorizeForService(COMPONENT(), ALL());
|
186
|
+
_authorize(functions, IComponentService.registerComponent.selector, "registerComponent");
|
187
|
+
_authorize(functions, IComponentService.approveTokenHandler.selector, "approveTokenHandler");
|
188
|
+
_authorize(functions, IComponentService.setWallet.selector, "setWallet");
|
189
|
+
_authorize(functions, IComponentService.setLocked.selector, "setLocked");
|
190
|
+
_authorize(functions, IComponentService.withdrawFees.selector, "withdrawFees");
|
191
|
+
_authorize(functions, IComponentService.registerProduct.selector, "registerProduct");
|
192
|
+
_authorize(functions, IComponentService.setProductFees.selector, "setProductFees");
|
193
|
+
_authorize(functions, IComponentService.setDistributionFees.selector, "setDistributionFees");
|
194
|
+
_authorize(functions, IComponentService.setPoolFees.selector, "setPoolFees");
|
195
|
+
|
196
|
+
}
|
197
|
+
|
198
|
+
/// @dev Distribution service function authorization.
|
199
|
+
function _setupRiskServiceAuthorization()
|
200
|
+
internal
|
201
|
+
{
|
202
|
+
IAccess.FunctionInfo[] storage functions;
|
203
|
+
functions = _authorizeForService(RISK(), ALL());
|
204
|
+
_authorize(functions, IRiskService.createRisk.selector, "createRisk");
|
205
|
+
_authorize(functions, IRiskService.updateRisk.selector, "updateRisk");
|
206
|
+
_authorize(functions, IRiskService.updateRiskState.selector, "updateRiskState");
|
150
207
|
}
|
151
208
|
|
152
209
|
/// @dev Distribution service function authorization.
|
153
|
-
function
|
210
|
+
function _setupClaimServiceAuthorization()
|
154
211
|
internal
|
155
212
|
{
|
156
213
|
IAccess.FunctionInfo[] storage functions;
|
214
|
+
functions = _authorizeForService(CLAIM(), ALL());
|
215
|
+
_authorize(functions, IClaimService.submit.selector, "submit");
|
216
|
+
_authorize(functions, IClaimService.confirm.selector, "confirm");
|
217
|
+
_authorize(functions, IClaimService.decline.selector, "decline");
|
218
|
+
_authorize(functions, IClaimService.revoke.selector, "revoke");
|
219
|
+
_authorize(functions, IClaimService.close.selector, "close");
|
220
|
+
_authorize(functions, IClaimService.createPayoutForBeneficiary.selector, "createPayoutForBeneficiary");
|
221
|
+
_authorize(functions, IClaimService.createPayout.selector, "createPayout");
|
222
|
+
_authorize(functions, IClaimService.processPayout.selector, "processPayout");
|
223
|
+
_authorize(functions, IClaimService.cancelPayout.selector, "cancelPayout");
|
224
|
+
}
|
157
225
|
|
226
|
+
/// @dev Distribution service function authorization.
|
227
|
+
function _setupDistributionServiceAuthorization()
|
228
|
+
internal
|
229
|
+
{
|
230
|
+
IAccess.FunctionInfo[] storage functions;
|
158
231
|
functions = _authorizeForService(DISTRIBUTION(), POLICY());
|
159
232
|
_authorize(functions, IDistributionService.processSale.selector, "processSale");
|
160
233
|
_authorize(functions, IDistributionService.processReferral.selector, "processReferral");
|
234
|
+
|
235
|
+
functions = _authorizeForService(DISTRIBUTION(), ALL());
|
236
|
+
_authorize(functions, IDistributionService.createDistributorType.selector, "createDistributorType");
|
237
|
+
_authorize(functions, IDistributionService.createDistributor.selector, "createDistributor");
|
238
|
+
_authorize(functions, IDistributionService.changeDistributorType.selector, "changeDistributorType");
|
239
|
+
_authorize(functions, IDistributionService.createReferral.selector, "createReferral");
|
240
|
+
_authorize(functions, IDistributionService.withdrawCommission.selector, "withdrawCommission");
|
161
241
|
}
|
162
242
|
|
163
243
|
|
@@ -174,6 +254,16 @@ contract ServiceAuthorizationV3
|
|
174
254
|
|
175
255
|
functions = _authorizeForService(POOL(), CLAIM());
|
176
256
|
_authorize(functions, IPoolService.processPayout.selector, "processPayout");
|
257
|
+
|
258
|
+
functions = _authorizeForService(POOL(), ALL());
|
259
|
+
_authorize(functions, IPoolService.setMaxBalanceAmount.selector, "setMaxBalanceAmount");
|
260
|
+
_authorize(functions, IPoolService.closeBundle.selector, "closeBundle");
|
261
|
+
_authorize(functions, IPoolService.processFundedClaim.selector, "processFundedClaim");
|
262
|
+
_authorize(functions, IPoolService.stake.selector, "stake");
|
263
|
+
_authorize(functions, IPoolService.unstake.selector, "unstake");
|
264
|
+
_authorize(functions, IPoolService.fundPoolWallet.selector, "fundPoolWallet");
|
265
|
+
_authorize(functions, IPoolService.defundPoolWallet.selector, "defundPoolWallet");
|
266
|
+
_authorize(functions, IPoolService.withdrawBundleFees.selector, "withdrawBundleFees");
|
177
267
|
}
|
178
268
|
|
179
269
|
|
@@ -184,11 +274,59 @@ contract ServiceAuthorizationV3
|
|
184
274
|
IAccess.FunctionInfo[] storage functions;
|
185
275
|
|
186
276
|
functions = _authorizeForService(BUNDLE(), POOL());
|
187
|
-
_authorize(functions, IBundleService.
|
277
|
+
_authorize(functions, IBundleService.stake.selector, "stake");
|
278
|
+
_authorize(functions, IBundleService.unstake.selector, "unstake");
|
188
279
|
_authorize(functions, IBundleService.close.selector, "close");
|
189
280
|
_authorize(functions, IBundleService.lockCollateral.selector, "lockCollateral");
|
190
281
|
_authorize(functions, IBundleService.releaseCollateral.selector, "releaseCollateral");
|
191
|
-
|
282
|
+
|
283
|
+
functions = _authorizeForService(BUNDLE(), ALL());
|
284
|
+
_authorize(functions, IBundleService.create.selector, "create");
|
285
|
+
_authorize(functions, IBundleService.extend.selector, "extend");
|
286
|
+
_authorize(functions, IBundleService.lock.selector, "lock");
|
287
|
+
_authorize(functions, IBundleService.unlock.selector, "unlock");
|
288
|
+
_authorize(functions, IBundleService.setFee.selector, "setFee");
|
289
|
+
}
|
290
|
+
|
291
|
+
function _setupOracleServiceAuthorization()
|
292
|
+
internal
|
293
|
+
{
|
294
|
+
IAccess.FunctionInfo[] storage functions;
|
295
|
+
|
296
|
+
functions = _authorizeForService(ORACLE(), ALL());
|
297
|
+
_authorize(functions, IOracleService.request.selector, "request");
|
298
|
+
_authorize(functions, IOracleService.respond.selector, "respond");
|
299
|
+
_authorize(functions, IOracleService.resend.selector, "resend");
|
300
|
+
_authorize(functions, IOracleService.cancel.selector, "cancel");
|
301
|
+
}
|
302
|
+
|
303
|
+
function _setupApplicationServiceAuthorization()
|
304
|
+
internal
|
305
|
+
{
|
306
|
+
IAccess.FunctionInfo[] storage functions;
|
307
|
+
|
308
|
+
functions = _authorizeForService(APPLICATION(), ALL());
|
309
|
+
_authorize(functions, IApplicationService.create.selector, "create");
|
310
|
+
_authorize(functions, IApplicationService.renew.selector, "renew");
|
311
|
+
_authorize(functions, IApplicationService.adjust.selector, "adjust");
|
312
|
+
_authorize(functions, IApplicationService.revoke.selector, "revoke");
|
313
|
+
}
|
314
|
+
|
315
|
+
function _setupPolicyServiceAuthorization()
|
316
|
+
internal
|
317
|
+
{
|
318
|
+
IAccess.FunctionInfo[] storage functions;
|
319
|
+
|
320
|
+
functions = _authorizeForService(POLICY(), ALL());
|
321
|
+
_authorize(functions, IPolicyService.decline.selector, "decline");
|
322
|
+
_authorize(functions, IPolicyService.createPolicy.selector, "createPolicy");
|
323
|
+
_authorize(functions, IPolicyService.collectPremium.selector, "collectPremium");
|
324
|
+
_authorize(functions, IPolicyService.activate.selector, "activate");
|
325
|
+
_authorize(functions, IPolicyService.adjustActivation.selector, "adjustActivation");
|
326
|
+
_authorize(functions, IPolicyService.expire.selector, "expire");
|
327
|
+
_authorize(functions, IPolicyService.expirePolicy.selector, "expirePolicy");
|
328
|
+
_authorize(functions, IPolicyService.close.selector, "close");
|
329
|
+
|
192
330
|
}
|
193
331
|
}
|
194
332
|
|
@@ -8,15 +8,13 @@ import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165C
|
|
8
8
|
import {REGISTRY} from "../type/ObjectType.sol";
|
9
9
|
import {VersionPart} from "../type/Version.sol";
|
10
10
|
|
11
|
-
import {IRegisterable} from "../shared/IRegisterable.sol";
|
12
|
-
|
13
11
|
import {IRegistry} from "./IRegistry.sol";
|
14
12
|
import {IRegistryLinked} from "../shared/IRegistryLinked.sol";
|
15
13
|
import {ReleaseRegistry} from "./ReleaseRegistry.sol";
|
16
14
|
import {RegistryAdmin} from "./RegistryAdmin.sol";
|
17
15
|
|
18
|
-
|
19
|
-
///
|
16
|
+
/// @dev The TokenRegistry contract is used to whitelist/manage ERC-20 of tokens per major release.
|
17
|
+
/// Only whitelisted tokens can be used as default tokens for products, distribution and pools components.
|
20
18
|
contract TokenRegistry is
|
21
19
|
AccessManaged,
|
22
20
|
IRegistryLinked
|
@@ -37,10 +35,13 @@ contract TokenRegistry is
|
|
37
35
|
error ErrorTokenRegistryMajorVersionInvalid(VersionPart majorVersion);
|
38
36
|
|
39
37
|
struct TokenInfo {
|
38
|
+
// slot 0
|
40
39
|
uint256 chainId;
|
40
|
+
// slot 1
|
41
|
+
string symbol;
|
42
|
+
// slot 2
|
41
43
|
address token;
|
42
44
|
uint8 decimals;
|
43
|
-
string symbol;
|
44
45
|
bool active;
|
45
46
|
}
|
46
47
|
|
@@ -68,7 +69,7 @@ contract TokenRegistry is
|
|
68
69
|
setAuthority(authority);
|
69
70
|
|
70
71
|
_registry = registry;
|
71
|
-
_dipToken = dipToken;
|
72
|
+
_dipToken = _verifyOnchainToken(address(dipToken));
|
72
73
|
|
73
74
|
// register dip token
|
74
75
|
uint256 chainId = block.chainid;
|
@@ -212,13 +213,13 @@ contract TokenRegistry is
|
|
212
213
|
return _tokenInfo[chainId][token].chainId > 0;
|
213
214
|
}
|
214
215
|
|
215
|
-
/// @dev returns true iff both the token is active for the specfied
|
216
|
-
function isActive(uint256 chainId, address token, VersionPart
|
216
|
+
/// @dev returns true iff both the token is active for the specfied release and the global token state is active
|
217
|
+
function isActive(uint256 chainId, address token, VersionPart release) external view returns (bool) {
|
217
218
|
if(!_tokenInfo[chainId][token].active) {
|
218
219
|
return false;
|
219
220
|
}
|
220
221
|
|
221
|
-
return _active[chainId][token][
|
222
|
+
return _active[chainId][token][release];
|
222
223
|
}
|
223
224
|
|
224
225
|
function getDipTokenAddress() external view returns (address) {
|
@@ -1,22 +1,21 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
5
4
|
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
6
5
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
7
|
-
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
8
6
|
|
9
|
-
import {Amount
|
7
|
+
import {Amount} from "../type/Amount.sol";
|
10
8
|
import {IComponent} from "./IComponent.sol";
|
11
9
|
import {IComponents} from "../instance/module/IComponents.sol";
|
12
|
-
import {
|
13
|
-
import {
|
10
|
+
import {IComponentService} from "./IComponentService.sol";
|
11
|
+
import {NftId} from "../type/NftId.sol";
|
12
|
+
import {ObjectType, COMPONENT} from "../type/ObjectType.sol";
|
14
13
|
import {Registerable} from "../shared/Registerable.sol";
|
15
14
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
16
|
-
import {
|
15
|
+
import {Version, VersionLib} from "../type/Version.sol";
|
16
|
+
|
17
17
|
|
18
18
|
abstract contract Component is
|
19
|
-
AccessManagedUpgradeable,
|
20
19
|
Registerable,
|
21
20
|
IComponent
|
22
21
|
{
|
@@ -25,10 +24,9 @@ abstract contract Component is
|
|
25
24
|
|
26
25
|
struct ComponentStorage {
|
27
26
|
string _name; // unique (per instance) component name
|
28
|
-
IERC20Metadata _token; // token for this component
|
29
|
-
address _wallet;
|
30
27
|
bool _isInterceptor;
|
31
28
|
bytes _data;
|
29
|
+
IComponentService _componentService;
|
32
30
|
}
|
33
31
|
|
34
32
|
|
@@ -39,18 +37,20 @@ abstract contract Component is
|
|
39
37
|
_;
|
40
38
|
}
|
41
39
|
|
40
|
+
|
42
41
|
function _getComponentStorage() private pure returns (ComponentStorage storage $) {
|
42
|
+
// solhint-disable-next-line no-inline-assembly
|
43
43
|
assembly {
|
44
44
|
$.slot := COMPONENT_LOCATION_V1
|
45
45
|
}
|
46
46
|
}
|
47
47
|
|
48
|
+
|
48
49
|
function _initializeComponent(
|
49
50
|
address authority,
|
50
51
|
address registry,
|
51
52
|
NftId parentNftId,
|
52
53
|
string memory name,
|
53
|
-
address token,
|
54
54
|
ObjectType componentType,
|
55
55
|
bool isInterceptor,
|
56
56
|
address initialOwner,
|
@@ -61,15 +61,12 @@ abstract contract Component is
|
|
61
61
|
virtual
|
62
62
|
onlyInitializing()
|
63
63
|
{
|
64
|
-
if (token == address(0)) {
|
65
|
-
revert ErrorComponentTokenAddressZero();
|
66
|
-
}
|
67
|
-
|
68
64
|
if (bytes(name).length == 0) {
|
69
65
|
revert ErrorComponentNameLengthZero();
|
70
66
|
}
|
71
67
|
|
72
|
-
|
68
|
+
__Registerable_init(
|
69
|
+
authority,
|
73
70
|
registry,
|
74
71
|
parentNftId,
|
75
72
|
componentType,
|
@@ -77,81 +74,18 @@ abstract contract Component is
|
|
77
74
|
initialOwner,
|
78
75
|
registryData);
|
79
76
|
|
80
|
-
__AccessManaged_init(authority);
|
81
|
-
|
82
77
|
// set component state
|
83
78
|
ComponentStorage storage $ = _getComponentStorage();
|
84
79
|
$._name = name;
|
85
|
-
$._token = IERC20Metadata(token);
|
86
|
-
$._wallet = address(this);
|
87
80
|
$._isInterceptor = isInterceptor;
|
88
81
|
$._data = componentData;
|
82
|
+
$._componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
89
83
|
|
90
84
|
_registerInterface(type(IAccessManaged).interfaceId);
|
91
85
|
_registerInterface(type(IComponent).interfaceId);
|
92
86
|
}
|
93
87
|
|
94
88
|
|
95
|
-
function approveTokenHandler(Amount spendingLimitAmount)
|
96
|
-
external
|
97
|
-
virtual
|
98
|
-
onlyOwner
|
99
|
-
{
|
100
|
-
approveTokenHandler(address(getToken()), spendingLimitAmount);
|
101
|
-
}
|
102
|
-
|
103
|
-
/// @dev Approves the component's token hander to spend tokens up to the specified limit.
|
104
|
-
/// When the spending limit amount equals AmountLib.max it is set to type(uint256).max.
|
105
|
-
function approveTokenHandler(address token, Amount spendingLimitAmount)
|
106
|
-
public
|
107
|
-
virtual
|
108
|
-
onlyOwner
|
109
|
-
{
|
110
|
-
if(getWallet() != address(this)) {
|
111
|
-
revert ErrorComponentWalletNotComponent();
|
112
|
-
}
|
113
|
-
|
114
|
-
uint256 spendingLimit = spendingLimitAmount.toInt();
|
115
|
-
bool isMaxAmount = false;
|
116
|
-
if (spendingLimitAmount == AmountLib.max()) {
|
117
|
-
spendingLimit = type(uint256).max;
|
118
|
-
isMaxAmount = true;
|
119
|
-
}
|
120
|
-
|
121
|
-
emit LogComponentTokenHandlerApproved(address(getTokenHandler()), spendingLimitAmount, isMaxAmount);
|
122
|
-
|
123
|
-
IERC20Metadata(token).approve(
|
124
|
-
address(getTokenHandler()),
|
125
|
-
spendingLimit);
|
126
|
-
}
|
127
|
-
|
128
|
-
function setWallet(address newWallet)
|
129
|
-
external
|
130
|
-
virtual
|
131
|
-
override
|
132
|
-
onlyOwner
|
133
|
-
{
|
134
|
-
// checks
|
135
|
-
address currentWallet = getWallet();
|
136
|
-
uint256 currentBalance = getToken().balanceOf(currentWallet);
|
137
|
-
|
138
|
-
// effects
|
139
|
-
_setWallet(newWallet);
|
140
|
-
|
141
|
-
// interactions
|
142
|
-
if (currentBalance > 0) {
|
143
|
-
// move tokens from old to new wallet
|
144
|
-
emit LogComponentWalletTokensTransferred(currentWallet, newWallet, currentBalance);
|
145
|
-
|
146
|
-
if (currentWallet == address(this)) {
|
147
|
-
// transfer from the component requires an allowance
|
148
|
-
getTokenHandler().distributeTokens(currentWallet, newWallet, AmountLib.toAmount(currentBalance));
|
149
|
-
} else {
|
150
|
-
getTokenHandler().collectTokens(currentWallet, newWallet, AmountLib.toAmount(currentBalance));
|
151
|
-
}
|
152
|
-
}
|
153
|
-
}
|
154
|
-
|
155
89
|
/// @dev callback function for nft transfers
|
156
90
|
/// may only be called by chain nft contract.
|
157
91
|
/// override internal function _nftTransferFrom to implement custom behaviour
|
@@ -164,7 +98,7 @@ abstract contract Component is
|
|
164
98
|
|
165
99
|
|
166
100
|
function getWallet() public view virtual returns (address walletAddress) {
|
167
|
-
return
|
101
|
+
return getTokenHandler().getWallet();
|
168
102
|
}
|
169
103
|
|
170
104
|
function getTokenHandler() public virtual view returns (TokenHandler tokenHandler) {
|
@@ -172,13 +106,17 @@ abstract contract Component is
|
|
172
106
|
}
|
173
107
|
|
174
108
|
function getToken() public view virtual returns (IERC20Metadata token) {
|
175
|
-
return
|
109
|
+
return getTokenHandler().TOKEN();
|
176
110
|
}
|
177
111
|
|
178
112
|
function getName() public view override returns(string memory name) {
|
179
113
|
return getComponentInfo().name;
|
180
114
|
}
|
181
115
|
|
116
|
+
function getVersion() public view virtual returns (Version version) {
|
117
|
+
return VersionLib.toVersion(1, 0, 0);
|
118
|
+
}
|
119
|
+
|
182
120
|
function getComponentInfo() public virtual view returns (IComponents.ComponentInfo memory info) {
|
183
121
|
if (isRegistered()) {
|
184
122
|
return _getComponentInfo();
|
@@ -208,38 +146,47 @@ abstract contract Component is
|
|
208
146
|
}
|
209
147
|
|
210
148
|
|
211
|
-
/// @dev
|
212
|
-
///
|
213
|
-
|
149
|
+
/// @dev Approves token hanlder to spend up to the specified amount of tokens.
|
150
|
+
/// Reverts if component wallet is not token handler itself.
|
151
|
+
/// Only component owner (nft holder) is authorizes to call this function.
|
152
|
+
function _approveTokenHandler(IERC20Metadata token, Amount amount)
|
214
153
|
internal
|
215
154
|
virtual
|
216
|
-
{
|
155
|
+
{
|
156
|
+
_getComponentStorage()._componentService.approveTokenHandler(
|
157
|
+
token,
|
158
|
+
amount);
|
159
|
+
}
|
160
|
+
|
217
161
|
|
218
162
|
/// @dev internal function for nft transfers.
|
219
163
|
/// handling logic that deals with nft transfers need to overwrite this function
|
220
164
|
function _nftTransferFrom(address from, address to, uint256 tokenId, address operator)
|
221
165
|
internal
|
222
166
|
virtual
|
223
|
-
|
167
|
+
// solhint-disable-next-line no-empty-blocks
|
168
|
+
{
|
169
|
+
// empty default implementation
|
170
|
+
}
|
224
171
|
|
225
172
|
|
226
|
-
/// @dev
|
173
|
+
/// @dev Sets the components wallet to the specified address.
|
174
|
+
/// Depending on the source of the component information this function needs to be overwritten.
|
227
175
|
/// eg for instance linked components that externally store this information with the instance store contract
|
228
|
-
function _setWallet(
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
if (newWallet == currentWallet) {
|
237
|
-
revert ErrorComponentWalletAddressIsSameAsCurrent();
|
238
|
-
}
|
239
|
-
|
240
|
-
$._wallet = newWallet;
|
241
|
-
emit LogComponentWalletAddressChanged(currentWallet, newWallet);
|
176
|
+
function _setWallet(
|
177
|
+
address newWallet
|
178
|
+
)
|
179
|
+
internal
|
180
|
+
virtual
|
181
|
+
{
|
182
|
+
_getComponentStorage()._componentService.setWallet(newWallet);
|
183
|
+
}
|
242
184
|
|
185
|
+
function _setLocked(bool locked)
|
186
|
+
internal
|
187
|
+
virtual
|
188
|
+
{
|
189
|
+
_getComponentStorage()._componentService.setLocked(locked);
|
243
190
|
}
|
244
191
|
|
245
192
|
|
@@ -250,16 +197,14 @@ abstract contract Component is
|
|
250
197
|
|
251
198
|
return IComponents.ComponentInfo({
|
252
199
|
name: $._name,
|
253
|
-
token: $._token,
|
254
200
|
tokenHandler: TokenHandler(address(0)),
|
255
|
-
wallet: $._wallet, // initial wallet address
|
256
201
|
data: $._data // user specific component data
|
257
202
|
});
|
258
203
|
}
|
259
204
|
|
260
|
-
|
261
|
-
|
262
|
-
|
205
|
+
/// @dev returns the service address for the specified domain
|
206
|
+
/// gets address via lookup from registry using the major version form the linked instance
|
207
|
+
function _getServiceAddress(ObjectType domain) internal view returns (address) {
|
208
|
+
return getRegistry().getServiceAddress(domain, getRelease());
|
263
209
|
}
|
264
|
-
|
265
210
|
}
|