@etherisc/gif-next 0.0.2-d13bb9e-069 → 0.0.2-d1ee1ae-450
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +81 -7
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1023 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +752 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +791 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +504 -244
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.json +24 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +673 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +202 -5
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +277 -20
- 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 +400 -189
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +143 -19
- 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/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 +184 -301
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +265 -31
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +103 -185
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +354 -163
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +133 -75
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +90 -167
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +209 -70
- 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 +196 -226
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +265 -31
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +420 -348
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +262 -32
- 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 +259 -266
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +644 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +156 -175
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +311 -228
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +644 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +756 -331
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +644 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +193 -45
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +236 -39
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +144 -93
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +284 -62
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +738 -325
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +209 -94
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +720 -305
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +170 -169
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +79 -59
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +800 -623
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +853 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +46 -5
- 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 +142 -183
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +247 -33
- 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 +104 -116
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +69 -11
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +118 -135
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +167 -81
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +113 -51
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +137 -182
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +265 -31
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +174 -328
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +95 -109
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +90 -141
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +112 -163
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +210 -247
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +125 -181
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +472 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +385 -391
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +143 -77
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +205 -47
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +98 -48
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +265 -223
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +265 -31
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +288 -173
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +118 -88
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +131 -9
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +170 -19
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +139 -54
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +117 -43
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +242 -195
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +86 -6
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +257 -184
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +727 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +125 -83
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +192 -130
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +93 -67
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +255 -213
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +167 -67
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +102 -48
- 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 +107 -26
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +144 -41
- 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/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 +151 -62
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +606 -446
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +878 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +181 -74
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +78 -44
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +1954 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +47 -6
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +426 -258
- 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 +15 -15
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +94 -93
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +449 -535
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +106 -84
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +55 -2
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +573 -4
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.json +24 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.json +30 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.json +40 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +81 -75
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +394 -300
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +104 -116
- 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/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +148 -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 +55 -2
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +2 -2
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +117 -134
- 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 +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +152 -38
- 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 +55 -2
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +327 -73
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +484 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +88 -24
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +170 -117
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +155 -23
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +276 -200
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +469 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +46 -5
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +108 -58
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +41 -73
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +222 -62
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +95 -49
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +205 -150
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +60 -50
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +11 -11
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +2 -2
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +2 -2
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +94 -38
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +4 -0
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +33 -0
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +23 -4
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +33 -31
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +69 -7
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +79 -15
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +21 -2
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +2 -2
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/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/Timestamp.sol/TimestampLib.json +2 -2
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +61 -37
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -21
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +101 -2
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +54 -22
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +15 -2
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/accounting/AccountingService.sol +261 -0
- package/contracts/accounting/AccountingServiceManager.sol +38 -0
- package/contracts/accounting/IAccountingService.sol +45 -0
- package/contracts/authorization/AccessAdmin.sol +342 -230
- package/contracts/authorization/AccessAdminLib.sol +183 -0
- package/contracts/authorization/AccessManagerCloneable.sol +146 -4
- package/contracts/authorization/Authorization.sol +350 -206
- package/contracts/authorization/IAccess.sol +13 -4
- package/contracts/authorization/IAccessAdmin.sol +69 -34
- package/contracts/authorization/IAuthorization.sol +33 -7
- package/contracts/authorization/IServiceAuthorization.sol +3 -1
- package/contracts/authorization/ServiceAuthorization.sol +26 -10
- package/contracts/distribution/BasicDistribution.sol +20 -17
- package/contracts/distribution/BasicDistributionAuthorization.sol +22 -9
- package/contracts/distribution/Distribution.sol +39 -88
- package/contracts/distribution/DistributionService.sol +150 -95
- package/contracts/distribution/DistributionServiceManager.sol +1 -1
- package/contracts/distribution/IDistributionComponent.sol +1 -10
- package/contracts/distribution/IDistributionService.sol +22 -20
- package/contracts/examples/fire/FirePool.sol +24 -13
- package/contracts/examples/fire/FirePoolAuthorization.sol +2 -1
- package/contracts/examples/fire/FireProduct.sol +74 -51
- package/contracts/examples/fire/FireProductAuthorization.sol +3 -3
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +43 -12
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +8 -12
- package/contracts/examples/unpermissioned/SimplePool.sol +36 -10
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +51 -29
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BundleSet.sol +42 -38
- package/contracts/instance/IInstance.sol +60 -17
- package/contracts/instance/IInstanceService.sol +27 -31
- package/contracts/instance/Instance.sol +116 -40
- package/contracts/instance/InstanceAdmin.sol +282 -120
- package/contracts/instance/InstanceAuthorizationV3.sol +91 -59
- package/contracts/instance/InstanceReader.sol +187 -32
- package/contracts/instance/InstanceService.sol +187 -190
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/InstanceStore.sol +13 -2
- package/contracts/instance/RiskSet.sol +118 -0
- package/contracts/instance/base/BalanceStore.sol +3 -5
- package/contracts/instance/base/ObjectCounter.sol +1 -2
- package/contracts/instance/base/ObjectLifecycle.sol +4 -2
- package/contracts/instance/base/ObjectSet.sol +31 -33
- package/contracts/instance/base/ObjectSetHelperLib.sol +30 -0
- package/contracts/instance/module/IBundle.sol +6 -5
- package/contracts/instance/module/IComponents.sol +26 -12
- package/contracts/instance/module/IDistribution.sol +21 -8
- package/contracts/instance/module/IPolicy.sol +28 -7
- package/contracts/instance/module/IRisk.sol +5 -0
- package/contracts/oracle/BasicOracle.sol +1 -4
- package/contracts/oracle/BasicOracleAuthorization.sol +3 -12
- package/contracts/oracle/IOracle.sol +9 -4
- package/contracts/oracle/IOracleService.sol +2 -1
- package/contracts/oracle/Oracle.sol +5 -18
- package/contracts/oracle/OracleService.sol +111 -82
- package/contracts/oracle/OracleServiceManager.sol +1 -1
- package/contracts/pool/BasicPool.sol +32 -25
- package/contracts/pool/BasicPoolAuthorization.sol +27 -9
- package/contracts/pool/BundleService.sol +88 -154
- package/contracts/pool/BundleServiceManager.sol +1 -1
- package/contracts/pool/IBundleService.sol +15 -43
- package/contracts/pool/IPoolComponent.sol +1 -7
- package/contracts/pool/IPoolService.sol +58 -64
- package/contracts/pool/Pool.sol +112 -122
- package/contracts/pool/PoolLib.sol +309 -0
- package/contracts/pool/PoolService.sol +280 -256
- package/contracts/pool/PoolServiceManager.sol +1 -1
- package/contracts/product/ApplicationService.sol +43 -16
- package/contracts/product/ApplicationServiceManager.sol +1 -1
- package/contracts/product/BasicProduct.sol +9 -13
- package/contracts/product/BasicProductAuthorization.sol +26 -11
- package/contracts/product/ClaimService.sol +210 -151
- package/contracts/product/ClaimServiceManager.sol +1 -1
- package/contracts/product/IApplicationService.sol +8 -2
- package/contracts/product/IClaimService.sol +14 -2
- package/contracts/product/IPolicyService.sol +26 -11
- package/contracts/product/IPricingService.sol +10 -9
- package/contracts/product/IProductComponent.sol +10 -1
- package/contracts/product/IRiskService.sol +7 -7
- package/contracts/product/PolicyService.sol +246 -292
- package/contracts/product/PolicyServiceLib.sol +119 -0
- package/contracts/product/PolicyServiceManager.sol +1 -1
- package/contracts/product/PricingService.sol +37 -28
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +101 -64
- package/contracts/product/RiskService.sol +92 -31
- package/contracts/product/RiskServiceManager.sol +1 -1
- package/contracts/registry/ChainNft.sol +10 -11
- package/contracts/registry/IRegistry.sol +18 -18
- package/contracts/registry/IRegistryService.sol +6 -4
- package/contracts/registry/IRelease.sol +29 -0
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +29 -6
- package/contracts/registry/RegistryAdmin.sol +145 -351
- package/contracts/registry/RegistryAuthorization.sol +271 -0
- package/contracts/registry/RegistryService.sol +40 -58
- package/contracts/registry/RegistryServiceManager.sol +1 -1
- package/contracts/registry/ReleaseAdmin.sol +253 -0
- package/contracts/registry/ReleaseLifecycle.sol +8 -3
- package/contracts/registry/ReleaseRegistry.sol +271 -245
- package/contracts/registry/ServiceAuthorizationV3.sol +182 -48
- package/contracts/registry/TokenRegistry.sol +10 -9
- package/contracts/shared/Component.sol +61 -119
- package/contracts/shared/ComponentService.sol +391 -371
- package/contracts/shared/ComponentServiceManager.sol +1 -1
- package/contracts/shared/ComponentVerifyingService.sol +27 -15
- package/contracts/shared/ContractLib.sol +312 -3
- package/contracts/shared/IComponent.sol +5 -17
- package/contracts/shared/IComponentService.sol +42 -40
- package/contracts/shared/IInstanceLinkedComponent.sol +3 -22
- package/contracts/shared/ILifecycle.sol +3 -1
- package/contracts/shared/INftOwnable.sol +2 -0
- package/contracts/shared/IRegisterable.sol +23 -1
- package/contracts/shared/IService.sol +3 -5
- package/contracts/shared/InitializableERC165.sol +9 -1
- package/contracts/shared/InstanceLinkedComponent.sol +68 -45
- package/contracts/shared/KeyValueStore.sol +1 -1
- package/contracts/shared/Lifecycle.sol +15 -4
- package/contracts/shared/NftOwnable.sol +27 -7
- package/contracts/shared/PolicyHolder.sol +1 -1
- package/contracts/shared/Registerable.sol +50 -19
- package/contracts/shared/RegistryLinked.sol +7 -13
- package/contracts/shared/Service.sol +9 -31
- package/contracts/shared/TokenHandler.sol +275 -72
- package/contracts/shared/TokenHandlerDeployerLib.sol +10 -2
- package/contracts/staking/IStaking.sol +23 -12
- package/contracts/staking/IStakingService.sol +19 -4
- package/contracts/staking/Staking.sol +103 -51
- package/contracts/staking/{StakeManagerLib.sol → StakingLib.sol} +80 -23
- package/contracts/staking/StakingReader.sol +18 -21
- package/contracts/staking/StakingService.sol +84 -24
- package/contracts/staking/StakingServiceManager.sol +5 -4
- package/contracts/staking/StakingStore.sol +2 -1
- package/contracts/type/Fee.sol +8 -8
- package/contracts/type/Key32.sol +2 -2
- package/contracts/type/Key32Set.sol +62 -0
- package/contracts/type/NftId.sol +6 -0
- package/contracts/type/ObjectType.sol +54 -35
- package/contracts/type/RiskId.sol +26 -8
- package/contracts/type/RoleId.sol +23 -15
- package/contracts/type/Selector.sol +5 -0
- package/contracts/type/StateId.sol +14 -1
- package/contracts/type/Timestamp.sol +0 -5
- package/contracts/type/UFixed.sol +34 -127
- package/contracts/type/Version.sol +54 -5
- package/contracts/upgradeability/ProxyManager.sol +13 -10
- package/contracts/upgradeability/UpgradableProxyWithAdmin.sol +7 -1
- package/package.json +5 -4
- 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/instance/module/IAccess.sol/IAccess.dbg.json +0 -4
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +0 -129
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +0 -39
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -440
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +0 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +0 -16
- package/contracts/authorization/IModuleAuthorization.sol +0 -21
- package/contracts/authorization/ModuleAuthorization.sol +0 -78
- package/contracts/instance/module/IAccess.sol +0 -46
- package/contracts/shared/InitializableCustom.sol +0 -177
@@ -1,168 +1,183 @@
|
|
1
1
|
// SPDX-License-Identifier: UNLICENSED
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {
|
5
|
-
|
6
|
-
import {AccessAdmin} from "../authorization/AccessAdmin.sol";
|
7
|
-
import {AccessManagerCloneable} from "../authorization/AccessManagerCloneable.sol";
|
8
|
-
import {IAccessAdmin} from "../authorization/IAccessAdmin.sol";
|
4
|
+
import {IAccess} from "../authorization/IAccess.sol";
|
9
5
|
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
10
|
-
import {
|
11
|
-
import {IModuleAuthorization} from "../authorization/IModuleAuthorization.sol";
|
6
|
+
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
12
7
|
import {IRegistry} from "../registry/IRegistry.sol";
|
13
8
|
import {IInstance} from "./IInstance.sol";
|
14
|
-
|
15
|
-
import {
|
16
|
-
import {
|
9
|
+
|
10
|
+
import {AccessAdmin} from "../authorization/AccessAdmin.sol";
|
11
|
+
import {AccessManagerCloneable} from "../authorization/AccessManagerCloneable.sol";
|
12
|
+
import {NftId} from "../type/NftId.sol";
|
13
|
+
import {ObjectType, INSTANCE, ORACLE} from "../type/ObjectType.sol";
|
14
|
+
import {RoleId, RoleIdLib} from "../type/RoleId.sol";
|
17
15
|
import {Str, StrLib} from "../type/String.sol";
|
18
16
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
19
|
-
import {VersionPart} from "../type/Version.sol";
|
17
|
+
import {VersionPart, VersionPartLib} from "../type/Version.sol";
|
20
18
|
|
21
19
|
|
22
20
|
contract InstanceAdmin is
|
23
21
|
AccessAdmin
|
24
22
|
{
|
25
23
|
string public constant INSTANCE_TARGET_NAME = "Instance";
|
26
|
-
string public constant INSTANCE_STORE_TARGET_NAME = "InstanceStore";
|
27
24
|
string public constant INSTANCE_ADMIN_TARGET_NAME = "InstanceAdmin";
|
25
|
+
string public constant INSTANCE_STORE_TARGET_NAME = "InstanceStore";
|
28
26
|
string public constant BUNDLE_SET_TARGET_NAME = "BundleSet";
|
27
|
+
string public constant RISK_SET_TARGET_NAME = "RiskSet";
|
29
28
|
|
30
29
|
uint64 public constant CUSTOM_ROLE_ID_MIN = 10000; // MUST be even
|
31
30
|
|
32
|
-
error
|
33
|
-
|
31
|
+
error ErrorInstanceAdminNotInstanceService(address caller);
|
32
|
+
|
33
|
+
error ErrorInstanceAdminNotRegistered(address instance);
|
34
|
+
error ErrorInstanceAdminNotInstance(address instance);
|
35
|
+
error ErrorInstanceAdminAlreadyAuthorized(address instance);
|
36
|
+
|
37
|
+
error ErrorInstanceAdminNotComponentRole(RoleId roleId);
|
38
|
+
error ErrorInstanceAdminRoleAlreadyExists(RoleId roleId);
|
39
|
+
error ErrorInstanceAdminRoleTypeNotContract(RoleId roleId, IAccess.RoleType roleType);
|
40
|
+
|
34
41
|
error ErrorInstanceAdminReleaseMismatch();
|
35
42
|
error ErrorInstanceAdminExpectedTargetMissing(string targetName);
|
36
43
|
|
37
|
-
IInstance _instance;
|
44
|
+
IInstance internal _instance;
|
38
45
|
IRegistry internal _registry;
|
39
|
-
|
46
|
+
VersionPart internal _release;
|
47
|
+
uint64 internal _customIdNext;
|
48
|
+
|
49
|
+
mapping(address target => RoleId roleId) internal _targetRoleId;
|
50
|
+
uint64 internal _components;
|
40
51
|
|
41
|
-
|
52
|
+
modifier onlyInstanceService() {
|
53
|
+
if (msg.sender != _registry.getServiceAddress(INSTANCE(), getRelease())) {
|
54
|
+
revert ErrorInstanceAdminNotInstanceService(msg.sender);
|
55
|
+
}
|
56
|
+
_;
|
57
|
+
}
|
42
58
|
|
43
59
|
/// @dev Only used for master instance admin.
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
AccessAdmin()
|
49
|
-
{
|
50
|
-
_instanceAuthorization = instanceAuthorization;
|
60
|
+
constructor(address accessManager) {
|
61
|
+
initialize(
|
62
|
+
accessManager,
|
63
|
+
"MasterInstanceAdmin");
|
51
64
|
}
|
52
65
|
|
53
|
-
|
54
|
-
///
|
55
|
-
///
|
56
|
-
/// Important:
|
57
|
-
function
|
58
|
-
|
59
|
-
|
66
|
+
|
67
|
+
/// @dev Completes the initialization of this instance admin using the provided instance, registry and version.
|
68
|
+
/// Important: Initialization of instance admin is only complete after calling this function.
|
69
|
+
/// Important: The instance MUST be registered and all instance supporting contracts must be wired to this instance.
|
70
|
+
function completeSetup(
|
71
|
+
address registry,
|
72
|
+
address instance,
|
73
|
+
address authorization,
|
74
|
+
VersionPart release
|
60
75
|
)
|
61
76
|
external
|
62
|
-
|
77
|
+
reinitializer(uint64(release.toInt()))
|
78
|
+
onlyDeployer()
|
63
79
|
{
|
64
|
-
//
|
65
|
-
|
80
|
+
// checks
|
81
|
+
_checkRegistry(registry);
|
82
|
+
_checkIsRegistered(registry, instance, INSTANCE());
|
66
83
|
|
67
|
-
|
68
|
-
|
84
|
+
AccessManagerCloneable(
|
85
|
+
authority()).completeSetup(
|
86
|
+
registry,
|
87
|
+
release);
|
69
88
|
|
70
|
-
|
71
|
-
_instanceAuthorization = IModuleAuthorization(instanceAuthorization);
|
72
|
-
}
|
89
|
+
_checkAuthorization(authorization, INSTANCE(), release, true);
|
73
90
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
{
|
78
|
-
if (address(_registry) != address(0) && !_registry.isRegistered(target)) {
|
79
|
-
revert ErrorInstanceAdminNotRegistered(target);
|
80
|
-
}
|
91
|
+
// effects
|
92
|
+
_registry = IRegistry(registry);
|
93
|
+
_release = release;
|
81
94
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
95
|
+
_instance = IInstance(instance);
|
96
|
+
_authorization = IAuthorization(authorization);
|
97
|
+
_components = 0;
|
98
|
+
_customIdNext = CUSTOM_ROLE_ID_MIN;
|
86
99
|
|
87
|
-
|
88
|
-
|
89
|
-
function initializeInstanceAuthorization(address instanceAddress)
|
90
|
-
external
|
91
|
-
{
|
92
|
-
_checkTargetIsReadyForAuthorization(instanceAddress);
|
100
|
+
// link nft ownability to instance
|
101
|
+
_linkToNftOwnable(instance);
|
93
102
|
|
94
|
-
|
95
|
-
|
96
|
-
_registry = _instance.getRegistry();
|
97
|
-
|
98
|
-
// check matching releases
|
99
|
-
if (_instanceAuthorization.getRelease() != _instance.getMajorVersion()) {
|
100
|
-
revert ErrorInstanceAdminReleaseMismatch();
|
101
|
-
}
|
103
|
+
// create instance role and target
|
104
|
+
_setupInstance(instance);
|
102
105
|
|
103
106
|
// add instance authorization
|
104
|
-
_createRoles(
|
105
|
-
|
106
|
-
|
107
|
+
_createRoles(_authorization);
|
108
|
+
// _createTargets(_authorization);
|
109
|
+
_setupInstanceHelperTargetsWithRoles();
|
110
|
+
_createTargetAuthorizations(_authorization);
|
111
|
+
}
|
107
112
|
|
108
|
-
|
109
|
-
|
113
|
+
|
114
|
+
function _createTargets(IAuthorization authorization)
|
115
|
+
internal
|
116
|
+
{
|
117
|
+
_createTargetWithRole(address(this), INSTANCE_ADMIN_TARGET_NAME, authorization.getTargetRole(StrLib.toStr(INSTANCE_ADMIN_TARGET_NAME)));
|
118
|
+
_createTargetWithRole(address(_instance.getInstanceStore()), INSTANCE_STORE_TARGET_NAME, authorization.getTargetRole(StrLib.toStr(INSTANCE_STORE_TARGET_NAME)));
|
119
|
+
_createTargetWithRole(address(_instance.getBundleSet()), BUNDLE_SET_TARGET_NAME, authorization.getTargetRole(StrLib.toStr(BUNDLE_SET_TARGET_NAME)));
|
120
|
+
_createTargetWithRole(address(_instance.getRiskSet()), RISK_SET_TARGET_NAME, authorization.getTargetRole(StrLib.toStr(RISK_SET_TARGET_NAME)));
|
110
121
|
}
|
111
122
|
|
112
123
|
|
113
124
|
/// @dev Initializes the authorization for the specified component.
|
114
125
|
/// Important: The component MUST be registered.
|
115
126
|
function initializeComponentAuthorization(
|
116
|
-
|
117
|
-
|
127
|
+
address componentAddress,
|
128
|
+
ObjectType expectedType
|
118
129
|
)
|
119
130
|
external
|
131
|
+
restricted()
|
120
132
|
{
|
121
|
-
|
133
|
+
// checks
|
134
|
+
_checkIsRegistered(address(getRegistry()), componentAddress, expectedType);
|
135
|
+
|
136
|
+
IInstanceLinkedComponent component = IInstanceLinkedComponent(componentAddress);
|
137
|
+
IAuthorization authorization = component.getAuthorization();
|
138
|
+
_checkAuthorization(address(authorization), expectedType, getRelease(), false);
|
122
139
|
|
140
|
+
// effects
|
141
|
+
// setup target and role for component (including token handler if applicable)
|
142
|
+
_setupComponentAndTokenHandler(component, expectedType);
|
143
|
+
|
144
|
+
// create other roles and function authorizations
|
123
145
|
_createRoles(authorization);
|
146
|
+
_createTargetAuthorizations(authorization);
|
147
|
+
}
|
148
|
+
|
149
|
+
function getRelease()
|
150
|
+
public
|
151
|
+
view
|
152
|
+
override
|
153
|
+
returns (VersionPart release)
|
154
|
+
{
|
155
|
+
return _release;
|
156
|
+
}
|
157
|
+
|
158
|
+
|
159
|
+
// create instance role and target
|
160
|
+
function _setupInstance(address instance) internal {
|
124
161
|
|
125
|
-
// create
|
162
|
+
// create instance role
|
163
|
+
RoleId instanceRoleId = _authorization.getTargetRole(
|
164
|
+
_authorization.getMainTarget());
|
165
|
+
|
166
|
+
_createRole(
|
167
|
+
instanceRoleId,
|
168
|
+
_authorization.getRoleInfo(instanceRoleId));
|
169
|
+
|
170
|
+
// create instance target
|
126
171
|
_createTarget(
|
127
|
-
|
128
|
-
|
172
|
+
instance,
|
173
|
+
_authorization.getMainTargetName(),
|
129
174
|
true, // checkAuthority
|
130
175
|
false); // custom
|
131
176
|
|
132
|
-
|
133
|
-
address(component.getTokenHandler()),
|
134
|
-
string(abi.encodePacked(authorization.getTargetName(), "TH")),
|
135
|
-
true,
|
136
|
-
false);
|
137
|
-
|
138
|
-
// FIXME: make this a bit nicer and work with IAuthorization. Use a specific role, not public - access to TokenHandler must be restricted
|
139
|
-
FunctionInfo[] memory functions = new FunctionInfo[](3);
|
140
|
-
functions[0] = toFunction(TokenHandler.collectTokens.selector, "collectTokens");
|
141
|
-
functions[1] = toFunction(TokenHandler.collectTokensToThreeRecipients.selector, "collectTokensToThreeRecipients");
|
142
|
-
functions[2] = toFunction(TokenHandler.distributeTokens.selector, "distributeTokens");
|
143
|
-
|
144
|
-
_authorizeTargetFunctions(
|
145
|
-
address(component.getTokenHandler()),
|
146
|
-
getPublicRole(),
|
147
|
-
functions);
|
148
|
-
|
177
|
+
// assign instance role to instance
|
149
178
|
_grantRoleToAccount(
|
150
|
-
|
151
|
-
|
152
|
-
address(component));
|
153
|
-
|
154
|
-
_createTargetAuthorizations(authorization);
|
155
|
-
}
|
156
|
-
|
157
|
-
|
158
|
-
function _grantComponentOwnerRoles()
|
159
|
-
internal
|
160
|
-
{
|
161
|
-
address instanceOwner = _registry.ownerOf(_instance.getNftId());
|
162
|
-
_grantRoleToAccount(DISTRIBUTION_OWNER_ROLE(), instanceOwner);
|
163
|
-
_grantRoleToAccount(ORACLE_OWNER_ROLE(), instanceOwner);
|
164
|
-
_grantRoleToAccount(POOL_OWNER_ROLE(), instanceOwner);
|
165
|
-
_grantRoleToAccount(PRODUCT_OWNER_ROLE(), instanceOwner);
|
179
|
+
instanceRoleId,
|
180
|
+
instance);
|
166
181
|
}
|
167
182
|
|
168
183
|
/// @dev Creates a custom role
|
@@ -184,13 +199,144 @@ contract InstanceAdmin is
|
|
184
199
|
_grantRoleToAccount(roleId, account);
|
185
200
|
}
|
186
201
|
|
202
|
+
|
203
|
+
function setInstanceLocked(bool locked)
|
204
|
+
external
|
205
|
+
// not restricted(): need to operate on locked instances to unlock instance
|
206
|
+
onlyInstanceService()
|
207
|
+
{
|
208
|
+
AccessManagerCloneable accessManager = AccessManagerCloneable(authority());
|
209
|
+
accessManager.setLocked(locked);
|
210
|
+
}
|
211
|
+
|
212
|
+
|
213
|
+
function setTargetLocked(address target, bool locked)
|
214
|
+
external
|
215
|
+
// not restricted(): might need to operate on targets while instance is locked
|
216
|
+
onlyInstanceService()
|
217
|
+
{
|
218
|
+
_setTargetLocked(target, locked);
|
219
|
+
}
|
220
|
+
|
221
|
+
|
222
|
+
function setComponentLocked(address target, bool locked)
|
223
|
+
external
|
224
|
+
restricted()
|
225
|
+
{
|
226
|
+
_setTargetLocked(target, locked);
|
227
|
+
}
|
228
|
+
|
229
|
+
/// @dev Returns the number of components that have been registered with this instance.
|
230
|
+
function components()
|
231
|
+
external
|
232
|
+
view
|
233
|
+
returns (uint64)
|
234
|
+
{
|
235
|
+
return _components;
|
236
|
+
}
|
237
|
+
|
187
238
|
/// @dev Returns the instance authorization specification used to set up this instance admin.
|
188
239
|
function getInstanceAuthorization()
|
189
240
|
external
|
190
241
|
view
|
191
|
-
returns (
|
242
|
+
returns (IAuthorization instanceAuthorizaion)
|
243
|
+
{
|
244
|
+
return _authorization;
|
245
|
+
}
|
246
|
+
|
247
|
+
// ------------------- Internal functions ------------------- //
|
248
|
+
|
249
|
+
function _setupComponentAndTokenHandler(
|
250
|
+
IInstanceLinkedComponent component,
|
251
|
+
ObjectType componentType
|
252
|
+
)
|
253
|
+
internal
|
254
|
+
{
|
255
|
+
|
256
|
+
IAuthorization authorization = component.getAuthorization();
|
257
|
+
string memory targetName = authorization.getMainTargetName();
|
258
|
+
|
259
|
+
// create component role and target
|
260
|
+
RoleId componentRoleId = _createComponentRoleId(component, authorization);
|
261
|
+
|
262
|
+
// create component's target
|
263
|
+
_createTarget(
|
264
|
+
address(component),
|
265
|
+
targetName,
|
266
|
+
true, // checkAuthority
|
267
|
+
false); // custom
|
268
|
+
|
269
|
+
// create component's token handler target if app
|
270
|
+
if (componentType != ORACLE()) {
|
271
|
+
NftId componentNftId = _registry.getNftIdForAddress(address(component));
|
272
|
+
address tokenHandler = address(
|
273
|
+
_instance.getInstanceReader().getComponentInfo(
|
274
|
+
componentNftId).tokenHandler);
|
275
|
+
|
276
|
+
_createTarget(
|
277
|
+
tokenHandler,
|
278
|
+
authorization.getTokenHandlerName(),
|
279
|
+
true,
|
280
|
+
false);
|
281
|
+
|
282
|
+
// token handler does not require its own role
|
283
|
+
// token handler is not calling other components
|
284
|
+
}
|
285
|
+
|
286
|
+
// assign component role to component
|
287
|
+
_grantRoleToAccount(
|
288
|
+
componentRoleId,
|
289
|
+
address(component));
|
290
|
+
}
|
291
|
+
|
292
|
+
|
293
|
+
function _createComponentRoleId(
|
294
|
+
IInstanceLinkedComponent component,
|
295
|
+
IAuthorization authorization
|
296
|
+
)
|
297
|
+
internal
|
298
|
+
returns (RoleId componentRoleId)
|
192
299
|
{
|
193
|
-
|
300
|
+
// checks
|
301
|
+
// check component is not yet authorized
|
302
|
+
if (_targetRoleId[address(component)].gtz()) {
|
303
|
+
revert ErrorInstanceAdminAlreadyAuthorized(address(component));
|
304
|
+
}
|
305
|
+
|
306
|
+
// check generic component role
|
307
|
+
RoleId genericComponentRoleId = authorization.getTargetRole(
|
308
|
+
authorization.getMainTarget());
|
309
|
+
|
310
|
+
if (!genericComponentRoleId.isComponentRole()) {
|
311
|
+
revert ErrorInstanceAdminNotComponentRole(genericComponentRoleId);
|
312
|
+
}
|
313
|
+
|
314
|
+
// check component role does not exist
|
315
|
+
componentRoleId = toComponentRole(
|
316
|
+
genericComponentRoleId,
|
317
|
+
_components);
|
318
|
+
|
319
|
+
if (roleExists(componentRoleId)) {
|
320
|
+
revert ErrorInstanceAdminRoleAlreadyExists(componentRoleId);
|
321
|
+
}
|
322
|
+
|
323
|
+
// check role info
|
324
|
+
IAccess.RoleInfo memory roleInfo = authorization.getRoleInfo(
|
325
|
+
genericComponentRoleId);
|
326
|
+
|
327
|
+
if (roleInfo.roleType != IAccess.RoleType.Contract) {
|
328
|
+
revert ErrorInstanceAdminRoleTypeNotContract(
|
329
|
+
componentRoleId,
|
330
|
+
roleInfo.roleType);
|
331
|
+
}
|
332
|
+
|
333
|
+
// effects
|
334
|
+
_targetRoleId[address(component)] = componentRoleId;
|
335
|
+
_components++;
|
336
|
+
|
337
|
+
_createRole(
|
338
|
+
componentRoleId,
|
339
|
+
roleInfo);
|
194
340
|
}
|
195
341
|
|
196
342
|
|
@@ -198,13 +344,18 @@ contract InstanceAdmin is
|
|
198
344
|
internal
|
199
345
|
{
|
200
346
|
RoleId[] memory roles = authorization.getRoles();
|
347
|
+
RoleId mainTargetRoleId = authorization.getTargetRole(
|
348
|
+
authorization.getMainTarget());
|
349
|
+
|
201
350
|
RoleId roleId;
|
202
351
|
RoleInfo memory roleInfo;
|
203
352
|
|
204
353
|
for(uint256 i = 0; i < roles.length; i++) {
|
354
|
+
|
205
355
|
roleId = roles[i];
|
206
356
|
|
207
|
-
if
|
357
|
+
// skip main target role, create role if not exists
|
358
|
+
if (roleId != mainTargetRoleId && !roleExists(roleId)) {
|
208
359
|
_createRole(
|
209
360
|
roleId,
|
210
361
|
authorization.getRoleInfo(roleId));
|
@@ -213,6 +364,16 @@ contract InstanceAdmin is
|
|
213
364
|
}
|
214
365
|
|
215
366
|
|
367
|
+
function toComponentRole(RoleId roleId, uint64 componentIdx)
|
368
|
+
internal
|
369
|
+
pure
|
370
|
+
returns (RoleId)
|
371
|
+
{
|
372
|
+
return RoleIdLib.toRoleId(
|
373
|
+
RoleIdLib.toInt(roleId) + componentIdx);
|
374
|
+
}
|
375
|
+
|
376
|
+
|
216
377
|
function _createTargetAuthorizations(IAuthorization authorization)
|
217
378
|
internal
|
218
379
|
{
|
@@ -245,7 +406,7 @@ contract InstanceAdmin is
|
|
245
406
|
{
|
246
407
|
// check that target name is defined in authorization specification
|
247
408
|
Str name = StrLib.toStr(targetName);
|
248
|
-
if (!
|
409
|
+
if (!_authorization.targetExists(name)) {
|
249
410
|
revert ErrorInstanceAdminExpectedTargetMissing(targetName);
|
250
411
|
}
|
251
412
|
|
@@ -253,28 +414,29 @@ contract InstanceAdmin is
|
|
253
414
|
_createTarget(
|
254
415
|
target,
|
255
416
|
targetName,
|
256
|
-
false, // check authority TODO check normal targets, don't check service targets (they share authority with
|
417
|
+
false, // check authority TODO check normal targets, don't check service targets (they share authority with release admin)
|
257
418
|
false);
|
258
419
|
|
259
420
|
// assign target role if defined
|
260
|
-
RoleId targetRoleId =
|
421
|
+
RoleId targetRoleId = _authorization.getTargetRole(name);
|
261
422
|
if (targetRoleId != RoleIdLib.zero()) {
|
262
423
|
_grantRoleToAccount(targetRoleId, target);
|
263
424
|
}
|
264
425
|
}
|
265
426
|
|
266
|
-
function
|
427
|
+
function _setupInstanceHelperTargetsWithRoles()
|
267
428
|
internal
|
268
429
|
{
|
430
|
+
|
269
431
|
// create module targets
|
270
|
-
_checkAndCreateTargetWithRole(address(_instance), INSTANCE_TARGET_NAME);
|
271
432
|
_checkAndCreateTargetWithRole(address(_instance.getInstanceStore()), INSTANCE_STORE_TARGET_NAME);
|
272
433
|
_checkAndCreateTargetWithRole(address(_instance.getInstanceAdmin()), INSTANCE_ADMIN_TARGET_NAME);
|
273
434
|
_checkAndCreateTargetWithRole(address(_instance.getBundleSet()), BUNDLE_SET_TARGET_NAME);
|
435
|
+
_checkAndCreateTargetWithRole(address(_instance.getRiskSet()), RISK_SET_TARGET_NAME);
|
274
436
|
|
275
|
-
// create targets for services that need to access the
|
276
|
-
ObjectType[] memory serviceDomains =
|
277
|
-
VersionPart release =
|
437
|
+
// create targets for services that need to access the instance targets
|
438
|
+
ObjectType[] memory serviceDomains = _authorization.getServiceDomains();
|
439
|
+
VersionPart release = _authorization.getRelease();
|
278
440
|
ObjectType serviceDomain;
|
279
441
|
|
280
442
|
for (uint256 i = 0; i < serviceDomains.length; i++) {
|
@@ -282,7 +444,7 @@ contract InstanceAdmin is
|
|
282
444
|
|
283
445
|
_checkAndCreateTargetWithRole(
|
284
446
|
_registry.getServiceAddress(serviceDomain, release),
|
285
|
-
|
447
|
+
_authorization.getServiceTarget(serviceDomain).toString());
|
286
448
|
}
|
287
449
|
}
|
288
450
|
}
|