@etherisc/gif-next 0.0.2-f634e5c-828 → 0.0.2-f677999-878
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1007 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +744 -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 +148 -62
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +233 -5
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +149 -21
- 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 +82 -12
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +68 -13
- 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 +79 -67
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +152 -33
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +51 -39
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +231 -186
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +57 -51
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +38 -26
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +119 -73
- 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 +102 -42
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +127 -40
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +257 -190
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +152 -33
- 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 +150 -56
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +589 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +95 -63
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +111 -48
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +589 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +315 -150
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +589 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +88 -45
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +54 -21
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +53 -3
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +80 -40
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +344 -99
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +127 -40
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +351 -198
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +65 -58
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +20 -22
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +422 -352
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +96 -53
- 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 +68 -56
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +126 -35
- 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 +38 -26
- 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 +52 -40
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +75 -68
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +25 -27
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +51 -39
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +127 -40
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +102 -201
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +33 -55
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +38 -80
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +38 -26
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +120 -175
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +51 -39
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +456 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +236 -281
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +61 -47
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +57 -50
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +16 -18
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +157 -130
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +152 -33
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +244 -187
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +55 -65
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +27 -3
- 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 +105 -68
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +27 -3
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +144 -117
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +37 -7
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +193 -173
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +293 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +45 -47
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +85 -78
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +31 -33
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +157 -130
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +102 -81
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +33 -19
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +26 -2
- 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 +64 -40
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +250 -221
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +51 -44
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +11 -13
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +1849 -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 +315 -49
- 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 +4 -4
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +51 -39
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +105 -442
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +40 -70
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +27 -16
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +57 -4
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
- 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 +38 -26
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +27 -291
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +38 -26
- 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/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +51 -39
- 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 +63 -162
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +118 -29
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +32 -32
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +38 -26
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +56 -3
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +32 -32
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +90 -57
- 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 +27 -19
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +4 -4
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +87 -51
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +18 -20
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +128 -128
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +22 -22
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- 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/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 +1 -1
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +2 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +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 +30 -6
- 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/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 +47 -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 +2 -2
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/accounting/AccountingService.sol +262 -0
- package/contracts/accounting/AccountingServiceManager.sol +38 -0
- package/contracts/accounting/IAccountingService.sol +45 -0
- package/contracts/authorization/AccessAdmin.sol +156 -82
- package/contracts/authorization/AccessManagerCloneable.sol +136 -3
- package/contracts/authorization/Authorization.sol +277 -229
- package/contracts/authorization/IAccessAdmin.sol +13 -7
- package/contracts/authorization/IAuthorization.sol +15 -1
- package/contracts/distribution/BasicDistribution.sol +11 -9
- package/contracts/distribution/BasicDistributionAuthorization.sol +21 -8
- package/contracts/distribution/Distribution.sol +37 -32
- package/contracts/distribution/DistributionService.sol +59 -33
- package/contracts/distribution/DistributionServiceManager.sol +1 -1
- package/contracts/distribution/IDistributionService.sol +16 -13
- package/contracts/examples/fire/FirePool.sol +6 -2
- package/contracts/examples/fire/FirePoolAuthorization.sol +2 -1
- package/contracts/examples/fire/FireProduct.sol +9 -3
- package/contracts/examples/fire/FireProductAuthorization.sol +2 -1
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +29 -9
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimplePool.sol +7 -9
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +36 -4
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BundleSet.sol +4 -4
- package/contracts/instance/IInstance.sol +6 -7
- package/contracts/instance/IInstanceService.sol +2 -0
- package/contracts/instance/Instance.sol +19 -11
- package/contracts/instance/InstanceAdmin.sol +213 -64
- package/contracts/instance/InstanceAuthorizationV3.sol +18 -23
- package/contracts/instance/InstanceReader.sol +91 -35
- package/contracts/instance/InstanceService.sol +43 -31
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/InstanceStore.sol +13 -2
- package/contracts/instance/RiskSet.sol +11 -12
- package/contracts/instance/base/ObjectLifecycle.sol +4 -2
- package/contracts/instance/base/ObjectSet.sol +7 -8
- package/contracts/instance/base/ObjectSetHelperLib.sol +30 -0
- package/contracts/instance/module/IComponents.sol +3 -2
- package/contracts/instance/module/IDistribution.sol +5 -2
- package/contracts/instance/module/IRisk.sol +2 -0
- package/contracts/oracle/BasicOracleAuthorization.sol +3 -12
- package/contracts/oracle/Oracle.sol +1 -1
- package/contracts/oracle/OracleService.sol +16 -15
- package/contracts/oracle/OracleServiceManager.sol +1 -1
- package/contracts/pool/BasicPoolAuthorization.sol +21 -13
- package/contracts/pool/BundleService.sol +35 -63
- package/contracts/pool/BundleServiceManager.sol +1 -1
- package/contracts/pool/IBundleService.sol +13 -20
- package/contracts/pool/IPoolService.sol +50 -38
- package/contracts/pool/Pool.sol +9 -9
- package/contracts/pool/PoolLib.sol +216 -0
- package/contracts/pool/PoolService.sol +307 -162
- package/contracts/pool/PoolServiceManager.sol +1 -1
- package/contracts/product/ApplicationService.sol +3 -3
- package/contracts/product/ApplicationServiceManager.sol +1 -1
- package/contracts/product/BasicProduct.sol +2 -0
- package/contracts/product/BasicProductAuthorization.sol +24 -10
- package/contracts/product/ClaimService.sol +157 -139
- package/contracts/product/ClaimServiceManager.sol +1 -1
- package/contracts/product/IClaimService.sol +14 -2
- package/contracts/product/IPolicyService.sol +11 -6
- package/contracts/product/IProductComponent.sol +4 -1
- package/contracts/product/IRiskService.sol +5 -8
- package/contracts/product/PolicyService.sol +95 -146
- package/contracts/product/PolicyServiceLib.sol +65 -0
- package/contracts/product/PolicyServiceManager.sol +1 -1
- package/contracts/product/PricingService.sol +23 -19
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +55 -13
- package/contracts/product/RiskService.sol +66 -29
- package/contracts/product/RiskServiceManager.sol +1 -1
- package/contracts/registry/IRegistry.sol +8 -15
- package/contracts/registry/IRelease.sol +26 -0
- package/contracts/registry/Registry.sol +7 -2
- package/contracts/registry/RegistryAdmin.sol +129 -226
- package/contracts/registry/RegistryService.sol +3 -3
- package/contracts/registry/RegistryServiceManager.sol +1 -1
- package/contracts/registry/ReleaseAdmin.sol +245 -0
- package/contracts/registry/ReleaseLifecycle.sol +2 -0
- package/contracts/registry/ReleaseRegistry.sol +124 -99
- package/contracts/registry/ServiceAuthorizationV3.sol +85 -14
- package/contracts/registry/TokenRegistry.sol +6 -8
- package/contracts/shared/Component.sol +32 -27
- package/contracts/shared/ComponentService.sol +89 -266
- package/contracts/shared/ComponentServiceManager.sol +1 -1
- package/contracts/shared/ComponentVerifyingService.sol +1 -1
- package/contracts/shared/ContractLib.sol +32 -3
- package/contracts/shared/IComponent.sol +3 -9
- package/contracts/shared/IComponentService.sol +1 -23
- package/contracts/shared/IRegisterable.sol +15 -4
- package/contracts/shared/IService.sol +3 -5
- package/contracts/shared/InstanceLinkedComponent.sol +3 -3
- package/contracts/shared/NftOwnable.sol +4 -4
- package/contracts/shared/PolicyHolder.sol +1 -1
- package/contracts/shared/Registerable.sol +45 -19
- package/contracts/shared/RegistryLinked.sol +1 -1
- package/contracts/shared/Service.sol +8 -27
- package/contracts/shared/TokenHandler.sol +40 -88
- package/contracts/staking/IStaking.sol +0 -8
- package/contracts/staking/IStakingService.sol +8 -0
- package/contracts/staking/StakeManagerLib.sol +1 -1
- package/contracts/staking/Staking.sol +34 -13
- package/contracts/staking/StakingReader.sol +1 -1
- package/contracts/staking/StakingService.sol +32 -42
- package/contracts/staking/StakingServiceManager.sol +5 -4
- package/contracts/type/ObjectType.sol +46 -21
- package/contracts/type/RiskId.sol +9 -3
- package/contracts/type/RoleId.sol +24 -4
- package/contracts/type/Selector.sol +5 -0
- package/contracts/type/Timestamp.sol +0 -5
- package/contracts/type/Version.sol +15 -5
- package/contracts/upgradeability/ProxyManager.sol +1 -1
- package/package.json +2 -2
- 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/contracts/authorization/ReleaseAccessManager.sol +0 -38
- package/contracts/instance/module/IAccess.sol +0 -46
@@ -3,11 +3,7 @@ pragma solidity ^0.8.20;
|
|
3
3
|
|
4
4
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
5
5
|
|
6
|
-
import {
|
7
|
-
import {Amount, AmountLib} from "../type/Amount.sol";
|
8
|
-
import {ComponentVerifyingService} from "../shared/ComponentVerifyingService.sol";
|
9
|
-
import {ContractLib} from "../shared/ContractLib.sol";
|
10
|
-
import {Fee, FeeLib} from "../type/Fee.sol";
|
6
|
+
import {IAccountingService} from "../accounting/IAccountingService.sol";
|
11
7
|
import {IComponent} from "../shared/IComponent.sol";
|
12
8
|
import {IComponents} from "../instance/module/IComponents.sol";
|
13
9
|
import {IComponentService} from "./IComponentService.sol";
|
@@ -27,8 +23,8 @@ import {Amount, AmountLib} from "../type/Amount.sol";
|
|
27
23
|
import {ContractLib} from "../shared/ContractLib.sol";
|
28
24
|
import {Fee, FeeLib} from "../type/Fee.sol";
|
29
25
|
import {KEEP_STATE} from "../type/StateId.sol";
|
30
|
-
import {NftId} from "../type/NftId.sol";
|
31
|
-
import {ObjectType,
|
26
|
+
import {NftId, NftIdLib} from "../type/NftId.sol";
|
27
|
+
import {ObjectType, ACCOUNTING, REGISTRY, COMPONENT, DISTRIBUTION, INSTANCE, ORACLE, POOL, PRODUCT} from "../type/ObjectType.sol";
|
32
28
|
import {Service} from "../shared/Service.sol";
|
33
29
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
34
30
|
import {TokenHandlerDeployerLib} from "../shared/TokenHandlerDeployerLib.sol";
|
@@ -42,6 +38,7 @@ contract ComponentService is
|
|
42
38
|
bool private constant INCREASE = true;
|
43
39
|
bool private constant DECREASE = false;
|
44
40
|
|
41
|
+
IAccountingService private _accountingService;
|
45
42
|
IRegistryService private _registryService;
|
46
43
|
IInstanceService private _instanceService;
|
47
44
|
|
@@ -79,12 +76,13 @@ contract ComponentService is
|
|
79
76
|
initializer()
|
80
77
|
{
|
81
78
|
(
|
82
|
-
address
|
83
|
-
address
|
79
|
+
address authority,
|
80
|
+
address registry
|
84
81
|
) = abi.decode(data, (address, address));
|
85
82
|
|
86
|
-
|
83
|
+
__Service_init(authority, registry, owner);
|
87
84
|
|
85
|
+
_accountingService = IAccountingService(_getServiceAddress(ACCOUNTING()));
|
88
86
|
_registryService = IRegistryService(_getServiceAddress(REGISTRY()));
|
89
87
|
_instanceService = IInstanceService(_getServiceAddress(INSTANCE()));
|
90
88
|
|
@@ -132,24 +130,6 @@ contract ComponentService is
|
|
132
130
|
}
|
133
131
|
|
134
132
|
|
135
|
-
function approveStakingTokenHandler(
|
136
|
-
IERC20Metadata token,
|
137
|
-
Amount amount
|
138
|
-
)
|
139
|
-
external
|
140
|
-
virtual
|
141
|
-
{
|
142
|
-
// checks
|
143
|
-
ContractLib.getAndVerifyStaking(
|
144
|
-
getRegistry(),
|
145
|
-
msg.sender); // only active
|
146
|
-
|
147
|
-
// effects
|
148
|
-
TokenHandler tokenHandler = IComponent(msg.sender).getTokenHandler();
|
149
|
-
tokenHandler.approve(token, amount);
|
150
|
-
}
|
151
|
-
|
152
|
-
|
153
133
|
function setWallet(address newWallet)
|
154
134
|
external
|
155
135
|
virtual
|
@@ -185,35 +165,52 @@ contract ComponentService is
|
|
185
165
|
_setLocked(instance.getInstanceAdmin(), componentAddress, locked);
|
186
166
|
}
|
187
167
|
|
168
|
+
/// @inheritdoc IComponentService
|
188
169
|
function withdrawFees(Amount amount)
|
189
170
|
external
|
190
171
|
virtual
|
191
172
|
returns (Amount withdrawnAmount)
|
192
173
|
{
|
174
|
+
// checks
|
193
175
|
(NftId componentNftId, IInstance instance) = _getAndVerifyActiveComponent(COMPONENT());
|
194
|
-
|
195
|
-
address componentWallet = info.tokenHandler.getWallet();
|
176
|
+
InstanceReader instanceReader = instance.getInstanceReader();
|
196
177
|
|
197
178
|
// determine withdrawn amount
|
179
|
+
Amount maxAvailableAmount = instanceReader.getFeeAmount(componentNftId);
|
198
180
|
withdrawnAmount = amount;
|
199
|
-
|
200
|
-
|
201
|
-
|
181
|
+
|
182
|
+
// max amount -> withraw all available fees
|
183
|
+
if (amount == AmountLib.max()) {
|
184
|
+
withdrawnAmount = maxAvailableAmount;
|
185
|
+
}
|
186
|
+
|
187
|
+
// check modified withdrawn amount
|
188
|
+
if (withdrawnAmount.eqz()) {
|
202
189
|
revert ErrorComponentServiceWithdrawAmountIsZero();
|
203
|
-
} else {
|
204
|
-
|
205
|
-
if (withdrawnAmount.gt(withdrawLimit)) {
|
206
|
-
revert ErrorComponentServiceWithdrawAmountExceedsLimit(withdrawnAmount, withdrawLimit);
|
207
|
-
}
|
190
|
+
} else if (withdrawnAmount > maxAvailableAmount) {
|
191
|
+
revert ErrorComponentServiceWithdrawAmountExceedsLimit(withdrawnAmount, maxAvailableAmount);
|
208
192
|
}
|
209
193
|
|
194
|
+
// effects
|
210
195
|
// decrease fee counters by withdrawnAmount
|
211
|
-
|
196
|
+
_accountingService.decreaseComponentFees(
|
197
|
+
instance.getInstanceStore(),
|
198
|
+
componentNftId,
|
199
|
+
withdrawnAmount);
|
212
200
|
|
213
|
-
// transfer amount to component owner
|
214
201
|
address componentOwner = getRegistry().ownerOf(componentNftId);
|
215
|
-
|
216
|
-
|
202
|
+
TokenHandler tokenHandler = instanceReader.getTokenHandler(componentNftId);
|
203
|
+
emit LogComponentServiceComponentFeesWithdrawn(
|
204
|
+
componentNftId,
|
205
|
+
componentOwner,
|
206
|
+
address(tokenHandler.TOKEN()),
|
207
|
+
withdrawnAmount);
|
208
|
+
|
209
|
+
// interactions
|
210
|
+
// transfer amount to component owner
|
211
|
+
tokenHandler.pushFeeToken(
|
212
|
+
componentOwner,
|
213
|
+
withdrawnAmount);
|
217
214
|
}
|
218
215
|
|
219
216
|
|
@@ -235,14 +232,22 @@ contract ComponentService is
|
|
235
232
|
|
236
233
|
// get product
|
237
234
|
IProductComponent product = IProductComponent(productAddress);
|
235
|
+
|
236
|
+
IComponents.ProductInfo memory initialProductInfo = product.getInitialProductInfo();
|
237
|
+
// force initialization of linked components with empty values to
|
238
|
+
// ensure no components are linked upon initialization of the product
|
239
|
+
initialProductInfo.poolNftId = NftIdLib.zero();
|
240
|
+
initialProductInfo.distributionNftId = NftIdLib.zero();
|
241
|
+
initialProductInfo.oracleNftId = new NftId[](initialProductInfo.expectedNumberOfOracles);
|
238
242
|
|
239
243
|
// create info
|
240
244
|
instanceStore.createProduct(
|
241
245
|
productNftId,
|
242
|
-
|
246
|
+
initialProductInfo);
|
243
247
|
|
244
|
-
|
245
|
-
|
248
|
+
instanceStore.createFee(
|
249
|
+
productNftId,
|
250
|
+
product.getInitialFeeInfo());
|
246
251
|
}
|
247
252
|
|
248
253
|
|
@@ -255,54 +260,29 @@ contract ComponentService is
|
|
255
260
|
nonReentrant()
|
256
261
|
{
|
257
262
|
(NftId productNftId, IInstance instance) = _getAndVerifyActiveComponent(PRODUCT());
|
258
|
-
IComponents.
|
263
|
+
IComponents.FeeInfo memory feeInfo = instance.getInstanceReader().getFeeInfo(productNftId);
|
259
264
|
bool feesChanged = false;
|
260
265
|
|
261
266
|
// update product fee if required
|
262
|
-
if(!FeeLib.eq(
|
263
|
-
_logUpdateFee(productNftId, "ProductFee",
|
264
|
-
|
267
|
+
if(!FeeLib.eq(feeInfo.productFee, productFee)) {
|
268
|
+
_logUpdateFee(productNftId, "ProductFee", feeInfo.productFee, productFee);
|
269
|
+
feeInfo.productFee = productFee;
|
265
270
|
feesChanged = true;
|
266
271
|
}
|
267
272
|
|
268
273
|
// update processing fee if required
|
269
|
-
if(!FeeLib.eq(
|
270
|
-
_logUpdateFee(productNftId, "ProcessingFee",
|
271
|
-
|
274
|
+
if(!FeeLib.eq(feeInfo.processingFee, processingFee)) {
|
275
|
+
_logUpdateFee(productNftId, "ProcessingFee", feeInfo.processingFee, processingFee);
|
276
|
+
feeInfo.processingFee = processingFee;
|
272
277
|
feesChanged = true;
|
273
278
|
}
|
274
279
|
|
275
280
|
if(feesChanged) {
|
276
|
-
instance.getInstanceStore().
|
281
|
+
instance.getInstanceStore().updateFee(productNftId, feeInfo);
|
277
282
|
emit LogComponentServiceProductFeesUpdated(productNftId);
|
278
283
|
}
|
279
284
|
}
|
280
285
|
|
281
|
-
function increaseProductFees(
|
282
|
-
InstanceStore instanceStore,
|
283
|
-
NftId productNftId,
|
284
|
-
Amount feeAmount
|
285
|
-
)
|
286
|
-
external
|
287
|
-
virtual
|
288
|
-
// TODO re-enable once role granting is stable and fixed
|
289
|
-
// restricted()
|
290
|
-
{
|
291
|
-
_checkNftType(productNftId, PRODUCT());
|
292
|
-
_changeTargetBalance(INCREASE, instanceStore, productNftId, AmountLib.zero(), feeAmount);
|
293
|
-
}
|
294
|
-
|
295
|
-
|
296
|
-
function decreaseProductFees(InstanceStore instanceStore, NftId productNftId, Amount feeAmount)
|
297
|
-
external
|
298
|
-
virtual
|
299
|
-
// TODO re-enable once role granting is stable and fixed
|
300
|
-
// restricted()
|
301
|
-
{
|
302
|
-
_checkNftType(productNftId, PRODUCT());
|
303
|
-
_changeTargetBalance(DECREASE, instanceStore, productNftId, AmountLib.zero(), feeAmount);
|
304
|
-
}
|
305
|
-
|
306
286
|
//-------- distribution -------------------------------------------------//
|
307
287
|
|
308
288
|
/// @dev registers the sending component as a distribution component
|
@@ -333,10 +313,6 @@ contract ComponentService is
|
|
333
313
|
// set distribution in product info
|
334
314
|
productInfo.distributionNftId = distributionNftId;
|
335
315
|
instanceStore.updateProduct(productNftId, productInfo, KEEP_STATE());
|
336
|
-
|
337
|
-
// authorize
|
338
|
-
instanceAdmin.initializeComponentAuthorization(
|
339
|
-
IInstanceLinkedComponent(distributioAddress));
|
340
316
|
}
|
341
317
|
|
342
318
|
|
@@ -348,93 +324,30 @@ contract ComponentService is
|
|
348
324
|
virtual
|
349
325
|
{
|
350
326
|
(NftId distributionNftId, IInstance instance) = _getAndVerifyActiveComponent(DISTRIBUTION());
|
351
|
-
(NftId productNftId, IComponents.
|
327
|
+
(NftId productNftId, IComponents.FeeInfo memory feeInfo) = _getLinkedFeeInfo(
|
352
328
|
instance.getInstanceReader(), distributionNftId);
|
353
329
|
bool feesChanged = false;
|
354
330
|
|
355
331
|
// update distributino fee if required
|
356
|
-
if(!FeeLib.eq(
|
357
|
-
_logUpdateFee(productNftId, "DistributionFee",
|
358
|
-
|
332
|
+
if(!FeeLib.eq(feeInfo.distributionFee, distributionFee)) {
|
333
|
+
_logUpdateFee(productNftId, "DistributionFee", feeInfo.distributionFee, distributionFee);
|
334
|
+
feeInfo.distributionFee = distributionFee;
|
359
335
|
feesChanged = true;
|
360
336
|
}
|
361
337
|
|
362
338
|
// update min distribution owner fee if required
|
363
|
-
if(!FeeLib.eq(
|
364
|
-
_logUpdateFee(productNftId, "MinDistributionOwnerFee",
|
365
|
-
|
339
|
+
if(!FeeLib.eq(feeInfo.minDistributionOwnerFee, minDistributionOwnerFee)) {
|
340
|
+
_logUpdateFee(productNftId, "MinDistributionOwnerFee", feeInfo.minDistributionOwnerFee, minDistributionOwnerFee);
|
341
|
+
feeInfo.minDistributionOwnerFee = minDistributionOwnerFee;
|
366
342
|
feesChanged = true;
|
367
343
|
}
|
368
344
|
|
369
345
|
if(feesChanged) {
|
370
|
-
instance.getInstanceStore().
|
346
|
+
instance.getInstanceStore().updateFee(productNftId, feeInfo);
|
371
347
|
emit LogComponentServiceDistributionFeesUpdated(distributionNftId);
|
372
348
|
}
|
373
349
|
}
|
374
350
|
|
375
|
-
function increaseDistributionBalance(
|
376
|
-
InstanceStore instanceStore,
|
377
|
-
NftId distributionNftId,
|
378
|
-
Amount amount,
|
379
|
-
Amount feeAmount
|
380
|
-
)
|
381
|
-
external
|
382
|
-
virtual
|
383
|
-
// TODO re-enable once role granting is stable and fixed
|
384
|
-
// restricted()
|
385
|
-
{
|
386
|
-
_checkNftType(distributionNftId, DISTRIBUTION());
|
387
|
-
_changeTargetBalance(INCREASE, instanceStore, distributionNftId, amount, feeAmount);
|
388
|
-
}
|
389
|
-
|
390
|
-
|
391
|
-
function decreaseDistributionBalance(
|
392
|
-
InstanceStore instanceStore,
|
393
|
-
NftId distributionNftId,
|
394
|
-
Amount amount,
|
395
|
-
Amount feeAmount
|
396
|
-
)
|
397
|
-
external
|
398
|
-
virtual
|
399
|
-
// TODO re-enable once role granting is stable and fixed
|
400
|
-
// restricted()
|
401
|
-
{
|
402
|
-
_checkNftType(distributionNftId, DISTRIBUTION());
|
403
|
-
_changeTargetBalance(DECREASE, instanceStore, distributionNftId, amount, feeAmount);
|
404
|
-
}
|
405
|
-
|
406
|
-
//-------- distributor -------------------------------------------------------//
|
407
|
-
|
408
|
-
function increaseDistributorBalance(
|
409
|
-
InstanceStore instanceStore,
|
410
|
-
NftId distributorNftId,
|
411
|
-
Amount amount,
|
412
|
-
Amount feeAmount
|
413
|
-
)
|
414
|
-
external
|
415
|
-
virtual
|
416
|
-
// TODO re-enable once role granting is stable and fixed
|
417
|
-
// restricted()
|
418
|
-
{
|
419
|
-
_checkNftType(distributorNftId, DISTRIBUTOR());
|
420
|
-
_changeTargetBalance(INCREASE, instanceStore, distributorNftId, amount, feeAmount);
|
421
|
-
}
|
422
|
-
|
423
|
-
function decreaseDistributorBalance(
|
424
|
-
InstanceStore instanceStore,
|
425
|
-
NftId distributorNftId,
|
426
|
-
Amount amount,
|
427
|
-
Amount feeAmount
|
428
|
-
)
|
429
|
-
external
|
430
|
-
virtual
|
431
|
-
// TODO re-enable once role granting is stable and fixed
|
432
|
-
// restricted()
|
433
|
-
{
|
434
|
-
_checkNftType(distributorNftId, DISTRIBUTOR());
|
435
|
-
_changeTargetBalance(DECREASE, instanceStore, distributorNftId, amount, feeAmount);
|
436
|
-
}
|
437
|
-
|
438
351
|
//-------- oracle -------------------------------------------------------//
|
439
352
|
|
440
353
|
function _registerOracle(address oracleAddress)
|
@@ -465,10 +378,6 @@ contract ComponentService is
|
|
465
378
|
productInfo.oracleNftId[productInfo.numberOfOracles] = oracleNftId;
|
466
379
|
productInfo.numberOfOracles++;
|
467
380
|
instanceStore.updateProduct(productNftId, productInfo, KEEP_STATE());
|
468
|
-
|
469
|
-
// authorize
|
470
|
-
instanceAdmin.initializeComponentAuthorization(
|
471
|
-
IInstanceLinkedComponent(oracleAddress));
|
472
381
|
}
|
473
382
|
|
474
383
|
//-------- pool ---------------------------------------------------------//
|
@@ -503,9 +412,6 @@ contract ComponentService is
|
|
503
412
|
// update pool in product info
|
504
413
|
productInfo.poolNftId = poolNftId;
|
505
414
|
instanceStore.updateProduct(productNftId, productInfo, KEEP_STATE());
|
506
|
-
|
507
|
-
// authorize
|
508
|
-
instanceAdmin.initializeComponentAuthorization(pool);
|
509
415
|
}
|
510
416
|
|
511
417
|
|
@@ -519,123 +425,37 @@ contract ComponentService is
|
|
519
425
|
{
|
520
426
|
(NftId poolNftId, IInstance instance) = _getAndVerifyActiveComponent(POOL());
|
521
427
|
|
522
|
-
(NftId productNftId, IComponents.
|
428
|
+
(NftId productNftId, IComponents.FeeInfo memory feeInfo) = _getLinkedFeeInfo(
|
523
429
|
instance.getInstanceReader(), poolNftId);
|
524
430
|
bool feesChanged = false;
|
525
431
|
|
526
432
|
// update pool fee if required
|
527
|
-
if(!FeeLib.eq(
|
528
|
-
_logUpdateFee(productNftId, "PoolFee",
|
529
|
-
|
433
|
+
if(!FeeLib.eq(feeInfo.poolFee, poolFee)) {
|
434
|
+
_logUpdateFee(productNftId, "PoolFee", feeInfo.poolFee, poolFee);
|
435
|
+
feeInfo.poolFee = poolFee;
|
530
436
|
feesChanged = true;
|
531
437
|
}
|
532
438
|
|
533
439
|
// update staking fee if required
|
534
|
-
if(!FeeLib.eq(
|
535
|
-
_logUpdateFee(productNftId, "StakingFee",
|
536
|
-
|
440
|
+
if(!FeeLib.eq(feeInfo.stakingFee, stakingFee)) {
|
441
|
+
_logUpdateFee(productNftId, "StakingFee", feeInfo.stakingFee, stakingFee);
|
442
|
+
feeInfo.stakingFee = stakingFee;
|
537
443
|
feesChanged = true;
|
538
444
|
}
|
539
445
|
|
540
446
|
// update performance fee if required
|
541
|
-
if(!FeeLib.eq(
|
542
|
-
_logUpdateFee(productNftId, "PerformanceFee",
|
543
|
-
|
447
|
+
if(!FeeLib.eq(feeInfo.performanceFee, performanceFee)) {
|
448
|
+
_logUpdateFee(productNftId, "PerformanceFee", feeInfo.performanceFee, performanceFee);
|
449
|
+
feeInfo.performanceFee = performanceFee;
|
544
450
|
feesChanged = true;
|
545
451
|
}
|
546
452
|
|
547
453
|
if(feesChanged) {
|
548
|
-
instance.getInstanceStore().
|
454
|
+
instance.getInstanceStore().updateFee(productNftId, feeInfo);
|
549
455
|
emit LogComponentServicePoolFeesUpdated(poolNftId);
|
550
456
|
}
|
551
457
|
}
|
552
458
|
|
553
|
-
function increasePoolBalance(
|
554
|
-
InstanceStore instanceStore,
|
555
|
-
NftId poolNftId,
|
556
|
-
Amount amount,
|
557
|
-
Amount feeAmount
|
558
|
-
)
|
559
|
-
public
|
560
|
-
virtual
|
561
|
-
// TODO re-enable once role granting is stable and fixed
|
562
|
-
// restricted()
|
563
|
-
{
|
564
|
-
_checkNftType(poolNftId, POOL());
|
565
|
-
_changeTargetBalance(INCREASE, instanceStore, poolNftId, amount, feeAmount);
|
566
|
-
}
|
567
|
-
|
568
|
-
function decreasePoolBalance(
|
569
|
-
InstanceStore instanceStore,
|
570
|
-
NftId poolNftId,
|
571
|
-
Amount amount,
|
572
|
-
Amount feeAmount
|
573
|
-
)
|
574
|
-
public
|
575
|
-
virtual
|
576
|
-
// TODO re-enable once role granting is stable and fixed
|
577
|
-
// restricted()
|
578
|
-
{
|
579
|
-
_checkNftType(poolNftId, POOL());
|
580
|
-
_changeTargetBalance(DECREASE, instanceStore, poolNftId, amount, feeAmount);
|
581
|
-
}
|
582
|
-
|
583
|
-
//-------- bundle -------------------------------------------------------//
|
584
|
-
|
585
|
-
function increaseBundleBalance(
|
586
|
-
InstanceStore instanceStore,
|
587
|
-
NftId bundleNftId,
|
588
|
-
Amount amount,
|
589
|
-
Amount feeAmount
|
590
|
-
)
|
591
|
-
external
|
592
|
-
virtual
|
593
|
-
// TODO re-enable once role granting is stable and fixed
|
594
|
-
// restricted()
|
595
|
-
{
|
596
|
-
_checkNftType(bundleNftId, BUNDLE());
|
597
|
-
_changeTargetBalance(INCREASE, instanceStore, bundleNftId, amount, feeAmount);
|
598
|
-
}
|
599
|
-
|
600
|
-
function decreaseBundleBalance(
|
601
|
-
InstanceStore instanceStore,
|
602
|
-
NftId bundleNftId,
|
603
|
-
Amount amount,
|
604
|
-
Amount feeAmount
|
605
|
-
)
|
606
|
-
external
|
607
|
-
virtual
|
608
|
-
// TODO re-enable once role granting is stable and fixed
|
609
|
-
// restricted()
|
610
|
-
{
|
611
|
-
_checkNftType(bundleNftId, BUNDLE());
|
612
|
-
_changeTargetBalance(DECREASE, instanceStore, bundleNftId, amount, feeAmount);
|
613
|
-
}
|
614
|
-
|
615
|
-
|
616
|
-
//-------- internal functions ------------------------------------------//
|
617
|
-
|
618
|
-
function _changeTargetBalance(
|
619
|
-
bool increase,
|
620
|
-
InstanceStore instanceStore,
|
621
|
-
NftId targetNftId,
|
622
|
-
Amount amount,
|
623
|
-
Amount feeAmount
|
624
|
-
)
|
625
|
-
internal
|
626
|
-
virtual
|
627
|
-
{
|
628
|
-
Amount totalAmount = amount + feeAmount;
|
629
|
-
|
630
|
-
if(increase) {
|
631
|
-
if(totalAmount.gtz()) { instanceStore.increaseBalance(targetNftId, totalAmount); }
|
632
|
-
if(feeAmount.gtz()) { instanceStore.increaseFees(targetNftId, feeAmount); }
|
633
|
-
} else {
|
634
|
-
if(totalAmount.gtz()) { instanceStore.decreaseBalance(targetNftId, totalAmount); }
|
635
|
-
if(feeAmount.gtz()) { instanceStore.decreaseFees(targetNftId, feeAmount); }
|
636
|
-
}
|
637
|
-
}
|
638
|
-
|
639
459
|
/// @dev Registers the component represented by the provided address.
|
640
460
|
function _register(
|
641
461
|
address componentAddress, // address of component to register
|
@@ -690,9 +510,6 @@ contract ComponentService is
|
|
690
510
|
address(token),
|
691
511
|
address(instanceAdmin.authority()));
|
692
512
|
|
693
|
-
// set token handler allowance to max
|
694
|
-
// componentInfo.tokenHandler.approve(token, AmountLib.max());
|
695
|
-
|
696
513
|
// register component with instance
|
697
514
|
instanceStore.createComponent(
|
698
515
|
componentNftId,
|
@@ -701,6 +518,9 @@ contract ComponentService is
|
|
701
518
|
// link component contract to nft id
|
702
519
|
component.linkToRegisteredNftId();
|
703
520
|
|
521
|
+
// authorize
|
522
|
+
instanceAdmin.initializeComponentAuthorization(component);
|
523
|
+
|
704
524
|
emit LogComponentServiceRegistered(instanceNftId, componentNftId, requiredType, address(component), address(token), initialOwner);
|
705
525
|
}
|
706
526
|
|
@@ -720,7 +540,7 @@ contract ComponentService is
|
|
720
540
|
}
|
721
541
|
|
722
542
|
|
723
|
-
function
|
543
|
+
function _getLinkedFeeInfo(
|
724
544
|
InstanceReader instanceReader,
|
725
545
|
NftId componentNftId
|
726
546
|
)
|
@@ -728,11 +548,11 @@ contract ComponentService is
|
|
728
548
|
view
|
729
549
|
returns(
|
730
550
|
NftId productNftId,
|
731
|
-
IComponents.
|
551
|
+
IComponents.FeeInfo memory info
|
732
552
|
)
|
733
553
|
{
|
734
|
-
productNftId = getRegistry().
|
735
|
-
info = instanceReader.
|
554
|
+
productNftId = getRegistry().getParentNftId(componentNftId);
|
555
|
+
info = instanceReader.getFeeInfo(productNftId);
|
736
556
|
}
|
737
557
|
|
738
558
|
|
@@ -780,9 +600,12 @@ contract ComponentService is
|
|
780
600
|
revert ErrorComponentServiceAlreadyRegistered(componentAddress);
|
781
601
|
}
|
782
602
|
|
783
|
-
//
|
603
|
+
// component release matches servie release
|
784
604
|
address parentAddress = registry.getObjectAddress(parentNftId);
|
785
|
-
if (component.getRelease() !=
|
605
|
+
if (component.getRelease() != getRelease()) {
|
606
|
+
revert ErrorComponentServiceReleaseMismatch(componentAddress, component.getRelease(), getRelease());
|
607
|
+
// component release matches parent release
|
608
|
+
} else if (component.getRelease() != IRegisterable(parentAddress).getRelease()){
|
786
609
|
revert ErrorComponentServiceReleaseMismatch(componentAddress, component.getRelease(), IRegisterable(parentAddress).getRelease());
|
787
610
|
}
|
788
611
|
|
@@ -17,7 +17,7 @@ contract ComponentServiceManager is ProxyManager {
|
|
17
17
|
)
|
18
18
|
{
|
19
19
|
ComponentService svc = new ComponentService();
|
20
|
-
bytes memory data = abi.encode(
|
20
|
+
bytes memory data = abi.encode(authority, registry);
|
21
21
|
IVersionable versionable = initialize(
|
22
22
|
registry,
|
23
23
|
address(svc),
|
@@ -116,7 +116,7 @@ abstract contract ComponentVerifyingService is
|
|
116
116
|
/// @dev returns the product nft id from the registry.
|
117
117
|
/// assumes the component nft id is valid and represents a product linked component.
|
118
118
|
function _getProductNftId(NftId componentNftId) internal view returns (NftId productNftId) {
|
119
|
-
productNftId = getRegistry().
|
119
|
+
productNftId = getRegistry().getParentNftId(componentNftId);
|
120
120
|
}
|
121
121
|
|
122
122
|
|
@@ -2,12 +2,14 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
|
5
|
+
import {IAccessManager} from "@openzeppelin/contracts/access/manager/IAccessManager.sol";
|
5
6
|
|
6
7
|
// import {InstanceAdmin} from "../instance/InstanceAdmin.sol";
|
7
8
|
import {IRegistry} from "../registry/IRegistry.sol";
|
8
9
|
import {IPolicyHolder} from "../shared/IPolicyHolder.sol";
|
9
10
|
import {NftId} from "../type/NftId.sol";
|
10
11
|
import {ObjectType, PRODUCT, DISTRIBUTION, ORACLE, POOL, STAKING} from "../type/ObjectType.sol";
|
12
|
+
import {VersionPart} from "../type/Version.sol";
|
11
13
|
|
12
14
|
interface ITargetHelper {
|
13
15
|
function isTargetLocked(address target) external view returns (bool);
|
@@ -17,6 +19,10 @@ interface IInstanceAdminHelper {
|
|
17
19
|
function getInstanceAdmin() external view returns (ITargetHelper);
|
18
20
|
}
|
19
21
|
|
22
|
+
interface ITokenRegistryHelper {
|
23
|
+
function isActive(uint256 chainId, address token, VersionPart release) external view returns (bool);
|
24
|
+
}
|
25
|
+
|
20
26
|
library ContractLib {
|
21
27
|
|
22
28
|
error ErrorContractLibNotRegistered(address target);
|
@@ -25,7 +31,6 @@ library ContractLib {
|
|
25
31
|
error ErrorContractLibComponentTypeMismatch(NftId componentNftId, ObjectType expectedType, ObjectType actualType);
|
26
32
|
error ErrorContractLibComponentInactive(NftId componentNftId);
|
27
33
|
|
28
|
-
|
29
34
|
function getAndVerifyComponent(
|
30
35
|
IRegistry registry,
|
31
36
|
address target,
|
@@ -130,17 +135,41 @@ library ContractLib {
|
|
130
135
|
view
|
131
136
|
returns (address instance)
|
132
137
|
{
|
133
|
-
NftId productNftId = registry.
|
134
|
-
NftId instanceNftId = registry.
|
138
|
+
NftId productNftId = registry.getParentNftId(componentNftId);
|
139
|
+
NftId instanceNftId = registry.getParentNftId(productNftId);
|
135
140
|
return registry.getObjectInfo(instanceNftId).objectAddress;
|
136
141
|
}
|
137
142
|
|
138
143
|
|
144
|
+
function isActiveToken(
|
145
|
+
address tokenRegistryAddress,
|
146
|
+
address token,
|
147
|
+
uint256 chainId,
|
148
|
+
VersionPart release
|
149
|
+
)
|
150
|
+
external
|
151
|
+
view
|
152
|
+
returns (bool)
|
153
|
+
{
|
154
|
+
return ITokenRegistryHelper(
|
155
|
+
tokenRegistryAddress).isActive(
|
156
|
+
chainId, token, release);
|
157
|
+
}
|
158
|
+
|
139
159
|
function isPolicyHolder(address target) external view returns (bool) {
|
140
160
|
return ERC165Checker.supportsInterface(target, type(IPolicyHolder).interfaceId);
|
141
161
|
}
|
142
162
|
|
143
163
|
|
164
|
+
function isAuthority(address authority) public view returns (bool) {
|
165
|
+
if (!isContract(authority)) {
|
166
|
+
return false;
|
167
|
+
}
|
168
|
+
|
169
|
+
return supportsInterface(authority, type(IAccessManager).interfaceId);
|
170
|
+
}
|
171
|
+
|
172
|
+
|
144
173
|
function isRegistry(address registry) public view returns (bool) {
|
145
174
|
if (!isContract(registry)) {
|
146
175
|
return false;
|