@etherisc/gif-next 0.0.2-f15b559-661 → 0.0.2-f1b01e0-214
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +43 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +38 -38
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +26 -26
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +6 -6
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +366 -251
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +1 -1
- 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 +8 -39
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +101 -28
- 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 +283 -189
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +37 -5
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +32 -145
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +101 -46
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +1 -87
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +160 -89
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +56 -52
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +1 -87
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +68 -5
- 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 +44 -74
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +101 -46
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +94 -124
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +101 -46
- 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 +82 -173
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +101 -46
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +20 -63
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +69 -112
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +101 -46
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +95 -138
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +101 -46
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +2 -2
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +104 -8
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +62 -13
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +119 -26
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +520 -413
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +101 -46
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +225 -196
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +94 -65
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +26 -36
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +356 -346
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +2 -2
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +20 -20
- 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 +14 -35
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +98 -35
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +0 -21
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +0 -21
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +42 -42
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +31 -31
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +22 -43
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +101 -46
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +64 -64
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +39 -39
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +6 -6
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +10 -31
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +18 -18
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +10 -31
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +34 -34
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +80 -80
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +41 -41
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +90 -24
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +34 -22
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +27 -48
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +101 -46
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +78 -78
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +50 -50
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +42 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +21 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +21 -42
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +21 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +62 -62
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +32 -32
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +41 -41
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +63 -82
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +31 -51
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +21 -42
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +55 -26
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +27 -23
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +1 -1
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +2 -2
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +445 -355
- 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 +18 -18
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +19 -19
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +481 -376
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +128 -124
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +2 -2
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +0 -21
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +114 -129
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +45 -49
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +60 -4
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +0 -21
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +44 -51
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +0 -21
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- 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 +0 -21
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/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/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +2 -2
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +2 -2
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +2 -2
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +83 -39
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +75 -4
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +133 -94
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +469 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +2 -2
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +41 -37
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +34 -61
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +109 -30
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +27 -23
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +148 -134
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +47 -37
- 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 +10 -10
- 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 +93 -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 +1 -1
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +2 -2
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +2 -2
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +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 +2 -2
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +2 -2
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +60 -36
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -2
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +56 -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 +4 -4
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/accounting/IAccountingService.sol +2 -2
- package/contracts/authorization/AccessAdmin.sol +201 -186
- package/contracts/authorization/AccessAdminLib.sol +183 -0
- package/contracts/authorization/AccessManagerCloneable.sol +40 -31
- package/contracts/authorization/Authorization.sol +61 -33
- package/contracts/authorization/IAccess.sol +13 -5
- package/contracts/authorization/IAccessAdmin.sol +63 -36
- package/contracts/authorization/IAuthorization.sol +6 -0
- package/contracts/distribution/BasicDistribution.sol +6 -6
- package/contracts/distribution/BasicDistributionAuthorization.sol +1 -1
- package/contracts/distribution/Distribution.sol +3 -48
- package/contracts/distribution/DistributionService.sol +57 -30
- package/contracts/distribution/IDistributionComponent.sol +0 -9
- package/contracts/distribution/IDistributionService.sol +4 -2
- package/contracts/examples/fire/FirePool.sol +0 -4
- package/contracts/examples/fire/FireProduct.sol +0 -4
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +32 -8
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -8
- package/contracts/examples/unpermissioned/SimplePool.sol +0 -4
- package/contracts/examples/unpermissioned/SimpleProduct.sol +0 -4
- package/contracts/instance/IInstance.sol +45 -9
- package/contracts/instance/IInstanceService.sol +19 -3
- package/contracts/instance/Instance.sol +73 -16
- package/contracts/instance/InstanceAdmin.sol +120 -107
- package/contracts/instance/InstanceAuthorizationV3.sol +43 -21
- package/contracts/instance/InstanceReader.sol +13 -0
- package/contracts/instance/InstanceService.sol +128 -73
- package/contracts/instance/module/IBundle.sol +6 -5
- package/contracts/instance/module/IComponents.sol +16 -5
- package/contracts/instance/module/IDistribution.sol +19 -7
- package/contracts/instance/module/IPolicy.sol +28 -8
- package/contracts/instance/module/IRisk.sol +2 -0
- package/contracts/oracle/BasicOracle.sol +1 -3
- package/contracts/oracle/BasicOracleAuthorization.sol +1 -1
- package/contracts/oracle/IOracle.sol +9 -4
- package/contracts/oracle/Oracle.sol +0 -2
- package/contracts/pool/BasicPool.sol +0 -2
- package/contracts/pool/BasicPoolAuthorization.sol +1 -1
- package/contracts/pool/Pool.sol +0 -2
- package/contracts/pool/PoolService.sol +1 -3
- package/contracts/product/ApplicationService.sol +21 -6
- package/contracts/product/BasicProduct.sol +0 -2
- package/contracts/product/BasicProductAuthorization.sol +1 -1
- package/contracts/product/IApplicationService.sol +3 -0
- package/contracts/product/IPricingService.sol +1 -0
- package/contracts/product/IRiskService.sol +3 -0
- package/contracts/product/PolicyService.sol +0 -18
- package/contracts/product/PricingService.sol +11 -6
- package/contracts/product/Product.sol +0 -2
- package/contracts/product/RiskService.sol +10 -0
- package/contracts/registry/IRegistry.sol +4 -0
- package/contracts/registry/RegistryAdmin.sol +133 -229
- package/contracts/registry/RegistryAuthorization.sol +267 -0
- package/contracts/registry/ReleaseAdmin.sol +30 -22
- package/contracts/registry/ReleaseRegistry.sol +39 -33
- package/contracts/registry/ServiceAuthorizationV3.sol +87 -3
- package/contracts/shared/Component.sol +13 -30
- package/contracts/shared/ComponentService.sol +58 -42
- package/contracts/shared/ContractLib.sol +28 -0
- package/contracts/shared/IComponent.sol +0 -3
- package/contracts/shared/IComponentService.sol +9 -9
- package/contracts/shared/InitializableERC165.sol +9 -1
- package/contracts/shared/InstanceLinkedComponent.sol +0 -2
- package/contracts/shared/NftOwnable.sol +1 -1
- package/contracts/shared/Registerable.sol +1 -4
- package/contracts/shared/TokenHandler.sol +5 -4
- package/contracts/staking/IStaking.sol +12 -2
- package/contracts/staking/IStakingService.sol +8 -1
- package/contracts/staking/Staking.sol +35 -15
- package/contracts/staking/{StakeManagerLib.sol → StakingLib.sol} +79 -22
- package/contracts/staking/StakingReader.sol +5 -15
- package/contracts/staking/StakingService.sol +36 -2
- package/contracts/staking/StakingStore.sol +2 -1
- package/contracts/type/Fee.sol +8 -8
- package/contracts/type/ObjectType.sol +5 -14
- package/contracts/type/UFixed.sol +27 -10
- package/contracts/type/Version.sol +39 -0
- package/package.json +2 -2
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -440
@@ -10,7 +10,7 @@ import {IInstance} from "./IInstance.sol";
|
|
10
10
|
import {AccessAdmin} from "../authorization/AccessAdmin.sol";
|
11
11
|
import {AccessManagerCloneable} from "../authorization/AccessManagerCloneable.sol";
|
12
12
|
import {NftId} from "../type/NftId.sol";
|
13
|
-
import {ObjectType} from "../type/ObjectType.sol";
|
13
|
+
import {ObjectType, INSTANCE, ORACLE} from "../type/ObjectType.sol";
|
14
14
|
import {RoleId, RoleIdLib} from "../type/RoleId.sol";
|
15
15
|
import {Str, StrLib} from "../type/String.sol";
|
16
16
|
import {TokenHandler} from "../shared/TokenHandler.sol";
|
@@ -21,18 +21,19 @@ contract InstanceAdmin is
|
|
21
21
|
AccessAdmin
|
22
22
|
{
|
23
23
|
string public constant INSTANCE_TARGET_NAME = "Instance";
|
24
|
-
string public constant INSTANCE_STORE_TARGET_NAME = "InstanceStore";
|
25
24
|
string public constant INSTANCE_ADMIN_TARGET_NAME = "InstanceAdmin";
|
25
|
+
string public constant INSTANCE_STORE_TARGET_NAME = "InstanceStore";
|
26
26
|
string public constant BUNDLE_SET_TARGET_NAME = "BundleSet";
|
27
|
-
string public constant
|
27
|
+
string public constant RISK_SET_TARGET_NAME = "RiskSet";
|
28
28
|
|
29
29
|
uint64 public constant CUSTOM_ROLE_ID_MIN = 10000; // MUST be even
|
30
30
|
|
31
|
-
error
|
32
|
-
|
33
|
-
error ErrorInstanceAdminNotRegistered(address
|
31
|
+
error ErrorInstanceAdminNotInstanceService(address caller);
|
32
|
+
|
33
|
+
error ErrorInstanceAdminNotRegistered(address instance);
|
34
|
+
error ErrorInstanceAdminNotInstance(address instance);
|
35
|
+
error ErrorInstanceAdminAlreadyAuthorized(address instance);
|
34
36
|
|
35
|
-
error ErrorInstanceAdminAlreadyAuthorized(address target);
|
36
37
|
error ErrorInstanceAdminNotComponentRole(RoleId roleId);
|
37
38
|
error ErrorInstanceAdminRoleAlreadyExists(RoleId roleId);
|
38
39
|
error ErrorInstanceAdminRoleTypeNotContract(RoleId roleId, IAccess.RoleType roleType);
|
@@ -42,119 +43,134 @@ contract InstanceAdmin is
|
|
42
43
|
|
43
44
|
IInstance internal _instance;
|
44
45
|
IRegistry internal _registry;
|
46
|
+
VersionPart internal _release;
|
45
47
|
uint64 internal _customIdNext;
|
46
48
|
|
47
49
|
mapping(address target => RoleId roleId) internal _targetRoleId;
|
48
50
|
uint64 internal _components;
|
49
51
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
modifier onlyInstanceOwner() {
|
54
|
-
if(msg.sender != _registry.ownerOf(address(_instance))) {
|
55
|
-
revert ErrorInstanceAdminCallerNotInstanceOwner(msg.sender);
|
52
|
+
modifier onlyInstanceService() {
|
53
|
+
if (msg.sender != _registry.getServiceAddress(INSTANCE(), getRelease())) {
|
54
|
+
revert ErrorInstanceAdminNotInstanceService(msg.sender);
|
56
55
|
}
|
57
56
|
_;
|
58
57
|
}
|
59
58
|
|
60
59
|
/// @dev Only used for master instance admin.
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
initialize(new AccessManagerCloneable());
|
66
|
-
|
67
|
-
_instanceAuthorization = IAuthorization(instanceAuthorization);
|
68
|
-
|
69
|
-
_disableInitializers();
|
60
|
+
constructor(address accessManager) {
|
61
|
+
initialize(
|
62
|
+
accessManager,
|
63
|
+
"MasterInstanceAdmin");
|
70
64
|
}
|
71
65
|
|
72
66
|
|
73
|
-
function initialize(
|
74
|
-
AccessManagerCloneable clonedAccessManager,
|
75
|
-
IRegistry registry,
|
76
|
-
VersionPart release
|
77
|
-
)
|
78
|
-
external
|
79
|
-
initializer()
|
80
|
-
{
|
81
|
-
__AccessAdmin_init(clonedAccessManager);
|
82
|
-
|
83
|
-
clonedAccessManager.completeSetup(
|
84
|
-
address(registry),
|
85
|
-
release);
|
86
|
-
|
87
|
-
_registry = registry;
|
88
|
-
}
|
89
|
-
|
90
67
|
/// @dev Completes the initialization of this instance admin using the provided instance, registry and version.
|
91
68
|
/// Important: Initialization of instance admin is only complete after calling this function.
|
92
69
|
/// Important: The instance MUST be registered and all instance supporting contracts must be wired to this instance.
|
93
70
|
function completeSetup(
|
71
|
+
address registry,
|
94
72
|
address instance,
|
95
|
-
address authorization
|
73
|
+
address authorization,
|
74
|
+
VersionPart release
|
96
75
|
)
|
97
76
|
external
|
98
|
-
reinitializer(uint64(
|
77
|
+
reinitializer(uint64(release.toInt()))
|
99
78
|
onlyDeployer()
|
100
79
|
{
|
80
|
+
// checks
|
81
|
+
_checkRegistry(registry);
|
82
|
+
_checkIsRegistered(registry, instance, INSTANCE());
|
83
|
+
|
84
|
+
AccessManagerCloneable(
|
85
|
+
authority()).completeSetup(
|
86
|
+
registry,
|
87
|
+
release);
|
88
|
+
|
89
|
+
_checkAuthorization(authorization, INSTANCE(), release, true);
|
90
|
+
|
91
|
+
// effects
|
92
|
+
_registry = IRegistry(registry);
|
93
|
+
_release = release;
|
94
|
+
|
95
|
+
_instance = IInstance(instance);
|
96
|
+
_authorization = IAuthorization(authorization);
|
101
97
|
_components = 0;
|
102
98
|
_customIdNext = CUSTOM_ROLE_ID_MIN;
|
103
|
-
_instance = IInstance(instance);
|
104
|
-
_instanceAuthorization = IAuthorization(authorization);
|
105
|
-
|
106
|
-
_checkTargetIsReadyForAuthorization(instance);
|
107
99
|
|
108
|
-
//
|
109
|
-
|
110
|
-
revert ErrorInstanceAdminReleaseMismatch();
|
111
|
-
}
|
100
|
+
// link nft ownability to instance
|
101
|
+
_linkToNftOwnable(instance);
|
112
102
|
|
113
103
|
// create instance role and target
|
114
104
|
_setupInstance(instance);
|
115
105
|
|
116
106
|
// add instance authorization
|
117
|
-
_createRoles(
|
118
|
-
|
107
|
+
_createRoles(_authorization);
|
108
|
+
// _createTargets(_authorization);
|
119
109
|
_setupInstanceHelperTargetsWithRoles();
|
120
|
-
_createTargetAuthorizations(
|
110
|
+
_createTargetAuthorizations(_authorization);
|
111
|
+
}
|
112
|
+
|
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)));
|
121
121
|
}
|
122
122
|
|
123
123
|
|
124
124
|
/// @dev Initializes the authorization for the specified component.
|
125
125
|
/// Important: The component MUST be registered.
|
126
126
|
function initializeComponentAuthorization(
|
127
|
-
|
127
|
+
address componentAddress,
|
128
|
+
ObjectType expectedType
|
128
129
|
)
|
129
130
|
external
|
130
131
|
restricted()
|
131
132
|
{
|
132
133
|
// checks
|
133
|
-
|
134
|
-
|
135
|
-
// setup target and role for component (including token handler)
|
136
|
-
_setupComponentAndTokenHandler(component);
|
134
|
+
_checkIsRegistered(address(getRegistry()), componentAddress, expectedType);
|
137
135
|
|
138
|
-
|
136
|
+
IInstanceLinkedComponent component = IInstanceLinkedComponent(componentAddress);
|
139
137
|
IAuthorization authorization = component.getAuthorization();
|
140
|
-
|
138
|
+
_checkAuthorization(address(authorization), expectedType, getRelease(), false);
|
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
|
145
|
+
_createRoles(authorization);
|
141
146
|
_createTargetAuthorizations(authorization);
|
142
147
|
}
|
143
148
|
|
149
|
+
function getRelease()
|
150
|
+
public
|
151
|
+
view
|
152
|
+
override
|
153
|
+
returns (VersionPart release)
|
154
|
+
{
|
155
|
+
return _release;
|
156
|
+
}
|
157
|
+
|
158
|
+
|
144
159
|
// create instance role and target
|
145
160
|
function _setupInstance(address instance) internal {
|
161
|
+
|
146
162
|
// create instance role
|
147
|
-
RoleId instanceRoleId =
|
148
|
-
|
163
|
+
RoleId instanceRoleId = _authorization.getTargetRole(
|
164
|
+
_authorization.getMainTarget());
|
149
165
|
|
150
166
|
_createRole(
|
151
167
|
instanceRoleId,
|
152
|
-
|
168
|
+
_authorization.getRoleInfo(instanceRoleId));
|
153
169
|
|
154
170
|
// create instance target
|
155
171
|
_createTarget(
|
156
172
|
instance,
|
157
|
-
|
173
|
+
_authorization.getMainTargetName(),
|
158
174
|
true, // checkAuthority
|
159
175
|
false); // custom
|
160
176
|
|
@@ -186,21 +202,28 @@ contract InstanceAdmin is
|
|
186
202
|
|
187
203
|
function setInstanceLocked(bool locked)
|
188
204
|
external
|
189
|
-
|
205
|
+
// not restricted(): need to operate on locked instances to unlock instance
|
206
|
+
onlyInstanceService()
|
190
207
|
{
|
191
208
|
AccessManagerCloneable accessManager = AccessManagerCloneable(authority());
|
192
|
-
|
193
|
-
if(accessManager.isLocked() == locked) {
|
194
|
-
revert ErrorInstanceAdminInstanceAlreadyLocked();
|
195
|
-
}
|
196
209
|
accessManager.setLocked(locked);
|
197
210
|
}
|
198
211
|
|
212
|
+
|
199
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)
|
200
223
|
external
|
201
224
|
restricted()
|
202
225
|
{
|
203
|
-
|
226
|
+
_setTargetLocked(target, locked);
|
204
227
|
}
|
205
228
|
|
206
229
|
/// @dev Returns the number of components that have been registered with this instance.
|
@@ -218,12 +241,15 @@ contract InstanceAdmin is
|
|
218
241
|
view
|
219
242
|
returns (IAuthorization instanceAuthorizaion)
|
220
243
|
{
|
221
|
-
return
|
244
|
+
return _authorization;
|
222
245
|
}
|
223
246
|
|
224
247
|
// ------------------- Internal functions ------------------- //
|
225
248
|
|
226
|
-
function _setupComponentAndTokenHandler(
|
249
|
+
function _setupComponentAndTokenHandler(
|
250
|
+
IInstanceLinkedComponent component,
|
251
|
+
ObjectType componentType
|
252
|
+
)
|
227
253
|
internal
|
228
254
|
{
|
229
255
|
|
@@ -240,25 +266,27 @@ contract InstanceAdmin is
|
|
240
266
|
true, // checkAuthority
|
241
267
|
false); // custom
|
242
268
|
|
243
|
-
// create component's token handler target
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
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
|
+
}
|
254
285
|
|
255
286
|
// assign component role to component
|
256
287
|
_grantRoleToAccount(
|
257
288
|
componentRoleId,
|
258
289
|
address(component));
|
259
|
-
|
260
|
-
// token handler does not require its own role
|
261
|
-
// token handler is not calling other components
|
262
290
|
}
|
263
291
|
|
264
292
|
|
@@ -312,20 +340,6 @@ contract InstanceAdmin is
|
|
312
340
|
}
|
313
341
|
|
314
342
|
|
315
|
-
function _checkTargetIsReadyForAuthorization(address target)
|
316
|
-
internal
|
317
|
-
view
|
318
|
-
{
|
319
|
-
if (!_registry.isRegistered(target)) {
|
320
|
-
revert ErrorInstanceAdminNotRegistered(target);
|
321
|
-
}
|
322
|
-
|
323
|
-
if (targetExists(target)) {
|
324
|
-
revert ErrorInstanceAdminAlreadyAuthorized(target);
|
325
|
-
}
|
326
|
-
}
|
327
|
-
|
328
|
-
|
329
343
|
function _createRoles(IAuthorization authorization)
|
330
344
|
internal
|
331
345
|
{
|
@@ -392,7 +406,7 @@ contract InstanceAdmin is
|
|
392
406
|
{
|
393
407
|
// check that target name is defined in authorization specification
|
394
408
|
Str name = StrLib.toStr(targetName);
|
395
|
-
if (!
|
409
|
+
if (!_authorization.targetExists(name)) {
|
396
410
|
revert ErrorInstanceAdminExpectedTargetMissing(targetName);
|
397
411
|
}
|
398
412
|
|
@@ -404,7 +418,7 @@ contract InstanceAdmin is
|
|
404
418
|
false);
|
405
419
|
|
406
420
|
// assign target role if defined
|
407
|
-
RoleId targetRoleId =
|
421
|
+
RoleId targetRoleId = _authorization.getTargetRole(name);
|
408
422
|
if (targetRoleId != RoleIdLib.zero()) {
|
409
423
|
_grantRoleToAccount(targetRoleId, target);
|
410
424
|
}
|
@@ -413,17 +427,16 @@ contract InstanceAdmin is
|
|
413
427
|
function _setupInstanceHelperTargetsWithRoles()
|
414
428
|
internal
|
415
429
|
{
|
416
|
-
// _checkAndCreateTargetWithRole(address(_instance), INSTANCE_TARGET_NAME);
|
417
430
|
|
418
431
|
// create module targets
|
419
432
|
_checkAndCreateTargetWithRole(address(_instance.getInstanceStore()), INSTANCE_STORE_TARGET_NAME);
|
420
433
|
_checkAndCreateTargetWithRole(address(_instance.getInstanceAdmin()), INSTANCE_ADMIN_TARGET_NAME);
|
421
434
|
_checkAndCreateTargetWithRole(address(_instance.getBundleSet()), BUNDLE_SET_TARGET_NAME);
|
422
|
-
_checkAndCreateTargetWithRole(address(_instance.getRiskSet()),
|
435
|
+
_checkAndCreateTargetWithRole(address(_instance.getRiskSet()), RISK_SET_TARGET_NAME);
|
423
436
|
|
424
|
-
// create targets for services that need to access the
|
425
|
-
ObjectType[] memory serviceDomains =
|
426
|
-
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();
|
427
440
|
ObjectType serviceDomain;
|
428
441
|
|
429
442
|
for (uint256 i = 0; i < serviceDomains.length; i++) {
|
@@ -431,7 +444,7 @@ contract InstanceAdmin is
|
|
431
444
|
|
432
445
|
_checkAndCreateTargetWithRole(
|
433
446
|
_registry.getServiceAddress(serviceDomain, release),
|
434
|
-
|
447
|
+
_authorization.getServiceTarget(serviceDomain).toString());
|
435
448
|
}
|
436
449
|
}
|
437
450
|
}
|
@@ -1,17 +1,16 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {
|
5
|
-
ACCOUNTING, ORACLE, POOL, INSTANCE, COMPONENT, DISTRIBUTION, APPLICATION, POLICY, CLAIM, BUNDLE, RISK
|
6
|
-
} from "../../contracts/type/ObjectType.sol";
|
4
|
+
import {IAccess} from "../authorization/IAccess.sol";
|
7
5
|
|
6
|
+
import {Authorization} from "../authorization/Authorization.sol";
|
7
|
+
import {ACCOUNTING, ORACLE, POOL, INSTANCE, COMPONENT, DISTRIBUTION, APPLICATION, POLICY, CLAIM, BUNDLE, RISK} from "../../contracts/type/ObjectType.sol";
|
8
8
|
import {BundleSet} from "../instance/BundleSet.sol";
|
9
|
-
import {RiskSet} from "../instance/RiskSet.sol";
|
10
|
-
import {IAccess} from "../authorization/IAccess.sol";
|
11
9
|
import {Instance} from "../instance/Instance.sol";
|
12
10
|
import {InstanceAdmin} from "../instance/InstanceAdmin.sol";
|
13
11
|
import {InstanceStore} from "../instance/InstanceStore.sol";
|
14
|
-
import {
|
12
|
+
import {PUBLIC_ROLE} from "../type/RoleId.sol";
|
13
|
+
import {RiskSet} from "../instance/RiskSet.sol";
|
15
14
|
|
16
15
|
|
17
16
|
contract InstanceAuthorizationV3
|
@@ -27,19 +26,10 @@ contract InstanceAuthorizationV3
|
|
27
26
|
string public constant RISK_SET_TARGET_NAME = "RiskSet";
|
28
27
|
|
29
28
|
constructor()
|
30
|
-
Authorization(INSTANCE_TARGET_NAME, INSTANCE())
|
29
|
+
Authorization(INSTANCE_TARGET_NAME, INSTANCE(), false, false)
|
31
30
|
{ }
|
32
31
|
|
33
|
-
function
|
34
|
-
internal
|
35
|
-
override
|
36
|
-
{
|
37
|
-
// instance supporting targets
|
38
|
-
_addTarget(INSTANCE_STORE_TARGET_NAME);
|
39
|
-
_addTarget(INSTANCE_ADMIN_TARGET_NAME);
|
40
|
-
_addTarget(BUNDLE_SET_TARGET_NAME);
|
41
|
-
_addTarget(RISK_SET_TARGET_NAME);
|
42
|
-
|
32
|
+
function _setupServiceTargets() internal virtual override {
|
43
33
|
// service targets relevant to instance
|
44
34
|
_addServiceTargetWithRole(INSTANCE());
|
45
35
|
_addServiceTargetWithRole(ACCOUNTING());
|
@@ -54,6 +44,19 @@ contract InstanceAuthorizationV3
|
|
54
44
|
_addServiceTargetWithRole(CLAIM());
|
55
45
|
}
|
56
46
|
|
47
|
+
function _setupTargets()
|
48
|
+
internal
|
49
|
+
override
|
50
|
+
{
|
51
|
+
// instance supporting targets
|
52
|
+
// _addGifContractTarget(INSTANCE_ADMIN_TARGET_NAME);
|
53
|
+
_addTarget(INSTANCE_ADMIN_TARGET_NAME);
|
54
|
+
_addTarget(INSTANCE_STORE_TARGET_NAME);
|
55
|
+
_addTarget(BUNDLE_SET_TARGET_NAME);
|
56
|
+
_addTarget(RISK_SET_TARGET_NAME);
|
57
|
+
|
58
|
+
}
|
59
|
+
|
57
60
|
|
58
61
|
function _setupTargetAuthorizations()
|
59
62
|
internal
|
@@ -107,6 +110,24 @@ contract InstanceAuthorizationV3
|
|
107
110
|
{
|
108
111
|
IAccess.FunctionInfo[] storage functions;
|
109
112
|
|
113
|
+
// authorize instance service role
|
114
|
+
functions = _authorizeForTarget(INSTANCE_TARGET_NAME, PUBLIC_ROLE());
|
115
|
+
_authorize(functions, Instance.registerProduct.selector, "registerProduct");
|
116
|
+
_authorize(functions, Instance.upgradeInstanceReader.selector, "upgradeInstanceReader");
|
117
|
+
|
118
|
+
// staking
|
119
|
+
_authorize(functions, Instance.setStakingLockingPeriod.selector, "setStakingLockingPeriod");
|
120
|
+
_authorize(functions, Instance.setStakingRewardRate.selector, "setStakingRewardRate");
|
121
|
+
_authorize(functions, Instance.refillStakingRewardReserves.selector, "refillStakingRewardReserves");
|
122
|
+
_authorize(functions, Instance.withdrawStakingRewardReserves.selector, "withdrawStakingRewardReserves");
|
123
|
+
|
124
|
+
// custom authz
|
125
|
+
_authorize(functions, Instance.createRole.selector, "createRole");
|
126
|
+
_authorize(functions, Instance.grantRole.selector, "grantRole");
|
127
|
+
_authorize(functions, Instance.revokeRole.selector, "revokeRole");
|
128
|
+
_authorize(functions, Instance.createTarget.selector, "createTarget");
|
129
|
+
_authorize(functions, Instance.setTargetFunctionRole.selector, "setTargetFunctionRole");
|
130
|
+
|
110
131
|
// authorize instance service role
|
111
132
|
functions = _authorizeForTarget(INSTANCE_TARGET_NAME, getServiceRole(INSTANCE()));
|
112
133
|
_authorize(functions, Instance.setInstanceReader.selector, "setInstanceReader");
|
@@ -118,14 +139,15 @@ contract InstanceAuthorizationV3
|
|
118
139
|
{
|
119
140
|
IAccess.FunctionInfo[] storage functions;
|
120
141
|
|
121
|
-
// authorize
|
122
|
-
functions = _authorizeForTarget(INSTANCE_ADMIN_TARGET_NAME,
|
123
|
-
_authorize(functions, InstanceAdmin.
|
142
|
+
// authorize component service role
|
143
|
+
functions = _authorizeForTarget(INSTANCE_ADMIN_TARGET_NAME, getServiceRole(INSTANCE()));
|
144
|
+
_authorize(functions, InstanceAdmin.setInstanceLocked.selector, "setInstanceLocked");
|
145
|
+
_authorize(functions, InstanceAdmin.setTargetLocked.selector, "setTargetLocked");
|
124
146
|
|
125
147
|
// authorize component service role
|
126
148
|
functions = _authorizeForTarget(INSTANCE_ADMIN_TARGET_NAME, getServiceRole(COMPONENT()));
|
127
149
|
_authorize(functions, InstanceAdmin.initializeComponentAuthorization.selector, "initializeComponentAuthoriz");
|
128
|
-
_authorize(functions, InstanceAdmin.
|
150
|
+
_authorize(functions, InstanceAdmin.setComponentLocked.selector, "setComponentLocked");
|
129
151
|
}
|
130
152
|
|
131
153
|
|
@@ -6,6 +6,7 @@ import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IER
|
|
6
6
|
import {IBundle} from "../instance/module/IBundle.sol";
|
7
7
|
import {IComponents} from "../instance/module/IComponents.sol";
|
8
8
|
import {IDistribution} from "../instance/module/IDistribution.sol";
|
9
|
+
import {IDistributionService} from "../distribution/IDistributionService.sol";
|
9
10
|
import {IInstance} from "./IInstance.sol";
|
10
11
|
import {IKeyValueStore} from "../shared/IKeyValueStore.sol";
|
11
12
|
import {IOracle} from "../oracle/IOracle.sol";
|
@@ -47,6 +48,7 @@ contract InstanceReader {
|
|
47
48
|
InstanceStore internal _store;
|
48
49
|
BundleSet internal _bundleSet;
|
49
50
|
RiskSet internal _riskSet;
|
51
|
+
IDistributionService internal _distributionService;
|
50
52
|
|
51
53
|
/// @dev This initializer needs to be called from the instance itself.
|
52
54
|
function initialize() public {
|
@@ -71,6 +73,7 @@ contract InstanceReader {
|
|
71
73
|
_store = _instance.getInstanceStore();
|
72
74
|
_bundleSet = _instance.getBundleSet();
|
73
75
|
_riskSet = _instance.getRiskSet();
|
76
|
+
_distributionService = IDistributionService(_registry.getServiceAddress(DISTRIBUTION(), _instance.getRelease()));
|
74
77
|
}
|
75
78
|
|
76
79
|
|
@@ -485,6 +488,16 @@ contract InstanceReader {
|
|
485
488
|
}
|
486
489
|
}
|
487
490
|
|
491
|
+
function isReferralValid(NftId distributionNftId, ReferralId referralId)
|
492
|
+
external
|
493
|
+
view
|
494
|
+
returns (bool isValid)
|
495
|
+
{
|
496
|
+
return _distributionService.referralIsValid(
|
497
|
+
distributionNftId,
|
498
|
+
referralId);
|
499
|
+
}
|
500
|
+
|
488
501
|
function getRequestInfo(RequestId requestId)
|
489
502
|
public
|
490
503
|
view
|