@etherisc/gif-next 0.0.2-eb7397c → 0.0.2-eb7c077-523
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +388 -8
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessAdmin.sol/AccessAdmin.json +1253 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.dbg.json +4 -0
- package/artifacts/contracts/authorization/AccessManagerCloneable.sol/AccessManagerCloneable.json +1206 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/Authorization.sol/Authorization.json +358 -0
- package/artifacts/contracts/authorization/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/{instance/access → authorization}/IAccess.sol/IAccess.json +1 -1
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAccessAdmin.sol/IAccessAdmin.json +1032 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IAuthorization.sol/IAuthorization.json +258 -0
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IModuleAuthorization.sol/IModuleAuthorization.json +290 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/IServiceAuthorization.sol/IServiceAuthorization.json +148 -0
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ModuleAuthorization.sol/ModuleAuthorization.json +390 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.dbg.json +4 -0
- package/artifacts/contracts/authorization/ServiceAuthorization.sol/ServiceAuthorization.json +190 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistribution.sol/BasicDistribution.json +1505 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.dbg.json +4 -0
- package/artifacts/contracts/distribution/BasicDistributionAuthorization.sol/BasicDistributionAuthorization.json +410 -0
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.dbg.json +4 -0
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +1191 -0
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +4 -0
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +1394 -0
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +4 -0
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +826 -0
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +4 -0
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +900 -0
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +4 -0
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +843 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.dbg.json +4 -0
- package/artifacts/contracts/instance/BundleSet.sol/BundleSet.json +703 -0
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +289 -529
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +4 -0
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +757 -0
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +446 -609
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1626 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceAuthorizationV3.sol/InstanceAuthorizationV3.json +601 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +1735 -0
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +1160 -0
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +734 -0
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +4 -0
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +3591 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +4 -0
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +318 -0
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +4 -0
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.json +137 -0
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +10 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +182 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectSet.sol/ObjectSet.json +181 -0
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +4 -0
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.json +129 -0
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +4 -0
- package/artifacts/contracts/instance/{pool/IPoolModule.sol/IPool.json → module/IBundle.sol/IBundle.json} +2 -2
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +4 -0
- package/artifacts/contracts/instance/{component/IComponent.sol/IComponent.json → module/IComponents.sol/IComponents.json} +2 -2
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +4 -0
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.json +10 -0
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +4 -0
- package/artifacts/contracts/instance/{policy → module}/IPolicy.sol/IPolicy.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +4 -0
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.json +10 -0
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +4 -0
- package/artifacts/contracts/mock/Dip.sol/Dip.json +376 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +1155 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracleAuthorization.sol/BasicOracleAuthorization.json +418 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.json +52 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +772 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +675 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +1063 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +1034 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +730 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPool.sol/BasicPool.json +1477 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.dbg.json +4 -0
- package/artifacts/contracts/pool/BasicPoolAuthorization.sol/BasicPoolAuthorization.json +410 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.dbg.json +4 -0
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +1134 -0
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +4 -0
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +754 -0
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +4 -0
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +703 -0
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +4 -0
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +959 -0
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +4 -0
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +1078 -0
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +4 -0
- package/artifacts/contracts/pool/Pool.sol/Pool.json +1269 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +1453 -0
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +4 -0
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +742 -0
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +4 -0
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +863 -0
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +730 -0
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProduct.sol/BasicProduct.json +1299 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.dbg.json +4 -0
- package/artifacts/contracts/product/BasicProductAuthorization.sol/BasicProductAuthorization.json +410 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.dbg.json +4 -0
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +1315 -0
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +822 -0
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +4 -0
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +512 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +4 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +772 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +4 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +720 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +4 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +549 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +4 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +966 -0
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +4 -0
- package/artifacts/contracts/product/IProductService.sol/IProductService.json +400 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +1183 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +766 -0
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +4 -0
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +1012 -0
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +786 -0
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +4 -0
- package/artifacts/contracts/product/Product.sol/Product.json +1257 -0
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +4 -0
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +708 -0
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +4 -0
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +702 -0
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +276 -2
- package/artifacts/contracts/registry/GlobalRegistry.sol/GlobalRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/GlobalRegistry.sol/GlobalRegistry.json +1503 -0
- package/artifacts/contracts/registry/GlobalRegistryAdmin.sol/GlobalRegistryAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/GlobalRegistryAdmin.sol/GlobalRegistryAdmin.json +1881 -0
- package/artifacts/contracts/registry/IGlobalRegistry.sol/IGlobalRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/IGlobalRegistry.sol/IGlobalRegistry.json +974 -0
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +722 -102
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +4 -0
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +940 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +4 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.json +52 -0
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +1156 -130
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +1871 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +1452 -0
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +4 -0
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +721 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseLifecycle.sol/ReleaseLifecycle.json +164 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/ReleaseRegistry.sol/ReleaseRegistry.json +1140 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.dbg.json +4 -0
- package/artifacts/contracts/registry/ServiceAuthorizationV3.sol/ServiceAuthorizationV3.json +214 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.dbg.json +4 -0
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +661 -0
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +4 -0
- package/artifacts/contracts/shared/Component.sol/Component.json +896 -0
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +1487 -0
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +784 -0
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +4 -0
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +539 -0
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +4 -0
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +73 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +4 -0
- package/artifacts/contracts/shared/IComponent.sol/IComponent.json +631 -0
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +4 -0
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +880 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +4 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +718 -0
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +474 -0
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +4 -0
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +110 -0
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +4 -0
- package/artifacts/contracts/{registry/Registry.sol/Registerable.json → shared/INftOwnable.sol/INftOwnable.json} +42 -77
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +4 -0
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.json +207 -0
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +4 -0
- package/artifacts/contracts/{instance/pool/PoolModule.sol/PoolModule.json → shared/IRegisterable.sol/IRegisterable.json} +98 -79
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/{instance/access/IAccess.sol/IAccessCheckRole.json → shared/IRegistryLinked.sol/IRegistryLinked.json} +11 -11
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +4 -0
- package/artifacts/contracts/shared/IService.sol/IService.json +346 -0
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +4 -0
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.json +39 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +4 -0
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +996 -0
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +4 -0
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +497 -0
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +4 -0
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +133 -0
- package/artifacts/contracts/shared/MainnetId.sol/MainnetContract.dbg.json +4 -0
- package/artifacts/contracts/shared/MainnetId.sol/MainnetContract.json +34 -0
- package/artifacts/contracts/shared/MainnetId.sol/MainnetId.dbg.json +4 -0
- package/artifacts/contracts/shared/MainnetId.sol/MainnetId.json +24 -0
- package/artifacts/contracts/shared/MainnetId.sol/SidenetContract.dbg.json +4 -0
- package/artifacts/contracts/shared/MainnetId.sol/SidenetContract.json +34 -0
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.dbg.json +4 -0
- package/artifacts/contracts/shared/NftIdSet.sol/NftIdSet.json +306 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +4 -0
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +244 -0
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +4 -0
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +320 -0
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +4 -0
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +353 -0
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.dbg.json +4 -0
- package/artifacts/contracts/shared/RegistryLinked.sol/RegistryLinked.json +71 -0
- package/artifacts/contracts/shared/Service.sol/Service.dbg.json +4 -0
- package/artifacts/contracts/shared/Service.sol/Service.json +507 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +4 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +150 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +4 -0
- package/artifacts/contracts/staking/IStaking.sol/IStaking.json +1438 -0
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +4 -0
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +1035 -0
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +460 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +4 -0
- package/artifacts/contracts/staking/Staking.sol/Staking.json +2005 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingLifecycle.sol/StakingLifecycle.json +164 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +761 -0
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +592 -0
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +1343 -0
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +718 -0
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +4 -0
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +2237 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +4 -0
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +571 -0
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +4 -0
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.json +10 -0
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +4 -0
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +345 -0
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +4 -0
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +225 -0
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +179 -0
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +4 -0
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +104 -0
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +4 -0
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +312 -0
- package/artifacts/contracts/type/Key32.sol/Key32Lib.dbg.json +4 -0
- package/artifacts/contracts/type/Key32.sol/Key32Lib.json +125 -0
- package/artifacts/contracts/type/NftId.sol/NftIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +209 -0
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +4 -0
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +33 -0
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +4 -0
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +239 -0
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +209 -0
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +4 -0
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +142 -0
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +204 -0
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +86 -0
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +369 -0
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +4 -0
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +198 -0
- package/artifacts/contracts/type/Selector.sol/SelectorLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorLib.json +129 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.dbg.json +4 -0
- package/artifacts/contracts/type/Selector.sol/SelectorSetLib.json +10 -0
- package/artifacts/contracts/type/StateId.sol/StateIdLib.dbg.json +4 -0
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +92 -0
- package/artifacts/contracts/type/String.sol/StrLib.dbg.json +4 -0
- package/artifacts/contracts/type/String.sol/StrLib.json +132 -0
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.dbg.json +4 -0
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +293 -0
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +4 -0
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +10 -0
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +4 -0
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +498 -0
- package/artifacts/contracts/type/Version.sol/VersionLib.dbg.json +4 -0
- package/artifacts/contracts/type/Version.sol/VersionLib.json +177 -0
- package/artifacts/contracts/type/Version.sol/VersionPartLib.dbg.json +4 -0
- package/artifacts/contracts/type/Version.sol/VersionPartLib.json +68 -0
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/IVersionable.sol/IVersionable.json +55 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/ProxyManager.sol/ProxyManager.json +617 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +129 -0
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.dbg.json +4 -0
- package/artifacts/contracts/upgradeability/Versionable.sol/Versionable.json +78 -0
- package/contracts/authorization/AccessAdmin.sol +590 -0
- package/contracts/authorization/AccessManagerCloneable.sol +16 -0
- package/contracts/authorization/Authorization.sol +218 -0
- package/contracts/authorization/IAccess.sol +48 -0
- package/contracts/authorization/IAccessAdmin.sol +136 -0
- package/contracts/authorization/IAuthorization.sol +54 -0
- package/contracts/authorization/IModuleAuthorization.sol +21 -0
- package/contracts/authorization/IServiceAuthorization.sol +38 -0
- package/contracts/authorization/ModuleAuthorization.sol +78 -0
- package/contracts/authorization/ServiceAuthorization.sol +90 -0
- package/contracts/distribution/BasicDistribution.sol +149 -0
- package/contracts/distribution/BasicDistributionAuthorization.sol +43 -0
- package/contracts/distribution/Distribution.sol +283 -0
- package/contracts/distribution/DistributionService.sol +288 -0
- package/contracts/distribution/DistributionServiceManager.sol +39 -0
- package/contracts/distribution/IDistributionComponent.sol +48 -0
- package/contracts/distribution/IDistributionService.sol +85 -0
- package/contracts/instance/BundleSet.sol +126 -0
- package/contracts/instance/IInstance.sol +81 -15
- package/contracts/instance/IInstanceService.sol +92 -0
- package/contracts/instance/Instance.sol +235 -45
- package/contracts/instance/InstanceAdmin.sol +266 -0
- package/contracts/instance/InstanceAuthorizationV3.sol +202 -0
- package/contracts/instance/InstanceReader.sol +405 -0
- package/contracts/instance/InstanceService.sol +443 -0
- package/contracts/instance/InstanceServiceManager.sol +40 -0
- package/contracts/instance/InstanceStore.sol +276 -0
- package/contracts/instance/base/BalanceStore.sol +123 -0
- package/contracts/instance/base/Cloneable.sol +28 -0
- package/contracts/instance/base/ObjectCounter.sol +21 -0
- package/contracts/instance/base/ObjectLifecycle.sol +106 -0
- package/contracts/instance/base/ObjectSet.sol +79 -0
- package/contracts/instance/module/IAccess.sol +46 -0
- package/contracts/instance/module/IBundle.sol +20 -0
- package/contracts/instance/module/IComponents.sol +52 -0
- package/contracts/instance/module/IDistribution.sol +42 -0
- package/contracts/instance/module/IPolicy.sol +84 -0
- package/contracts/instance/module/IRisk.sol +11 -0
- package/contracts/mock/Dip.sol +26 -0
- package/contracts/oracle/BasicOracle.sol +48 -0
- package/contracts/oracle/BasicOracleAuthorization.sol +46 -0
- package/contracts/oracle/IOracle.sol +36 -0
- package/contracts/oracle/IOracleComponent.sol +32 -0
- package/contracts/oracle/IOracleService.sol +65 -0
- package/contracts/oracle/Oracle.sol +157 -0
- package/contracts/oracle/OracleService.sol +278 -0
- package/contracts/oracle/OracleServiceManager.sol +39 -0
- package/contracts/pool/BasicPool.sol +164 -0
- package/contracts/pool/BasicPoolAuthorization.sol +49 -0
- package/contracts/pool/BundleService.sol +284 -0
- package/contracts/pool/BundleServiceManager.sol +39 -0
- package/contracts/pool/IBundleService.sol +106 -0
- package/contracts/pool/IPoolComponent.sol +52 -0
- package/contracts/pool/IPoolService.sol +150 -0
- package/contracts/pool/Pool.sol +311 -0
- package/contracts/pool/PoolService.sol +436 -0
- package/contracts/pool/PoolServiceManager.sol +39 -0
- package/contracts/product/ApplicationService.sol +230 -0
- package/contracts/product/ApplicationServiceManager.sol +38 -0
- package/contracts/product/BasicProduct.sol +82 -0
- package/contracts/product/BasicProductAuthorization.sol +40 -0
- package/contracts/product/ClaimService.sol +416 -0
- package/contracts/product/ClaimServiceManager.sol +38 -0
- package/contracts/product/IApplicationService.sol +62 -0
- package/contracts/product/IClaimService.sol +99 -0
- package/contracts/product/IPolicyService.sol +78 -0
- package/contracts/product/IPricingService.sol +39 -0
- package/contracts/product/IProductComponent.sol +39 -0
- package/contracts/product/IProductService.sol +33 -0
- package/contracts/product/PolicyService.sol +475 -0
- package/contracts/product/PolicyServiceManager.sol +39 -0
- package/contracts/product/PricingService.sol +300 -0
- package/contracts/product/PricingServiceManager.sol +39 -0
- package/contracts/product/Product.sol +392 -0
- package/contracts/product/ProductService.sol +99 -0
- package/contracts/product/ProductServiceManager.sol +39 -0
- package/contracts/registry/ChainNft.sol +153 -108
- package/contracts/registry/GlobalRegistry.sol +95 -0
- package/contracts/registry/GlobalRegistryAdmin.sol +38 -0
- package/contracts/registry/IGlobalRegistry.sol +17 -0
- package/contracts/registry/IRegistry.sol +112 -49
- package/contracts/registry/IRegistryService.sol +69 -0
- package/contracts/registry/ITransferInterceptor.sol +7 -0
- package/contracts/registry/Registry.sol +504 -119
- package/contracts/registry/RegistryAdmin.sol +447 -0
- package/contracts/registry/RegistryService.sol +252 -0
- package/contracts/registry/RegistryServiceManager.sol +53 -0
- package/contracts/registry/ReleaseLifecycle.sol +27 -0
- package/contracts/registry/ReleaseRegistry.sol +533 -0
- package/contracts/registry/ServiceAuthorizationV3.sol +200 -0
- package/contracts/registry/TokenRegistry.sol +315 -0
- package/contracts/shared/Component.sol +281 -0
- package/contracts/shared/ComponentService.sol +581 -0
- package/contracts/shared/ComponentServiceManager.sol +35 -0
- package/contracts/shared/ComponentVerifyingService.sol +117 -0
- package/contracts/shared/ERC165.sol +27 -0
- package/contracts/shared/IComponent.sol +70 -0
- package/contracts/shared/IComponentService.sol +102 -0
- package/contracts/shared/IInstanceLinkedComponent.sol +50 -0
- package/contracts/shared/IKeyValueStore.sol +54 -0
- package/contracts/shared/ILifecycle.sol +29 -0
- package/contracts/shared/INftOwnable.sol +23 -0
- package/contracts/shared/IPolicyHolder.sol +45 -0
- package/contracts/shared/IRegisterable.sol +15 -0
- package/contracts/shared/IRegistryLinked.sol +11 -0
- package/contracts/shared/IService.sol +25 -0
- package/contracts/shared/InitializableCustom.sol +177 -0
- package/contracts/shared/InstanceLinkedComponent.sol +151 -0
- package/contracts/shared/KeyValueStore.sol +131 -0
- package/contracts/shared/Lifecycle.sol +77 -0
- package/contracts/shared/MainnetId.sol +29 -0
- package/contracts/shared/NftIdSet.sol +65 -0
- package/contracts/shared/NftOwnable.sol +107 -0
- package/contracts/shared/PolicyHolder.sol +102 -0
- package/contracts/shared/Registerable.sol +75 -0
- package/contracts/shared/RegistryLinked.sol +43 -0
- package/contracts/shared/Service.sol +82 -0
- package/contracts/shared/TokenHandler.sol +58 -0
- package/contracts/staking/IStaking.sol +167 -0
- package/contracts/staking/IStakingService.sol +160 -0
- package/contracts/staking/StakeManagerLib.sol +231 -0
- package/contracts/staking/Staking.sol +510 -0
- package/contracts/staking/StakingLifecycle.sol +23 -0
- package/contracts/staking/StakingManager.sol +50 -0
- package/contracts/staking/StakingReader.sol +183 -0
- package/contracts/staking/StakingService.sol +411 -0
- package/contracts/staking/StakingServiceManager.sol +44 -0
- package/contracts/staking/StakingStore.sol +605 -0
- package/contracts/staking/TargetManagerLib.sol +207 -0
- package/contracts/type/AddressSet.sol +58 -0
- package/contracts/type/Amount.sol +128 -0
- package/contracts/type/Blocknumber.sol +136 -0
- package/contracts/type/ClaimId.sol +75 -0
- package/contracts/type/DistributorType.sol +55 -0
- package/contracts/type/Fee.sol +66 -0
- package/contracts/type/Key32.sol +50 -0
- package/contracts/type/NftId.sol +78 -0
- package/contracts/type/NftIdSet.sol +62 -0
- package/contracts/type/ObjectType.sol +271 -0
- package/contracts/type/PayoutId.sol +82 -0
- package/contracts/type/Referral.sol +89 -0
- package/contracts/type/RequestId.sol +75 -0
- package/contracts/type/RiskId.sol +43 -0
- package/contracts/type/RoleId.sol +174 -0
- package/contracts/type/Seconds.sol +81 -0
- package/contracts/type/Selector.sol +102 -0
- package/contracts/type/StateId.sol +135 -0
- package/contracts/type/String.sol +53 -0
- package/contracts/type/Timestamp.sol +136 -0
- package/contracts/type/UFixed.sol +332 -0
- package/contracts/type/Version.sol +110 -0
- package/contracts/upgradeability/IVersionable.sol +53 -0
- package/contracts/upgradeability/ProxyManager.sol +198 -0
- package/contracts/upgradeability/UpgradableProxyWithAdmin.sol +14 -0
- package/contracts/upgradeability/Versionable.sol +59 -0
- package/package.json +25 -7
- package/artifacts/contracts/components/Component.sol/Component.dbg.json +0 -4
- package/artifacts/contracts/components/Component.sol/Component.json +0 -179
- package/artifacts/contracts/components/Component.sol/InstanceLinked.dbg.json +0 -4
- package/artifacts/contracts/components/Component.sol/InstanceLinked.json +0 -35
- package/artifacts/contracts/components/IPool.sol/IPoolComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IPool.sol/IPoolComponent.json +0 -179
- package/artifacts/contracts/components/IProduct.sol/IProductComponent.dbg.json +0 -4
- package/artifacts/contracts/components/IProduct.sol/IProductComponent.json +0 -192
- package/artifacts/contracts/components/Pool.sol/Pool.dbg.json +0 -4
- package/artifacts/contracts/components/Pool.sol/Pool.json +0 -213
- package/artifacts/contracts/components/Product.sol/Product.dbg.json +0 -4
- package/artifacts/contracts/components/Product.sol/Product.json +0 -231
- package/artifacts/contracts/experiment/errors/Require.sol/Require.dbg.json +0 -4
- package/artifacts/contracts/experiment/errors/Require.sol/Require.json +0 -105
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.dbg.json +0 -4
- package/artifacts/contracts/experiment/errors/Revert.sol/Revert.json +0 -105
- package/artifacts/contracts/experiment/inheritance/A.sol/A.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/A.sol/A.json +0 -128
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/A.sol/AShared.json +0 -42
- package/artifacts/contracts/experiment/inheritance/B.sol/B.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/B.sol/B.json +0 -76
- package/artifacts/contracts/experiment/inheritance/C.sol/C.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/C.sol/C.json +0 -89
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IA.sol/IA.json +0 -128
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IA.sol/ISharedA.json +0 -37
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IB.sol/IB.json +0 -50
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.dbg.json +0 -4
- package/artifacts/contracts/experiment/inheritance/IC.sol/IC.json +0 -63
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.dbg.json +0 -4
- package/artifacts/contracts/experiment/types/TypeA.sol/TypeALib.json +0 -10
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.dbg.json +0 -4
- package/artifacts/contracts/experiment/types/TypeB.sol/TypeBLib.json +0 -10
- package/artifacts/contracts/instance/access/Access.sol/AccessModule.dbg.json +0 -4
- package/artifacts/contracts/instance/access/Access.sol/AccessModule.json +0 -400
- package/artifacts/contracts/instance/access/IAccess.sol/IAccess.dbg.json +0 -4
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessCheckRole.dbg.json +0 -4
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessComponentTypeRoles.dbg.json +0 -4
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessComponentTypeRoles.json +0 -50
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessModule.dbg.json +0 -4
- package/artifacts/contracts/instance/access/IAccess.sol/IAccessModule.json +0 -336
- package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentModule.dbg.json +0 -4
- package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentModule.json +0 -327
- package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/instance/component/ComponentModule.sol/ComponentOwnerService.json +0 -147
- package/artifacts/contracts/instance/component/IComponent.sol/IComponent.dbg.json +0 -4
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentContract.dbg.json +0 -4
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentContract.json +0 -179
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentModule.dbg.json +0 -4
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentModule.json +0 -245
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentOwnerService.dbg.json +0 -4
- package/artifacts/contracts/instance/component/IComponent.sol/IComponentOwnerService.json +0 -94
- package/artifacts/contracts/instance/component/IComponent.sol/IInstanceLinked.dbg.json +0 -4
- package/artifacts/contracts/instance/component/IComponent.sol/IInstanceLinked.json +0 -24
- package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicy.dbg.json +0 -4
- package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicyModule.dbg.json +0 -4
- package/artifacts/contracts/instance/policy/IPolicy.sol/IPolicyModule.json +0 -231
- package/artifacts/contracts/instance/policy/PolicyModule.sol/PolicyModule.dbg.json +0 -4
- package/artifacts/contracts/instance/policy/PolicyModule.sol/PolicyModule.json +0 -231
- package/artifacts/contracts/instance/pool/IPoolModule.sol/IPool.dbg.json +0 -4
- package/artifacts/contracts/instance/pool/IPoolModule.sol/IPoolModule.dbg.json +0 -4
- package/artifacts/contracts/instance/pool/IPoolModule.sol/IPoolModule.json +0 -149
- package/artifacts/contracts/instance/pool/PoolModule.sol/PoolModule.dbg.json +0 -4
- package/artifacts/contracts/instance/product/IProductService.sol/IProductModule.dbg.json +0 -4
- package/artifacts/contracts/instance/product/IProductService.sol/IProductModule.json +0 -75
- package/artifacts/contracts/instance/product/IProductService.sol/IProductService.dbg.json +0 -4
- package/artifacts/contracts/instance/product/IProductService.sol/IProductService.json +0 -114
- package/artifacts/contracts/instance/product/ProductService.sol/ProductModule.dbg.json +0 -4
- package/artifacts/contracts/instance/product/ProductService.sol/ProductModule.json +0 -75
- package/artifacts/contracts/instance/product/ProductService.sol/ProductService.dbg.json +0 -4
- package/artifacts/contracts/instance/product/ProductService.sol/ProductService.json +0 -167
- package/artifacts/contracts/registry/IChainNft.sol/IChainNft.dbg.json +0 -4
- package/artifacts/contracts/registry/IChainNft.sol/IChainNft.json +0 -452
- package/artifacts/contracts/registry/IRegistry.sol/IOwnable.dbg.json +0 -4
- package/artifacts/contracts/registry/IRegistry.sol/IOwnable.json +0 -24
- package/artifacts/contracts/registry/IRegistry.sol/IRegisterable.dbg.json +0 -4
- package/artifacts/contracts/registry/IRegistry.sol/IRegisterable.json +0 -166
- package/artifacts/contracts/registry/IRegistry.sol/IRegistryLinked.dbg.json +0 -4
- package/artifacts/contracts/registry/IRegistry.sol/IRegistryLinked.json +0 -49
- package/artifacts/contracts/registry/Registry.sol/Registerable.dbg.json +0 -4
- package/artifacts/contracts/registry/Registry.sol/RegistryLinked.dbg.json +0 -4
- package/artifacts/contracts/registry/Registry.sol/RegistryLinked.json +0 -60
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.dbg.json +0 -4
- package/artifacts/contracts/types/Blocknumber.sol/BlocknumberLib.json +0 -174
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.dbg.json +0 -4
- package/artifacts/contracts/types/ChainId.sol/ChainIdLib.json +0 -10
- package/artifacts/contracts/types/NftId.sol/NftIdLib.dbg.json +0 -4
- package/artifacts/contracts/types/NftId.sol/NftIdLib.json +0 -92
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.dbg.json +0 -4
- package/artifacts/contracts/types/Timestamp.sol/TimestampLib.json +0 -174
- package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.dbg.json +0 -4
- package/artifacts/contracts/types/UFixed.sol/UFixedMathLib.json +0 -440
- package/contracts/components/Component.sol +0 -62
- package/contracts/components/IPool.sol +0 -9
- package/contracts/components/IProduct.sol +0 -12
- package/contracts/components/Pool.sol +0 -29
- package/contracts/components/Product.sol +0 -66
- package/contracts/experiment/errors/Require.sol +0 -33
- package/contracts/experiment/errors/Revert.sol +0 -39
- package/contracts/experiment/inheritance/A.sol +0 -56
- package/contracts/experiment/inheritance/B.sol +0 -23
- package/contracts/experiment/inheritance/C.sol +0 -28
- package/contracts/experiment/inheritance/IA.sol +0 -18
- package/contracts/experiment/inheritance/IB.sol +0 -9
- package/contracts/experiment/inheritance/IC.sol +0 -11
- package/contracts/experiment/types/TypeA.sol +0 -42
- package/contracts/experiment/types/TypeB.sol +0 -24
- package/contracts/instance/access/Access.sol +0 -218
- package/contracts/instance/access/IAccess.sol +0 -83
- package/contracts/instance/component/ComponentModule.sol +0 -248
- package/contracts/instance/component/IComponent.sol +0 -95
- package/contracts/instance/policy/IPolicy.sol +0 -66
- package/contracts/instance/policy/PolicyModule.sol +0 -107
- package/contracts/instance/pool/IPoolModule.sol +0 -41
- package/contracts/instance/pool/PoolModule.sol +0 -86
- package/contracts/instance/product/IProductService.sol +0 -46
- package/contracts/instance/product/ProductService.sol +0 -108
- package/contracts/registry/IChainNft.sol +0 -18
- package/contracts/types/Blocknumber.sol +0 -60
- package/contracts/types/ChainId.sol +0 -30
- package/contracts/types/NftId.sol +0 -35
- package/contracts/types/Timestamp.sol +0 -55
- package/contracts/types/UFixed.sol +0 -207
@@ -0,0 +1,447 @@
|
|
1
|
+
// SPDX-License-Identifier: UNLICENSED
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {AccessAdmin} from "../authorization/AccessAdmin.sol";
|
5
|
+
import {IAccess} from "../authorization/IAccess.sol";
|
6
|
+
import {IRegistry} from "./IRegistry.sol";
|
7
|
+
import {IService} from "../shared/IService.sol";
|
8
|
+
import {IServiceAuthorization} from "../authorization/IServiceAuthorization.sol";
|
9
|
+
import {IStaking} from "../staking/IStaking.sol";
|
10
|
+
import {ObjectType, ObjectTypeLib, ALL, REGISTRY, STAKING, POOL, RELEASE} from "../type/ObjectType.sol";
|
11
|
+
import {ReleaseRegistry} from "./ReleaseRegistry.sol";
|
12
|
+
import {RoleId, RoleIdLib, ADMIN_ROLE, GIF_MANAGER_ROLE, GIF_ADMIN_ROLE, PUBLIC_ROLE} from "../type/RoleId.sol";
|
13
|
+
import {StakingStore} from "../staking/StakingStore.sol";
|
14
|
+
import {TokenRegistry} from "./TokenRegistry.sol";
|
15
|
+
import {VersionPart} from "../type/Version.sol";
|
16
|
+
import {SidenetContract} from "../shared/MainnetId.sol";
|
17
|
+
|
18
|
+
/*
|
19
|
+
1) GIF_MANAGER_ROLE
|
20
|
+
- can have arbitrary number of members
|
21
|
+
- responsible for services registrations
|
22
|
+
- responsible for token registration and activation
|
23
|
+
|
24
|
+
2) GIF_ADMIN_ROLE
|
25
|
+
- admin of GIF_MANAGER_ROLE
|
26
|
+
- MUST have 1 member at any time
|
27
|
+
- granted/revoked ONLY in transferAdminRole() -> consider lock out situations!!!
|
28
|
+
- responsible for creation and activation of releases
|
29
|
+
*/
|
30
|
+
contract RegistryAdmin is
|
31
|
+
SidenetContract,
|
32
|
+
AccessAdmin
|
33
|
+
{
|
34
|
+
string public constant GIF_ADMIN_ROLE_NAME = "GifAdminRole";
|
35
|
+
string public constant GIF_MANAGER_ROLE_NAME = "GifManagerRole";
|
36
|
+
string public constant POOL_SERVICE_ROLE_NAME = "PoolServiceRole";
|
37
|
+
string public constant RELEASE_REGISTRY_ROLE_NAME = "ReleaseRegistryRole";
|
38
|
+
string public constant REGISTRY_SERVICE_ROLE_NAME = "RegistryServiceRole";
|
39
|
+
string public constant STAKING_SERVICE_ROLE_NAME = "StakingServiceRole";
|
40
|
+
string public constant STAKING_ROLE_NAME = "StakingRole";
|
41
|
+
|
42
|
+
string public constant REGISTRY_TARGET_NAME = "Registry";
|
43
|
+
string public constant RELEASE_REGISTRY_TARGET_NAME = "ReleaseRegistry";
|
44
|
+
string public constant TOKEN_REGISTRY_TARGET_NAME = "TokenRegistry";
|
45
|
+
string public constant STAKING_TARGET_NAME = "Staking";
|
46
|
+
string public constant STAKING_STORE_TARGET_NAME = "StakingStore";
|
47
|
+
|
48
|
+
uint8 public constant MAX_NUM_RELEASES = 99;
|
49
|
+
// TODO consider deleting this
|
50
|
+
mapping(address service => VersionPart majorVersion) private _ServiceRelease;
|
51
|
+
|
52
|
+
address internal _registry;
|
53
|
+
address private _releaseRegistry;
|
54
|
+
address private _tokenRegistry;
|
55
|
+
address private _staking;
|
56
|
+
address private _stakingStore;
|
57
|
+
|
58
|
+
constructor() AccessAdmin() { }
|
59
|
+
|
60
|
+
function completeSetup(
|
61
|
+
IRegistry registry,
|
62
|
+
address gifAdmin,
|
63
|
+
address gifManager
|
64
|
+
)
|
65
|
+
external
|
66
|
+
initializer
|
67
|
+
onlyDeployer()
|
68
|
+
{
|
69
|
+
_registry = address(registry);
|
70
|
+
_releaseRegistry = registry.getReleaseRegistryAddress();
|
71
|
+
_tokenRegistry = registry.getTokenRegistryAddress();
|
72
|
+
_staking = registry.getStakingAddress();
|
73
|
+
_stakingStore = address(
|
74
|
+
IStaking(_staking).getStakingStore());
|
75
|
+
|
76
|
+
// at this moment all registry contracts are deployed and fully intialized
|
77
|
+
_createTarget(_tokenRegistry, TOKEN_REGISTRY_TARGET_NAME, true, false);
|
78
|
+
|
79
|
+
_setupGifAdminRole(gifAdmin);
|
80
|
+
_setupGifManagerRole(gifManager);
|
81
|
+
|
82
|
+
_setupRegistry();
|
83
|
+
_setupReleaseRegistry();
|
84
|
+
_setupStaking();
|
85
|
+
}
|
86
|
+
|
87
|
+
|
88
|
+
/// @dev Sets up authorizaion for specified service.
|
89
|
+
/// For all authorized services its authorized functions are enabled.
|
90
|
+
/// Permissioned function: Access is restricted to release manager.
|
91
|
+
function authorizeService(
|
92
|
+
IServiceAuthorization serviceAuthorization,
|
93
|
+
IService service,
|
94
|
+
ObjectType serviceDomain,
|
95
|
+
VersionPart releaseVersion
|
96
|
+
)
|
97
|
+
external
|
98
|
+
restricted()
|
99
|
+
{
|
100
|
+
_createServiceTargetAndRole(service, serviceDomain, releaseVersion);
|
101
|
+
_authorizeServiceFunctions(serviceAuthorization, service, serviceDomain, releaseVersion);
|
102
|
+
}
|
103
|
+
|
104
|
+
function grantServiceRole(
|
105
|
+
IService service,
|
106
|
+
ObjectType domain,
|
107
|
+
VersionPart version
|
108
|
+
)
|
109
|
+
external
|
110
|
+
restricted()
|
111
|
+
{
|
112
|
+
_grantRoleToAccount(
|
113
|
+
RoleIdLib.roleForTypeAndVersion(
|
114
|
+
domain,
|
115
|
+
version),
|
116
|
+
address(service));
|
117
|
+
}
|
118
|
+
|
119
|
+
function revokeServiceRole(
|
120
|
+
IService service,
|
121
|
+
ObjectType domain,
|
122
|
+
VersionPart version
|
123
|
+
)
|
124
|
+
external
|
125
|
+
restricted()
|
126
|
+
{
|
127
|
+
_revokeRoleFromAccount(
|
128
|
+
RoleIdLib.roleForTypeAndVersion(
|
129
|
+
domain,
|
130
|
+
version),
|
131
|
+
address(service));
|
132
|
+
}
|
133
|
+
|
134
|
+
function grantServiceRoleForAllVersions(IService service, ObjectType domain)
|
135
|
+
external
|
136
|
+
restricted()
|
137
|
+
{
|
138
|
+
_grantRoleToAccount(
|
139
|
+
RoleIdLib.roleForTypeAndAllVersions(domain),
|
140
|
+
address(service));
|
141
|
+
}
|
142
|
+
|
143
|
+
function revokeServiceRoleForAllVersions(IService service, ObjectType domain)
|
144
|
+
external
|
145
|
+
restricted()
|
146
|
+
{
|
147
|
+
_revokeRoleFromAccount(
|
148
|
+
RoleIdLib.roleForTypeAndAllVersions(domain),
|
149
|
+
address(service));
|
150
|
+
}
|
151
|
+
|
152
|
+
/*function transferAdmin(address to)
|
153
|
+
external
|
154
|
+
restricted // only with GIF_ADMIN_ROLE or nft owner
|
155
|
+
{
|
156
|
+
_accessManager.revoke(GIF_ADMIN_ROLE, );
|
157
|
+
_accesssManager.grant(GIF_ADMIN_ROLE, to, 0);
|
158
|
+
}*/
|
159
|
+
|
160
|
+
//--- view functions ----------------------------------------------------//
|
161
|
+
|
162
|
+
function getGifAdminRole() external view returns (RoleId) {
|
163
|
+
return GIF_ADMIN_ROLE();
|
164
|
+
}
|
165
|
+
|
166
|
+
function getGifManagerRole() external view returns (RoleId) {
|
167
|
+
return GIF_MANAGER_ROLE();
|
168
|
+
}
|
169
|
+
|
170
|
+
//--- private functions -------------------------------------------------//
|
171
|
+
|
172
|
+
function _createServiceTargetAndRole(
|
173
|
+
IService service,
|
174
|
+
ObjectType serviceDomain,
|
175
|
+
VersionPart releaseVersion
|
176
|
+
)
|
177
|
+
private
|
178
|
+
{
|
179
|
+
string memory baseName = ObjectTypeLib.toName(serviceDomain);
|
180
|
+
uint256 versionInt = releaseVersion.toInt();
|
181
|
+
|
182
|
+
// create service target
|
183
|
+
string memory serviceTargetName = ObjectTypeLib.toVersionedName(
|
184
|
+
baseName, "Service", versionInt);
|
185
|
+
|
186
|
+
_createTarget(
|
187
|
+
address(service),
|
188
|
+
serviceTargetName,
|
189
|
+
true,
|
190
|
+
false);
|
191
|
+
|
192
|
+
// create service role
|
193
|
+
RoleId serviceRoleId = RoleIdLib.roleForTypeAndVersion(
|
194
|
+
serviceDomain,
|
195
|
+
releaseVersion);
|
196
|
+
|
197
|
+
_createRole(
|
198
|
+
serviceRoleId,
|
199
|
+
toRole({
|
200
|
+
adminRoleId: ADMIN_ROLE(),
|
201
|
+
roleType: RoleType.Contract,
|
202
|
+
maxMemberCount: 1,
|
203
|
+
name: ObjectTypeLib.toVersionedName(
|
204
|
+
baseName,
|
205
|
+
"ServiceRole",
|
206
|
+
versionInt)}));
|
207
|
+
|
208
|
+
_grantRoleToAccount(
|
209
|
+
serviceRoleId,
|
210
|
+
address(service));
|
211
|
+
}
|
212
|
+
|
213
|
+
|
214
|
+
function _authorizeServiceFunctions(
|
215
|
+
IServiceAuthorization serviceAuthorization,
|
216
|
+
IService service,
|
217
|
+
ObjectType serviceDomain,
|
218
|
+
VersionPart releaseVersion
|
219
|
+
)
|
220
|
+
private
|
221
|
+
{
|
222
|
+
ObjectType authorizedDomain;
|
223
|
+
RoleId authorizedRoleId;
|
224
|
+
|
225
|
+
ObjectType[] memory authorizedDomains = serviceAuthorization.getAuthorizedDomains(serviceDomain);
|
226
|
+
|
227
|
+
for (uint256 i = 0; i < authorizedDomains.length; i++) {
|
228
|
+
authorizedDomain = authorizedDomains[i];
|
229
|
+
|
230
|
+
// derive authorized role from authorized domain
|
231
|
+
if (authorizedDomain == ALL()) {
|
232
|
+
authorizedRoleId = PUBLIC_ROLE();
|
233
|
+
} else {
|
234
|
+
authorizedRoleId = RoleIdLib.roleForTypeAndVersion(
|
235
|
+
authorizedDomain,
|
236
|
+
releaseVersion);
|
237
|
+
}
|
238
|
+
|
239
|
+
// get authorized functions for authorized domain
|
240
|
+
IAccess.FunctionInfo[] memory authorizatedFunctions = serviceAuthorization.getAuthorizedFunctions(
|
241
|
+
serviceDomain,
|
242
|
+
authorizedDomain);
|
243
|
+
|
244
|
+
_authorizeTargetFunctions(
|
245
|
+
address(service),
|
246
|
+
authorizedRoleId,
|
247
|
+
authorizatedFunctions);
|
248
|
+
}
|
249
|
+
}
|
250
|
+
|
251
|
+
//--- private initialization functions -------------------------------------------//
|
252
|
+
|
253
|
+
function _setupGifAdminRole(address gifAdmin)
|
254
|
+
private
|
255
|
+
onlyInitializing()
|
256
|
+
{
|
257
|
+
|
258
|
+
_createRole(
|
259
|
+
GIF_ADMIN_ROLE(),
|
260
|
+
toRole({
|
261
|
+
adminRoleId: ADMIN_ROLE(),
|
262
|
+
roleType: RoleType.Gif,
|
263
|
+
maxMemberCount: 2, // TODO decide on max member count
|
264
|
+
name: GIF_ADMIN_ROLE_NAME}));
|
265
|
+
|
266
|
+
// for ReleaseRegistry
|
267
|
+
FunctionInfo[] memory functions;
|
268
|
+
functions = new FunctionInfo[](4);
|
269
|
+
functions[0] = toFunction(ReleaseRegistry.createNextRelease.selector, "createNextRelease");
|
270
|
+
functions[1] = toFunction(ReleaseRegistry.activateNextRelease.selector, "activateNextRelease");
|
271
|
+
functions[2] = toFunction(ReleaseRegistry.pauseRelease.selector, "pauseRelease");
|
272
|
+
functions[3] = toFunction(ReleaseRegistry.unpauseRelease.selector, "unpauseRelease");
|
273
|
+
_authorizeTargetFunctions(_releaseRegistry, GIF_ADMIN_ROLE(), functions);
|
274
|
+
|
275
|
+
_grantRoleToAccount(GIF_ADMIN_ROLE(), gifAdmin);
|
276
|
+
}
|
277
|
+
|
278
|
+
function _setupGifManagerRole(address gifManager)
|
279
|
+
private
|
280
|
+
onlyInitializing()
|
281
|
+
{
|
282
|
+
|
283
|
+
_createRole(
|
284
|
+
GIF_MANAGER_ROLE(),
|
285
|
+
toRole({
|
286
|
+
adminRoleId: ADMIN_ROLE(),
|
287
|
+
roleType: RoleType.Gif,
|
288
|
+
maxMemberCount: 1,
|
289
|
+
name: GIF_MANAGER_ROLE_NAME}));
|
290
|
+
|
291
|
+
// for TokenRegistry
|
292
|
+
FunctionInfo[] memory functions;
|
293
|
+
functions = new FunctionInfo[](5);
|
294
|
+
functions[0] = toFunction(TokenRegistry.registerToken.selector, "registerToken");
|
295
|
+
functions[1] = toFunction(TokenRegistry.registerRemoteToken.selector, "registerRemoteToken");
|
296
|
+
functions[2] = toFunction(TokenRegistry.setActive.selector, "setActive");
|
297
|
+
functions[3] = toFunction(TokenRegistry.setActiveForVersion.selector, "setActiveForVersion");
|
298
|
+
// TODO find a better way (only needed for testing)
|
299
|
+
functions[4] = toFunction(TokenRegistry.setActiveWithVersionCheck.selector, "setActiveWithVersionCheck");
|
300
|
+
_authorizeTargetFunctions(_tokenRegistry, GIF_MANAGER_ROLE(), functions);
|
301
|
+
|
302
|
+
// for ReleaseRegistry
|
303
|
+
functions = new FunctionInfo[](2);
|
304
|
+
functions[0] = toFunction(ReleaseRegistry.prepareNextRelease.selector, "prepareNextRelease");
|
305
|
+
functions[1] = toFunction(ReleaseRegistry.registerService.selector, "registerService");
|
306
|
+
_authorizeTargetFunctions(_releaseRegistry, GIF_MANAGER_ROLE(), functions);
|
307
|
+
|
308
|
+
_grantRoleToAccount(GIF_MANAGER_ROLE(), gifManager);
|
309
|
+
}
|
310
|
+
|
311
|
+
function _setupRegistry()
|
312
|
+
internal
|
313
|
+
virtual
|
314
|
+
onlyInitializing()
|
315
|
+
{
|
316
|
+
_createTarget(_registry, REGISTRY_TARGET_NAME, true, false);
|
317
|
+
|
318
|
+
// registry function authorization for registry service
|
319
|
+
RoleId registryServiceRoleId = RoleIdLib.roleForTypeAndAllVersions(REGISTRY());
|
320
|
+
_createRole(
|
321
|
+
registryServiceRoleId,
|
322
|
+
toRole({
|
323
|
+
adminRoleId: ADMIN_ROLE(),
|
324
|
+
roleType: RoleType.Contract,
|
325
|
+
maxMemberCount: MAX_NUM_RELEASES,
|
326
|
+
name: REGISTRY_SERVICE_ROLE_NAME}));
|
327
|
+
|
328
|
+
FunctionInfo[] memory functions;
|
329
|
+
functions = new FunctionInfo[](2);
|
330
|
+
functions[0] = toFunction(IRegistry.register.selector, "register");
|
331
|
+
functions[1] = toFunction(IRegistry.registerWithCustomType.selector, "registerWithCustomType");
|
332
|
+
// TODO add registerChainRegistry()
|
333
|
+
|
334
|
+
_authorizeTargetFunctions(_registry, registryServiceRoleId, functions);
|
335
|
+
}
|
336
|
+
|
337
|
+
|
338
|
+
function _setupReleaseRegistry()
|
339
|
+
private
|
340
|
+
onlyInitializing()
|
341
|
+
{
|
342
|
+
|
343
|
+
_createTarget(_releaseRegistry, RELEASE_REGISTRY_TARGET_NAME, true, false);
|
344
|
+
|
345
|
+
RoleId releaseRegistryRoleId = RoleIdLib.roleForType(RELEASE());
|
346
|
+
_createRole(
|
347
|
+
releaseRegistryRoleId,
|
348
|
+
toRole({
|
349
|
+
adminRoleId: ADMIN_ROLE(),
|
350
|
+
roleType: RoleType.Contract,
|
351
|
+
maxMemberCount: 1,
|
352
|
+
name: RELEASE_REGISTRY_ROLE_NAME}));
|
353
|
+
|
354
|
+
FunctionInfo[] memory functions;
|
355
|
+
functions = new FunctionInfo[](5);
|
356
|
+
functions[0] = toFunction(RegistryAdmin.authorizeService.selector, "authorizeService");
|
357
|
+
functions[1] = toFunction(RegistryAdmin.grantServiceRoleForAllVersions.selector, "grantServiceRoleForAllVersions");
|
358
|
+
functions[2] = toFunction(RegistryAdmin.revokeServiceRoleForAllVersions.selector, "revokeServiceRoleForAllVersions");
|
359
|
+
functions[3] = toFunction(RegistryAdmin.grantServiceRole.selector, "grantServiceRole");
|
360
|
+
functions[4] = toFunction(RegistryAdmin.revokeServiceRole.selector, "revokeServiceRole");
|
361
|
+
|
362
|
+
_authorizeTargetFunctions(address(this), releaseRegistryRoleId, functions);
|
363
|
+
|
364
|
+
_grantRoleToAccount(releaseRegistryRoleId, _releaseRegistry);
|
365
|
+
}
|
366
|
+
|
367
|
+
|
368
|
+
function _setupStaking()
|
369
|
+
private
|
370
|
+
onlyInitializing()
|
371
|
+
{
|
372
|
+
_createTarget(_staking, STAKING_TARGET_NAME, true, false);
|
373
|
+
_createTarget(_stakingStore, STAKING_STORE_TARGET_NAME, true, false);
|
374
|
+
|
375
|
+
// staking function authorization for staking service
|
376
|
+
RoleId stakingServiceRoleId = RoleIdLib.roleForTypeAndAllVersions(STAKING());
|
377
|
+
_createRole(
|
378
|
+
stakingServiceRoleId,
|
379
|
+
toRole({
|
380
|
+
adminRoleId: ADMIN_ROLE(),
|
381
|
+
roleType: RoleType.Contract,
|
382
|
+
maxMemberCount: MAX_NUM_RELEASES,
|
383
|
+
name: STAKING_SERVICE_ROLE_NAME}));
|
384
|
+
|
385
|
+
FunctionInfo[] memory functions;
|
386
|
+
functions = new FunctionInfo[](13);
|
387
|
+
functions[0] = toFunction(IStaking.registerTarget.selector, "registerTarget");
|
388
|
+
functions[1] = toFunction(IStaking.setLockingPeriod.selector, "setLockingPeriod");
|
389
|
+
functions[2] = toFunction(IStaking.setRewardRate.selector, "setRewardRate");
|
390
|
+
functions[3] = toFunction(IStaking.refillRewardReserves.selector, "refillRewardReserves");
|
391
|
+
functions[4] = toFunction(IStaking.withdrawRewardReserves.selector, "withdrawRewardReserves");
|
392
|
+
functions[5] = toFunction(IStaking.createStake.selector, "createStake");
|
393
|
+
functions[6] = toFunction(IStaking.stake.selector, "stake");
|
394
|
+
functions[7] = toFunction(IStaking.unstake.selector, "unstake");
|
395
|
+
functions[8] = toFunction(IStaking.restake.selector, "restake");
|
396
|
+
functions[9] = toFunction(IStaking.updateRewards.selector, "updateRewards");
|
397
|
+
functions[10] = toFunction(IStaking.claimRewards.selector, "claimRewards");
|
398
|
+
functions[11] = toFunction(IStaking.collectDipAmount.selector, "collectDipAmount");
|
399
|
+
functions[12] = toFunction(IStaking.transferDipAmount.selector, "transferDipAmount");
|
400
|
+
_authorizeTargetFunctions(_staking, stakingServiceRoleId, functions);
|
401
|
+
|
402
|
+
// staking function authorization for pool service
|
403
|
+
RoleId poolServiceRoleId = RoleIdLib.roleForTypeAndAllVersions(POOL());
|
404
|
+
_createRole(
|
405
|
+
poolServiceRoleId,
|
406
|
+
toRole({
|
407
|
+
adminRoleId: ADMIN_ROLE(),
|
408
|
+
roleType: RoleType.Contract,
|
409
|
+
maxMemberCount: MAX_NUM_RELEASES,
|
410
|
+
name: POOL_SERVICE_ROLE_NAME}));
|
411
|
+
|
412
|
+
// staking function authorizations
|
413
|
+
functions = new FunctionInfo[](2);
|
414
|
+
functions[0] = toFunction(IStaking.increaseTotalValueLocked.selector, "increaseTotalValueLocked");
|
415
|
+
functions[1] = toFunction(IStaking.decreaseTotalValueLocked.selector, "decreaseTotalValueLocked");
|
416
|
+
_authorizeTargetFunctions(_staking, poolServiceRoleId, functions);
|
417
|
+
|
418
|
+
// staking store function authorizations
|
419
|
+
RoleId stakingRoleId = RoleIdLib.roleForType(STAKING());
|
420
|
+
_createRole(
|
421
|
+
stakingRoleId,
|
422
|
+
toRole({
|
423
|
+
adminRoleId: ADMIN_ROLE(),
|
424
|
+
roleType: RoleType.Contract,
|
425
|
+
maxMemberCount: 1,
|
426
|
+
name: STAKING_ROLE_NAME}));
|
427
|
+
|
428
|
+
functions = new FunctionInfo[](14);
|
429
|
+
functions[0] = toFunction(StakingStore.setStakingRate.selector, "setStakingRate");
|
430
|
+
functions[1] = toFunction(StakingStore.createTarget.selector, "createTarget");
|
431
|
+
functions[2] = toFunction(StakingStore.updateTarget.selector, "updateTarget");
|
432
|
+
functions[3] = toFunction(StakingStore.increaseReserves.selector, "increaseReserves");
|
433
|
+
functions[4] = toFunction(StakingStore.decreaseReserves.selector, "decreaseReserves");
|
434
|
+
functions[5] = toFunction(StakingStore.increaseTotalValueLocked.selector, "increaseTotalValueLocked");
|
435
|
+
functions[6] = toFunction(StakingStore.decreaseTotalValueLocked.selector, "decreaseTotalValueLocked");
|
436
|
+
functions[7] = toFunction(StakingStore.create.selector, "create");
|
437
|
+
functions[8] = toFunction(StakingStore.update.selector, "update");
|
438
|
+
functions[9] = toFunction(StakingStore.increaseStake.selector, "increaseStake");
|
439
|
+
functions[10] = toFunction(StakingStore.restakeRewards.selector, "restakeRewards");
|
440
|
+
functions[11] = toFunction(StakingStore.updateRewards.selector, "updateRewards");
|
441
|
+
functions[12] = toFunction(StakingStore.claimUpTo.selector, "claimUpTo");
|
442
|
+
functions[13] = toFunction(StakingStore.unstakeUpTo.selector, "unstakeUpTo");
|
443
|
+
_authorizeTargetFunctions(_stakingStore, stakingRoleId, functions);
|
444
|
+
|
445
|
+
_grantRoleToAccount(stakingRoleId, _staking);
|
446
|
+
}
|
447
|
+
}
|
@@ -0,0 +1,252 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
import {IComponent} from "../../contracts/shared/IComponent.sol";
|
5
|
+
import {IDistributionComponent} from "../../contracts/distribution/IDistributionComponent.sol";
|
6
|
+
import {IInstance} from "../instance/IInstance.sol";
|
7
|
+
import {IPoolComponent} from "../../contracts/pool/IPoolComponent.sol";
|
8
|
+
import {IProductComponent} from "../../contracts/product/IProductComponent.sol";
|
9
|
+
import {IRegisterable} from "../../contracts/shared/IRegisterable.sol";
|
10
|
+
import {IRegistry} from "./IRegistry.sol";
|
11
|
+
import {IRegistryService} from "./IRegistryService.sol";
|
12
|
+
|
13
|
+
import {ObjectType, REGISTRY, SERVICE, PRODUCT, ORACLE, POOL, INSTANCE, COMPONENT, DISTRIBUTION, DISTRIBUTOR, APPLICATION, POLICY, CLAIM, BUNDLE, STAKE, STAKING, PRICE} from "../../contracts/type/ObjectType.sol";
|
14
|
+
import {NftId, NftIdLib} from "../../contracts/type/NftId.sol";
|
15
|
+
import {Service} from "../shared/Service.sol";
|
16
|
+
|
17
|
+
contract RegistryService is
|
18
|
+
Service,
|
19
|
+
IRegistryService
|
20
|
+
{
|
21
|
+
using NftIdLib for NftId;
|
22
|
+
|
23
|
+
// TODO update to real hash when registry is stable
|
24
|
+
bytes32 public constant REGISTRY_CREATION_CODE_HASH = bytes32(0);
|
25
|
+
|
26
|
+
// from Versionable
|
27
|
+
|
28
|
+
/// @dev top level initializer
|
29
|
+
function _initialize(
|
30
|
+
address owner,
|
31
|
+
bytes memory data
|
32
|
+
)
|
33
|
+
internal
|
34
|
+
virtual override
|
35
|
+
initializer()
|
36
|
+
{
|
37
|
+
(
|
38
|
+
address registryAddress,
|
39
|
+
address initialAuthority
|
40
|
+
) = abi.decode(data, (address, address));
|
41
|
+
|
42
|
+
initializeService(registryAddress, initialAuthority, owner);
|
43
|
+
registerInterface(type(IRegistryService).interfaceId);
|
44
|
+
}
|
45
|
+
|
46
|
+
|
47
|
+
function registerStaking(IRegisterable staking, address owner)
|
48
|
+
external
|
49
|
+
virtual
|
50
|
+
restricted()
|
51
|
+
returns(
|
52
|
+
IRegistry.ObjectInfo memory info
|
53
|
+
)
|
54
|
+
{
|
55
|
+
info = _getAndVerifyContractInfo(staking, STAKING(), owner);
|
56
|
+
info.nftId = getRegistry().register(info);
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
function registerInstance(IRegisterable instance, address owner)
|
61
|
+
external
|
62
|
+
virtual
|
63
|
+
restricted
|
64
|
+
returns(
|
65
|
+
IRegistry.ObjectInfo memory info
|
66
|
+
)
|
67
|
+
{
|
68
|
+
if(!instance.supportsInterface(type(IInstance).interfaceId)) {
|
69
|
+
revert ErrorRegistryServiceNotInstance(address(instance));
|
70
|
+
}
|
71
|
+
|
72
|
+
info = _getAndVerifyContractInfo(instance, INSTANCE(), owner);
|
73
|
+
info.nftId = getRegistry().register(info);
|
74
|
+
|
75
|
+
instance.linkToRegisteredNftId(); // asume safe
|
76
|
+
}
|
77
|
+
|
78
|
+
function registerProduct(IComponent product, address owner)
|
79
|
+
external
|
80
|
+
restricted
|
81
|
+
returns(
|
82
|
+
IRegistry.ObjectInfo memory info
|
83
|
+
)
|
84
|
+
{
|
85
|
+
// CAN revert if no ERC165 support -> will revert with empty message
|
86
|
+
if(!product.supportsInterface(type(IProductComponent).interfaceId)) {
|
87
|
+
revert ErrorRegistryServiceNotProduct(address(product));
|
88
|
+
}
|
89
|
+
|
90
|
+
info = _getAndVerifyContractInfo(product, PRODUCT(), owner);
|
91
|
+
info.nftId = getRegistry().register(info);
|
92
|
+
}
|
93
|
+
|
94
|
+
function registerComponent(
|
95
|
+
IComponent component,
|
96
|
+
ObjectType objectType,
|
97
|
+
address initialOwner
|
98
|
+
)
|
99
|
+
external
|
100
|
+
restricted
|
101
|
+
returns(
|
102
|
+
IRegistry.ObjectInfo memory info
|
103
|
+
)
|
104
|
+
{
|
105
|
+
// CAN revert if no ERC165 support -> will revert with empty message
|
106
|
+
if(!component.supportsInterface(type(IComponent).interfaceId)) {
|
107
|
+
revert ErrorRegistryServiceNotComponent(address(component));
|
108
|
+
}
|
109
|
+
|
110
|
+
info = _getAndVerifyContractInfo(component, objectType, initialOwner);
|
111
|
+
info.nftId = getRegistry().register(info);
|
112
|
+
}
|
113
|
+
|
114
|
+
function registerPool(IComponent pool, address owner)
|
115
|
+
external
|
116
|
+
restricted
|
117
|
+
returns(
|
118
|
+
IRegistry.ObjectInfo memory info
|
119
|
+
)
|
120
|
+
{
|
121
|
+
if(!pool.supportsInterface(type(IPoolComponent).interfaceId)) {
|
122
|
+
revert ErrorRegistryServiceNotPool(address(pool));
|
123
|
+
}
|
124
|
+
|
125
|
+
info = _getAndVerifyContractInfo(pool, POOL(), owner);
|
126
|
+
info.nftId = getRegistry().register(info);
|
127
|
+
}
|
128
|
+
|
129
|
+
function registerDistribution(IComponent distribution, address owner)
|
130
|
+
external
|
131
|
+
restricted
|
132
|
+
returns(
|
133
|
+
IRegistry.ObjectInfo memory info
|
134
|
+
)
|
135
|
+
{
|
136
|
+
if(!distribution.supportsInterface(type(IDistributionComponent).interfaceId)) {
|
137
|
+
revert ErrorRegistryServiceNotDistribution(address(distribution));
|
138
|
+
}
|
139
|
+
|
140
|
+
info = _getAndVerifyContractInfo(distribution, DISTRIBUTION(), owner);
|
141
|
+
info.nftId = getRegistry().register(info);
|
142
|
+
}
|
143
|
+
|
144
|
+
function registerDistributor(IRegistry.ObjectInfo memory info)
|
145
|
+
external
|
146
|
+
restricted
|
147
|
+
returns(NftId nftId)
|
148
|
+
{
|
149
|
+
_verifyObjectInfo(info, DISTRIBUTOR());
|
150
|
+
nftId = getRegistry().register(info);
|
151
|
+
}
|
152
|
+
|
153
|
+
function registerPolicy(IRegistry.ObjectInfo memory info)
|
154
|
+
external
|
155
|
+
restricted
|
156
|
+
returns(NftId nftId)
|
157
|
+
{
|
158
|
+
_verifyObjectInfo(info, POLICY());
|
159
|
+
nftId = getRegistry().register(info);
|
160
|
+
}
|
161
|
+
|
162
|
+
function registerBundle(IRegistry.ObjectInfo memory info)
|
163
|
+
external
|
164
|
+
restricted
|
165
|
+
returns(NftId nftId)
|
166
|
+
{
|
167
|
+
_verifyObjectInfo(info, BUNDLE());
|
168
|
+
nftId = getRegistry().register(info);
|
169
|
+
}
|
170
|
+
|
171
|
+
function registerStake(IRegistry.ObjectInfo memory info)
|
172
|
+
external
|
173
|
+
restricted
|
174
|
+
returns(NftId nftId)
|
175
|
+
{
|
176
|
+
_verifyObjectInfo(info, STAKE());
|
177
|
+
nftId = getRegistry().register(info);
|
178
|
+
}
|
179
|
+
|
180
|
+
// Internal
|
181
|
+
|
182
|
+
function _getAndVerifyContractInfo(
|
183
|
+
IRegisterable registerable,
|
184
|
+
ObjectType expectedType, // assume can be valid only
|
185
|
+
address expectedOwner // assume can be 0 when given by other service
|
186
|
+
)
|
187
|
+
internal
|
188
|
+
view
|
189
|
+
returns(
|
190
|
+
IRegistry.ObjectInfo memory info
|
191
|
+
)
|
192
|
+
{
|
193
|
+
info = registerable.getInitialInfo();
|
194
|
+
|
195
|
+
if(info.objectAddress != address(registerable)) {
|
196
|
+
revert ErrorRegistryServiceRegisterableAddressInvalid(registerable, info.objectAddress);
|
197
|
+
}
|
198
|
+
|
199
|
+
if(info.objectType != expectedType) {// type is checked in registry anyway...but service logic may depend on expected value
|
200
|
+
revert ErrorRegistryServiceRegisterableTypeInvalid(registerable, expectedType, info.objectType);
|
201
|
+
}
|
202
|
+
|
203
|
+
address owner = info.initialOwner;
|
204
|
+
|
205
|
+
if(owner != expectedOwner) { // registerable owner protection
|
206
|
+
revert ErrorRegistryServiceRegisterableOwnerInvalid(registerable, expectedOwner, owner);
|
207
|
+
}
|
208
|
+
|
209
|
+
if(owner == address(registerable)) {
|
210
|
+
revert ErrorRegistryServiceRegisterableSelfRegistration(registerable);
|
211
|
+
}
|
212
|
+
|
213
|
+
if(owner == address(0)) {
|
214
|
+
revert ErrorRegistryServiceRegisterableOwnerZero(registerable);
|
215
|
+
}
|
216
|
+
|
217
|
+
if(getRegistry().isRegistered(owner)) {
|
218
|
+
revert ErrorRegistryServiceRegisterableOwnerRegistered(registerable, owner);
|
219
|
+
}
|
220
|
+
}
|
221
|
+
|
222
|
+
function _verifyObjectInfo(
|
223
|
+
IRegistry.ObjectInfo memory info,
|
224
|
+
ObjectType expectedType
|
225
|
+
)
|
226
|
+
internal
|
227
|
+
view
|
228
|
+
{
|
229
|
+
if(info.objectAddress > address(0)) {
|
230
|
+
revert ErrorRegistryServiceObjectAddressNotZero(info.objectType);
|
231
|
+
}
|
232
|
+
|
233
|
+
if(info.objectType != expectedType) {// type is checked in registry anyway...but service logic may depend on expected value
|
234
|
+
revert ErrorRegistryServiceObjectTypeInvalid(expectedType, info.objectType);
|
235
|
+
}
|
236
|
+
|
237
|
+
address owner = info.initialOwner;
|
238
|
+
|
239
|
+
if(owner == address(0)) {
|
240
|
+
revert ErrorRegistryServiceObjectOwnerZero(info.objectType);
|
241
|
+
}
|
242
|
+
|
243
|
+
if(getRegistry().isRegistered(owner)) {
|
244
|
+
revert ErrorRegistryServiceObjectOwnerRegistered(info.objectType, owner);
|
245
|
+
}
|
246
|
+
}
|
247
|
+
|
248
|
+
// From IService
|
249
|
+
function _getDomain() internal override pure returns(ObjectType serviceDomain) {
|
250
|
+
return REGISTRY();
|
251
|
+
}
|
252
|
+
}
|