@etherisc/gif-next 0.0.2-de7c770-422 → 0.0.2-de9ede4-391
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +28 -7
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1000 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +746 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +767 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +103 -63
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.json +24 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +67 -11
- 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 +60 -32
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +40 -3
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +19 -0
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +4 -0
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +1196 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +68 -5
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +159 -209
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +82 -22
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +99 -125
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +180 -86
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +139 -64
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +87 -108
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +52 -0
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/DamageLevel.sol/DamageLevelLib.json +22 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePool.sol/FirePool.json +1441 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +502 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +1991 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +470 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.json +376 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +187 -169
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +470 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +131 -157
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +282 -194
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +502 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +564 -249
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +470 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +147 -42
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +116 -48
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +53 -101
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +149 -60
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +196 -138
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +58 -85
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +687 -84
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +118 -148
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +107 -44
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +475 -116
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +810 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/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 +46 -5
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +119 -169
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +84 -24
- 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 +82 -103
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +43 -9
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +95 -121
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +147 -79
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +127 -40
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +115 -141
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +114 -22
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +148 -150
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +121 -70
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +48 -33
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +102 -134
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +272 -185
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +115 -152
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +413 -263
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +144 -45
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +119 -45
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +103 -40
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +158 -138
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +82 -22
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +200 -86
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +144 -61
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +63 -7
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +64 -8
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +178 -19
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +80 -51
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +141 -116
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +29 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +328 -119
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +150 -55
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +170 -107
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +119 -48
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +154 -134
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +81 -26
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +101 -34
- 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 +91 -15
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +114 -35
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +5 -18
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +135 -51
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +220 -182
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +94 -172
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +99 -32
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +47 -6
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +123 -225
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +66 -8
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +72 -80
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +483 -477
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +141 -76
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +47 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +488 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.json +24 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.json +30 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +61 -64
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +425 -261
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +82 -103
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +36 -0
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +36 -0
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +16 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +16 -6
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +29 -0
- 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 +29 -0
- 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 +94 -120
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +42 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +42 -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 +18 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +18 -8
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +66 -8
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +47 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +388 -35
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +395 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +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 +79 -100
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +29 -21
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +3 -3
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +158 -170
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +46 -5
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +120 -54
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +7 -12
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +87 -53
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +103 -36
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +145 -104
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +3 -3
- 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 +33 -9
- 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 +28 -4
- 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 +3 -3
- 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 +2 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +19 -19
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +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 +99 -5
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +15 -2
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +16 -3
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +79 -27
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/accounting/AccountingService.sol +263 -0
- package/contracts/accounting/AccountingServiceManager.sol +38 -0
- package/contracts/accounting/IAccountingService.sol +45 -0
- package/contracts/authorization/AccessAdmin.sol +82 -56
- package/contracts/authorization/Authorization.sol +111 -39
- package/contracts/authorization/IAccess.sol +1 -0
- package/contracts/authorization/IAccessAdmin.sol +4 -3
- package/contracts/authorization/IAuthorization.sol +13 -7
- package/contracts/authorization/IServiceAuthorization.sol +3 -1
- package/contracts/authorization/ReleaseAccessManager.sol +38 -0
- package/contracts/authorization/ServiceAuthorization.sol +26 -10
- package/contracts/distribution/BasicDistribution.sol +8 -7
- package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
- package/contracts/distribution/Distribution.sol +32 -40
- package/contracts/distribution/DistributionService.sol +86 -65
- package/contracts/distribution/DistributionServiceManager.sol +6 -6
- package/contracts/distribution/IDistributionComponent.sol +1 -1
- package/contracts/distribution/IDistributionService.sol +5 -6
- package/contracts/examples/fire/DamageLevel.sol +59 -0
- package/contracts/examples/fire/FirePool.sol +90 -0
- package/contracts/examples/fire/FirePoolAuthorization.sol +35 -0
- package/contracts/examples/fire/FireProduct.sol +436 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +45 -0
- package/contracts/examples/fire/FireUSD.sol +26 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +11 -4
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -4
- package/contracts/examples/unpermissioned/SimplePool.sol +37 -6
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +24 -23
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BundleSet.sol +38 -34
- package/contracts/instance/IInstance.sol +11 -3
- package/contracts/instance/IInstanceService.sol +7 -29
- package/contracts/instance/Instance.sol +36 -26
- package/contracts/instance/InstanceAdmin.sol +57 -54
- package/contracts/instance/InstanceAuthorizationV3.sol +50 -32
- package/contracts/instance/InstanceReader.sol +187 -21
- package/contracts/instance/InstanceService.sol +54 -129
- package/contracts/instance/InstanceServiceManager.sol +6 -7
- package/contracts/instance/InstanceStore.sol +12 -2
- package/contracts/instance/RiskSet.sol +119 -0
- package/contracts/instance/base/ObjectCounter.sol +1 -2
- package/contracts/instance/base/ObjectLifecycle.sol +2 -1
- package/contracts/instance/base/ObjectSet.sol +24 -25
- package/contracts/instance/module/IComponents.sol +20 -7
- package/contracts/instance/module/IPolicy.sol +4 -3
- package/contracts/instance/module/IRisk.sol +1 -0
- package/contracts/oracle/BasicOracle.sol +0 -1
- package/contracts/oracle/IOracleService.sol +2 -1
- package/contracts/oracle/Oracle.sol +4 -15
- package/contracts/oracle/OracleService.sol +110 -80
- package/contracts/oracle/OracleServiceManager.sol +6 -6
- package/contracts/pool/BasicPool.sol +33 -24
- package/contracts/pool/BasicPoolAuthorization.sol +12 -2
- package/contracts/pool/BundleService.sol +74 -87
- package/contracts/pool/BundleServiceManager.sol +6 -6
- package/contracts/pool/IBundleService.sol +2 -15
- package/contracts/pool/IPoolComponent.sol +19 -15
- package/contracts/pool/IPoolService.sol +30 -37
- package/contracts/pool/Pool.sol +141 -122
- package/contracts/pool/PoolService.sol +263 -157
- package/contracts/pool/PoolServiceManager.sol +4 -4
- package/contracts/product/ApplicationService.sol +31 -20
- package/contracts/product/ApplicationServiceManager.sol +4 -4
- package/contracts/product/BasicProduct.sol +8 -12
- package/contracts/product/BasicProductAuthorization.sol +1 -3
- package/contracts/product/ClaimService.sol +233 -106
- package/contracts/product/ClaimServiceManager.sol +4 -4
- package/contracts/product/IApplicationService.sol +5 -2
- package/contracts/product/IClaimService.sol +3 -2
- package/contracts/product/IPolicyService.sol +25 -8
- package/contracts/product/IPricingService.sol +9 -9
- package/contracts/product/IProductComponent.sol +23 -3
- package/contracts/product/PolicyService.sol +361 -198
- package/contracts/product/PolicyServiceManager.sol +4 -4
- package/contracts/product/PricingService.sol +10 -11
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +76 -74
- package/contracts/product/RiskService.sol +16 -6
- package/contracts/product/RiskServiceManager.sol +4 -4
- package/contracts/registry/ChainNft.sol +10 -11
- package/contracts/registry/IRegistry.sol +8 -3
- package/contracts/registry/IRegistryService.sol +5 -12
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +29 -6
- package/contracts/registry/RegistryAdmin.sol +29 -36
- package/contracts/registry/RegistryService.sol +33 -44
- package/contracts/registry/RegistryServiceManager.sol +2 -2
- package/contracts/registry/ReleaseLifecycle.sol +6 -3
- package/contracts/registry/ReleaseRegistry.sol +205 -210
- package/contracts/registry/ServiceAuthorizationV3.sol +58 -50
- package/contracts/shared/Component.sol +56 -105
- package/contracts/shared/ComponentService.sol +384 -329
- package/contracts/shared/ComponentServiceManager.sol +8 -5
- package/contracts/shared/ComponentVerifyingService.sol +27 -16
- package/contracts/shared/ContractLib.sol +224 -0
- package/contracts/shared/IComponent.sol +6 -14
- package/contracts/shared/IComponentService.sol +45 -37
- package/contracts/shared/IInstanceLinkedComponent.sol +3 -22
- package/contracts/shared/ILifecycle.sol +3 -1
- package/contracts/shared/INftOwnable.sol +2 -0
- package/contracts/shared/IPolicyHolder.sol +12 -13
- package/contracts/shared/IRegisterable.sol +11 -0
- package/contracts/shared/InstanceLinkedComponent.sol +68 -43
- package/contracts/shared/KeyValueStore.sol +1 -1
- package/contracts/shared/Lifecycle.sol +15 -4
- package/contracts/shared/NftOwnable.sol +23 -3
- package/contracts/shared/PolicyHolder.sol +11 -5
- package/contracts/shared/Registerable.sol +15 -7
- package/contracts/shared/RegistryLinked.sol +6 -12
- package/contracts/shared/Service.sol +16 -14
- package/contracts/shared/TokenHandler.sol +316 -66
- package/contracts/shared/TokenHandlerDeployerLib.sol +10 -2
- package/contracts/staking/IStaking.sol +9 -4
- package/contracts/staking/IStakingService.sol +0 -3
- package/contracts/staking/Staking.sol +42 -25
- package/contracts/staking/StakingManager.sol +8 -6
- package/contracts/staking/StakingReader.sol +12 -5
- package/contracts/staking/StakingService.sol +56 -23
- package/contracts/staking/StakingServiceManager.sol +2 -2
- package/contracts/type/Amount.sol +15 -0
- package/contracts/type/ClaimId.sol +6 -1
- package/contracts/type/Key32.sol +2 -2
- package/contracts/type/Key32Set.sol +62 -0
- package/contracts/type/NftId.sol +7 -0
- package/contracts/type/ObjectType.sol +14 -0
- package/contracts/type/PayoutId.sol +10 -10
- package/contracts/type/RiskId.sol +30 -4
- package/contracts/type/RoleId.sol +0 -12
- package/contracts/type/StateId.sol +14 -1
- package/contracts/type/UFixed.sol +13 -119
- package/contracts/upgradeability/ProxyManager.sol +68 -34
- package/contracts/upgradeability/Versionable.sol +2 -2
- package/package.json +4 -3
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +0 -4
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.json +0 -290
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +0 -4
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +0 -390
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +0 -39
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +0 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +0 -16
- package/contracts/authorization/IModuleAuthorization.sol +0 -21
- package/contracts/authorization/ModuleAuthorization.sol +0 -78
- package/contracts/shared/InitializableCustom.sol +0 -177
@@ -2,13 +2,13 @@
|
|
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";
|
9
10
|
import {IBundleService} from "../pool/IBundleService.sol";
|
10
11
|
import {IDistributionService} from "../distribution/IDistributionService.sol";
|
11
|
-
import {IInstanceService} from "../instance/IInstanceService.sol";
|
12
12
|
import {IPoolService} from "../pool/IPoolService.sol";
|
13
13
|
import {IStakingService} from "../staking/IStakingService.sol";
|
14
14
|
import {IRegistryService} from "./IRegistryService.sol";
|
@@ -20,7 +20,7 @@ contract ServiceAuthorizationV3
|
|
20
20
|
{
|
21
21
|
|
22
22
|
constructor(string memory commitHash)
|
23
|
-
ServiceAuthorization(commitHash)
|
23
|
+
ServiceAuthorization(commitHash, 3)
|
24
24
|
{}
|
25
25
|
|
26
26
|
function _setupDomains()
|
@@ -30,16 +30,17 @@ contract ServiceAuthorizationV3
|
|
30
30
|
_authorizeDomain(REGISTRY(), address(1));
|
31
31
|
_authorizeDomain(STAKING(), address(2));
|
32
32
|
_authorizeDomain(INSTANCE(), address(3));
|
33
|
-
_authorizeDomain(
|
34
|
-
_authorizeDomain(
|
35
|
-
_authorizeDomain(
|
36
|
-
_authorizeDomain(
|
37
|
-
_authorizeDomain(
|
38
|
-
_authorizeDomain(
|
39
|
-
_authorizeDomain(
|
40
|
-
_authorizeDomain(
|
41
|
-
_authorizeDomain(
|
42
|
-
_authorizeDomain(
|
33
|
+
_authorizeDomain(ACCOUNTING(), address(4));
|
34
|
+
_authorizeDomain(COMPONENT(), address(5));
|
35
|
+
_authorizeDomain(DISTRIBUTION(), address(6));
|
36
|
+
_authorizeDomain(PRICE(), address(7));
|
37
|
+
_authorizeDomain(BUNDLE(), address(8));
|
38
|
+
_authorizeDomain(POOL(), address(9));
|
39
|
+
_authorizeDomain(ORACLE(), address(10));
|
40
|
+
_authorizeDomain(RISK(), address(11));
|
41
|
+
_authorizeDomain(POLICY(), address(12));
|
42
|
+
_authorizeDomain(CLAIM(), address(13));
|
43
|
+
_authorizeDomain(APPLICATION(), address(14));
|
43
44
|
}
|
44
45
|
|
45
46
|
|
@@ -50,6 +51,7 @@ contract ServiceAuthorizationV3
|
|
50
51
|
_setupIRegistryServiceAuthorization();
|
51
52
|
_setupStakingServiceAuthorization();
|
52
53
|
_setupInstanceServiceAuthorization();
|
54
|
+
_setupAccountingServiceAuthorization();
|
53
55
|
_setupComponentServiceAuthorization();
|
54
56
|
_setupDistributionServiceAuthorization();
|
55
57
|
_setupPoolServiceAuthorization();
|
@@ -67,27 +69,21 @@ contract ServiceAuthorizationV3
|
|
67
69
|
functions = _authorizeForService(REGISTRY(), APPLICATION());
|
68
70
|
_authorize(functions, IRegistryService.registerPolicy.selector, "registerPolicy");
|
69
71
|
|
70
|
-
// functions = _authorizeForService(REGISTRY(), POOL());
|
71
|
-
// _authorize(functions, IRegistryService.registerPool.selector, "registerPool");
|
72
|
-
|
73
72
|
functions = _authorizeForService(REGISTRY(), BUNDLE());
|
74
73
|
_authorize(functions, IRegistryService.registerBundle.selector, "registerBundle");
|
75
74
|
|
75
|
+
functions = _authorizeForService(REGISTRY(), COMPONENT());
|
76
|
+
_authorize(functions, IRegistryService.registerProduct.selector, "registerProduct");
|
77
|
+
_authorize(functions, IRegistryService.registerProductLinkedComponent.selector, "registerProductLinkedComponent");
|
78
|
+
|
76
79
|
functions = _authorizeForService(REGISTRY(), DISTRIBUTION());
|
77
|
-
// _authorize(functions, IRegistryService.registerDistribution.selector, "registerDistribution");
|
78
80
|
_authorize(functions, IRegistryService.registerDistributor.selector, "registerDistributor");
|
79
81
|
|
80
|
-
functions = _authorizeForService(REGISTRY(), COMPONENT());
|
81
|
-
_authorize(functions, IRegistryService.registerComponent.selector, "registerComponent");
|
82
|
-
|
83
82
|
functions = _authorizeForService(REGISTRY(), INSTANCE());
|
84
83
|
_authorize(functions, IRegistryService.registerInstance.selector, "registerInstance");
|
85
84
|
|
86
85
|
functions = _authorizeForService(REGISTRY(), STAKING());
|
87
86
|
_authorize(functions, IRegistryService.registerStake.selector, "registerStake");
|
88
|
-
|
89
|
-
// functions = _authorizeForService(REGISTRY(), PRODUCT());
|
90
|
-
// _authorize(functions, IRegistryService.registerProduct.selector, "registerProduct");
|
91
87
|
}
|
92
88
|
|
93
89
|
|
@@ -118,11 +114,37 @@ contract ServiceAuthorizationV3
|
|
118
114
|
/// @dev Instance service function authorization.
|
119
115
|
function _setupInstanceServiceAuthorization()
|
120
116
|
internal
|
117
|
+
{
|
118
|
+
}
|
119
|
+
|
120
|
+
/// @dev Accounting service function authorization.
|
121
|
+
function _setupAccountingServiceAuthorization()
|
122
|
+
internal
|
121
123
|
{
|
122
124
|
IAccess.FunctionInfo[] storage functions;
|
123
125
|
|
124
|
-
functions = _authorizeForService(
|
125
|
-
_authorize(functions,
|
126
|
+
functions = _authorizeForService(ACCOUNTING(), BUNDLE());
|
127
|
+
_authorize(functions, IAccountingService.increaseBundleBalance.selector, "increaseBundleBalance");
|
128
|
+
_authorize(functions, IAccountingService.decreaseBundleBalance.selector, "decreaseBundleBalance");
|
129
|
+
|
130
|
+
functions = _authorizeForService(ACCOUNTING(), COMPONENT());
|
131
|
+
_authorize(functions, IAccountingService.decreaseComponentFees.selector, "decreaseComponentFees");
|
132
|
+
|
133
|
+
functions = _authorizeForService(ACCOUNTING(), DISTRIBUTION());
|
134
|
+
_authorize(functions, IAccountingService.increaseDistributionBalance.selector, "increaseDistributionBalance");
|
135
|
+
_authorize(functions, IAccountingService.decreaseDistributionBalance.selector, "decreaseDistributionBalance");
|
136
|
+
_authorize(functions, IAccountingService.increaseDistributorBalance.selector, "increaseDistributorBalance");
|
137
|
+
_authorize(functions, IAccountingService.decreaseDistributorBalance.selector, "decreaseDistributorBalance");
|
138
|
+
|
139
|
+
functions = _authorizeForService(ACCOUNTING(), POLICY());
|
140
|
+
_authorize(functions, IAccountingService.increaseProductFees.selector, "increaseProductFees");
|
141
|
+
|
142
|
+
functions = _authorizeForService(ACCOUNTING(), POOL());
|
143
|
+
_authorize(functions, IAccountingService.increasePoolBalance.selector, "increasePoolBalance");
|
144
|
+
_authorize(functions, IAccountingService.decreasePoolBalance.selector, "decreasePoolBalance");
|
145
|
+
_authorize(functions, IAccountingService.increaseBundleBalanceForPool.selector, "increaseBundleBalanceForPool");
|
146
|
+
_authorize(functions, IAccountingService.decreaseBundleBalanceForPool.selector, "decreaseBundleBalanceForPool");
|
147
|
+
|
126
148
|
}
|
127
149
|
|
128
150
|
|
@@ -130,27 +152,6 @@ contract ServiceAuthorizationV3
|
|
130
152
|
function _setupComponentServiceAuthorization()
|
131
153
|
internal
|
132
154
|
{
|
133
|
-
// authz.authorizations = new DomainAuthorization[](4);
|
134
|
-
|
135
|
-
// authz.authorizations[0].domain = POLICY();
|
136
|
-
// _functions = new IAccessAdmin.Function[](1);
|
137
|
-
// __authorize(ComponentService.increaseProductFees.selector, "increaseProductFees"));
|
138
|
-
// authz.authorizations[0].functions = _functions;
|
139
|
-
|
140
|
-
// authz.authorizations[1].domain = DISTRIBUTION();
|
141
|
-
// _functions = new IAccessAdmin.Function[](1);
|
142
|
-
// __authorize(ComponentService.increaseDistributionBalance.selector, "increaseDistributionBalance"));
|
143
|
-
// authz.authorizations[1].functions = _functions;
|
144
|
-
|
145
|
-
// authz.authorizations[2].domain = POOL();
|
146
|
-
// _functions = new IAccessAdmin.Function[](1);
|
147
|
-
// __authorize(ComponentService.increasePoolBalance.selector, "increasePoolBalance"));
|
148
|
-
// authz.authorizations[2].functions = _functions;
|
149
|
-
|
150
|
-
// authz.authorizations[3].domain = BUNDLE();
|
151
|
-
// _functions = new IAccessAdmin.Function[](1);
|
152
|
-
// __authorize(ComponentService.increaseBundleBalance.selector, "increaseBundleBalance"));
|
153
|
-
// authz.authorizations[3].functions = _functions;
|
154
155
|
}
|
155
156
|
|
156
157
|
/// @dev Distribution service function authorization.
|
@@ -174,11 +175,10 @@ contract ServiceAuthorizationV3
|
|
174
175
|
functions = _authorizeForService(POOL(), POLICY());
|
175
176
|
_authorize(functions, IPoolService.lockCollateral.selector, "lockCollateral");
|
176
177
|
_authorize(functions, IPoolService.releaseCollateral.selector, "releaseCollateral");
|
177
|
-
_authorize(functions, IPoolService.reduceCollateral.selector, "reduceCollateral");
|
178
178
|
_authorize(functions, IPoolService.processSale.selector, "processSale");
|
179
179
|
|
180
180
|
functions = _authorizeForService(POOL(), CLAIM());
|
181
|
-
_authorize(functions, IPoolService.
|
181
|
+
_authorize(functions, IPoolService.processPayout.selector, "processPayout");
|
182
182
|
}
|
183
183
|
|
184
184
|
|
@@ -189,11 +189,19 @@ contract ServiceAuthorizationV3
|
|
189
189
|
IAccess.FunctionInfo[] storage functions;
|
190
190
|
|
191
191
|
functions = _authorizeForService(BUNDLE(), POOL());
|
192
|
-
_authorize(functions, IBundleService.
|
192
|
+
_authorize(functions, IBundleService.stake.selector, "stake");
|
193
|
+
_authorize(functions, IBundleService.unstake.selector, "unstake");
|
193
194
|
_authorize(functions, IBundleService.close.selector, "close");
|
194
195
|
_authorize(functions, IBundleService.lockCollateral.selector, "lockCollateral");
|
195
196
|
_authorize(functions, IBundleService.releaseCollateral.selector, "releaseCollateral");
|
196
|
-
|
197
|
+
|
198
|
+
functions = _authorizeForService(BUNDLE(), ALL());
|
199
|
+
_authorize(functions, IBundleService.create.selector, "create");
|
200
|
+
_authorize(functions, IBundleService.extend.selector, "extend");
|
201
|
+
_authorize(functions, IBundleService.lock.selector, "lock");
|
202
|
+
_authorize(functions, IBundleService.unlock.selector, "unlock");
|
203
|
+
_authorize(functions, IBundleService.setFee.selector, "setFee");
|
204
|
+
_authorize(functions, IBundleService.withdrawBundleFees.selector, "withdrawBundleFees");
|
197
205
|
}
|
198
206
|
}
|
199
207
|
|
@@ -4,16 +4,15 @@ pragma solidity ^0.8.20;
|
|
4
4
|
import {AccessManagedUpgradeable} from "@openzeppelin/contracts-upgradeable/access/manager/AccessManagedUpgradeable.sol";
|
5
5
|
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
6
6
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
7
|
-
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
8
7
|
|
9
|
-
import {Amount
|
8
|
+
import {Amount} from "../type/Amount.sol";
|
10
9
|
import {IComponent} from "./IComponent.sol";
|
11
10
|
import {IComponents} from "../instance/module/IComponents.sol";
|
12
|
-
import {
|
13
|
-
import {
|
11
|
+
import {IComponentService} from "./IComponentService.sol";
|
12
|
+
import {NftId} from "../type/NftId.sol";
|
13
|
+
import {ObjectType, COMPONENT} from "../type/ObjectType.sol";
|
14
14
|
import {Registerable} from "../shared/Registerable.sol";
|
15
15
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
16
|
-
import {VersionPartLib} from "../type/Version.sol";
|
17
16
|
|
18
17
|
abstract contract Component is
|
19
18
|
AccessManagedUpgradeable,
|
@@ -26,9 +25,9 @@ abstract contract Component is
|
|
26
25
|
struct ComponentStorage {
|
27
26
|
string _name; // unique (per instance) component name
|
28
27
|
IERC20Metadata _token; // token for this component
|
29
|
-
address _wallet;
|
30
28
|
bool _isInterceptor;
|
31
29
|
bytes _data;
|
30
|
+
IComponentService _componentService;
|
32
31
|
}
|
33
32
|
|
34
33
|
|
@@ -39,12 +38,6 @@ abstract contract Component is
|
|
39
38
|
_;
|
40
39
|
}
|
41
40
|
|
42
|
-
modifier onlyNftOwner(NftId nftId) {
|
43
|
-
if(msg.sender != getRegistry().ownerOf(nftId)) {
|
44
|
-
revert ErrorNftOwnableNotOwner(msg.sender);
|
45
|
-
}
|
46
|
-
_;
|
47
|
-
}
|
48
41
|
|
49
42
|
function _getComponentStorage() private pure returns (ComponentStorage storage $) {
|
50
43
|
assembly {
|
@@ -52,6 +45,7 @@ abstract contract Component is
|
|
52
45
|
}
|
53
46
|
}
|
54
47
|
|
48
|
+
|
55
49
|
function _initializeComponent(
|
56
50
|
address authority,
|
57
51
|
address registry,
|
@@ -68,9 +62,6 @@ abstract contract Component is
|
|
68
62
|
virtual
|
69
63
|
onlyInitializing()
|
70
64
|
{
|
71
|
-
_initializeRegisterable(registry, parentNftId, componentType, isInterceptor, initialOwner, registryData);
|
72
|
-
__AccessManaged_init(authority);
|
73
|
-
|
74
65
|
if (token == address(0)) {
|
75
66
|
revert ErrorComponentTokenAddressZero();
|
76
67
|
}
|
@@ -79,94 +70,51 @@ abstract contract Component is
|
|
79
70
|
revert ErrorComponentNameLengthZero();
|
80
71
|
}
|
81
72
|
|
73
|
+
_initializeRegisterable(
|
74
|
+
registry,
|
75
|
+
parentNftId,
|
76
|
+
componentType,
|
77
|
+
isInterceptor,
|
78
|
+
initialOwner,
|
79
|
+
registryData);
|
80
|
+
|
81
|
+
__AccessManaged_init(authority);
|
82
|
+
|
82
83
|
// set component state
|
83
84
|
ComponentStorage storage $ = _getComponentStorage();
|
84
85
|
$._name = name;
|
85
86
|
$._token = IERC20Metadata(token);
|
86
|
-
$._wallet = address(this);
|
87
87
|
$._isInterceptor = isInterceptor;
|
88
88
|
$._data = componentData;
|
89
|
+
$._componentService = IComponentService(_getServiceAddress(COMPONENT()));
|
89
90
|
|
90
91
|
_registerInterface(type(IAccessManaged).interfaceId);
|
91
92
|
_registerInterface(type(IComponent).interfaceId);
|
92
93
|
}
|
93
94
|
|
94
95
|
|
95
|
-
function
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
function approveTokenHandler(address token, Amount spendingLimitAmount)
|
104
|
-
public
|
105
|
-
virtual
|
106
|
-
onlyOwner
|
107
|
-
{
|
108
|
-
if(getWallet() != address(this)) {
|
109
|
-
revert ErrorComponentWalletNotComponent();
|
110
|
-
}
|
111
|
-
|
112
|
-
emit LogComponentTokenHandlerApproved(address(getTokenHandler()), spendingLimitAmount);
|
113
|
-
|
114
|
-
IERC20Metadata(token).approve(
|
115
|
-
address(getTokenHandler()),
|
116
|
-
spendingLimitAmount.toInt());
|
117
|
-
}
|
118
|
-
|
119
|
-
function setWallet(address newWallet)
|
120
|
-
external
|
121
|
-
virtual
|
122
|
-
override
|
123
|
-
onlyOwner
|
124
|
-
{
|
125
|
-
// checks
|
126
|
-
address currentWallet = getWallet();
|
127
|
-
uint256 currentBalance = getToken().balanceOf(currentWallet);
|
128
|
-
|
129
|
-
// effects
|
130
|
-
_setWallet(newWallet);
|
131
|
-
|
132
|
-
// interactions
|
133
|
-
if (currentBalance > 0) {
|
134
|
-
// move tokens from old to new wallet
|
135
|
-
emit LogComponentWalletTokensTransferred(currentWallet, newWallet, currentBalance);
|
136
|
-
|
137
|
-
if (currentWallet == address(this)) {
|
138
|
-
// transfer from the component requires an allowance
|
139
|
-
getTokenHandler().distributeTokens(currentWallet, newWallet, AmountLib.toAmount(currentBalance));
|
140
|
-
} else {
|
141
|
-
getTokenHandler().collectTokens(currentWallet, newWallet, AmountLib.toAmount(currentBalance));
|
142
|
-
}
|
143
|
-
}
|
144
|
-
}
|
145
|
-
|
146
|
-
|
147
|
-
/// @dev callback function for nft mints
|
148
|
-
/// may only be called by chain nft contract.
|
149
|
-
/// override internal function _nftMint to implement custom behaviour
|
150
|
-
function nftMint(address to, uint256 tokenId)
|
151
|
-
external
|
152
|
-
onlyChainNft
|
153
|
-
{
|
154
|
-
_nftMint(to, tokenId);
|
155
|
-
}
|
96
|
+
// function setWallet(address newWallet)
|
97
|
+
// external
|
98
|
+
// virtual
|
99
|
+
// override
|
100
|
+
// onlyOwner
|
101
|
+
// {
|
102
|
+
// _setWallet(newWallet);
|
103
|
+
// }
|
156
104
|
|
157
105
|
/// @dev callback function for nft transfers
|
158
106
|
/// may only be called by chain nft contract.
|
159
107
|
/// override internal function _nftTransferFrom to implement custom behaviour
|
160
|
-
function nftTransferFrom(address from, address to, uint256 tokenId)
|
108
|
+
function nftTransferFrom(address from, address to, uint256 tokenId, address operator)
|
161
109
|
external
|
162
110
|
onlyChainNft
|
163
111
|
{
|
164
|
-
_nftTransferFrom(from, to, tokenId);
|
112
|
+
_nftTransferFrom(from, to, tokenId, operator);
|
165
113
|
}
|
166
114
|
|
167
115
|
|
168
116
|
function getWallet() public view virtual returns (address walletAddress) {
|
169
|
-
return
|
117
|
+
return getTokenHandler().getWallet();
|
170
118
|
}
|
171
119
|
|
172
120
|
function getTokenHandler() public virtual view returns (TokenHandler tokenHandler) {
|
@@ -210,16 +158,22 @@ abstract contract Component is
|
|
210
158
|
}
|
211
159
|
|
212
160
|
|
213
|
-
/// @dev
|
214
|
-
///
|
215
|
-
|
161
|
+
/// @dev Approves token hanlder to spend up to the specified amount of tokens.
|
162
|
+
/// Reverts if component wallet is not token handler itself.
|
163
|
+
/// Only component owner (nft holder) is authorizes to call this function.
|
164
|
+
function _approveTokenHandler(IERC20Metadata token, Amount amount)
|
216
165
|
internal
|
217
166
|
virtual
|
218
|
-
{
|
167
|
+
{
|
168
|
+
_getComponentStorage()._componentService.approveTokenHandler(
|
169
|
+
token,
|
170
|
+
amount);
|
171
|
+
}
|
172
|
+
|
219
173
|
|
220
174
|
/// @dev internal function for nft transfers.
|
221
175
|
/// handling logic that deals with nft transfers need to overwrite this function
|
222
|
-
function _nftTransferFrom(address from, address to, uint256 tokenId)
|
176
|
+
function _nftTransferFrom(address from, address to, uint256 tokenId, address operator)
|
223
177
|
internal
|
224
178
|
virtual
|
225
179
|
{ }
|
@@ -227,21 +181,20 @@ abstract contract Component is
|
|
227
181
|
|
228
182
|
/// @dev depending on the source of the component information this function needs to be overwritten.
|
229
183
|
/// eg for instance linked components that externally store this information with the instance store contract
|
230
|
-
function _setWallet(
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
if (newWallet == currentWallet) {
|
239
|
-
revert ErrorComponentWalletAddressIsSameAsCurrent();
|
240
|
-
}
|
241
|
-
|
242
|
-
$._wallet = newWallet;
|
243
|
-
emit LogComponentWalletAddressChanged(currentWallet, newWallet);
|
184
|
+
function _setWallet(
|
185
|
+
address newWallet
|
186
|
+
)
|
187
|
+
internal
|
188
|
+
virtual
|
189
|
+
{
|
190
|
+
_getComponentStorage()._componentService.setWallet(newWallet);
|
191
|
+
}
|
244
192
|
|
193
|
+
function _setLocked(bool locked)
|
194
|
+
internal
|
195
|
+
virtual
|
196
|
+
{
|
197
|
+
_getComponentStorage()._componentService.setLockedFromComponent(address(this), locked);
|
245
198
|
}
|
246
199
|
|
247
200
|
|
@@ -252,17 +205,15 @@ abstract contract Component is
|
|
252
205
|
|
253
206
|
return IComponents.ComponentInfo({
|
254
207
|
name: $._name,
|
255
|
-
productNftId: NftIdLib.zero(),
|
256
208
|
token: $._token,
|
257
209
|
tokenHandler: TokenHandler(address(0)),
|
258
|
-
wallet: $._wallet, // initial wallet address
|
259
210
|
data: $._data // user specific component data
|
260
211
|
});
|
261
212
|
}
|
262
213
|
|
263
|
-
|
264
|
-
|
265
|
-
|
214
|
+
/// @dev returns the service address for the specified domain
|
215
|
+
/// gets address via lookup from registry using the major version form the linked instance
|
216
|
+
function _getServiceAddress(ObjectType domain) internal view returns (address) {
|
217
|
+
return getRegistry().getServiceAddress(domain, getRelease());
|
266
218
|
}
|
267
|
-
|
268
219
|
}
|