@etherisc/gif-next 0.0.2-952752e-374 → 0.0.2-957bd35-589
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -312
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingService.sol/AccountingService.json +106 -38
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/accounting/AccountingServiceManager.sol/AccountingServiceManager.json +111 -45
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.dbg.json +1 -1
- package/artifacts/contracts/accounting/IAccountingService.sol/IAccountingService.json +58 -6
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +1 -1
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +690 -296
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdminLib.sol/AccessAdminLib.json +2008 -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 +438 -35
- 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 +529 -221
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +191 -21
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +256 -16
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +1 -1
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +426 -27
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +66 -154
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +427 -53
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +21 -98
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +512 -204
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +167 -77
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +20 -97
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +358 -82
- 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 +109 -110
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FirePoolAuthorization.sol/FirePoolAuthorization.json +401 -59
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProduct.sol/FireProduct.json +145 -142
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/fire/FireProductAuthorization.sol/FireProductAuthorization.json +426 -52
- 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 +128 -178
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol/SimpleDistributionAuthorization.json +426 -52
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleOracle.sol/SimpleOracle.json +39 -73
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePool.sol/SimplePool.json +130 -148
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimplePoolAuthorization.sol/SimplePoolAuthorization.json +401 -59
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProduct.sol/SimpleProduct.json +360 -193
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/examples/unpermissioned/SimpleProductAuthorization.sol/SimpleProductAuthorization.json +426 -52
- package/artifacts/contracts/instance/BaseStore.sol/BaseStore.dbg.json +4 -0
- package/artifacts/contracts/{shared/IKeyValueStore.sol/IKeyValueStore.json → instance/BaseStore.sol/BaseStore.json} +51 -229
- 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/IBaseStore.sol/IBaseStore.dbg.json +4 -0
- package/artifacts/contracts/instance/IBaseStore.sol/IBaseStore.json +304 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +482 -28
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +355 -12
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +520 -85
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1037 -437
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +369 -71
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +674 -487
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +387 -64
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +100 -52
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +1328 -2007
- package/artifacts/contracts/instance/ProductStore.sol/ProductStore.dbg.json +4 -0
- package/artifacts/contracts/instance/ProductStore.sol/ProductStore.json +3427 -0
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.dbg.json +1 -1
- package/artifacts/contracts/instance/RiskSet.sol/RiskSet.json +101 -88
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +8 -8
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +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 +33 -45
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +1 -1
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +425 -54
- 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 +19 -31
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +29 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +19 -31
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +87 -42
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +116 -50
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +59 -79
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +1 -1
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +401 -59
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +280 -209
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +134 -68
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +174 -87
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +29 -41
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +306 -166
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +29 -41
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolLib.sol/PoolLib.json +522 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +547 -340
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +162 -68
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +273 -50
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +123 -41
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +46 -58
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +1 -1
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +426 -52
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +137 -139
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +128 -82
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +208 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +45 -23
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +133 -65
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +50 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +40 -52
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.dbg.json +1 -1
- package/artifacts/contracts/product/IRiskService.sol/IRiskService.json +231 -19
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +245 -161
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceLib.sol/PolicyServiceLib.json +783 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +146 -80
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +116 -114
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +115 -65
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +40 -52
- package/artifacts/contracts/product/RiskService.sol/RiskService.dbg.json +1 -1
- package/artifacts/contracts/product/RiskService.sol/RiskService.json +279 -43
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/RiskServiceManager.sol/RiskServiceManager.json +111 -41
- 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/IRegistry.sol/IRegistry.json +52 -22
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +29 -0
- 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 +90 -60
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +824 -430
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAuthorization.sol/RegistryAuthorization.json +1137 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +47 -18
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +96 -38
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseAdmin.sol/ReleaseAdmin.json +933 -457
- 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 +202 -126
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +1 -1
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +459 -26
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +119 -59
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/Component.sol/Component.json +19 -31
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +206 -252
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +130 -72
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.dbg.json +1 -1
- package/artifacts/contracts/shared/ContractLib.sol/ContractLib.json +130 -39
- 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/ContractLib.sol/ITokenRegistryHelper.json +2 -2
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +19 -31
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +111 -157
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +19 -31
- 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/INftOwnable.sol/INftOwnable.json +19 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.json +19 -0
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +29 -0
- package/artifacts/contracts/shared/InitializableERC165.sol/InitializableERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/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 +19 -31
- 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 +21 -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 +19 -0
- 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 +29 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +62 -161
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandlerBase.json +118 -29
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandlerDeployerLib.sol/TokenHandlerDeployerLib.json +32 -32
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1453 -153
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +187 -107
- package/artifacts/contracts/staking/ITargetLimitHandler.sol/ITargetLimitHandler.dbg.json +4 -0
- package/artifacts/contracts/staking/ITargetLimitHandler.sol/ITargetLimitHandler.json +50 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +1565 -239
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLib.sol/StakingLib.json +470 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +146 -67
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +294 -177
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +229 -157
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +99 -45
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +1633 -819
- package/artifacts/contracts/staking/TargetHandler.sol/TargetHandler.dbg.json +4 -0
- package/artifacts/contracts/staking/TargetHandler.sol/TargetHandler.json +309 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +159 -87
- 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/Blocknumber.sol/BlocknumberLib.json +64 -19
- package/artifacts/contracts/type/ChainId.sol/ChainIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/ChainId.sol/ChainIdLib.json +193 -0
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +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 +9 -4
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +42 -157
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +45 -2
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +21 -2
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +1 -1
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +2 -2
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +1 -1
- package/artifacts/contracts/type/String.sol/StrLib.json +50 -2
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +3 -3
- 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/IVersionable.sol/IVersionable.json +10 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +81 -27
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +15 -2
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.json +10 -0
- package/contracts/accounting/AccountingService.sol +15 -3
- package/contracts/accounting/IAccountingService.sol +4 -2
- package/contracts/authorization/AccessAdmin.sol +364 -344
- package/contracts/authorization/AccessAdminLib.sol +678 -0
- package/contracts/authorization/AccessManagerCloneable.sol +23 -32
- package/contracts/authorization/Authorization.sol +161 -260
- package/contracts/authorization/IAccess.sol +29 -12
- package/contracts/authorization/IAccessAdmin.sol +85 -83
- package/contracts/authorization/IAuthorization.sol +9 -43
- package/contracts/authorization/IServiceAuthorization.sol +55 -17
- package/contracts/authorization/ServiceAuthorization.sol +228 -34
- package/contracts/distribution/BasicDistribution.sol +14 -13
- package/contracts/distribution/BasicDistributionAuthorization.sol +29 -9
- package/contracts/distribution/Distribution.sol +22 -64
- package/contracts/distribution/DistributionService.sol +166 -75
- package/contracts/distribution/IDistributionComponent.sol +3 -10
- package/contracts/distribution/IDistributionService.sol +34 -19
- package/contracts/examples/fire/FirePool.sol +0 -4
- package/contracts/examples/fire/FirePoolAuthorization.sol +1 -1
- package/contracts/examples/fire/FireProduct.sol +7 -12
- package/contracts/examples/fire/FireProductAuthorization.sol +1 -1
- package/contracts/examples/unpermissioned/SimpleDistribution.sol +32 -8
- package/contracts/examples/unpermissioned/SimpleDistributionAuthorization.sol +1 -1
- package/contracts/examples/unpermissioned/SimpleOracle.sol +4 -8
- package/contracts/examples/unpermissioned/SimplePool.sol +0 -5
- package/contracts/examples/unpermissioned/SimplePoolAuthorization.sol +1 -1
- package/contracts/examples/unpermissioned/SimpleProduct.sol +94 -27
- package/contracts/examples/unpermissioned/SimpleProductAuthorization.sol +1 -1
- package/contracts/instance/BaseStore.sol +93 -0
- package/contracts/instance/IBaseStore.sol +37 -0
- package/contracts/instance/IInstance.sol +103 -13
- package/contracts/instance/IInstanceService.sol +54 -7
- package/contracts/instance/Instance.sol +177 -61
- package/contracts/instance/InstanceAdmin.sol +199 -218
- package/contracts/instance/InstanceAuthorizationV3.sol +120 -70
- package/contracts/instance/InstanceReader.sol +392 -382
- package/contracts/instance/InstanceService.sol +283 -173
- package/contracts/instance/InstanceStore.sol +153 -128
- package/contracts/instance/ProductStore.sol +290 -0
- package/contracts/instance/RiskSet.sol +10 -2
- package/contracts/instance/TargetNames.sol +10 -0
- package/contracts/instance/base/BalanceStore.sol +4 -6
- package/contracts/instance/base/ObjectLifecycle.sol +2 -6
- package/contracts/instance/module/IBundle.sol +6 -5
- package/contracts/instance/module/IComponents.sol +15 -6
- package/contracts/instance/module/IDistribution.sol +21 -8
- package/contracts/instance/module/IPolicy.sol +28 -8
- package/contracts/instance/module/IRisk.sol +2 -0
- package/contracts/oracle/BasicOracle.sol +3 -6
- package/contracts/oracle/BasicOracleAuthorization.sol +15 -8
- package/contracts/oracle/IOracle.sol +9 -4
- package/contracts/oracle/Oracle.sol +4 -8
- package/contracts/oracle/OracleService.sol +8 -8
- package/contracts/pool/BasicPool.sol +4 -18
- package/contracts/pool/BasicPoolAuthorization.sol +29 -16
- package/contracts/pool/BundleService.sol +57 -96
- package/contracts/pool/IBundleService.sol +27 -32
- package/contracts/pool/IPoolService.sol +57 -40
- package/contracts/pool/Pool.sol +15 -29
- package/contracts/pool/PoolLib.sol +341 -0
- package/contracts/pool/PoolService.sol +189 -190
- package/contracts/product/ApplicationService.sol +85 -17
- package/contracts/product/BasicProduct.sol +2 -5
- package/contracts/product/BasicProductAuthorization.sol +31 -9
- package/contracts/product/ClaimService.sol +112 -194
- package/contracts/product/IApplicationService.sol +24 -2
- package/contracts/product/IClaimService.sol +6 -6
- package/contracts/product/IPolicyService.sol +20 -8
- package/contracts/product/IPricingService.sol +1 -0
- package/contracts/product/IRiskService.sol +25 -10
- package/contracts/product/PolicyService.sol +110 -201
- package/contracts/product/PolicyServiceLib.sol +139 -0
- package/contracts/product/PricingService.sol +33 -31
- package/contracts/product/Product.sol +61 -33
- package/contracts/product/RiskService.sol +63 -25
- package/contracts/registry/IRegistry.sol +17 -9
- package/contracts/registry/IRelease.sol +6 -3
- package/contracts/registry/Registry.sol +19 -9
- package/contracts/registry/RegistryAdmin.sol +85 -256
- package/contracts/registry/RegistryAuthorization.sol +337 -0
- package/contracts/registry/RegistryService.sol +1 -1
- package/contracts/registry/ReleaseAdmin.sol +70 -116
- package/contracts/registry/ReleaseRegistry.sol +57 -43
- package/contracts/registry/ServiceAuthorizationV3.sol +131 -31
- package/contracts/registry/TokenRegistry.sol +56 -52
- package/contracts/shared/Component.sol +19 -35
- package/contracts/shared/ComponentService.sol +281 -290
- package/contracts/shared/ContractLib.sol +137 -77
- package/contracts/shared/IComponent.sol +1 -4
- package/contracts/shared/IComponentService.sol +21 -26
- package/contracts/shared/INftOwnable.sol +2 -0
- package/contracts/shared/IRegisterable.sol +0 -1
- package/contracts/shared/InitializableERC165.sol +9 -1
- package/contracts/shared/InstanceLinkedComponent.sol +8 -13
- package/contracts/shared/NftOwnable.sol +4 -2
- package/contracts/shared/PolicyHolder.sol +3 -2
- package/contracts/shared/Registerable.sol +1 -4
- package/contracts/shared/Service.sol +6 -4
- package/contracts/shared/TokenHandler.sol +44 -91
- package/contracts/staking/IStaking.sol +265 -72
- package/contracts/staking/IStakingService.sol +45 -75
- package/contracts/staking/ITargetLimitHandler.sol +17 -0
- package/contracts/staking/Staking.sol +475 -204
- package/contracts/staking/{StakeManagerLib.sol → StakingLib.sol} +55 -84
- package/contracts/staking/StakingManager.sol +4 -3
- package/contracts/staking/StakingReader.sol +58 -77
- package/contracts/staking/StakingService.sol +62 -180
- package/contracts/staking/StakingServiceManager.sol +6 -4
- package/contracts/staking/StakingStore.sol +1093 -330
- package/contracts/staking/TargetHandler.sol +132 -0
- package/contracts/staking/TargetManagerLib.sol +69 -46
- package/contracts/type/Amount.sol +4 -0
- package/contracts/type/Blocknumber.sol +17 -22
- package/contracts/type/ChainId.sol +101 -0
- package/contracts/type/Fee.sol +8 -8
- package/contracts/type/NftId.sol +3 -3
- package/contracts/type/ObjectType.sol +69 -52
- package/contracts/type/RiskId.sol +4 -3
- package/contracts/type/RoleId.sol +60 -45
- package/contracts/type/Seconds.sol +19 -0
- package/contracts/type/Selector.sol +5 -0
- package/contracts/type/String.sol +12 -0
- package/contracts/type/Timestamp.sol +4 -2
- package/contracts/type/UFixed.sol +28 -10
- package/contracts/type/Version.sol +39 -0
- package/contracts/upgradeability/IVersionable.sol +3 -0
- package/contracts/upgradeability/ProxyManager.sol +26 -12
- package/contracts/upgradeability/UpgradableProxyWithAdmin.sol +12 -2
- package/contracts/upgradeability/Versionable.sol +6 -3
- package/package.json +2 -2
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.dbg.json +0 -4
- package/artifacts/contracts/authorization/AccessAdmin.sol/IAccessManagedChecker.json +0 -24
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +0 -4
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +0 -129
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +0 -4
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +0 -485
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +0 -4
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +0 -538
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +0 -4
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +0 -440
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +0 -4
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +0 -205
- package/contracts/instance/module/IAccess.sol +0 -46
- package/contracts/shared/ComponentVerifyingService.sol +0 -128
- package/contracts/shared/IKeyValueStore.sol +0 -54
- package/contracts/shared/KeyValueStore.sol +0 -131
- package/contracts/staking/StakingLifecycle.sol +0 -23
@@ -19,13 +19,16 @@ interface IRegistry is
|
|
19
19
|
IERC165
|
20
20
|
{
|
21
21
|
|
22
|
-
event
|
23
|
-
event
|
24
|
-
event
|
22
|
+
event LogRegistryObjectRegistered(NftId nftId, NftId parentNftId, ObjectType objectType, bool isInterceptor, address objectAddress, address initialOwner);
|
23
|
+
event LogRegistryServiceRegistered(VersionPart majorVersion, ObjectType domain);
|
24
|
+
event LogRegistryChainRegistryRegistered(NftId nftId, uint256 chainId, address chainRegistryAddress);
|
25
25
|
|
26
26
|
// initialize
|
27
27
|
error ErrorRegistryCallerNotDeployer();
|
28
28
|
|
29
|
+
// register()
|
30
|
+
error ErrorRegistryObjectTypeNotSupported(ObjectType objectType);
|
31
|
+
|
29
32
|
// registerRegistry()
|
30
33
|
error ErrorRegistryNotOnMainnet(uint256 chainId);
|
31
34
|
error ErrorRegistryChainRegistryChainIdZero(NftId nftId);
|
@@ -36,8 +39,7 @@ interface IRegistry is
|
|
36
39
|
// registerService()
|
37
40
|
error ErrorRegistryServiceAddressZero();
|
38
41
|
error ErrorRegistryServiceVersionZero(address service);
|
39
|
-
|
40
|
-
//error ErrorRegistryServiceVersionNotDeploying(address service, VersionPart version);
|
42
|
+
|
41
43
|
error ErrorRegistryServiceDomainZero(address service, VersionPart version);
|
42
44
|
error ErrorRegistryNotService(address service, ObjectType objectType);
|
43
45
|
error ErrorRegistryServiceParentNotRegistry(address service, VersionPart version, NftId parentNftId);
|
@@ -48,16 +50,20 @@ interface IRegistry is
|
|
48
50
|
|
49
51
|
// _register()
|
50
52
|
error ErrorRegistryGlobalRegistryAsParent(address objectAddress, ObjectType objectType);
|
51
|
-
error
|
53
|
+
error ErrorRegistryTypeCombinationInvalid(address objectAddress, ObjectType objectType, ObjectType parentType);
|
52
54
|
error ErrorRegistryContractAlreadyRegistered(address objectAddress);
|
53
55
|
|
54
56
|
struct ObjectInfo {
|
57
|
+
// slot 0
|
55
58
|
NftId nftId;
|
56
59
|
NftId parentNftId;
|
57
60
|
ObjectType objectType;
|
58
61
|
bool isInterceptor;
|
62
|
+
// slot 1
|
59
63
|
address objectAddress;
|
64
|
+
// slot 2
|
60
65
|
address initialOwner;
|
66
|
+
// slot 3
|
61
67
|
bytes data;
|
62
68
|
}
|
63
69
|
|
@@ -89,11 +95,11 @@ interface IRegistry is
|
|
89
95
|
/// May not be used to register known core types.
|
90
96
|
function registerWithCustomType(ObjectInfo memory info) external returns (NftId nftId);
|
91
97
|
|
92
|
-
function
|
98
|
+
function getInitialRelease() external view returns (VersionPart);
|
93
99
|
|
94
|
-
function
|
100
|
+
function getNextRelease() external view returns (VersionPart);
|
95
101
|
|
96
|
-
function
|
102
|
+
function getLatestRelease() external view returns (VersionPart);
|
97
103
|
|
98
104
|
function getReleaseInfo(VersionPart release) external view returns (IRelease.ReleaseInfo memory);
|
99
105
|
|
@@ -118,6 +124,8 @@ interface IRegistry is
|
|
118
124
|
|
119
125
|
function getObjectInfo(NftId nftId) external view returns (ObjectInfo memory info);
|
120
126
|
|
127
|
+
function getParentNftId(NftId nftId) external view returns (NftId parentNftId);
|
128
|
+
|
121
129
|
function isObjectType(NftId nftId, ObjectType expectedObjectType) external view returns (bool);
|
122
130
|
|
123
131
|
function isObjectType(address contractAddress, ObjectType expectedObjectType) external view returns (bool);
|
@@ -11,13 +11,16 @@ import {VersionPart} from "../type/Version.sol";
|
|
11
11
|
interface IRelease {
|
12
12
|
|
13
13
|
struct ReleaseInfo {
|
14
|
+
// slot 0
|
15
|
+
address releaseAdmin;
|
14
16
|
StateId state;
|
15
17
|
VersionPart version;
|
16
|
-
bytes32 salt;
|
17
|
-
IServiceAuthorization auth;
|
18
|
-
address releaseAdmin;
|
19
18
|
Timestamp activatedAt;
|
20
19
|
Timestamp disabledAt;
|
20
|
+
// slot 1
|
21
|
+
IServiceAuthorization auth;
|
22
|
+
// slot 2
|
23
|
+
bytes32 salt;
|
21
24
|
}
|
22
25
|
|
23
26
|
/// @dev Registers a registry contract for a specified chain.
|
@@ -172,7 +172,7 @@ contract Registry is
|
|
172
172
|
revert ErrorRegistryChainRegistryNftIdInvalid(nftId, chainId);
|
173
173
|
}
|
174
174
|
|
175
|
-
emit
|
175
|
+
emit LogRegistryChainRegistryRegistered(nftId, chainId, registryAddress);
|
176
176
|
|
177
177
|
_registerRegistryForNft(
|
178
178
|
chainId,
|
@@ -231,7 +231,7 @@ contract Registry is
|
|
231
231
|
|
232
232
|
_service[version][domain] = service;
|
233
233
|
|
234
|
-
emit
|
234
|
+
emit LogRegistryServiceRegistered(version, domain);
|
235
235
|
|
236
236
|
nftId = _register(info);
|
237
237
|
}
|
@@ -246,6 +246,11 @@ contract Registry is
|
|
246
246
|
address objectAddress = info.objectAddress;
|
247
247
|
ObjectType objectType = info.objectType;
|
248
248
|
|
249
|
+
// specialized functions have to be used to register registries and services
|
250
|
+
if(objectType == REGISTRY() || objectType == STAKING() || objectType == SERVICE()) {
|
251
|
+
revert ErrorRegistryObjectTypeNotSupported(objectType);
|
252
|
+
}
|
253
|
+
|
249
254
|
// this indidirectly enforces that the parent is registered
|
250
255
|
// parentType would be zero for a non-registered parent which is never a valid type combination
|
251
256
|
ObjectType parentType = _info[info.parentNftId].objectType;
|
@@ -253,13 +258,13 @@ contract Registry is
|
|
253
258
|
// check type combinations for core objects
|
254
259
|
if(objectAddress == address(0)) {
|
255
260
|
if(_coreObjectCombinations[objectType][parentType] == false) {
|
256
|
-
revert
|
261
|
+
revert ErrorRegistryTypeCombinationInvalid(objectAddress, objectType, parentType);
|
257
262
|
}
|
258
263
|
}
|
259
264
|
// check type combinations for contract objects
|
260
265
|
else {
|
261
266
|
if(_coreContractCombinations[objectType][parentType] == false) {
|
262
|
-
revert
|
267
|
+
revert ErrorRegistryTypeCombinationInvalid(objectAddress, objectType, parentType);
|
263
268
|
}
|
264
269
|
}
|
265
270
|
|
@@ -284,9 +289,10 @@ contract Registry is
|
|
284
289
|
objectType == ObjectTypeLib.zero() ||
|
285
290
|
parentType == ObjectTypeLib.zero() ||
|
286
291
|
parentType == PROTOCOL() ||
|
292
|
+
parentType == STAKING() ||
|
287
293
|
parentType == SERVICE()
|
288
294
|
) {
|
289
|
-
revert
|
295
|
+
revert ErrorRegistryTypeCombinationInvalid(info.objectAddress, objectType, parentType);
|
290
296
|
}
|
291
297
|
|
292
298
|
nftId = _register(info);
|
@@ -294,17 +300,17 @@ contract Registry is
|
|
294
300
|
|
295
301
|
|
296
302
|
/// @dev earliest GIF major version
|
297
|
-
function
|
303
|
+
function getInitialRelease() external view returns (VersionPart) {
|
298
304
|
return VersionPartLib.toVersionPart(_releaseRegistry.INITIAL_GIF_VERSION());
|
299
305
|
}
|
300
306
|
|
301
307
|
/// @dev next GIF release version to be released
|
302
|
-
function
|
308
|
+
function getNextRelease() external view returns (VersionPart) {
|
303
309
|
return _releaseRegistry.getNextVersion();
|
304
310
|
}
|
305
311
|
|
306
312
|
/// @dev latest active GIF release version
|
307
|
-
function
|
313
|
+
function getLatestRelease() external view returns (VersionPart) {
|
308
314
|
return _releaseRegistry.getLatestVersion();
|
309
315
|
}
|
310
316
|
|
@@ -356,6 +362,10 @@ contract Registry is
|
|
356
362
|
return _info[nftId];
|
357
363
|
}
|
358
364
|
|
365
|
+
function getParentNftId(NftId nftId) external view returns (NftId parentNftId) {
|
366
|
+
return _info[nftId].parentNftId;
|
367
|
+
}
|
368
|
+
|
359
369
|
function isObjectType(address contractAddress, ObjectType expectedObjectType) external view returns (bool) {
|
360
370
|
NftId nftId = _nftIdByAddress[contractAddress];
|
361
371
|
return isObjectType(nftId, expectedObjectType);
|
@@ -491,7 +501,7 @@ contract Registry is
|
|
491
501
|
_info[nftId] = info;
|
492
502
|
_setAddressForNftId(nftId, objectAddress);
|
493
503
|
|
494
|
-
emit
|
504
|
+
emit LogRegistryObjectRegistered(nftId, parentNftId, objectType, isInterceptor, objectAddress, owner);
|
495
505
|
|
496
506
|
// calls nft receiver(1) and interceptor(2)
|
497
507
|
uint256 mintedTokenId = CHAIN_NFT.mint(
|
@@ -1,21 +1,18 @@
|
|
1
1
|
// SPDX-License-Identifier: UNLICENSED
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
|
-
import {
|
5
|
-
import {AccessManagerCloneable} from "../authorization/AccessManagerCloneable.sol";
|
6
|
-
import {IAccess} from "../authorization/IAccess.sol";
|
4
|
+
import {IAuthorization} from "../authorization/IAuthorization.sol";
|
7
5
|
import {IRegistry} from "./IRegistry.sol";
|
8
6
|
import {IService} from "../shared/IService.sol";
|
9
|
-
import {IServiceAuthorization} from "../authorization/IServiceAuthorization.sol";
|
10
7
|
import {IStaking} from "../staking/IStaking.sol";
|
11
|
-
|
12
|
-
import {
|
13
|
-
import {
|
14
|
-
import {
|
15
|
-
import {
|
16
|
-
import {
|
17
|
-
import {
|
18
|
-
import {VersionPart
|
8
|
+
|
9
|
+
import {AccessAdmin} from "../authorization/AccessAdmin.sol";
|
10
|
+
import {AccessAdminLib} from "../authorization/AccessAdminLib.sol";
|
11
|
+
import {AccessManagerCloneable} from "../authorization/AccessManagerCloneable.sol";
|
12
|
+
import {ObjectType, REGISTRY} from "../type/ObjectType.sol";
|
13
|
+
import {RoleId, RoleIdLib, GIF_MANAGER_ROLE, GIF_ADMIN_ROLE} from "../type/RoleId.sol";
|
14
|
+
import {Str} from "../type/String.sol";
|
15
|
+
import {VersionPart} from "../type/Version.sol";
|
19
16
|
|
20
17
|
/*
|
21
18
|
1) GIF_MANAGER_ROLE
|
@@ -40,305 +37,137 @@ contract RegistryAdmin is
|
|
40
37
|
/// @dev gif core roles
|
41
38
|
string public constant GIF_ADMIN_ROLE_NAME = "GifAdminRole";
|
42
39
|
string public constant GIF_MANAGER_ROLE_NAME = "GifManagerRole";
|
43
|
-
string public constant RELEASE_REGISTRY_ROLE_NAME = "ReleaseRegistryRole";
|
44
|
-
string public constant STAKING_ROLE_NAME = "StakingRole";
|
45
|
-
|
46
|
-
/// @dev gif roles for external contracts
|
47
|
-
string public constant REGISTRY_SERVICE_ROLE_NAME = "RegistryServiceRole";
|
48
|
-
string public constant POOL_SERVICE_ROLE_NAME = "PoolServiceRole";
|
49
|
-
string public constant STAKING_SERVICE_ROLE_NAME = "StakingServiceRole";
|
50
40
|
|
51
41
|
/// @dev gif core targets
|
52
42
|
string public constant REGISTRY_ADMIN_TARGET_NAME = "RegistryAdmin";
|
53
43
|
string public constant REGISTRY_TARGET_NAME = "Registry";
|
54
44
|
string public constant RELEASE_REGISTRY_TARGET_NAME = "ReleaseRegistry";
|
55
45
|
string public constant STAKING_TARGET_NAME = "Staking";
|
56
|
-
string public constant
|
46
|
+
string public constant STAKING_TARGET_HANDLER_NAME = "TargetHandler";
|
57
47
|
string public constant STAKING_STORE_TARGET_NAME = "StakingStore";
|
48
|
+
string public constant STAKING_TH_TARGET_NAME = "StakingTH";
|
58
49
|
string public constant TOKEN_REGISTRY_TARGET_NAME = "TokenRegistry";
|
59
50
|
string public constant TOKEN_HANDLER_TARGET_NAME = "TokenHandler";
|
60
51
|
|
61
|
-
|
52
|
+
// completeSetup
|
53
|
+
error ErrorRegistryAdminNotRegistry(address registry);
|
62
54
|
|
63
55
|
address internal _registry;
|
64
56
|
address private _releaseRegistry;
|
65
57
|
address private _tokenRegistry;
|
66
58
|
address private _staking;
|
59
|
+
address private _stakingTargetHandler;
|
67
60
|
address private _stakingStore;
|
68
61
|
|
69
62
|
constructor() {
|
70
|
-
initialize(
|
63
|
+
initialize(
|
64
|
+
address(new AccessManagerCloneable()),
|
65
|
+
"RegistryAdmin");
|
71
66
|
}
|
72
67
|
|
68
|
+
|
73
69
|
function completeSetup(
|
74
|
-
|
70
|
+
address registry,
|
71
|
+
address authorization,
|
72
|
+
VersionPart release,
|
75
73
|
address gifAdmin,
|
76
74
|
address gifManager
|
77
75
|
)
|
78
76
|
public
|
79
77
|
virtual
|
80
78
|
reinitializer(type(uint8).max)
|
81
|
-
onlyDeployer()
|
82
79
|
{
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
80
|
+
// checks
|
81
|
+
AccessAdminLib.checkRegistry(registry);
|
82
|
+
|
83
|
+
AccessManagerCloneable(
|
84
|
+
authority()).completeSetup(
|
85
|
+
registry,
|
86
|
+
release);
|
87
|
+
|
88
|
+
_checkAuthorization(authorization, REGISTRY(), release, false, true);
|
89
|
+
|
90
|
+
_registry = registry;
|
91
|
+
_authorization = IAuthorization(authorization);
|
92
|
+
|
93
|
+
IRegistry registryContract = IRegistry(registry);
|
94
|
+
_releaseRegistry = registryContract.getReleaseRegistryAddress();
|
95
|
+
_tokenRegistry = registryContract.getTokenRegistryAddress();
|
96
|
+
_staking = registryContract.getStakingAddress();
|
97
|
+
_stakingTargetHandler = address(IStaking(_staking).getTargetHandler());
|
98
|
+
_stakingStore = address(IStaking(_staking).getStakingStore());
|
99
|
+
|
100
|
+
// link nft ownability to registry
|
101
|
+
_linkToNftOwnable(_registry);
|
102
|
+
|
103
|
+
_createRoles(_authorization);
|
104
|
+
|
105
|
+
// setup registry core targets
|
106
|
+
_createCoreTargets(_authorization.getMainTargetName());
|
107
|
+
|
108
|
+
// setup non-contract roles
|
109
|
+
_grantRoleToAccount(GIF_ADMIN_ROLE(), gifAdmin);
|
110
|
+
_grantRoleToAccount(GIF_MANAGER_ROLE(), gifManager);
|
111
|
+
|
112
|
+
// authorize functions of registry and staking contracts
|
113
|
+
_createTargetAuthorizations(_authorization);
|
103
114
|
}
|
104
115
|
|
105
|
-
/*function transferAdmin(address to)
|
106
|
-
external
|
107
|
-
restricted // only with GIF_ADMIN_ROLE or nft owner
|
108
|
-
{
|
109
|
-
_accessManager.revoke(GIF_ADMIN_ROLE, );
|
110
|
-
_accesssManager.grant(GIF_ADMIN_ROLE, to, 0);
|
111
|
-
}*/
|
112
116
|
|
113
|
-
function grantServiceRoleForAllVersions(
|
117
|
+
function grantServiceRoleForAllVersions(
|
118
|
+
IService service,
|
119
|
+
ObjectType domain
|
120
|
+
)
|
114
121
|
external
|
115
122
|
restricted()
|
116
123
|
{
|
117
124
|
_grantRoleToAccount(
|
118
|
-
RoleIdLib.
|
125
|
+
RoleIdLib.toGenericServiceRoleId(domain),
|
119
126
|
address(service));
|
120
127
|
}
|
121
128
|
|
122
129
|
//--- view functions ----------------------------------------------------//
|
123
130
|
|
124
|
-
function getGifAdminRole() external
|
131
|
+
function getGifAdminRole() external pure returns (RoleId) {
|
125
132
|
return GIF_ADMIN_ROLE();
|
126
133
|
}
|
127
134
|
|
128
|
-
function getGifManagerRole() external
|
135
|
+
function getGifManagerRole() external pure returns (RoleId) {
|
129
136
|
return GIF_MANAGER_ROLE();
|
130
137
|
}
|
131
138
|
|
132
139
|
//--- private initialization functions -------------------------------------------//
|
133
140
|
|
134
|
-
function _createTargets()
|
135
|
-
private
|
136
|
-
onlyInitializing()
|
137
|
-
{
|
138
|
-
IStaking staking = IStaking(_staking);
|
139
|
-
address tokenHandler = address(staking.getTokenHandler());
|
140
|
-
|
141
|
-
_createTarget(address(this), REGISTRY_ADMIN_TARGET_NAME, false, false);
|
142
|
-
_createTarget(_registry, REGISTRY_TARGET_NAME, true, false);
|
143
|
-
_createTarget(_releaseRegistry, RELEASE_REGISTRY_TARGET_NAME, true, false);
|
144
|
-
_createTarget(_staking, STAKING_TARGET_NAME, true, false);
|
145
|
-
_createTarget(_stakingStore, STAKING_STORE_TARGET_NAME, true, false);
|
146
|
-
_createTarget(_tokenRegistry, TOKEN_REGISTRY_TARGET_NAME, true, false);
|
147
|
-
_createTarget(tokenHandler, TOKEN_HANDLER_TARGET_NAME, true, false);
|
148
|
-
}
|
149
141
|
|
150
|
-
function
|
151
|
-
|
152
|
-
onlyInitializing()
|
142
|
+
function _createCoreTargets(string memory registryTargetName)
|
143
|
+
internal
|
153
144
|
{
|
154
|
-
// create
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
FunctionInfo[] memory functions;
|
165
|
-
functions = new FunctionInfo[](1);
|
166
|
-
functions[0] = toFunction(IRegistry.registerRegistry.selector, "registerRegistry");
|
167
|
-
_authorizeTargetFunctions(_registry, GIF_ADMIN_ROLE(), functions);
|
168
|
-
|
169
|
-
// grant permissions to the gif admin role for release registry contract
|
170
|
-
functions = new FunctionInfo[](3);
|
171
|
-
functions[0] = toFunction(ReleaseRegistry.createNextRelease.selector, "createNextRelease");
|
172
|
-
functions[1] = toFunction(ReleaseRegistry.activateNextRelease.selector, "activateNextRelease");
|
173
|
-
functions[2] = toFunction(ReleaseRegistry.setActive.selector, "setActive");
|
174
|
-
_authorizeTargetFunctions(_releaseRegistry, GIF_ADMIN_ROLE(), functions);
|
175
|
-
|
176
|
-
_grantRoleToAccount(GIF_ADMIN_ROLE(), gifAdmin);
|
145
|
+
// create unchecked registry targets
|
146
|
+
_createTarget(_registry, registryTargetName, TargetType.Core, false);
|
147
|
+
_createTarget(address(this), REGISTRY_ADMIN_TARGET_NAME, TargetType.Core, false);
|
148
|
+
_createTarget(_releaseRegistry, RELEASE_REGISTRY_TARGET_NAME, TargetType.Core, false);
|
149
|
+
_createTarget(_tokenRegistry, TOKEN_REGISTRY_TARGET_NAME, TargetType.Core, false);
|
150
|
+
|
151
|
+
// create unchecked staking targets
|
152
|
+
_createTarget(_staking, STAKING_TARGET_NAME, TargetType.Core, false);
|
153
|
+
_createTarget(_stakingTargetHandler, STAKING_TARGET_HANDLER_NAME, TargetType.Core, false);
|
154
|
+
_createTarget(_stakingStore, STAKING_STORE_TARGET_NAME, TargetType.Core, false);
|
177
155
|
}
|
178
|
-
|
179
|
-
function _setupGifManagerRole(address gifManager)
|
180
|
-
private
|
181
|
-
onlyInitializing()
|
182
|
-
{
|
183
|
-
// create gif manager role
|
184
|
-
_createRole(
|
185
|
-
GIF_MANAGER_ROLE(),
|
186
|
-
toRole({
|
187
|
-
adminRoleId: ADMIN_ROLE(),
|
188
|
-
roleType: RoleType.Gif,
|
189
|
-
maxMemberCount: 1, // TODO decide on max member count
|
190
|
-
name: GIF_MANAGER_ROLE_NAME}));
|
191
|
-
|
192
|
-
// grant permissions to the gif manager role for token registry contract
|
193
|
-
FunctionInfo[] memory functions;
|
194
|
-
functions = new FunctionInfo[](5);
|
195
|
-
functions[0] = toFunction(TokenRegistry.registerToken.selector, "registerToken");
|
196
|
-
functions[1] = toFunction(TokenRegistry.registerRemoteToken.selector, "registerRemoteToken");
|
197
|
-
functions[2] = toFunction(TokenRegistry.setActive.selector, "setActive");
|
198
|
-
functions[3] = toFunction(TokenRegistry.setActiveForVersion.selector, "setActiveForVersion");
|
199
|
-
// TODO find a better way (only needed for testing)
|
200
|
-
functions[4] = toFunction(TokenRegistry.setActiveWithVersionCheck.selector, "setActiveWithVersionCheck");
|
201
|
-
_authorizeTargetFunctions(_tokenRegistry, GIF_MANAGER_ROLE(), functions);
|
202
|
-
|
203
|
-
// grant permissions to the gif manager role for release registry contract
|
204
|
-
functions = new FunctionInfo[](2);
|
205
|
-
functions[0] = toFunction(ReleaseRegistry.prepareNextRelease.selector, "prepareNextRelease");
|
206
|
-
functions[1] = toFunction(ReleaseRegistry.registerService.selector, "registerService");
|
207
|
-
_authorizeTargetFunctions(_releaseRegistry, GIF_MANAGER_ROLE(), functions);
|
208
156
|
|
209
|
-
_grantRoleToAccount(GIF_MANAGER_ROLE(), gifManager);
|
210
|
-
}
|
211
157
|
|
212
|
-
function
|
213
|
-
|
214
|
-
onlyInitializing()
|
158
|
+
function _createTargetAuthorizations(IAuthorization authorization)
|
159
|
+
internal
|
215
160
|
{
|
216
|
-
|
217
|
-
|
218
|
-
RoleId releaseRegistryRoleId = RoleIdLib.roleForType(RELEASE());
|
219
|
-
_createRole(
|
220
|
-
releaseRegistryRoleId,
|
221
|
-
toRole({
|
222
|
-
adminRoleId: ADMIN_ROLE(),
|
223
|
-
roleType: RoleType.Contract,
|
224
|
-
maxMemberCount: 1,
|
225
|
-
name: RELEASE_REGISTRY_ROLE_NAME}));
|
226
|
-
_grantRoleToAccount(releaseRegistryRoleId, _releaseRegistry);
|
227
|
-
|
228
|
-
// grant permissions to the release registry role for release admin contract
|
229
|
-
FunctionInfo[] memory functions;
|
230
|
-
functions = new FunctionInfo[](1);
|
231
|
-
functions[0] = toFunction(RegistryAdmin.grantServiceRoleForAllVersions.selector, "grantServiceRoleForAllVersions");
|
232
|
-
_authorizeTargetFunctions(address(this), releaseRegistryRoleId, functions);
|
233
|
-
|
234
|
-
// grant permissions to the release registry role for registry contract
|
235
|
-
functions = new FunctionInfo[](1);
|
236
|
-
functions[0] = toFunction(IRegistry.registerService.selector, "registerService");
|
237
|
-
_authorizeTargetFunctions(_registry, releaseRegistryRoleId, functions);
|
238
|
-
|
239
|
-
// create registry service role
|
240
|
-
RoleId registryServiceRoleId = RoleIdLib.roleForTypeAndAllVersions(REGISTRY());
|
241
|
-
_createRole(
|
242
|
-
registryServiceRoleId,
|
243
|
-
toRole({
|
244
|
-
adminRoleId: ADMIN_ROLE(),
|
245
|
-
roleType: RoleType.Contract,
|
246
|
-
maxMemberCount: MAX_NUM_RELEASES,
|
247
|
-
name: REGISTRY_SERVICE_ROLE_NAME}));
|
248
|
-
|
249
|
-
// grant permissions to the registry service role for registry contract
|
250
|
-
functions = new FunctionInfo[](2);
|
251
|
-
functions[0] = toFunction(IRegistry.register.selector, "register");
|
252
|
-
functions[1] = toFunction(IRegistry.registerWithCustomType.selector, "registerWithCustomType");
|
253
|
-
_authorizeTargetFunctions(_registry, registryServiceRoleId, functions);
|
254
|
-
}
|
161
|
+
Str[] memory targets = authorization.getTargets();
|
162
|
+
Str target;
|
255
163
|
|
164
|
+
for(uint256 i = 0; i < targets.length; i++) {
|
165
|
+
target = targets[i];
|
166
|
+
RoleId[] memory authorizedRoles = authorization.getAuthorizedRoles(target);
|
256
167
|
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
// create and grant staking contract role
|
262
|
-
RoleId stakingRoleId = RoleIdLib.roleForType(STAKING());
|
263
|
-
_createRole(
|
264
|
-
stakingRoleId,
|
265
|
-
toRole({
|
266
|
-
adminRoleId: ADMIN_ROLE(),
|
267
|
-
roleType: RoleType.Contract,
|
268
|
-
maxMemberCount: 1,
|
269
|
-
name: STAKING_ROLE_NAME}));
|
270
|
-
_grantRoleToAccount(stakingRoleId, _staking);
|
271
|
-
|
272
|
-
// grant permissions to the staking role for staking store contract
|
273
|
-
FunctionInfo[] memory functions;
|
274
|
-
functions = new FunctionInfo[](14);
|
275
|
-
functions[0] = toFunction(StakingStore.setStakingRate.selector, "setStakingRate");
|
276
|
-
functions[1] = toFunction(StakingStore.createTarget.selector, "createTarget");
|
277
|
-
functions[2] = toFunction(StakingStore.updateTarget.selector, "updateTarget");
|
278
|
-
functions[3] = toFunction(StakingStore.increaseReserves.selector, "increaseReserves");
|
279
|
-
functions[4] = toFunction(StakingStore.decreaseReserves.selector, "decreaseReserves");
|
280
|
-
functions[5] = toFunction(StakingStore.increaseTotalValueLocked.selector, "increaseTotalValueLocked");
|
281
|
-
functions[6] = toFunction(StakingStore.decreaseTotalValueLocked.selector, "decreaseTotalValueLocked");
|
282
|
-
functions[7] = toFunction(StakingStore.create.selector, "create");
|
283
|
-
functions[8] = toFunction(StakingStore.update.selector, "update");
|
284
|
-
functions[9] = toFunction(StakingStore.increaseStake.selector, "increaseStake");
|
285
|
-
functions[10] = toFunction(StakingStore.restakeRewards.selector, "restakeRewards");
|
286
|
-
functions[11] = toFunction(StakingStore.updateRewards.selector, "updateRewards");
|
287
|
-
functions[12] = toFunction(StakingStore.claimUpTo.selector, "claimUpTo");
|
288
|
-
functions[13] = toFunction(StakingStore.unstakeUpTo.selector, "unstakeUpTo");
|
289
|
-
_authorizeTargetFunctions(_stakingStore, stakingRoleId, functions);
|
290
|
-
|
291
|
-
// grant permissions to the staking role for token handler contract
|
292
|
-
IStaking staking = IStaking(_staking);
|
293
|
-
functions = new FunctionInfo[](2);
|
294
|
-
functions[0] = toFunction(TokenHandler.collectTokens.selector, "collectTokens");
|
295
|
-
functions[1] = toFunction(TokenHandler.distributeTokens.selector, "distributeTokens");
|
296
|
-
_authorizeTargetFunctions(address(staking.getTokenHandler()), stakingRoleId, functions);
|
297
|
-
|
298
|
-
// create staking service role
|
299
|
-
RoleId stakingServiceRoleId = RoleIdLib.roleForTypeAndAllVersions(STAKING());
|
300
|
-
_createRole(
|
301
|
-
stakingServiceRoleId,
|
302
|
-
toRole({
|
303
|
-
adminRoleId: ADMIN_ROLE(),
|
304
|
-
roleType: RoleType.Contract,
|
305
|
-
maxMemberCount: MAX_NUM_RELEASES,
|
306
|
-
name: STAKING_SERVICE_ROLE_NAME}));
|
307
|
-
|
308
|
-
// grant permissions to the staking service role for staking contract
|
309
|
-
functions = new FunctionInfo[](11);
|
310
|
-
functions[0] = toFunction(IStaking.registerTarget.selector, "registerTarget");
|
311
|
-
functions[1] = toFunction(IStaking.setLockingPeriod.selector, "setLockingPeriod");
|
312
|
-
functions[2] = toFunction(IStaking.setRewardRate.selector, "setRewardRate");
|
313
|
-
functions[3] = toFunction(IStaking.refillRewardReserves.selector, "refillRewardReserves");
|
314
|
-
functions[4] = toFunction(IStaking.withdrawRewardReserves.selector, "withdrawRewardReserves");
|
315
|
-
functions[5] = toFunction(IStaking.createStake.selector, "createStake");
|
316
|
-
functions[6] = toFunction(IStaking.stake.selector, "stake");
|
317
|
-
functions[7] = toFunction(IStaking.unstake.selector, "unstake");
|
318
|
-
functions[8] = toFunction(IStaking.restake.selector, "restake");
|
319
|
-
functions[9] = toFunction(IStaking.updateRewards.selector, "updateRewards");
|
320
|
-
functions[10] = toFunction(IStaking.claimRewards.selector, "claimRewards");
|
321
|
-
_authorizeTargetFunctions(_staking, stakingServiceRoleId, functions);
|
322
|
-
|
323
|
-
// create pool service role
|
324
|
-
RoleId poolServiceRoleId = RoleIdLib.roleForTypeAndAllVersions(POOL());
|
325
|
-
_createRole(
|
326
|
-
poolServiceRoleId,
|
327
|
-
toRole({
|
328
|
-
adminRoleId: ADMIN_ROLE(),
|
329
|
-
roleType: RoleType.Contract,
|
330
|
-
maxMemberCount: MAX_NUM_RELEASES,
|
331
|
-
name: POOL_SERVICE_ROLE_NAME}));
|
332
|
-
|
333
|
-
// grant permissions to the pool service role for staking contract
|
334
|
-
functions = new FunctionInfo[](2);
|
335
|
-
functions[0] = toFunction(IStaking.increaseTotalValueLocked.selector, "increaseTotalValueLocked");
|
336
|
-
functions[1] = toFunction(IStaking.decreaseTotalValueLocked.selector, "decreaseTotalValueLocked");
|
337
|
-
_authorizeTargetFunctions(_staking, poolServiceRoleId, functions);
|
338
|
-
|
339
|
-
// grant permissions to public role for staking contract
|
340
|
-
functions = new FunctionInfo[](1);
|
341
|
-
functions[0] = toFunction(Staking.approveTokenHandler.selector, "approveTokenHandler");
|
342
|
-
_authorizeTargetFunctions(_staking, PUBLIC_ROLE(), functions);
|
168
|
+
for(uint256 j = 0; j < authorizedRoles.length; j++) {
|
169
|
+
_authorizeFunctions(authorization, target, authorizedRoles[j]);
|
170
|
+
}
|
171
|
+
}
|
343
172
|
}
|
344
173
|
}
|