@etherisc/gif-next 0.0.2-ba07940-332 → 0.0.2-ba5b255-091
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +27 -6
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +1007 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +744 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +4 -0
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +791 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +452 -243
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.json +24 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +673 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +202 -5
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +222 -21
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +348 -184
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +100 -13
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +2 -2
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +92 -285
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +207 -33
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +44 -162
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +309 -168
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +89 -51
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +31 -131
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +177 -67
- 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 +93 -139
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +188 -46
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +247 -287
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +207 -33
- package/artifacts/contracts/examples/fire/FireUSD.sol/FireUSD.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistribution.sol/SimpleDistribution.json +161 -244
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +644 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +76 -155
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +130 -131
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +644 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +288 -226
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +644 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +193 -45
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +192 -30
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +177 -12
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +221 -67
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +775 -306
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +226 -46
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +713 -201
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +203 -85
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +46 -34
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +421 -371
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +4 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +853 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +2 -2
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +16 -5
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSetHelperLib.sol/ObjectSetHelperLib.json +168 -0
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +66 -167
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +189 -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 +36 -71
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +27 -3
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +50 -103
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +112 -81
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +69 -27
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +49 -102
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +188 -46
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +127 -331
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +53 -87
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +56 -136
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +36 -95
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +163 -226
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +49 -126
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +456 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +302 -363
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +93 -51
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +165 -57
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +54 -24
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +155 -193
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +207 -33
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +244 -179
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +74 -64
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +103 -10
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +142 -20
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +112 -56
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +48 -3
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +142 -162
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +58 -7
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +211 -180
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +293 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +76 -50
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +120 -76
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +60 -38
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +155 -193
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +143 -77
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +66 -24
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +50 -2
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +31 -7
- package/artifacts/contracts/registry/IRelease.sol/IRelease.dbg.json +4 -0
- package/artifacts/contracts/registry/IRelease.sol/IRelease.json +24 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +88 -40
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +559 -415
- 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 +69 -46
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +42 -20
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +1966 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +2 -2
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +332 -54
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +6 -6
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +4 -4
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +49 -88
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +228 -440
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +65 -63
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +27 -16
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +509 -4
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/IInstanceAdminHelper.json +24 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITargetHelper.json +30 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.dbg.json +4 -0
- package/artifacts/contracts/shared/ContractLib.sol/ITokenRegistryHelper.json +40 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +36 -57
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +123 -262
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +36 -71
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +120 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +27 -3
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/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 +49 -102
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +2 -2
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +2 -2
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +2 -2
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +118 -62
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +2 -2
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +1 -1
- package/artifacts/contracts/shared/Service.sol/Service.json +27 -16
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +327 -73
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +484 -0
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +88 -24
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +116 -90
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +127 -3
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +193 -193
- 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 +61 -45
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +30 -57
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +180 -49
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +50 -24
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +143 -129
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +33 -23
- 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 +3 -3
- 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 +3 -3
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +1 -1
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +2 -2
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.dbg.json +4 -0
- package/artifacts/contracts/type/Key32Set.sol/LibKey32Set.json +33 -0
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +23 -4
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +33 -31
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +2 -2
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +2 -2
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +2 -2
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +69 -7
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +79 -15
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +21 -2
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +2 -2
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +2 -2
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +3 -3
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionLib.json +2 -21
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +1 -1
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +101 -2
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +18 -2
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/contracts/accounting/AccountingService.sol +262 -0
- package/contracts/accounting/AccountingServiceManager.sol +38 -0
- package/contracts/accounting/IAccountingService.sol +45 -0
- package/contracts/authorization/AccessAdmin.sol +301 -192
- package/contracts/authorization/AccessAdminLib.sol +183 -0
- package/contracts/authorization/AccessManagerCloneable.sol +146 -4
- package/contracts/authorization/Authorization.sol +307 -231
- package/contracts/authorization/IAccessAdmin.sol +69 -36
- package/contracts/authorization/IAuthorization.sol +21 -1
- package/contracts/distribution/BasicDistribution.sol +18 -16
- package/contracts/distribution/BasicDistributionAuthorization.sol +22 -9
- package/contracts/distribution/Distribution.sol +36 -77
- package/contracts/distribution/DistributionService.sol +84 -53
- package/contracts/distribution/DistributionServiceManager.sol +1 -1
- package/contracts/distribution/IDistributionComponent.sol +0 -9
- package/contracts/distribution/IDistributionService.sol +22 -20
- package/contracts/examples/fire/FirePool.sol +10 -11
- package/contracts/examples/fire/FirePoolAuthorization.sol +2 -1
- package/contracts/examples/fire/FireProduct.sol +16 -11
- package/contracts/examples/fire/FireProductAuthorization.sol +2 -1
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +39 -8
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -8
- package/contracts/examples/unpermissioned/SimplePool.sol +26 -5
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +28 -0
- package/contracts/examples/unpermissioned/SimpleProduct.sol +36 -8
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +28 -0
- package/contracts/instance/BundleSet.sol +42 -38
- package/contracts/instance/IInstance.sol +61 -18
- package/contracts/instance/IInstanceService.sol +31 -9
- package/contracts/instance/Instance.sol +107 -53
- package/contracts/instance/InstanceAdmin.sol +310 -115
- package/contracts/instance/InstanceAuthorizationV3.sol +99 -40
- package/contracts/instance/InstanceReader.sol +209 -33
- package/contracts/instance/InstanceService.sol +205 -115
- package/contracts/instance/InstanceServiceManager.sol +1 -1
- package/contracts/instance/InstanceStore.sol +13 -2
- package/contracts/instance/RiskSet.sol +118 -0
- package/contracts/instance/base/ObjectCounter.sol +1 -2
- package/contracts/instance/base/ObjectLifecycle.sol +4 -2
- package/contracts/instance/base/ObjectSet.sol +31 -33
- package/contracts/instance/base/ObjectSetHelperLib.sol +30 -0
- package/contracts/instance/module/IComponents.sol +3 -4
- package/contracts/instance/module/IDistribution.sol +5 -2
- package/contracts/instance/module/IPolicy.sol +2 -1
- package/contracts/instance/module/IRisk.sol +3 -0
- package/contracts/oracle/BasicOracle.sol +1 -3
- package/contracts/oracle/BasicOracleAuthorization.sol +3 -12
- package/contracts/oracle/Oracle.sol +1 -3
- package/contracts/oracle/OracleService.sol +92 -73
- package/contracts/oracle/OracleServiceManager.sol +1 -1
- package/contracts/pool/BasicPool.sol +19 -2
- package/contracts/pool/BasicPoolAuthorization.sol +22 -14
- package/contracts/pool/BundleService.sol +88 -154
- package/contracts/pool/BundleServiceManager.sol +1 -1
- package/contracts/pool/IBundleService.sol +15 -43
- package/contracts/pool/IPoolComponent.sol +1 -5
- package/contracts/pool/IPoolService.sol +58 -62
- package/contracts/pool/Pool.sol +95 -81
- package/contracts/pool/PoolLib.sol +216 -0
- package/contracts/pool/PoolService.sol +418 -211
- package/contracts/pool/PoolServiceManager.sol +1 -1
- package/contracts/product/ApplicationService.sol +39 -16
- package/contracts/product/ApplicationServiceManager.sol +1 -1
- package/contracts/product/BasicProduct.sol +2 -2
- package/contracts/product/BasicProductAuthorization.sol +24 -10
- package/contracts/product/ClaimService.sol +177 -136
- package/contracts/product/ClaimServiceManager.sol +1 -1
- package/contracts/product/IApplicationService.sol +8 -2
- package/contracts/product/IClaimService.sol +14 -2
- package/contracts/product/IPolicyService.sol +26 -11
- package/contracts/product/IPricingService.sol +1 -0
- package/contracts/product/IProductComponent.sol +4 -1
- package/contracts/product/IRiskService.sol +7 -7
- package/contracts/product/PolicyService.sol +244 -263
- package/contracts/product/PolicyServiceLib.sol +65 -0
- package/contracts/product/PolicyServiceManager.sol +1 -1
- package/contracts/product/PricingService.sol +32 -20
- package/contracts/product/PricingServiceManager.sol +3 -3
- package/contracts/product/Product.sol +59 -23
- package/contracts/product/RiskService.sol +89 -31
- package/contracts/product/RiskServiceManager.sol +1 -1
- package/contracts/registry/ChainNft.sol +4 -2
- package/contracts/registry/IRegistry.sol +10 -15
- package/contracts/registry/IRelease.sol +26 -0
- package/contracts/registry/Registry.sol +16 -3
- package/contracts/registry/RegistryAdmin.sol +145 -335
- package/contracts/registry/RegistryAuthorization.sol +267 -0
- package/contracts/registry/RegistryService.sol +3 -3
- package/contracts/registry/RegistryServiceManager.sol +1 -1
- package/contracts/registry/ReleaseAdmin.sol +253 -0
- package/contracts/registry/ReleaseLifecycle.sol +2 -0
- package/contracts/registry/ReleaseRegistry.sol +150 -134
- package/contracts/registry/ServiceAuthorizationV3.sol +180 -40
- package/contracts/registry/TokenRegistry.sol +6 -8
- package/contracts/shared/Component.sol +52 -107
- package/contracts/shared/ComponentService.sol +264 -291
- package/contracts/shared/ComponentServiceManager.sol +1 -1
- package/contracts/shared/ComponentVerifyingService.sol +16 -14
- package/contracts/shared/ContractLib.sol +246 -3
- package/contracts/shared/IComponent.sol +1 -17
- package/contracts/shared/IComponentService.sol +18 -26
- package/contracts/shared/IInstanceLinkedComponent.sol +0 -11
- package/contracts/shared/IRegisterable.sol +15 -4
- package/contracts/shared/IService.sol +3 -5
- package/contracts/shared/InitializableERC165.sol +9 -1
- package/contracts/shared/InstanceLinkedComponent.sol +4 -22
- package/contracts/shared/NftOwnable.sol +10 -6
- package/contracts/shared/PolicyHolder.sol +1 -1
- package/contracts/shared/Registerable.sol +41 -20
- package/contracts/shared/RegistryLinked.sol +7 -13
- package/contracts/shared/Service.sol +8 -27
- package/contracts/shared/TokenHandler.sol +275 -72
- package/contracts/shared/TokenHandlerDeployerLib.sol +10 -2
- package/contracts/staking/IStaking.sol +17 -10
- package/contracts/staking/IStakingService.sol +16 -1
- package/contracts/staking/Staking.sol +95 -46
- package/contracts/staking/{StakeManagerLib.sol → StakingLib.sol} +80 -23
- package/contracts/staking/StakingReader.sol +6 -16
- package/contracts/staking/StakingService.sol +85 -14
- package/contracts/staking/StakingServiceManager.sol +5 -4
- package/contracts/staking/StakingStore.sol +2 -1
- package/contracts/type/Key32.sol +2 -2
- package/contracts/type/Key32Set.sol +62 -0
- package/contracts/type/NftId.sol +6 -0
- package/contracts/type/ObjectType.sol +53 -35
- package/contracts/type/RiskId.sol +26 -8
- package/contracts/type/RoleId.sol +27 -4
- package/contracts/type/Selector.sol +5 -0
- package/contracts/type/Timestamp.sol +0 -5
- package/contracts/type/UFixed.sol +9 -119
- package/contracts/type/Version.sol +54 -5
- package/contracts/upgradeability/ProxyManager.sol +1 -1
- package/package.json +4 -4
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.dbg.json +0 -4
- package/artifacts/contracts/authorization/ReleaseAccessManager.sol/ReleaseAccessManager.json +0 -1196
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +0 -4
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +0 -129
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -440
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +0 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +0 -16
- package/contracts/authorization/ReleaseAccessManager.sol +0 -38
- package/contracts/instance/module/IAccess.sol +0 -46
@@ -1,35 +1,34 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {IAccessManaged} from "@openzeppelin/contracts/access/manager/IAccessManaged.sol";
|
5
|
-
|
6
4
|
import {Amount} from "../type/Amount.sol";
|
7
5
|
import {BundleSet} from "./BundleSet.sol";
|
6
|
+
import {RiskSet} from "./RiskSet.sol";
|
8
7
|
import {InstanceAdmin} from "./InstanceAdmin.sol";
|
9
8
|
import {InstanceReader} from "./InstanceReader.sol";
|
10
9
|
import {InstanceStore} from "./InstanceStore.sol";
|
11
10
|
import {IRegisterable} from "../shared/IRegisterable.sol";
|
12
|
-
import {ITransferInterceptor} from "../registry/ITransferInterceptor.sol";
|
13
11
|
import {NftId} from "../type/NftId.sol";
|
14
12
|
import {RoleId} from "../type/RoleId.sol";
|
15
13
|
import {Seconds} from "../type/Seconds.sol";
|
16
14
|
import {UFixed} from "../type/UFixed.sol";
|
17
|
-
import {VersionPart} from "../type/Version.sol";
|
18
15
|
|
19
16
|
|
20
17
|
interface IInstance is
|
21
|
-
IRegisterable
|
22
|
-
ITransferInterceptor,
|
23
|
-
IAccessManaged
|
18
|
+
IRegisterable
|
24
19
|
{
|
25
20
|
error ErrorInstanceInstanceAdminZero();
|
26
|
-
error ErrorInstanceInstanceAdminAlreadySet(address
|
21
|
+
error ErrorInstanceInstanceAdminAlreadySet(address instanceAdmin);
|
27
22
|
error ErrorInstanceInstanceAdminAuthorityMismatch(address instanceAuthority);
|
28
23
|
|
29
24
|
error ErrorInstanceBundleSetAlreadySet(address instanceBundleSet);
|
30
25
|
error ErrorInstanceBundleSetInstanceMismatch(address instance);
|
31
26
|
error ErrorInstanceBundleSetAuthorityMismatch(address instanceAuthority);
|
32
27
|
|
28
|
+
error ErrorInstanceRiskSetAlreadySet(address instanceRiskSet);
|
29
|
+
error ErrorInstanceRiskSetInstanceMismatch(address instance);
|
30
|
+
error ErrorInstanceRiskSetAuthorityMismatch(address instanceAuthority);
|
31
|
+
|
33
32
|
error ErrorInstanceInstanceReaderInstanceMismatch(address instanceAuthority);
|
34
33
|
|
35
34
|
error ErrorInstanceInstanceStoreAlreadySet(address instanceStore);
|
@@ -39,28 +38,72 @@ interface IInstance is
|
|
39
38
|
uint64 requestsCount;
|
40
39
|
}
|
41
40
|
|
42
|
-
|
43
|
-
function registerProduct(address product) external returns (NftId productNftId);
|
41
|
+
///--- instance ---------------------------------------------------------//
|
44
42
|
|
45
|
-
|
46
|
-
function
|
47
|
-
function revokeRole(RoleId roleId, address account) external;
|
43
|
+
/// @dev Locks/unlocks the complete instance, including all its components.
|
44
|
+
function setInstanceLocked(bool locked) external;
|
48
45
|
|
49
|
-
|
50
|
-
function
|
51
|
-
function setTargetLocked(address target, bool locked) external;
|
46
|
+
/// @dev Upgrades the instance reader to the specified target.
|
47
|
+
function upgradeInstanceReader() external;
|
52
48
|
|
49
|
+
/// @dev Sets the instance reader for the instance.
|
50
|
+
/// Permissioned: only the instance service may call this function.
|
51
|
+
function setInstanceReader(InstanceReader instanceReader) external;
|
52
|
+
|
53
|
+
///--- staking ----------------------------------------------------------//
|
54
|
+
|
55
|
+
/// @dev Sets the duration for locking new stakes on this instance..
|
53
56
|
function setStakingLockingPeriod(Seconds stakeLockingPeriod) external;
|
57
|
+
|
58
|
+
/// @dev Sets the staking reward rate [apr] for this instance.
|
54
59
|
function setStakingRewardRate(UFixed rewardRate) external;
|
60
|
+
|
61
|
+
/// @dev Sets the maximum staked amount for this instance.
|
62
|
+
function setStakingMaxAmount(Amount maxStakedAmount) external;
|
63
|
+
|
64
|
+
/// @dev Refills the staking reward reserves for the specified target.
|
55
65
|
function refillStakingRewardReserves(Amount dipAmount) external;
|
56
66
|
|
57
67
|
/// @dev Defunds the staking reward reserves for the specified target.
|
58
|
-
/// Permissioned: only the target owner may call this function.
|
59
68
|
function withdrawStakingRewardReserves(Amount dipAmount) external returns (Amount newBalance);
|
60
69
|
|
61
|
-
|
70
|
+
///--- product/component ------------------------------------------------//
|
71
|
+
|
72
|
+
/// @dev Locks/unlocks the specified target.
|
73
|
+
function setTargetLocked(address target, bool locked) external;
|
74
|
+
|
75
|
+
/// @dev Register a product with the instance.
|
76
|
+
function registerProduct(address product, address token) external returns (NftId productNftId);
|
77
|
+
|
78
|
+
///--- authz ------------------------------------------------------------//
|
79
|
+
|
80
|
+
/// @dev Creates a new custom role for the calling instance.
|
81
|
+
/// Custom roles are intended to be used for access control of custom components and its helper contracts.
|
82
|
+
/// Custom roles are not intended to be used as target roles for custom contracts.
|
83
|
+
function createRole(string memory roleName, RoleId adminRoleId, uint32 maxMemberCount) external returns (RoleId roleId);
|
84
|
+
|
85
|
+
function grantRole(RoleId roleId, address account) external;
|
86
|
+
function revokeRole(RoleId roleId, address account) external;
|
87
|
+
|
88
|
+
function createTarget(address target, string memory name) external;
|
89
|
+
function setTargetFunctionRole(string memory targetName, bytes4[] calldata selectors, RoleId roleId) external;
|
90
|
+
|
91
|
+
//--- getters -----------------------------------------------------------//
|
92
|
+
|
93
|
+
/// @dev returns the overall locking state of the instance (including all components)
|
94
|
+
function isInstanceLocked() external view returns (bool isLocked);
|
95
|
+
|
96
|
+
/// @dev returns the locking state of the specified target
|
97
|
+
function isTargetLocked(address target) external view returns (bool isLocked);
|
98
|
+
|
99
|
+
// get products
|
100
|
+
function products() external view returns (uint256 productCount);
|
101
|
+
function getProductNftId(uint256 idx) external view returns (NftId productNftId);
|
102
|
+
|
103
|
+
// get supporting contracts
|
62
104
|
function getInstanceReader() external view returns (InstanceReader);
|
63
105
|
function getBundleSet() external view returns (BundleSet);
|
106
|
+
function getRiskSet() external view returns (RiskSet);
|
64
107
|
function getInstanceAdmin() external view returns (InstanceAdmin);
|
65
108
|
function getInstanceStore() external view returns (InstanceStore);
|
66
109
|
}
|
@@ -2,9 +2,7 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {Amount} from "../type/Amount.sol";
|
5
|
-
import {
|
6
|
-
import {Instance} from "./Instance.sol";
|
7
|
-
import {IInstanceLinkedComponent} from "../shared/IInstanceLinkedComponent.sol";
|
5
|
+
import {IInstance} from "./IInstance.sol";
|
8
6
|
import {IService} from "../shared/IService.sol";
|
9
7
|
import {NftId} from "../type/NftId.sol";
|
10
8
|
import {ObjectType} from "../type/ObjectType.sol";
|
@@ -18,13 +16,14 @@ interface IInstanceService is IService {
|
|
18
16
|
// onlyInstance
|
19
17
|
error ErrorInstanceServiceNotRegistered(address instance);
|
20
18
|
error ErrorInstanceServiceNotInstance(address instance, ObjectType objectType);
|
21
|
-
error ErrorInstanceServiceInstanceVersionMismatch(
|
19
|
+
error ErrorInstanceServiceInstanceVersionMismatch(NftId instanceNftId, VersionPart expectedRelease, VersionPart instanceRelease);
|
22
20
|
|
23
21
|
error ErrorInstanceServiceComponentNotInstanceLinked(address component);
|
24
22
|
|
25
23
|
error ErrorInstanceServiceMasterInstanceAlreadySet();
|
26
24
|
error ErrorInstanceServiceMasterInstanceAdminAlreadySet();
|
27
25
|
error ErrorInstanceServiceMasterBundleSetAlreadySet();
|
26
|
+
error ErrorInstanceServiceMasterRiskSetAlreadySet();
|
28
27
|
error ErrorInstanceServiceInstanceAddressZero();
|
29
28
|
|
30
29
|
error ErrorInstanceServiceMasterInstanceReaderNotSet();
|
@@ -36,12 +35,15 @@ interface IInstanceService is IService {
|
|
36
35
|
error ErrorInstanceServiceInstanceAdminZero();
|
37
36
|
error ErrorInstanceServiceInstanceReaderZero();
|
38
37
|
error ErrorInstanceServiceBundleSetZero();
|
38
|
+
error ErrorInstanceServiceRiskSetZero();
|
39
39
|
error ErrorInstanceServiceInstanceStoreZero();
|
40
40
|
|
41
41
|
error ErrorInstanceServiceInstanceAuthorityMismatch();
|
42
42
|
error ErrorInstanceServiceBundleSetAuthorityMismatch();
|
43
|
+
error ErrorInstanceServiceRiskSetAuthorityMismatch();
|
43
44
|
error ErrorInstanceServiceInstanceReaderInstanceMismatch2();
|
44
|
-
error
|
45
|
+
error ErrorInstanceServiceBundleSetInstanceMismatch();
|
46
|
+
error ErrorInstanceServiceRiskSetInstanceMismatch();
|
45
47
|
error ErrorInstanceServiceInstanceStoreAuthorityMismatch();
|
46
48
|
|
47
49
|
error ErrorInstanceServiceRequestUnauhorized(address caller);
|
@@ -52,21 +54,41 @@ interface IInstanceService is IService {
|
|
52
54
|
|
53
55
|
event LogInstanceCloned(NftId instanceNftId, address instance);
|
54
56
|
|
57
|
+
/// @dev creates a new role for the calling instance.
|
58
|
+
function createRole(string memory roleName, RoleId adminRoleId, uint32 maxMemberCount) external returns (RoleId roleId);
|
59
|
+
|
60
|
+
/// @dev grants the specified role to the specified account for the calling instance.
|
61
|
+
function grantRole(RoleId roleId, address account) external;
|
62
|
+
|
63
|
+
/// @dev revokes the specified role from the specified account for the calling instance.
|
64
|
+
function revokeRole(RoleId roleId, address account) external;
|
65
|
+
|
66
|
+
/// @dev Locks the complete instance, including all its components.
|
67
|
+
function setInstanceLocked(bool locked) external;
|
68
|
+
|
69
|
+
/// @dev Locks/unlocks the specified target constrolled by the corresponding instance admin.
|
70
|
+
function setTargetLocked(address target, bool locked) external;
|
71
|
+
|
72
|
+
/// @dev Creates a new instance.
|
73
|
+
/// The caller becomes the owner of the new instance.
|
74
|
+
/// Creation of a new instance is achieved by this service through the creation and registration
|
75
|
+
/// of a new clone of the master instance and then setting up the initial wiring and authorization
|
76
|
+
/// of the necessary components.
|
55
77
|
function createInstance()
|
56
78
|
external
|
57
79
|
returns (
|
58
|
-
|
59
|
-
Instance clonedInstance,
|
80
|
+
IInstance instance,
|
60
81
|
NftId instanceNftId
|
61
82
|
);
|
62
83
|
|
84
|
+
function upgradeInstanceReader() external;
|
85
|
+
function upgradeMasterInstanceReader(address instanceReaderAddress) external;
|
63
86
|
|
64
87
|
function setStakingLockingPeriod(Seconds stakeLockingPeriod) external;
|
65
88
|
function setStakingRewardRate(UFixed rewardRate) external;
|
89
|
+
function setStakingMaxAmount(Amount maxStakedAmount) external;
|
66
90
|
function refillStakingRewardReserves(address rewardProvider, Amount dipAmount) external;
|
67
91
|
|
68
92
|
/// @dev Defunds the staking reward reserves for the specified target.
|
69
93
|
function withdrawStakingRewardReserves(Amount dipAmount) external returns (Amount newBalance);
|
70
|
-
|
71
|
-
function setComponentLocked(bool locked) external;
|
72
94
|
}
|
@@ -1,110 +1,131 @@
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {
|
4
|
+
import {IInstance} from "./IInstance.sol";
|
5
|
+
import {IComponentService} from "../shared/IComponentService.sol";
|
6
|
+
import {IInstanceService} from "./IInstanceService.sol";
|
7
|
+
import {IRegistry} from "../registry/IRegistry.sol";
|
5
8
|
|
6
9
|
import {Amount} from "../type/Amount.sol";
|
7
10
|
import {BundleSet} from "./BundleSet.sol";
|
11
|
+
import {RiskSet} from "./RiskSet.sol";
|
8
12
|
import {COMPONENT, INSTANCE} from "../type/ObjectType.sol";
|
9
|
-
import {IInstance} from "./IInstance.sol";
|
10
|
-
import {IComponentService} from "../shared/IComponentService.sol";
|
11
|
-
import {IInstanceService} from "./IInstanceService.sol";
|
12
13
|
import {InstanceReader} from "./InstanceReader.sol";
|
13
14
|
import {InstanceAdmin} from "./InstanceAdmin.sol";
|
14
15
|
import {InstanceStore} from "./InstanceStore.sol";
|
15
|
-
import {IRegistry} from "../registry/IRegistry.sol";
|
16
16
|
import {NftId} from "../type/NftId.sol";
|
17
17
|
import {Registerable} from "../shared/Registerable.sol";
|
18
18
|
import {RoleId} from "../type/RoleId.sol";
|
19
19
|
import {Seconds} from "../type/Seconds.sol";
|
20
20
|
import {UFixed} from "../type/UFixed.sol";
|
21
|
-
import {VersionPart
|
21
|
+
import {VersionPart} from "../type/Version.sol";
|
22
22
|
|
23
23
|
contract Instance is
|
24
24
|
IInstance,
|
25
|
-
AccessManagedUpgradeable,
|
26
25
|
Registerable
|
27
26
|
{
|
28
27
|
bool private _initialized;
|
29
28
|
|
30
29
|
IComponentService internal _componentService;
|
31
30
|
IInstanceService internal _instanceService;
|
31
|
+
|
32
32
|
InstanceAdmin internal _instanceAdmin;
|
33
33
|
InstanceReader internal _instanceReader;
|
34
|
-
BundleSet internal
|
34
|
+
BundleSet internal _bundleSet;
|
35
|
+
RiskSet internal _riskSet;
|
35
36
|
InstanceStore internal _instanceStore;
|
36
|
-
|
37
|
-
modifier onlyChainNft() {
|
38
|
-
if(msg.sender != getRegistry().getChainNftAddress()) {
|
39
|
-
revert();
|
40
|
-
}
|
41
|
-
_;
|
42
|
-
}
|
37
|
+
NftId [] internal _products;
|
43
38
|
|
44
39
|
function initialize(
|
45
40
|
InstanceAdmin instanceAdmin,
|
46
41
|
InstanceStore instanceStore,
|
47
|
-
BundleSet
|
42
|
+
BundleSet bundleSet,
|
43
|
+
RiskSet riskSet,
|
48
44
|
InstanceReader instanceReader,
|
49
45
|
IRegistry registry,
|
46
|
+
VersionPart release,
|
50
47
|
address initialOwner
|
51
48
|
)
|
52
49
|
external
|
53
50
|
initializer()
|
54
51
|
{
|
55
|
-
|
56
|
-
if(_instanceAdmin.authority() == address(0)) {
|
52
|
+
if(address(instanceAdmin) == address(0)) {
|
57
53
|
revert ErrorInstanceInstanceAdminZero();
|
58
54
|
}
|
59
55
|
|
60
|
-
|
61
|
-
__AccessManaged_init(_instanceAdmin.authority());
|
56
|
+
_instanceAdmin = instanceAdmin;
|
62
57
|
|
63
58
|
// setup instance object info
|
64
|
-
|
65
|
-
|
66
|
-
registry
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
59
|
+
__Registerable_init({
|
60
|
+
authority: instanceAdmin.authority(),
|
61
|
+
registry: address(registry),
|
62
|
+
parentNftId: registry.getNftId(),
|
63
|
+
objectType: INSTANCE(),
|
64
|
+
isInterceptor: false,
|
65
|
+
initialOwner: initialOwner,
|
66
|
+
data: ""});
|
71
67
|
|
72
68
|
// store instance supporting contracts
|
73
69
|
_instanceStore = instanceStore;
|
74
|
-
|
70
|
+
_bundleSet = bundleSet;
|
71
|
+
_riskSet = riskSet;
|
75
72
|
_instanceReader = instanceReader;
|
76
73
|
|
77
74
|
// initialize instance supporting contracts
|
78
75
|
_instanceStore.initialize();
|
79
|
-
|
76
|
+
_bundleSet.initialize(instanceAdmin.authority(), address(registry));
|
77
|
+
_riskSet.initialize(instanceAdmin.authority(), address(registry));
|
80
78
|
_instanceReader.initialize();
|
81
79
|
|
82
80
|
_componentService = IComponentService(
|
83
81
|
getRegistry().getServiceAddress(
|
84
82
|
COMPONENT(),
|
85
|
-
|
83
|
+
release));
|
86
84
|
|
87
85
|
_instanceService = IInstanceService(
|
88
86
|
getRegistry().getServiceAddress(
|
89
87
|
INSTANCE(),
|
90
|
-
|
88
|
+
release));
|
91
89
|
|
92
90
|
_registerInterface(type(IInstance).interfaceId);
|
93
91
|
}
|
94
92
|
|
93
|
+
|
94
|
+
function setInstanceLocked(bool locked)
|
95
|
+
external
|
96
|
+
// not restricted(): need to be able to unlock a locked instance
|
97
|
+
onlyOwner()
|
98
|
+
{
|
99
|
+
_instanceService.setInstanceLocked(locked);
|
100
|
+
}
|
101
|
+
|
102
|
+
|
103
|
+
function upgradeInstanceReader()
|
104
|
+
external
|
105
|
+
restricted()
|
106
|
+
onlyOwner()
|
107
|
+
{
|
108
|
+
_instanceService.upgradeInstanceReader();
|
109
|
+
}
|
110
|
+
|
111
|
+
|
95
112
|
//--- ProductRegistration ----------------------------------------------//
|
96
|
-
|
113
|
+
|
114
|
+
function registerProduct(address product, address token)
|
97
115
|
external
|
116
|
+
restricted()
|
98
117
|
onlyOwner()
|
99
118
|
returns (NftId productNftId)
|
100
119
|
{
|
101
|
-
|
120
|
+
productNftId = _componentService.registerProduct(product, token);
|
121
|
+
_products.push(productNftId);
|
102
122
|
}
|
103
123
|
|
104
124
|
//--- Staking ----------------------------------------------------------//
|
105
125
|
|
106
126
|
function setStakingLockingPeriod(Seconds stakeLockingPeriod)
|
107
127
|
external
|
128
|
+
restricted()
|
108
129
|
onlyOwner()
|
109
130
|
{
|
110
131
|
_instanceService.setStakingLockingPeriod(stakeLockingPeriod);
|
@@ -112,13 +133,22 @@ contract Instance is
|
|
112
133
|
|
113
134
|
function setStakingRewardRate(UFixed rewardRate)
|
114
135
|
external
|
136
|
+
restricted()
|
115
137
|
onlyOwner()
|
116
138
|
{
|
117
139
|
_instanceService.setStakingRewardRate(rewardRate);
|
118
140
|
}
|
119
141
|
|
142
|
+
function setStakingMaxAmount(Amount maxStakedAmount)
|
143
|
+
external
|
144
|
+
onlyOwner()
|
145
|
+
{
|
146
|
+
_instanceService.setStakingMaxAmount(maxStakedAmount);
|
147
|
+
}
|
148
|
+
|
120
149
|
function refillStakingRewardReserves(Amount dipAmount)
|
121
150
|
external
|
151
|
+
restricted()
|
122
152
|
onlyOwner()
|
123
153
|
{
|
124
154
|
address instanceOwner = msg.sender;
|
@@ -127,6 +157,7 @@ contract Instance is
|
|
127
157
|
|
128
158
|
function withdrawStakingRewardReserves(Amount dipAmount)
|
129
159
|
external
|
160
|
+
restricted()
|
130
161
|
onlyOwner()
|
131
162
|
returns (Amount newBalance)
|
132
163
|
{
|
@@ -135,17 +166,23 @@ contract Instance is
|
|
135
166
|
|
136
167
|
//--- Roles ------------------------------------------------------------//
|
137
168
|
|
138
|
-
|
169
|
+
/// @inheritdoc IInstance
|
170
|
+
function createRole(
|
171
|
+
string memory roleName,
|
172
|
+
RoleId adminRoleId,
|
173
|
+
uint32 maxMemberCount
|
174
|
+
)
|
139
175
|
external
|
176
|
+
restricted()
|
140
177
|
onlyOwner()
|
141
|
-
returns (RoleId roleId
|
178
|
+
returns (RoleId roleId)
|
142
179
|
{
|
143
|
-
|
144
|
-
// (roleId, admin) = _instanceAdmin.createRole(roleName, adminName);
|
180
|
+
return _instanceService.createRole(roleName, adminRoleId, maxMemberCount);
|
145
181
|
}
|
146
182
|
|
147
183
|
function grantRole(RoleId roleId, address account)
|
148
184
|
external
|
185
|
+
restricted()
|
149
186
|
onlyOwner()
|
150
187
|
{
|
151
188
|
_instanceAdmin.grantRole(roleId, account);
|
@@ -153,6 +190,7 @@ contract Instance is
|
|
153
190
|
|
154
191
|
function revokeRole(RoleId roleId, address account)
|
155
192
|
external
|
193
|
+
restricted()
|
156
194
|
onlyOwner()
|
157
195
|
{
|
158
196
|
// TODO refactor
|
@@ -161,8 +199,18 @@ contract Instance is
|
|
161
199
|
|
162
200
|
//--- Targets ------------------------------------------------------------//
|
163
201
|
|
202
|
+
|
203
|
+
function setTargetLocked(address target, bool locked)
|
204
|
+
external
|
205
|
+
// not restricted(): instance owner may need to be able to unlock targets on an locked instance
|
206
|
+
onlyOwner()
|
207
|
+
{
|
208
|
+
_instanceService.setTargetLocked(target, locked);
|
209
|
+
}
|
210
|
+
|
164
211
|
function createTarget(address target, string memory name)
|
165
212
|
external
|
213
|
+
restricted()
|
166
214
|
onlyOwner()
|
167
215
|
{
|
168
216
|
// TODO refactor
|
@@ -175,27 +223,13 @@ contract Instance is
|
|
175
223
|
RoleId roleId
|
176
224
|
)
|
177
225
|
external
|
226
|
+
restricted()
|
178
227
|
onlyOwner()
|
179
228
|
{
|
180
229
|
// TODO refactor
|
181
230
|
// _instanceAdmin.setTargetFunctionRoleByInstance(targetName, selectors, roleId);
|
182
231
|
}
|
183
232
|
|
184
|
-
function setTargetLocked(address target, bool locked)
|
185
|
-
external
|
186
|
-
onlyOwner()
|
187
|
-
{
|
188
|
-
// TODO refactor
|
189
|
-
// _instanceAdmin.setTargetLockedByInstance(target, locked);
|
190
|
-
}
|
191
|
-
|
192
|
-
//--- ITransferInterceptor ----------------------------------------------//
|
193
|
-
|
194
|
-
function nftTransferFrom(address from, address to, uint256 tokenId, address operator) external onlyChainNft {
|
195
|
-
// TODO refactor
|
196
|
-
// _instanceAdmin.transferInstanceOwnerRole(from, to);
|
197
|
-
}
|
198
|
-
|
199
233
|
//--- initial setup functions -------------------------------------------//
|
200
234
|
|
201
235
|
|
@@ -212,12 +246,32 @@ contract Instance is
|
|
212
246
|
|
213
247
|
//--- external view functions -------------------------------------------//
|
214
248
|
|
249
|
+
function isInstanceLocked() external view returns (bool) {
|
250
|
+
return _instanceAdmin.isLocked();
|
251
|
+
}
|
252
|
+
|
253
|
+
function isTargetLocked(address target) external view returns (bool) {
|
254
|
+
return _instanceAdmin.isTargetLocked(target);
|
255
|
+
}
|
256
|
+
|
257
|
+
function products() external view returns (uint256 productCount) {
|
258
|
+
return _products.length;
|
259
|
+
}
|
260
|
+
|
261
|
+
function getProductNftId(uint256 idx) external view returns (NftId productNftId) {
|
262
|
+
return _products[idx];
|
263
|
+
}
|
264
|
+
|
215
265
|
function getInstanceReader() external view returns (InstanceReader) {
|
216
266
|
return _instanceReader;
|
217
267
|
}
|
218
268
|
|
219
269
|
function getBundleSet() external view returns (BundleSet) {
|
220
|
-
return
|
270
|
+
return _bundleSet;
|
271
|
+
}
|
272
|
+
|
273
|
+
function getRiskSet() external view returns (RiskSet) {
|
274
|
+
return _riskSet;
|
221
275
|
}
|
222
276
|
|
223
277
|
function getInstanceAdmin() external view returns (InstanceAdmin) {
|