@etherisc/gif-next 0.0.2-d16f92c-416 → 0.0.2-d18e1c5-511
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +130 -8
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1075 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +790 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +843 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +1664 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +1289 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +1403 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +790 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.json +10 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/{shared → authorization}/IAccessAdmin.sol/IAccessAdmin.json +525 -342
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +455 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +397 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +646 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +1234 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +805 -0
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +139 -616
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +754 -323
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +228 -124
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +145 -282
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +535 -78
- 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 +1474 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +805 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +2043 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +805 -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/flight/FlightLib.sol/FlightLib.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightLib.sol/FlightLib.json +408 -0
- package/artifacts/contracts/examples/flight/FlightOracle.sol/FlightOracle.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightOracle.sol/FlightOracle.json +1198 -0
- package/artifacts/contracts/examples/flight/FlightOracleAuthorization.sol/FlightOracleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightOracleAuthorization.sol/FlightOracleAuthorization.json +805 -0
- package/artifacts/contracts/examples/flight/FlightPool.sol/FlightPool.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightPool.sol/FlightPool.json +1466 -0
- package/artifacts/contracts/examples/flight/FlightPoolAuthorization.sol/FlightPoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightPoolAuthorization.sol/FlightPoolAuthorization.json +805 -0
- package/artifacts/contracts/examples/flight/FlightProduct.sol/FlightProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightProduct.sol/FlightProduct.json +2185 -0
- package/artifacts/contracts/examples/flight/FlightProductAuthorization.sol/FlightProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightProductAuthorization.sol/FlightProductAuthorization.json +805 -0
- package/artifacts/contracts/examples/flight/FlightUSD.sol/FlightUSD.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/FlightUSD.sol/FlightUSD.json +376 -0
- package/artifacts/contracts/examples/flight/originalV1.sol/FlightDelayChainlink.dbg.json +4 -0
- package/artifacts/contracts/examples/flight/originalV1.sol/FlightDelayChainlink.json +901 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +1429 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +805 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +1161 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +1637 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +805 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +2575 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +805 -0
- package/artifacts/contracts/instance/BaseStore.sol/BaseStore.dbg.json +4 -0
- package/artifacts/contracts/{shared/IKeyValueStore.sol/IKeyValueStore.json → instance/BaseStore.sol/BaseStore.json} +59 -195
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +4 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +851 -0
- package/artifacts/contracts/instance/IBaseStore.sol/IBaseStore.dbg.json +4 -0
- package/artifacts/contracts/instance/IBaseStore.sol/IBaseStore.json +304 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +580 -80
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +398 -75
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +590 -218
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1889 -313
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +837 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +1760 -840
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +392 -274
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +141 -127
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +1298 -1857
- package/artifacts/contracts/instance/ProductStore.sol/ProductStore.dbg.json +4 -0
- package/artifacts/contracts/instance/ProductStore.sol/ProductStore.json +3427 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +866 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +8 -8
- 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 +4 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +223 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +192 -0
- 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/mock/Dip.sol/Dip.json +2 -2
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +947 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +805 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.json +43 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +142 -139
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +98 -11
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +140 -423
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +198 -190
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +177 -97
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +1232 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +805 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +569 -265
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +216 -104
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +383 -53
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +147 -406
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +711 -340
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +144 -694
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +522 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +925 -545
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +230 -106
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +353 -180
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +159 -99
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +1149 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +805 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +466 -245
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +187 -123
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +301 -9
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +350 -18
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +417 -101
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +183 -80
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +282 -271
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +4 -0
- package/artifacts/contracts/{shared/ComponentVerifyingService.sol/ComponentVerifyingService.json → product/IRiskService.sol/IRiskService.json} +283 -157
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +532 -311
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +783 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +196 -108
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +249 -329
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +165 -137
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +316 -606
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +4 -0
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +873 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +774 -0
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +59 -16
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +384 -69
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +97 -148
- 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 +617 -133
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +796 -537
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +1074 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +136 -290
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +141 -89
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +2152 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +205 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +1389 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +523 -27
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +120 -60
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +86 -287
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +609 -569
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +197 -131
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +632 -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/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 +92 -103
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +535 -240
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +131 -139
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +34 -3
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.json +35 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +15 -47
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +167 -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 +84 -2
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +4 -0
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.json +53 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +125 -376
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +42 -62
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +4 -0
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +306 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +41 -57
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +19 -141
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +141 -97
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -15
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +86 -111
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +585 -12
- 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 +4 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +172 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1513 -204
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +235 -123
- package/artifacts/contracts/staking/ITargetLimitHandler.sol/ITargetLimitHandler.dbg.json +4 -0
- package/artifacts/contracts/staking/ITargetLimitHandler.sol/ITargetLimitHandler.json +50 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +1635 -465
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +470 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +191 -105
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +295 -183
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +282 -281
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +144 -96
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +1637 -801
- package/artifacts/contracts/staking/TargetHandler.sol/TargetHandler.dbg.json +4 -0
- package/artifacts/contracts/staking/TargetHandler.sol/TargetHandler.json +309 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +184 -76
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.json +2 -2
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +63 -10
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +45 -19
- package/artifacts/contracts/type/ChainId.sol/ChainIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/ChainId.sol/ChainIdLib.json +193 -0
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +28 -4
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +4 -4
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +98 -37
- 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 +61 -9
- 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 +23 -4
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +4 -4
- package/artifacts/contracts/type/RequestIdSet.sol/RequestIdSet.dbg.json +4 -0
- package/artifacts/contracts/type/RequestIdSet.sol/RequestIdSet.json +33 -0
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +125 -7
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +79 -91
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +112 -2
- 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/String.sol/StrLib.json +69 -2
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +56 -5
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +126 -33
- 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 +120 -2
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +4 -0
- package/artifacts/contracts/{shared → upgradeability}/IVersionable.sol/IVersionable.json +11 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +656 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +142 -0
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +4 -0
- package/artifacts/contracts/{shared → upgradeability}/Versionable.sol/Versionable.json +11 -1
- package/contracts/accounting/AccountingService.sol +274 -0
- package/contracts/accounting/AccountingServiceManager.sol +38 -0
- package/contracts/accounting/IAccountingService.sol +47 -0
- package/contracts/authorization/AccessAdmin.sol +780 -0
- package/contracts/authorization/AccessAdminLib.sol +396 -0
- package/contracts/authorization/AccessManagerCloneable.sol +158 -0
- package/contracts/authorization/Authorization.sol +169 -0
- package/contracts/authorization/IAccess.sol +67 -0
- package/contracts/authorization/IAccessAdmin.sol +144 -0
- package/contracts/authorization/IAuthorization.sol +26 -0
- package/contracts/authorization/IServiceAuthorization.sol +78 -0
- package/contracts/authorization/ServiceAuthorization.sol +320 -0
- package/contracts/distribution/BasicDistribution.sol +140 -0
- package/contracts/distribution/BasicDistributionAuthorization.sol +67 -0
- package/contracts/distribution/Distribution.sol +125 -141
- package/contracts/distribution/DistributionService.sol +284 -133
- package/contracts/distribution/DistributionServiceManager.sol +8 -11
- package/contracts/distribution/IDistributionComponent.sol +21 -42
- package/contracts/distribution/IDistributionService.sol +60 -26
- package/contracts/examples/fire/DamageLevel.sol +59 -0
- package/contracts/examples/fire/FirePool.sol +86 -0
- package/contracts/examples/fire/FirePoolAuthorization.sol +35 -0
- package/contracts/examples/fire/FireProduct.sol +433 -0
- package/contracts/examples/fire/FireProductAuthorization.sol +45 -0
- package/contracts/examples/fire/FireUSD.sol +26 -0
- package/contracts/examples/flight/FlightLib.sol +279 -0
- package/contracts/examples/flight/FlightOracle.sol +167 -0
- package/contracts/examples/flight/FlightOracleAuthorization.sol +34 -0
- package/contracts/examples/flight/FlightPool.sol +89 -0
- package/contracts/examples/flight/FlightPoolAuthorization.sol +37 -0
- package/contracts/examples/flight/FlightProduct.sol +470 -0
- package/contracts/examples/flight/FlightProductAuthorization.sol +44 -0
- package/contracts/examples/flight/FlightUSD.sol +26 -0
- package/contracts/examples/flight/originalV1.sol +396 -0
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +81 -0
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +133 -0
- package/contracts/examples/unpermissioned/SimplePool.sol +102 -0
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +437 -0
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BaseStore.sol +93 -0
- package/contracts/instance/BundleSet.sol +130 -0
- package/contracts/instance/IBaseStore.sol +37 -0
- package/contracts/instance/IInstance.sol +118 -49
- package/contracts/instance/IInstanceService.sol +68 -46
- package/contracts/instance/Instance.sol +221 -133
- package/contracts/instance/InstanceAdmin.sol +297 -249
- package/contracts/instance/InstanceAuthorizationV3.sol +275 -0
- package/contracts/instance/InstanceReader.sol +498 -256
- package/contracts/instance/InstanceService.sol +340 -265
- package/contracts/instance/InstanceServiceManager.sol +8 -13
- package/contracts/instance/InstanceStore.sol +163 -109
- package/contracts/instance/ProductStore.sol +290 -0
- package/contracts/instance/RiskSet.sol +126 -0
- package/contracts/instance/TargetNames.sol +10 -0
- package/contracts/instance/base/BalanceStore.sol +4 -6
- package/contracts/instance/base/ObjectCounter.sol +1 -2
- package/contracts/instance/base/ObjectLifecycle.sol +109 -0
- package/contracts/instance/base/ObjectSet.sol +77 -0
- package/contracts/instance/base/ObjectSetHelperLib.sol +30 -0
- package/contracts/instance/module/IBundle.sol +6 -5
- package/contracts/instance/module/IComponents.sol +29 -21
- package/contracts/instance/module/IDistribution.sol +21 -9
- package/contracts/instance/module/IPolicy.sol +50 -29
- package/contracts/instance/module/IRisk.sol +5 -0
- package/contracts/mock/Dip.sol +1 -1
- package/contracts/oracle/BasicOracle.sol +44 -0
- package/contracts/oracle/BasicOracleAuthorization.sol +52 -0
- package/contracts/oracle/IOracle.sol +25 -4
- package/contracts/oracle/IOracleComponent.sol +2 -1
- package/contracts/oracle/IOracleService.sol +14 -13
- package/contracts/oracle/Oracle.sol +60 -53
- package/contracts/oracle/OracleService.sol +119 -87
- package/contracts/oracle/OracleServiceManager.sol +8 -11
- package/contracts/pool/BasicPool.sol +161 -0
- package/contracts/pool/BasicPoolAuthorization.sol +81 -0
- package/contracts/pool/BundleService.sol +222 -132
- package/contracts/pool/BundleServiceManager.sol +8 -11
- package/contracts/pool/IBundleService.sol +43 -33
- package/contracts/pool/IPoolComponent.sol +20 -70
- package/contracts/pool/IPoolService.sol +97 -77
- package/contracts/pool/Pool.sol +196 -164
- package/contracts/pool/PoolLib.sol +341 -0
- package/contracts/pool/PoolService.sol +419 -257
- package/contracts/pool/PoolServiceManager.sol +6 -9
- package/contracts/product/ApplicationService.sol +154 -81
- package/contracts/product/ApplicationServiceManager.sol +6 -6
- package/contracts/product/BasicProduct.sol +48 -0
- package/contracts/product/BasicProductAuthorization.sol +64 -0
- package/contracts/product/ClaimService.sol +391 -207
- package/contracts/product/ClaimServiceManager.sol +6 -6
- package/contracts/product/IApplicationService.sol +29 -3
- package/contracts/product/IClaimService.sol +48 -11
- package/contracts/product/IPolicyService.sol +61 -37
- package/contracts/product/IPricingService.sol +11 -10
- package/contracts/product/IProductComponent.sol +29 -9
- package/contracts/product/IRiskService.sol +48 -0
- package/contracts/product/PolicyService.sol +445 -275
- package/contracts/product/PolicyServiceLib.sol +139 -0
- package/contracts/product/PolicyServiceManager.sol +6 -9
- package/contracts/product/PricingService.sol +90 -84
- package/contracts/product/PricingServiceManager.sol +6 -9
- package/contracts/product/Product.sol +261 -147
- package/contracts/product/RiskService.sol +189 -0
- package/contracts/product/RiskServiceManager.sol +39 -0
- package/contracts/registry/ChainNft.sol +72 -40
- package/contracts/registry/IRegistry.sol +84 -36
- package/contracts/registry/IRegistryService.sol +3 -10
- package/contracts/registry/IRelease.sol +29 -0
- package/contracts/registry/ITransferInterceptor.sol +1 -2
- package/contracts/registry/Registry.sol +378 -224
- package/contracts/registry/RegistryAdmin.sol +119 -261
- package/contracts/registry/RegistryAuthorization.sol +336 -0
- package/contracts/registry/RegistryService.sol +42 -67
- package/contracts/registry/RegistryServiceManager.sol +5 -5
- package/contracts/registry/ReleaseAdmin.sol +195 -0
- package/contracts/registry/ReleaseLifecycle.sol +32 -0
- package/contracts/registry/ReleaseRegistry.sol +525 -0
- package/contracts/registry/ServiceAuthorizationV3.sol +213 -71
- package/contracts/registry/TokenRegistry.sol +61 -59
- package/contracts/shared/Component.sol +71 -142
- package/contracts/shared/ComponentService.sol +459 -385
- package/contracts/shared/ComponentServiceManager.sol +10 -7
- package/contracts/shared/ContractLib.sol +312 -0
- package/contracts/shared/IComponent.sol +6 -18
- package/contracts/shared/IComponentService.sol +50 -41
- package/contracts/shared/IInstanceLinkedComponent.sol +10 -26
- package/contracts/shared/ILifecycle.sol +3 -2
- package/contracts/shared/INftOwnable.sol +4 -0
- package/contracts/shared/IPolicyHolder.sol +12 -22
- package/contracts/shared/IRegisterable.sol +22 -1
- package/contracts/shared/IService.sol +4 -6
- package/contracts/shared/{ERC165.sol → InitializableERC165.sol} +11 -3
- package/contracts/shared/InstanceLinkedComponent.sol +145 -57
- package/contracts/shared/Lifecycle.sol +30 -72
- package/contracts/shared/{NftIdSetManager.sol → NftIdSet.sol} +1 -1
- package/contracts/shared/NftOwnable.sol +33 -11
- package/contracts/shared/PolicyHolder.sol +20 -59
- package/contracts/shared/Registerable.sol +52 -21
- package/contracts/shared/RegistryLinked.sol +9 -14
- package/contracts/shared/Service.sol +22 -38
- package/contracts/shared/TokenHandler.sol +310 -26
- package/contracts/shared/TokenHandlerDeployerLib.sol +20 -0
- package/contracts/staking/IStaking.sol +272 -73
- package/contracts/staking/IStakingService.sol +48 -74
- package/contracts/staking/ITargetLimitHandler.sol +17 -0
- package/contracts/staking/Staking.sol +534 -250
- package/contracts/staking/StakingLib.sol +195 -0
- package/contracts/staking/StakingManager.sol +14 -15
- package/contracts/staking/StakingReader.sol +72 -88
- package/contracts/staking/StakingService.sol +62 -152
- package/contracts/staking/StakingServiceManager.sol +9 -7
- package/contracts/staking/StakingStore.sol +1096 -341
- package/contracts/staking/TargetHandler.sol +132 -0
- package/contracts/staking/TargetManagerLib.sol +73 -46
- package/contracts/type/Amount.sol +31 -5
- package/contracts/type/Blocknumber.sol +22 -16
- package/contracts/type/ChainId.sol +101 -0
- package/contracts/type/ClaimId.sol +6 -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 +7 -0
- package/contracts/type/ObjectType.sol +91 -54
- package/contracts/type/PayoutId.sol +10 -10
- package/contracts/type/Referral.sol +7 -0
- package/contracts/type/RequestIdSet.sol +62 -0
- package/contracts/type/RiskId.sol +38 -6
- package/contracts/type/RoleId.sol +93 -114
- package/contracts/type/Seconds.sol +44 -1
- package/contracts/type/Selector.sol +5 -0
- package/contracts/type/StateId.sol +15 -1
- package/contracts/type/String.sol +42 -0
- package/contracts/type/Timestamp.sol +24 -8
- package/contracts/type/UFixed.sol +62 -125
- package/contracts/type/Version.sol +57 -6
- package/contracts/{shared → upgradeability}/IVersionable.sol +3 -0
- package/contracts/{shared → upgradeability}/ProxyManager.sol +96 -49
- package/contracts/upgradeability/UpgradableProxyWithAdmin.sol +24 -0
- package/contracts/{shared → upgradeability}/Versionable.sol +8 -5
- package/package.json +9 -6
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +0 -4
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +0 -709
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +0 -228
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +0 -4
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +0 -187
- 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/product/IProductService.sol/IProductService.dbg.json +0 -4
- package/artifacts/contracts/product/IProductService.sol/IProductService.json +0 -400
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +0 -4
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +0 -708
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +0 -4
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +0 -702
- package/artifacts/contracts/registry/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +0 -4
- package/artifacts/contracts/registry/IServiceAuthorization.sol/IServiceAuthorization.json +0 -129
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.dbg.json +0 -4
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +0 -1218
- package/artifacts/contracts/registry/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +0 -4
- package/artifacts/contracts/registry/ServiceAuthorization.sol/ServiceAuthorization.json +0 -171
- package/artifacts/contracts/shared/AccessAdmin.sol/AccessAdmin.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessAdmin.sol/AccessAdmin.json +0 -1559
- package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.json +0 -1193
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.json +0 -1747
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.json +0 -1760
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.json +0 -1838
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.json +0 -1856
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +0 -4
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +0 -4
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +0 -73
- package/artifacts/contracts/shared/IAccessAdmin.sol/IAccessAdmin.dbg.json +0 -4
- package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.dbg.json +0 -4
- package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.json +0 -1562
- package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.dbg.json +0 -4
- package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.json +0 -1600
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +0 -4
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +0 -39
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +0 -571
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.dbg.json +0 -4
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +0 -306
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +0 -4
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +0 -617
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +0 -4
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +0 -129
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -460
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +0 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +0 -10
- package/contracts/instance/BundleManager.sol +0 -126
- package/contracts/instance/InstanceAuthorizationsLib.sol +0 -377
- package/contracts/instance/base/ObjectManager.sol +0 -80
- package/contracts/instance/module/IAccess.sol +0 -46
- package/contracts/product/IProductService.sol +0 -33
- package/contracts/product/ProductService.sol +0 -124
- package/contracts/product/ProductServiceManager.sol +0 -42
- package/contracts/registry/IServiceAuthorization.sol +0 -35
- package/contracts/registry/ReleaseManager.sol +0 -527
- package/contracts/registry/ServiceAuthorization.sol +0 -86
- package/contracts/shared/AccessAdmin.sol +0 -759
- package/contracts/shared/AccessManagerCustom.sol +0 -741
- package/contracts/shared/AccessManagerExtended.sol +0 -481
- package/contracts/shared/AccessManagerExtendedInitializeable.sol +0 -13
- package/contracts/shared/AccessManagerExtendedWithDisable.sol +0 -137
- package/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol +0 -14
- package/contracts/shared/ComponentVerifyingService.sol +0 -117
- package/contracts/shared/IAccessAdmin.sol +0 -168
- package/contracts/shared/IAccessManagerExtended.sol +0 -74
- package/contracts/shared/IAccessManagerExtendedWithDisable.sol +0 -18
- package/contracts/shared/IKeyValueStore.sol +0 -53
- package/contracts/shared/InitializableCustom.sol +0 -177
- package/contracts/shared/KeyValueStore.sol +0 -127
- package/contracts/shared/UpgradableProxyWithAdmin.sol +0 -16
- package/contracts/staking/StakeManagerLib.sol +0 -231
@@ -1,331 +1,379 @@
|
|
1
|
-
// SPDX-License-Identifier:
|
1
|
+
// SPDX-License-Identifier: UNLICENSED
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
|
7
|
-
import {RoleId, RoleIdLib, ADMIN_ROLE, PUBLIC_ROLE, INSTANCE_SERVICE_ROLE, INSTANCE_OWNER_ROLE, INSTANCE_ROLE} from "../type/RoleId.sol";
|
8
|
-
import {TimestampLib} from "../type/Timestamp.sol";
|
9
|
-
import {NftId} from "../type/NftId.sol";
|
10
|
-
|
11
|
-
import {AccessManagerExtendedInitializeable} from "../shared/AccessManagerExtendedInitializeable.sol";
|
12
|
-
|
4
|
+
import {IAccess} from "../authorization/IAccess.sol";
|
5
|
+
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
6
|
+
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
13
7
|
import {IRegistry} from "../registry/IRegistry.sol";
|
14
|
-
|
15
8
|
import {IInstance} from "./IInstance.sol";
|
16
|
-
|
9
|
+
|
10
|
+
import {AccessAdmin} from "../authorization/AccessAdmin.sol";
|
11
|
+
import {AccessAdminLib} from "../authorization/AccessAdminLib.sol";
|
12
|
+
import {AccessManagerCloneable} from "../authorization/AccessManagerCloneable.sol";
|
13
|
+
import {ObjectType, INSTANCE} from "../type/ObjectType.sol";
|
14
|
+
import {RoleId, ADMIN_ROLE} from "../type/RoleId.sol";
|
15
|
+
import {Str} from "../type/String.sol";
|
16
|
+
import {VersionPart} from "../type/Version.sol";
|
17
|
+
import {INSTANCE_TARGET_NAME, INSTANCE_ADMIN_TARGET_NAME, INSTANCE_STORE_TARGET_NAME, PRODUCT_STORE_TARGET_NAME, BUNDLE_SET_TARGET_NAME, RISK_SET_TARGET_NAME} from "./TargetNames.sol";
|
18
|
+
|
17
19
|
|
18
20
|
contract InstanceAdmin is
|
19
|
-
|
21
|
+
AccessAdmin
|
20
22
|
{
|
21
|
-
|
23
|
+
// onlyInstanceService
|
24
|
+
error ErrorInstanceAdminNotInstanceService(address caller);
|
22
25
|
|
23
|
-
|
24
|
-
|
26
|
+
// authorizeFunctions
|
27
|
+
error ErrorInstanceAdminNotComponentOrCustomTarget(address target);
|
25
28
|
|
26
|
-
|
29
|
+
IInstance internal _instance;
|
30
|
+
IRegistry internal _registry;
|
31
|
+
VersionPart internal _release;
|
27
32
|
|
28
|
-
uint64
|
29
|
-
uint32 public constant EXECUTION_DELAY = 0;
|
33
|
+
uint64 internal _customRoleIdNext;
|
30
34
|
|
31
|
-
mapping(address target =>
|
32
|
-
|
33
|
-
uint64 _idNext;
|
35
|
+
mapping(address target => RoleId roleId) internal _targetRoleId;
|
36
|
+
uint64 internal _components;
|
34
37
|
|
35
|
-
AccessManagerExtendedInitializeable internal _accessManager;
|
36
|
-
address _instance;
|
37
|
-
IRegistry internal _registry;
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
IRegistry registry = instance.getRegistry();
|
45
|
-
address authority = instance.authority();
|
46
|
-
|
47
|
-
__AccessManaged_init(authority);
|
48
|
-
|
49
|
-
_accessManager = AccessManagerExtendedInitializeable(authority);
|
50
|
-
_instance = instanceAddress;
|
51
|
-
_registry = registry;
|
52
|
-
_idNext = CUSTOM_ROLE_ID_MIN;
|
53
|
-
|
54
|
-
// minimum configuration required for nft interception
|
55
|
-
_createRole(INSTANCE_ROLE(), INSTANCE_ROLE_NAME, IAccess.Type.Core);
|
56
|
-
_createRole(INSTANCE_OWNER_ROLE(), INSTANCE_OWNER_ROLE_NAME, IAccess.Type.Core);
|
57
|
-
_grantRole(INSTANCE_ROLE(), address(instance));
|
58
|
-
|
59
|
-
_createTarget(address(this), INSTANCE_ADMIN_TARGET_NAME, IAccess.Type.Core);
|
60
|
-
bytes4[] memory instanceAdminInstanceSelectors = new bytes4[](1);
|
61
|
-
instanceAdminInstanceSelectors[0] = this.transferInstanceOwnerRole.selector;
|
62
|
-
_setTargetFunctionRole(address(this), instanceAdminInstanceSelectors, INSTANCE_ROLE());
|
39
|
+
modifier onlyInstanceService() {
|
40
|
+
if (msg.sender != _registry.getServiceAddress(INSTANCE(), getRelease())) {
|
41
|
+
revert ErrorInstanceAdminNotInstanceService(msg.sender);
|
42
|
+
}
|
43
|
+
_;
|
63
44
|
}
|
64
45
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
function createCoreRole(RoleId roleId, string memory name) external restricted() {
|
71
|
-
_createRole(roleId, name, IAccess.Type.Core);
|
46
|
+
/// @dev Only used for master instance admin.
|
47
|
+
constructor(address accessManager) {
|
48
|
+
initialize(
|
49
|
+
accessManager,
|
50
|
+
"MasterInstanceAdmin");
|
72
51
|
}
|
73
52
|
|
74
|
-
// ADMIN_ROLE
|
75
|
-
// assume gif roles can be revoked
|
76
|
-
// assume admin is INSTANCE_OWNER_ROLE or INSTANCE_ROLE
|
77
|
-
function createGifRole(RoleId roleId, string memory name, RoleId admin) external restricted() {
|
78
|
-
_createRole(roleId, name, IAccess.Type.Gif);
|
79
|
-
_setRoleAdmin(roleId, admin);
|
80
|
-
}
|
81
53
|
|
82
|
-
|
83
|
-
|
84
|
-
|
54
|
+
/// @dev Completes the initialization of this instance admin using the provided instance, registry and version.
|
55
|
+
/// Important: Initialization of instance admin is only complete after calling this function.
|
56
|
+
/// Important: The instance MUST be registered and all instance supporting contracts must be wired to this instance.
|
57
|
+
function completeSetup(
|
58
|
+
address registry,
|
59
|
+
address authorization,
|
60
|
+
VersionPart release,
|
61
|
+
address instance
|
62
|
+
)
|
85
63
|
external
|
86
|
-
|
87
|
-
|
64
|
+
reinitializer(uint64(release.toInt()))
|
65
|
+
onlyDeployer()
|
88
66
|
{
|
89
|
-
|
67
|
+
// checks
|
68
|
+
AccessAdminLib.checkIsRegistered(registry, instance, INSTANCE());
|
90
69
|
|
91
|
-
|
92
|
-
|
70
|
+
AccessManagerCloneable(
|
71
|
+
authority()).completeSetup(
|
72
|
+
registry,
|
73
|
+
release);
|
93
74
|
|
94
|
-
|
95
|
-
_setRoleAdmin(admin, INSTANCE_OWNER_ROLE());
|
96
|
-
}
|
75
|
+
_checkAuthorization(authorization, INSTANCE(), release, false, true);
|
97
76
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
function setRoleAdmin(RoleId roleId, RoleId admin) public restricted() {
|
102
|
-
_setRoleAdmin(roleId, admin);
|
103
|
-
}
|
77
|
+
// effects
|
78
|
+
_registry = IRegistry(registry);
|
79
|
+
_release = release;
|
104
80
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
assert(_hasRole(INSTANCE_ROLE(), _instance));
|
110
|
-
assert(_getRoleAdmin(INSTANCE_OWNER_ROLE()).toInt() == ADMIN_ROLE().toInt());
|
111
|
-
if(from != address(0)) { // nft transfer
|
112
|
-
assert(_getRoleMembers(INSTANCE_OWNER_ROLE()) == 1);
|
113
|
-
} else { // nft minting
|
114
|
-
assert(_getRoleMembers(INSTANCE_OWNER_ROLE()) == 0);
|
115
|
-
}
|
81
|
+
_instance = IInstance(instance);
|
82
|
+
_authorization = IAuthorization(authorization);
|
83
|
+
_components = 0;
|
84
|
+
_customRoleIdNext = 0;
|
116
85
|
|
117
|
-
//
|
118
|
-
|
119
|
-
_grantRole(INSTANCE_OWNER_ROLE(), to);
|
120
|
-
if(from != address(0)) { // nft transfer
|
121
|
-
_revokeRole(INSTANCE_OWNER_ROLE(), from);
|
122
|
-
}
|
86
|
+
// link nft ownability to instance
|
87
|
+
_linkToNftOwnable(instance);
|
123
88
|
|
124
|
-
//
|
125
|
-
|
126
|
-
assert(_hasRole(INSTANCE_OWNER_ROLE(), to));
|
127
|
-
}
|
89
|
+
// setup instance targets
|
90
|
+
_createInstanceTargets(_authorization.getMainTargetName());
|
128
91
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
92
|
+
// setup non-contract roles
|
93
|
+
_setupServiceRoles(_authorization);
|
94
|
+
_createRoles(_authorization);
|
95
|
+
|
96
|
+
// authorize functions of instance contracts
|
97
|
+
_createTargetAuthorizations(_authorization);
|
134
98
|
}
|
135
99
|
|
136
|
-
// INSTANCE_SERVICE_ROLE
|
137
|
-
function createGifTarget(address target, string memory name) external restricted()
|
138
|
-
{
|
139
|
-
if(!_registry.isRegistered(target)) {
|
140
|
-
revert IAccess.ErrorIAccessTargetNotRegistered(target);
|
141
|
-
}
|
142
100
|
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
101
|
+
/// @dev grants the service roles to the service addresses based on the authorization specification.
|
102
|
+
/// Service addresses used for the granting are determined by the registry and the release of this instance.
|
103
|
+
function _setupServiceRoles(IAuthorization authorization)
|
104
|
+
internal
|
105
|
+
{
|
106
|
+
ObjectType[] memory serviceDomains = authorization.getServiceDomains();
|
107
|
+
|
108
|
+
for(uint256 i = 0; i < serviceDomains.length; i++) {
|
109
|
+
ObjectType serviceDomain = serviceDomains[i];
|
110
|
+
RoleId serviceRoleId = authorization.getServiceRole(serviceDomain);
|
111
|
+
string memory serviceRoleName = authorization.getRoleName(serviceRoleId);
|
112
|
+
|
113
|
+
// create service role if missing
|
114
|
+
if (!roleExists(serviceRoleId)) {
|
115
|
+
_createRole(
|
116
|
+
serviceRoleId,
|
117
|
+
AccessAdminLib.toRole(
|
118
|
+
ADMIN_ROLE(),
|
119
|
+
IAccess.RoleType.Contract,
|
120
|
+
1,
|
121
|
+
serviceRoleName));
|
122
|
+
}
|
123
|
+
|
124
|
+
// grant service role to service
|
125
|
+
address service = _registry.getServiceAddress(serviceDomain, _release);
|
126
|
+
_grantRoleToAccount(
|
127
|
+
serviceRoleId,
|
128
|
+
service);
|
147
129
|
}
|
148
|
-
|
149
|
-
_createTarget(target, name, IAccess.Type.Gif);
|
150
130
|
}
|
151
131
|
|
152
|
-
// INSTANCE_ROLE
|
153
|
-
// assume custom target.authority() is constant -> target MUST not be used with different instance access manager
|
154
|
-
// assume custom target can not be registered as component -> each service which is doing component registration MUST register a gif target
|
155
|
-
// assume custom target can not be registered as instance or service -> why?
|
156
|
-
// TODO check target associated with instance owner or instance or instance components or components helpers
|
157
|
-
function createTarget(address target, string memory name) external restricted() {
|
158
|
-
_createTarget(target, name, IAccess.Type.Custom);
|
159
|
-
}
|
160
|
-
|
161
|
-
// TODO instance owner locks component instead of revoking it access to the instance...
|
162
|
-
// INSTANCE_SERVICE_ROLE
|
163
|
-
function setTargetLockedByService(address target, bool locked) external restricted {
|
164
|
-
_setTargetLocked(target, locked);
|
165
|
-
}
|
166
132
|
|
167
|
-
|
168
|
-
|
169
|
-
|
133
|
+
function _createInstanceTargets(string memory instanceTargetName)
|
134
|
+
internal
|
135
|
+
{
|
136
|
+
_createManagedTarget(address(_instance), instanceTargetName, TargetType.Instance);
|
137
|
+
_createManagedTarget(address(this), INSTANCE_ADMIN_TARGET_NAME, TargetType.Instance);
|
138
|
+
_createManagedTarget(address(_instance.getInstanceStore()), INSTANCE_STORE_TARGET_NAME, TargetType.Instance);
|
139
|
+
_createManagedTarget(address(_instance.getProductStore()), PRODUCT_STORE_TARGET_NAME, TargetType.Instance);
|
140
|
+
_createManagedTarget(address(_instance.getBundleSet()), BUNDLE_SET_TARGET_NAME, TargetType.Instance);
|
141
|
+
_createManagedTarget(address(_instance.getRiskSet()), RISK_SET_TARGET_NAME, TargetType.Instance);
|
170
142
|
}
|
171
143
|
|
172
144
|
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
// INSTANCE_SERVICE_ROLE if used not only during initilization, works with:
|
182
|
-
// core roles for core targets
|
183
|
-
// gif roles for gif targets
|
184
|
-
function setTargetFunctionRoleByService(
|
185
|
-
string memory targetName,
|
186
|
-
bytes4[] calldata selectors,
|
187
|
-
RoleId roleId
|
188
|
-
)
|
189
|
-
public
|
190
|
-
virtual
|
191
|
-
restricted
|
145
|
+
/// @dev Initializes the authorization for the specified component.
|
146
|
+
/// Important: The component MUST be registered.
|
147
|
+
function initializeComponentAuthorization(
|
148
|
+
address componentAddress,
|
149
|
+
ObjectType expectedType
|
150
|
+
)
|
151
|
+
external
|
152
|
+
restricted()
|
192
153
|
{
|
193
|
-
|
194
|
-
|
195
|
-
if(_targetType[target] == IAccess.Type.Custom) {
|
196
|
-
revert IAccess.ErrorIAccessTargetTypeInvalid(target, IAccess.Type.Custom);
|
197
|
-
}
|
154
|
+
// checks
|
155
|
+
AccessAdminLib.checkIsRegistered(address(getRegistry()), componentAddress, expectedType);
|
198
156
|
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
157
|
+
IInstanceLinkedComponent component = IInstanceLinkedComponent(componentAddress);
|
158
|
+
IAuthorization authorization = component.getAuthorization();
|
159
|
+
_checkAuthorization(address(authorization), expectedType, getRelease(), false, false);
|
160
|
+
|
161
|
+
// effects
|
162
|
+
_createRoles(authorization);
|
163
|
+
_createManagedTarget(componentAddress, authorization.getMainTargetName(), TargetType.Component);
|
164
|
+
_createTargetAuthorizations(authorization);
|
203
165
|
|
204
|
-
|
166
|
+
// increase component count
|
167
|
+
_components++;
|
205
168
|
}
|
206
169
|
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
// TODO instance owner can mess with gif target (component) -> e.g. set custom role for function intendent to work with gif role
|
213
|
-
function setTargetFunctionRoleByInstance(
|
214
|
-
string memory targetName,
|
215
|
-
bytes4[] calldata selectors,
|
216
|
-
RoleId roleId// string memory roleName
|
217
|
-
)
|
218
|
-
public
|
219
|
-
virtual
|
220
|
-
restricted()
|
170
|
+
function getRelease()
|
171
|
+
public
|
172
|
+
view
|
173
|
+
override
|
174
|
+
returns (VersionPart release)
|
221
175
|
{
|
222
|
-
|
176
|
+
return _release;
|
177
|
+
}
|
223
178
|
|
224
|
-
// not core target
|
225
|
-
if(_targetType[target] == IAccess.Type.Core) {
|
226
|
-
revert IAccess.ErrorIAccessTargetTypeInvalid(target, IAccess.Type.Core);
|
227
|
-
}
|
228
179
|
|
229
|
-
|
230
|
-
|
231
|
-
|
180
|
+
/// @dev Creates a custom role.
|
181
|
+
function createRole(
|
182
|
+
string memory name,
|
183
|
+
RoleId adminRoleId,
|
184
|
+
uint32 maxMemberCount
|
185
|
+
)
|
186
|
+
external
|
187
|
+
restricted()
|
188
|
+
returns (RoleId roleId)
|
189
|
+
{
|
190
|
+
// check role does not yet exist
|
191
|
+
if (roleExists(name)) {
|
192
|
+
revert ErrorAccessAdminRoleAlreadyCreated(
|
193
|
+
getRoleForName(name),
|
194
|
+
name);
|
232
195
|
}
|
233
196
|
|
234
|
-
|
197
|
+
// create roleId
|
198
|
+
roleId = AccessAdminLib.getCustomRoleId(_customRoleIdNext++);
|
199
|
+
|
200
|
+
// create role
|
201
|
+
_createRole(
|
202
|
+
roleId,
|
203
|
+
AccessAdminLib.toRole(
|
204
|
+
adminRoleId,
|
205
|
+
IAccess.RoleType.Custom,
|
206
|
+
maxMemberCount,
|
207
|
+
name));
|
235
208
|
}
|
236
209
|
|
237
|
-
//--- Role internal view/pure functions --------------------------------------//
|
238
|
-
function _createRole(RoleId roleId, string memory name, IAccess.Type rtype) internal {
|
239
|
-
_validateRole(roleId, rtype);
|
240
210
|
|
241
|
-
|
242
|
-
|
211
|
+
/// @dev Activtes/pauses the specified role.
|
212
|
+
function setRoleActive(RoleId roleId, bool active)
|
213
|
+
external
|
214
|
+
restricted()
|
215
|
+
{
|
216
|
+
_setRoleActive(roleId, active);
|
243
217
|
}
|
244
218
|
|
245
|
-
function _validateRole(RoleId roleId, IAccess.Type rtype) internal pure
|
246
|
-
{
|
247
|
-
uint roleIdInt = roleId.toInt();
|
248
|
-
if(rtype == IAccess.Type.Custom && roleIdInt < CUSTOM_ROLE_ID_MIN) {
|
249
|
-
revert IAccess.ErrorIAccessRoleIdTooSmall(roleId);
|
250
|
-
}
|
251
219
|
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
220
|
+
/// @dev Grants the provided role to the specified account
|
221
|
+
function grantRole(
|
222
|
+
RoleId roleId,
|
223
|
+
address account)
|
224
|
+
external
|
225
|
+
restricted()
|
226
|
+
{
|
227
|
+
_grantRoleToAccount(roleId, account);
|
259
228
|
}
|
260
229
|
|
261
|
-
function _grantRole(RoleId roleId, address account) internal {
|
262
|
-
_accessManager.grantRole(roleId.toInt(), account, EXECUTION_DELAY);
|
263
|
-
}
|
264
230
|
|
265
|
-
|
266
|
-
|
231
|
+
/// @dev Revokes the provided role from the specified account
|
232
|
+
function revokeRole(
|
233
|
+
RoleId roleId,
|
234
|
+
address account)
|
235
|
+
external
|
236
|
+
restricted()
|
237
|
+
{
|
238
|
+
_revokeRoleFromAccount(roleId, account);
|
267
239
|
}
|
268
240
|
|
269
|
-
function _setRoleAdmin(RoleId roleId, RoleId admin) internal {
|
270
|
-
if(_roleType[roleId] == IAccess.Type.Core) {
|
271
|
-
revert IAccess.ErrorIAccessRoleTypeInvalid(roleId, IAccess.Type.Core);
|
272
|
-
}
|
273
241
|
|
274
|
-
|
242
|
+
/// @dev Create a new custom target.
|
243
|
+
/// The target needs to be an access managed contract.
|
244
|
+
function createTarget(
|
245
|
+
address target,
|
246
|
+
string memory name
|
247
|
+
)
|
248
|
+
external
|
249
|
+
restricted()
|
250
|
+
returns (RoleId contractRoleId)
|
251
|
+
{
|
252
|
+
return _createManagedTarget(
|
253
|
+
target,
|
254
|
+
name,
|
255
|
+
TargetType.Custom);
|
275
256
|
}
|
276
257
|
|
277
|
-
function _getRoleAdmin(RoleId roleId) internal view returns (RoleId admin) {
|
278
|
-
return RoleIdLib.toRoleId(_accessManager.getRoleAdmin(roleId.toInt()));
|
279
|
-
}
|
280
258
|
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
259
|
+
/// @dev Add function authorizations for the specified component or custom target.
|
260
|
+
function authorizeFunctions(
|
261
|
+
address target,
|
262
|
+
RoleId roleId,
|
263
|
+
IAccess.FunctionInfo[] memory functions
|
264
|
+
)
|
265
|
+
external
|
266
|
+
restricted()
|
267
|
+
{
|
268
|
+
_checkComponentOrCustomTarget(target);
|
269
|
+
_authorizeTargetFunctions(target, roleId, functions, true);
|
285
270
|
}
|
286
271
|
|
287
|
-
|
288
|
-
|
272
|
+
|
273
|
+
/// @dev Removes function authorizations for the specified component or custom target.
|
274
|
+
function unauthorizeFunctions(
|
275
|
+
address target,
|
276
|
+
IAccess.FunctionInfo[] memory functions
|
277
|
+
)
|
278
|
+
external
|
279
|
+
restricted()
|
280
|
+
{
|
281
|
+
_checkComponentOrCustomTarget(target);
|
282
|
+
_authorizeTargetFunctions(target, ADMIN_ROLE(), functions, false);
|
289
283
|
}
|
290
284
|
|
291
|
-
function _getNextCustomRoleId() internal returns(RoleId roleId, RoleId admin) {
|
292
|
-
uint64 roleIdInt = _idNext;
|
293
|
-
uint64 adminInt = roleIdInt + 1;
|
294
285
|
|
295
|
-
|
286
|
+
/// @dev locks the instance and all its releated targets including component and custom targets.
|
287
|
+
function setInstanceLocked(bool locked)
|
288
|
+
external
|
289
|
+
// not restricted(): need to operate on locked instances to unlock instance
|
290
|
+
onlyInstanceService()
|
291
|
+
{
|
292
|
+
AccessManagerCloneable accessManager = AccessManagerCloneable(authority());
|
293
|
+
accessManager.setLocked(locked);
|
294
|
+
}
|
296
295
|
|
297
|
-
|
298
|
-
|
296
|
+
|
297
|
+
function setTargetLocked(address target, bool locked)
|
298
|
+
external
|
299
|
+
// not restricted(): might need to operate on targets while instance is locked
|
300
|
+
onlyInstanceService()
|
301
|
+
{
|
302
|
+
_setTargetLocked(target, locked);
|
299
303
|
}
|
300
304
|
|
301
|
-
|
302
|
-
function
|
303
|
-
|
305
|
+
|
306
|
+
function setComponentLocked(address target, bool locked)
|
307
|
+
external
|
308
|
+
restricted()
|
304
309
|
{
|
305
|
-
|
306
|
-
_targetType[target] = ttype;
|
307
|
-
_accessManager.createTarget(target, name);
|
310
|
+
_setTargetLocked(target, locked);
|
308
311
|
}
|
309
312
|
|
310
|
-
|
311
|
-
|
313
|
+
/// @dev Returns the number of components that have been registered with this instance.
|
314
|
+
function components()
|
315
|
+
external
|
312
316
|
view
|
313
|
-
|
317
|
+
returns (uint64)
|
318
|
+
{
|
319
|
+
return _components;
|
320
|
+
}
|
314
321
|
|
315
|
-
|
316
|
-
|
317
|
-
|
322
|
+
/// @dev Returns the instance authorization specification used to set up this instance admin.
|
323
|
+
function getInstanceAuthorization()
|
324
|
+
external
|
325
|
+
view
|
326
|
+
returns (IAuthorization instanceAuthorizaion)
|
318
327
|
{
|
319
|
-
|
328
|
+
return _authorization;
|
329
|
+
}
|
330
|
+
|
331
|
+
// ------------------- Internal functions ------------------- //
|
320
332
|
|
321
|
-
|
322
|
-
|
333
|
+
function _createRoles(IAuthorization authorization)
|
334
|
+
internal
|
335
|
+
{
|
336
|
+
RoleId[] memory roles = authorization.getRoles();
|
337
|
+
RoleId mainTargetRoleId = authorization.getTargetRole(
|
338
|
+
authorization.getMainTarget());
|
339
|
+
|
340
|
+
for(uint256 i = 0; i < roles.length; i++) {
|
341
|
+
RoleId roleId = roles[i];
|
342
|
+
|
343
|
+
// skip main target role, create role if not exists
|
344
|
+
if (roleId != mainTargetRoleId && !roleExists(roleId)) {
|
345
|
+
_createRole(
|
346
|
+
roleId,
|
347
|
+
authorization.getRoleInfo(roleId));
|
348
|
+
}
|
323
349
|
}
|
350
|
+
}
|
351
|
+
|
352
|
+
|
353
|
+
function _createTargetAuthorizations(IAuthorization authorization)
|
354
|
+
internal
|
355
|
+
{
|
356
|
+
Str[] memory targets = authorization.getTargets();
|
357
|
+
Str target;
|
324
358
|
|
325
|
-
|
359
|
+
for(uint256 i = 0; i < targets.length; i++) {
|
360
|
+
target = targets[i];
|
361
|
+
RoleId[] memory authorizedRoles = authorization.getAuthorizedRoles(target);
|
362
|
+
|
363
|
+
for(uint256 j = 0; j < authorizedRoles.length; j++) {
|
364
|
+
_authorizeFunctions(authorization, target, authorizedRoles[j]);
|
365
|
+
}
|
366
|
+
}
|
326
367
|
}
|
327
368
|
|
328
|
-
|
329
|
-
|
369
|
+
|
370
|
+
function _checkComponentOrCustomTarget(address target)
|
371
|
+
internal
|
372
|
+
view
|
373
|
+
{
|
374
|
+
IAccess.TargetType targetType = getTargetInfo(target).targetType;
|
375
|
+
if (targetType != TargetType.Component && targetType != TargetType.Custom) {
|
376
|
+
revert ErrorInstanceAdminNotComponentOrCustomTarget(target);
|
377
|
+
}
|
330
378
|
}
|
331
|
-
}
|
379
|
+
}
|