@etherisc/gif-next 0.0.2-e802d97-251 → 0.0.2-e83e4a5-207
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +18 -2
- 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/authorization/IAccess.sol/IAccess.json +10 -0
- 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 +1 -1
- package/artifacts/contracts/distribution/Distribution.sol/Distribution.json +17 -242
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionService.sol/DistributionService.json +138 -93
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.dbg.json +1 -1
- package/artifacts/contracts/distribution/DistributionServiceManager.sol/DistributionServiceManager.json +65 -57
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionComponent.sol/IDistributionComponent.json +71 -146
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.dbg.json +1 -1
- package/artifacts/contracts/distribution/IDistributionService.sol/IDistributionService.json +45 -16
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.dbg.json +1 -1
- package/artifacts/contracts/instance/BundleManager.sol/BundleManager.json +33 -108
- package/artifacts/contracts/instance/IInstance.sol/IInstance.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstance.sol/IInstance.json +58 -78
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/IInstanceService.sol/IInstanceService.json +147 -40
- package/artifacts/contracts/instance/Instance.sol/Instance.dbg.json +1 -1
- package/artifacts/contracts/instance/Instance.sol/Instance.json +72 -140
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceAdmin.sol/InstanceAdmin.json +1208 -290
- 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 +1 -1
- package/artifacts/contracts/instance/InstanceReader.sol/InstanceReader.json +110 -76
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceService.sol/InstanceService.json +210 -103
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceServiceManager.sol/InstanceServiceManager.json +49 -49
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/InstanceStore.sol/InstanceStore.json +84 -135
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.dbg.json +1 -1
- package/artifacts/contracts/instance/base/BalanceStore.sol/BalanceStore.json +2 -2
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.dbg.json +1 -1
- package/artifacts/contracts/instance/base/Cloneable.sol/Cloneable.json +0 -53
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectCounter.sol/ObjectCounter.json +2 -2
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.dbg.json +4 -0
- package/artifacts/contracts/instance/base/ObjectLifecycle.sol/ObjectLifecycle.json +182 -0
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.dbg.json +1 -1
- package/artifacts/contracts/instance/base/ObjectManager.sol/ObjectManager.json +3 -78
- package/artifacts/contracts/instance/module/IAccess.sol/IAccess.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IBundle.sol/IBundle.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IComponents.sol/IComponents.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IDistribution.sol/IDistribution.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IPolicy.sol/IPolicy.dbg.json +1 -1
- package/artifacts/contracts/instance/module/IRisk.sol/IRisk.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.dbg.json +1 -1
- package/artifacts/contracts/mock/Dip.sol/Dip.json +2 -2
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.dbg.json +4 -0
- package/artifacts/contracts/oracle/BasicOracle.sol/BasicOracle.json +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 +1 -1
- package/artifacts/contracts/oracle/IOracle.sol/IOracle.json +43 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleComponent.sol/IOracleComponent.json +13 -0
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/IOracleService.sol/IOracleService.json +13 -0
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.dbg.json +1 -1
- package/artifacts/contracts/oracle/Oracle.sol/Oracle.json +13 -96
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleService.sol/OracleService.json +66 -29
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/oracle/OracleServiceManager.sol/OracleServiceManager.json +44 -32
- 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 +1 -1
- package/artifacts/contracts/pool/BundleService.sol/BundleService.json +78 -49
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/BundleServiceManager.sol/BundleServiceManager.json +50 -42
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.dbg.json +1 -1
- package/artifacts/contracts/pool/IBundleService.sol/IBundleService.json +13 -0
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolComponent.sol/IPoolComponent.json +7 -202
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/IPoolService.sol/IPoolService.json +13 -0
- package/artifacts/contracts/pool/Pool.sol/Pool.dbg.json +1 -1
- package/artifacts/contracts/pool/Pool.sol/Pool.json +7 -303
- package/artifacts/contracts/pool/PoolService.sol/PoolService.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolService.sol/PoolService.json +62 -41
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.dbg.json +1 -1
- package/artifacts/contracts/pool/PoolServiceManager.sol/PoolServiceManager.json +42 -38
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationService.sol/ApplicationService.json +66 -37
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ApplicationServiceManager.sol/ApplicationServiceManager.json +44 -36
- 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 +1 -1
- package/artifacts/contracts/product/ClaimService.sol/ClaimService.json +106 -69
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ClaimServiceManager.sol/ClaimServiceManager.json +64 -52
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.dbg.json +1 -1
- package/artifacts/contracts/product/IApplicationService.sol/IApplicationService.json +13 -0
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.dbg.json +1 -1
- package/artifacts/contracts/product/IClaimService.sol/IClaimService.json +13 -0
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/IPolicyService.sol/IPolicyService.json +13 -0
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.dbg.json +1 -1
- package/artifacts/contracts/product/IPricingService.sol/IPricingService.json +13 -0
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.dbg.json +1 -1
- package/artifacts/contracts/product/IProductComponent.sol/IProductComponent.json +13 -42
- package/artifacts/contracts/product/IProductService.sol/IProductService.dbg.json +1 -1
- package/artifacts/contracts/product/IProductService.sol/IProductService.json +13 -0
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyService.sol/PolicyService.json +84 -47
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PolicyServiceManager.sol/PolicyServiceManager.json +53 -41
- package/artifacts/contracts/product/PricingService.sol/PricingService.dbg.json +1 -1
- package/artifacts/contracts/product/PricingService.sol/PricingService.json +92 -63
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/PricingServiceManager.sol/PricingServiceManager.json +57 -49
- package/artifacts/contracts/product/Product.sol/Product.dbg.json +1 -1
- package/artifacts/contracts/product/Product.sol/Product.json +13 -153
- package/artifacts/contracts/product/ProductService.sol/ProductService.dbg.json +1 -1
- package/artifacts/contracts/product/ProductService.sol/ProductService.json +54 -25
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.dbg.json +1 -1
- package/artifacts/contracts/product/ProductServiceManager.sol/ProductServiceManager.json +38 -30
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.dbg.json +1 -1
- package/artifacts/contracts/registry/ChainNft.sol/ChainNft.json +2 -2
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistry.sol/IRegistry.json +0 -44
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/IRegistryService.sol/IRegistryService.json +13 -0
- package/artifacts/contracts/registry/ITransferInterceptor.sol/ITransferInterceptor.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.dbg.json +1 -1
- package/artifacts/contracts/registry/Registry.sol/Registry.json +24 -68
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryAdmin.sol/RegistryAdmin.json +1505 -166
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryService.sol/RegistryService.json +50 -13
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.dbg.json +1 -1
- package/artifacts/contracts/registry/RegistryServiceManager.sol/RegistryServiceManager.json +37 -25
- 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/ReleaseManager.sol/ReleaseManager.dbg.json +1 -1
- package/artifacts/contracts/registry/ReleaseManager.sol/ReleaseManager.json +185 -318
- 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 +1 -1
- package/artifacts/contracts/registry/TokenRegistry.sol/TokenRegistry.json +4 -4
- package/artifacts/contracts/shared/Component.sol/Component.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentService.sol/ComponentService.json +82 -85
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentServiceManager.sol/ComponentServiceManager.json +52 -60
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.dbg.json +1 -1
- package/artifacts/contracts/shared/ComponentVerifyingService.sol/ComponentVerifyingService.json +13 -0
- package/artifacts/contracts/shared/ERC165.sol/ERC165.dbg.json +1 -1
- package/artifacts/contracts/shared/ERC165.sol/ERC165.json +2 -2
- package/artifacts/contracts/shared/IComponent.sol/IComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.dbg.json +1 -1
- package/artifacts/contracts/shared/IComponentService.sol/IComponentService.json +13 -0
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/IInstanceLinkedComponent.sol/IInstanceLinkedComponent.json +13 -0
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/IKeyValueStore.sol/IKeyValueStore.json +11 -5
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/ILifecycle.sol/ILifecycle.json +0 -5
- package/artifacts/contracts/shared/INftOwnable.sol/INftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/IPolicyHolder.sol/IPolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegisterable.sol/IRegisterable.dbg.json +1 -1
- package/artifacts/contracts/shared/IRegistryLinked.sol/IRegistryLinked.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.dbg.json +1 -1
- package/artifacts/contracts/shared/IService.sol/IService.json +13 -0
- package/artifacts/contracts/shared/IVersionable.sol/IVersionable.dbg.json +1 -1
- package/artifacts/contracts/shared/InitializableCustom.sol/InitializableCustom.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.dbg.json +1 -1
- package/artifacts/contracts/shared/InstanceLinkedComponent.sol/InstanceLinkedComponent.json +13 -53
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.dbg.json +1 -1
- package/artifacts/contracts/shared/KeyValueStore.sol/KeyValueStore.json +15 -89
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.dbg.json +1 -1
- package/artifacts/contracts/shared/Lifecycle.sol/Lifecycle.json +4 -65
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.dbg.json +1 -1
- package/artifacts/contracts/shared/NftIdSetManager.sol/NftIdSetManager.json +22 -22
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.dbg.json +1 -1
- package/artifacts/contracts/shared/NftOwnable.sol/NftOwnable.json +6 -6
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.dbg.json +1 -1
- package/artifacts/contracts/shared/PolicyHolder.sol/PolicyHolder.json +6 -6
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.dbg.json +1 -1
- package/artifacts/contracts/shared/ProxyManager.sol/ProxyManager.json +14 -14
- package/artifacts/contracts/shared/Registerable.sol/Registerable.dbg.json +1 -1
- package/artifacts/contracts/shared/Registerable.sol/Registerable.json +8 -8
- 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 +13 -0
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.dbg.json +1 -1
- package/artifacts/contracts/shared/TokenHandler.sol/TokenHandler.json +6 -6
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.dbg.json +1 -1
- package/artifacts/contracts/shared/UpgradableProxyWithAdmin.sol/UpgradableProxyWithAdmin.json +2 -2
- package/artifacts/contracts/shared/Versionable.sol/Versionable.dbg.json +1 -1
- package/artifacts/contracts/staking/IStaking.sol/IStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/IStakingService.sol/IStakingService.json +49 -7
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/StakeManagerLib.sol/StakeManagerLib.json +44 -28
- package/artifacts/contracts/staking/Staking.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/staking/Staking.sol/Staking.json +44 -84
- 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 +1 -1
- package/artifacts/contracts/staking/StakingManager.sol/StakingManager.json +40 -56
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingReader.sol/StakingReader.json +6 -6
- package/artifacts/contracts/staking/StakingService.sol/StakingService.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingService.sol/StakingService.json +92 -73
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingServiceManager.sol/StakingServiceManager.json +39 -47
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.dbg.json +1 -1
- package/artifacts/contracts/staking/StakingStore.sol/StakingStore.json +197 -149
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.dbg.json +1 -1
- package/artifacts/contracts/staking/TargetManagerLib.sol/TargetManagerLib.json +22 -22
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.dbg.json +1 -1
- package/artifacts/contracts/type/AddressSet.sol/LibAddressSet.json +2 -2
- package/artifacts/contracts/type/Amount.sol/AmountLib.dbg.json +1 -1
- package/artifacts/contracts/type/Amount.sol/AmountLib.json +8 -8
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.dbg.json +1 -1
- package/artifacts/contracts/type/Blocknumber.sol/BlocknumberLib.json +2 -2
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/ClaimId.sol/ClaimIdLib.json +4 -4
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/DistributorType.sol/DistributorTypeLib.json +4 -4
- package/artifacts/contracts/type/Fee.sol/FeeLib.dbg.json +1 -1
- package/artifacts/contracts/type/Fee.sol/FeeLib.json +12 -12
- 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/NftId.sol/NftIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/NftId.sol/NftIdLib.json +4 -4
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.dbg.json +1 -1
- package/artifacts/contracts/type/NftIdSet.sol/LibNftIdSet.json +2 -2
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.dbg.json +1 -1
- package/artifacts/contracts/type/ObjectType.sol/ObjectTypeLib.json +136 -2
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/PayoutId.sol/PayoutIdLib.json +4 -4
- package/artifacts/contracts/type/Referral.sol/ReferralLib.dbg.json +1 -1
- package/artifacts/contracts/type/Referral.sol/ReferralLib.json +4 -4
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RequestId.sol/RequestIdLib.json +4 -4
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RiskId.sol/RiskIdLib.json +4 -4
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.dbg.json +1 -1
- package/artifacts/contracts/type/RoleId.sol/RoleIdLib.json +219 -6
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.dbg.json +1 -1
- package/artifacts/contracts/type/Seconds.sol/SecondsLib.json +2 -2
- 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 +1 -1
- package/artifacts/contracts/type/StateId.sol/StateIdLib.json +2 -2
- 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 +1 -1
- package/artifacts/contracts/type/Timestamp.sol/TimestampLib.json +4 -4
- package/artifacts/contracts/type/UFixed.sol/MathLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/MathLib.json +2 -2
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.dbg.json +1 -1
- package/artifacts/contracts/type/UFixed.sol/UFixedLib.json +21 -2
- 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 +2 -2
- package/contracts/authorization/AccessAdmin.sol +591 -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 +126 -104
- package/contracts/distribution/DistributionService.sol +13 -9
- package/contracts/distribution/IDistributionComponent.sol +17 -35
- package/contracts/distribution/IDistributionService.sol +5 -1
- package/contracts/instance/IInstance.sol +11 -7
- package/contracts/instance/IInstanceService.sol +29 -18
- package/contracts/instance/Instance.sol +103 -85
- package/contracts/instance/InstanceAdmin.sol +202 -267
- package/contracts/instance/InstanceAuthorizationV3.sol +202 -0
- package/contracts/instance/InstanceReader.sol +24 -9
- package/contracts/instance/InstanceService.sol +151 -70
- package/contracts/instance/InstanceStore.sol +15 -20
- package/contracts/instance/base/BalanceStore.sol +11 -6
- package/contracts/instance/base/Cloneable.sol +2 -25
- package/contracts/instance/base/ObjectLifecycle.sol +106 -0
- package/contracts/instance/base/ObjectManager.sol +7 -10
- package/contracts/oracle/BasicOracle.sol +48 -0
- package/contracts/oracle/BasicOracleAuthorization.sol +46 -0
- package/contracts/oracle/IOracle.sol +16 -0
- package/contracts/oracle/Oracle.sol +61 -49
- package/contracts/oracle/OracleService.sol +5 -4
- package/contracts/pool/BasicPool.sol +164 -0
- package/contracts/pool/BasicPoolAuthorization.sol +49 -0
- package/contracts/pool/BundleService.sol +19 -19
- package/contracts/pool/IPoolComponent.sol +0 -60
- package/contracts/pool/Pool.sol +143 -131
- package/contracts/pool/PoolService.sol +7 -8
- package/contracts/product/ApplicationService.sol +5 -5
- package/contracts/product/BasicProduct.sol +82 -0
- package/contracts/product/BasicProductAuthorization.sol +40 -0
- package/contracts/product/ClaimService.sol +5 -5
- package/contracts/product/IProductComponent.sol +6 -9
- package/contracts/product/PolicyService.sol +5 -5
- package/contracts/product/PricingService.sol +4 -5
- package/contracts/product/Product.sol +103 -88
- package/contracts/product/ProductService.sol +5 -5
- package/contracts/registry/IRegistry.sol +5 -8
- package/contracts/registry/Registry.sol +6 -4
- package/contracts/registry/RegistryAdmin.sol +276 -148
- package/contracts/registry/RegistryService.sol +5 -5
- package/contracts/registry/RegistryServiceManager.sol +0 -5
- package/contracts/registry/ReleaseLifecycle.sol +27 -0
- package/contracts/registry/ReleaseManager.sol +161 -274
- package/contracts/registry/ServiceAuthorizationV3.sol +200 -0
- package/contracts/shared/ComponentService.sol +24 -61
- package/contracts/shared/ComponentVerifyingService.sol +1 -1
- package/contracts/shared/IInstanceLinkedComponent.sol +4 -0
- package/contracts/shared/IKeyValueStore.sol +1 -0
- package/contracts/shared/ILifecycle.sol +1 -2
- package/contracts/shared/IService.sol +7 -0
- package/contracts/shared/InstanceLinkedComponent.sol +26 -19
- package/contracts/shared/KeyValueStore.sol +6 -2
- package/contracts/shared/Lifecycle.sol +16 -69
- package/contracts/shared/Service.sol +27 -21
- package/contracts/staking/IStakingService.sol +11 -7
- package/contracts/staking/StakeManagerLib.sol +52 -0
- package/contracts/staking/Staking.sol +58 -96
- package/contracts/staking/StakingLifecycle.sol +23 -0
- package/contracts/staking/StakingService.sol +61 -56
- package/contracts/staking/StakingServiceManager.sol +0 -1
- package/contracts/staking/StakingStore.sol +82 -39
- package/contracts/type/ObjectType.sol +169 -62
- package/contracts/type/RoleId.sol +103 -75
- package/contracts/type/Selector.sol +102 -0
- package/contracts/type/String.sol +53 -0
- package/contracts/type/UFixed.sol +6 -0
- package/package.json +4 -1
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/instance/InstanceAuthorizationsLib.sol/InstanceAuthorizationsLib.json +0 -228
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.dbg.json +0 -4
- package/artifacts/contracts/registry/ServiceAuthorizationsLib.sol/ServiceAuthorizationsLib.json +0 -137
- package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerCustom.sol/AccessManagerCustom.json +0 -1193
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtended.sol/AccessManagerExtended.json +0 -1715
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedInitializeable.sol/AccessManagerExtendedInitializeable.json +0 -1728
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisable.sol/AccessManagerExtendedWithDisable.json +0 -1806
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.dbg.json +0 -4
- package/artifacts/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol/AccessManagerExtendedWithDisableInitializeable.json +0 -1824
- package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.dbg.json +0 -4
- package/artifacts/contracts/shared/IAccessManagerExtended.sol/IAccessManagerExtended.json +0 -1562
- package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.dbg.json +0 -4
- package/artifacts/contracts/shared/IAccessManagerExtendedWithDisable.sol/IAccessManagerExtendedWithDisable.json +0 -1600
- package/contracts/instance/InstanceAuthorizationsLib.sol +0 -377
- package/contracts/registry/ServiceAuthorizationsLib.sol +0 -173
- package/contracts/shared/AccessManagerCustom.sol +0 -736
- package/contracts/shared/AccessManagerExtended.sol +0 -470
- package/contracts/shared/AccessManagerExtendedInitializeable.sol +0 -13
- package/contracts/shared/AccessManagerExtendedWithDisable.sol +0 -137
- package/contracts/shared/AccessManagerExtendedWithDisableInitializeable.sol +0 -14
- package/contracts/shared/IAccessManagerExtended.sol +0 -74
- package/contracts/shared/IAccessManagerExtendedWithDisable.sol +0 -18
@@ -12,140 +12,142 @@ using {
|
|
12
12
|
ObjectTypeLib.gtz
|
13
13
|
} for ObjectType global;
|
14
14
|
|
15
|
-
// general pure free functions
|
16
15
|
|
17
|
-
|
18
|
-
return toObjectType(1);
|
19
|
-
}
|
16
|
+
//--- GIF object types/domains (rage: 1 - 99) -------------------------------//
|
20
17
|
|
21
18
|
function PROTOCOL() pure returns (ObjectType) {
|
22
|
-
return
|
19
|
+
return ObjectType.wrap(1);
|
23
20
|
}
|
24
21
|
|
25
|
-
function
|
26
|
-
return
|
22
|
+
function REGISTRY() pure returns (ObjectType) {
|
23
|
+
return ObjectType.wrap(2);
|
27
24
|
}
|
28
25
|
|
29
|
-
function
|
30
|
-
return
|
26
|
+
function STAKING() pure returns (ObjectType) {
|
27
|
+
return ObjectType.wrap(3);
|
31
28
|
}
|
32
29
|
|
33
|
-
function
|
34
|
-
return
|
30
|
+
function TOKEN() pure returns (ObjectType) {
|
31
|
+
return ObjectType.wrap(6);
|
35
32
|
}
|
36
33
|
|
37
|
-
function
|
38
|
-
return
|
34
|
+
function RELEASE() pure returns (ObjectType) {
|
35
|
+
return ObjectType.wrap(7);
|
39
36
|
}
|
40
37
|
|
41
|
-
function
|
42
|
-
return
|
38
|
+
function ROLE() pure returns (ObjectType) {
|
39
|
+
return ObjectType.wrap(8);
|
43
40
|
}
|
44
41
|
|
45
42
|
function SERVICE() pure returns (ObjectType) {
|
46
|
-
return
|
43
|
+
return ObjectType.wrap(9);
|
47
44
|
}
|
48
45
|
|
49
46
|
function INSTANCE() pure returns (ObjectType) {
|
50
|
-
return
|
47
|
+
return ObjectType.wrap(10);
|
51
48
|
}
|
52
49
|
|
53
|
-
function
|
54
|
-
return
|
50
|
+
function COMPONENT() pure returns (ObjectType) {
|
51
|
+
return ObjectType.wrap(11);
|
55
52
|
}
|
56
53
|
|
57
|
-
function
|
58
|
-
return
|
54
|
+
function PRODUCT() pure returns (ObjectType) {
|
55
|
+
return ObjectType.wrap(12);
|
59
56
|
}
|
60
57
|
|
61
|
-
function
|
62
|
-
return
|
58
|
+
function ORACLE() pure returns (ObjectType) {
|
59
|
+
return ObjectType.wrap(13);
|
63
60
|
}
|
64
61
|
|
65
|
-
function
|
66
|
-
return
|
62
|
+
function DISTRIBUTION() pure returns (ObjectType) {
|
63
|
+
return ObjectType.wrap(14);
|
67
64
|
}
|
68
65
|
|
69
|
-
function
|
70
|
-
return
|
66
|
+
function POOL() pure returns (ObjectType) {
|
67
|
+
return ObjectType.wrap(15);
|
71
68
|
}
|
72
69
|
|
73
|
-
function
|
74
|
-
return
|
70
|
+
function APPLICATION() pure returns (ObjectType) {
|
71
|
+
return ObjectType.wrap(20);
|
75
72
|
}
|
76
73
|
|
77
|
-
function
|
78
|
-
return
|
74
|
+
function POLICY() pure returns (ObjectType) {
|
75
|
+
return ObjectType.wrap(21);
|
79
76
|
}
|
80
77
|
|
81
|
-
function
|
82
|
-
return
|
78
|
+
function CLAIM() pure returns (ObjectType) {
|
79
|
+
return ObjectType.wrap(22);
|
83
80
|
}
|
84
81
|
|
85
|
-
function
|
86
|
-
return
|
82
|
+
function PAYOUT() pure returns (ObjectType) {
|
83
|
+
return ObjectType.wrap(23);
|
87
84
|
}
|
88
85
|
|
89
|
-
function
|
90
|
-
return
|
86
|
+
function RISK() pure returns (ObjectType) {
|
87
|
+
return ObjectType.wrap(24);
|
91
88
|
}
|
92
89
|
|
93
|
-
function
|
94
|
-
return
|
90
|
+
function PRICE() pure returns (ObjectType) {
|
91
|
+
return ObjectType.wrap(25);
|
95
92
|
}
|
96
93
|
|
97
|
-
function
|
98
|
-
return
|
94
|
+
function REQUEST() pure returns (ObjectType) {
|
95
|
+
return ObjectType.wrap(26);
|
99
96
|
}
|
100
97
|
|
101
|
-
function
|
102
|
-
return
|
98
|
+
function DISTRIBUTOR_TYPE() pure returns (ObjectType) {
|
99
|
+
return ObjectType.wrap(27);
|
103
100
|
}
|
104
101
|
|
105
|
-
function
|
106
|
-
return
|
102
|
+
function DISTRIBUTOR() pure returns (ObjectType) {
|
103
|
+
return ObjectType.wrap(28);
|
107
104
|
}
|
108
105
|
|
109
|
-
function
|
110
|
-
return
|
106
|
+
function REFERRAL() pure returns (ObjectType) {
|
107
|
+
return ObjectType.wrap(29);
|
111
108
|
}
|
112
109
|
|
113
|
-
function
|
114
|
-
return
|
110
|
+
function BUNDLE() pure returns (ObjectType) {
|
111
|
+
return ObjectType.wrap(30);
|
115
112
|
}
|
116
113
|
|
117
|
-
function
|
118
|
-
return
|
114
|
+
function TARGET() pure returns (ObjectType) {
|
115
|
+
return ObjectType.wrap(31);
|
119
116
|
}
|
120
117
|
|
121
|
-
function
|
122
|
-
return
|
118
|
+
function STAKE() pure returns (ObjectType) {
|
119
|
+
return ObjectType.wrap(32);
|
123
120
|
}
|
124
121
|
|
125
|
-
/// @dev
|
126
|
-
|
127
|
-
|
122
|
+
/// @dev Object type that includes any other object type.
|
123
|
+
/// Note that eq()/'==' does not take this property into account.
|
124
|
+
function ALL() pure returns (ObjectType) {
|
125
|
+
return ObjectType.wrap(99);
|
128
126
|
}
|
129
127
|
|
130
|
-
// pure free functions for operators
|
128
|
+
// other pure free functions for operators
|
131
129
|
function eqObjectType(ObjectType a, ObjectType b) pure returns (bool isSame) {
|
132
130
|
return ObjectType.unwrap(a) == ObjectType.unwrap(b);
|
133
131
|
}
|
134
132
|
|
135
|
-
function neObjectType(
|
136
|
-
ObjectType a,
|
137
|
-
ObjectType b
|
138
|
-
) pure returns (bool isDifferent) {
|
133
|
+
function neObjectType(ObjectType a, ObjectType b) pure returns (bool isSame) {
|
139
134
|
return ObjectType.unwrap(a) != ObjectType.unwrap(b);
|
140
135
|
}
|
141
136
|
|
142
137
|
// library functions that operate on user defined type
|
143
138
|
library ObjectTypeLib {
|
144
139
|
|
140
|
+
error ErrorVersionTooBig(uint256 version);
|
141
|
+
|
145
142
|
function zero() public pure returns (ObjectType) {
|
146
143
|
return ObjectType.wrap(0);
|
147
144
|
}
|
148
145
|
|
146
|
+
/// @dev Converts the uint256 into ObjectType.
|
147
|
+
function toObjectType(uint256 objectType) public pure returns (ObjectType) {
|
148
|
+
return ObjectType.wrap(uint8(objectType));
|
149
|
+
}
|
150
|
+
|
149
151
|
/// @dev Converts the NftId to a uint256.
|
150
152
|
function toInt(ObjectType objectType) public pure returns (uint96) {
|
151
153
|
return uint96(ObjectType.unwrap(objectType));
|
@@ -163,6 +165,111 @@ library ObjectTypeLib {
|
|
163
165
|
|
164
166
|
/// @dev Returns true if the values are equal (==).
|
165
167
|
function eq(ObjectType a, ObjectType b) public pure returns (bool isSame) {
|
166
|
-
return
|
168
|
+
return ObjectType.unwrap(a) == ObjectType.unwrap(b);
|
169
|
+
}
|
170
|
+
|
171
|
+
/// @dev Returns true if the values are not equal (!=).
|
172
|
+
function ne(ObjectType a, ObjectType b) public pure returns (bool isSame) {
|
173
|
+
return ObjectType.unwrap(a) != ObjectType.unwrap(b);
|
174
|
+
}
|
175
|
+
|
176
|
+
/// @dev Returns the type/domain name for the provided object type
|
177
|
+
function toName(ObjectType objectType) public pure returns (string memory name) {
|
178
|
+
if (objectType == REGISTRY()) {
|
179
|
+
return "Registry";
|
180
|
+
} else if (objectType == STAKING()) {
|
181
|
+
return "Staking";
|
182
|
+
} else if (objectType == INSTANCE()) {
|
183
|
+
return "Instance";
|
184
|
+
} else if (objectType == COMPONENT()) {
|
185
|
+
return "Component";
|
186
|
+
} else if (objectType == PRODUCT()) {
|
187
|
+
return "Product";
|
188
|
+
} else if (objectType == ORACLE()) {
|
189
|
+
return "Oracle";
|
190
|
+
} else if (objectType == DISTRIBUTION()) {
|
191
|
+
return "Distribution";
|
192
|
+
} else if (objectType == POOL()) {
|
193
|
+
return "Pool";
|
194
|
+
} else if (objectType == APPLICATION()) {
|
195
|
+
return "Application";
|
196
|
+
} else if (objectType == POLICY()) {
|
197
|
+
return "Policy";
|
198
|
+
} else if (objectType == CLAIM()) {
|
199
|
+
return "Claim";
|
200
|
+
} else if (objectType == PRICE()) {
|
201
|
+
return "Price";
|
202
|
+
} else if (objectType == BUNDLE()) {
|
203
|
+
return "Bundle";
|
204
|
+
}
|
205
|
+
|
206
|
+
// fallback: ObjectType<obect-type-int>
|
207
|
+
return string(
|
208
|
+
abi.encodePacked(
|
209
|
+
"ObjectType",
|
210
|
+
toString(
|
211
|
+
toInt(objectType))));
|
212
|
+
}
|
213
|
+
|
214
|
+
function toVersionedName(
|
215
|
+
string memory name,
|
216
|
+
string memory suffix,
|
217
|
+
uint256 version
|
218
|
+
)
|
219
|
+
external
|
220
|
+
pure
|
221
|
+
returns (string memory versionedName)
|
222
|
+
{
|
223
|
+
if (version > maxNumReleases()) {
|
224
|
+
revert ErrorVersionTooBig(version);
|
225
|
+
}
|
226
|
+
|
227
|
+
string memory versionName = "_v0";
|
228
|
+
|
229
|
+
if (version >= 10) {
|
230
|
+
versionName = "_v";
|
231
|
+
}
|
232
|
+
|
233
|
+
versionedName = string(
|
234
|
+
abi.encodePacked(
|
235
|
+
name,
|
236
|
+
suffix,
|
237
|
+
versionName,
|
238
|
+
toString(version)));
|
239
|
+
}
|
240
|
+
|
241
|
+
/// @dev returns the max number of releases (major versions) this gif setup can handle.
|
242
|
+
function maxNumReleases() public pure returns (uint8) {
|
243
|
+
return 99;
|
244
|
+
}
|
245
|
+
|
246
|
+
/// @dev returns the provied int as a string
|
247
|
+
function toString(uint256 value) public pure returns (string memory name) {
|
248
|
+
|
249
|
+
if (value == 0) {
|
250
|
+
return "0";
|
251
|
+
}
|
252
|
+
|
253
|
+
uint256 temp = value;
|
254
|
+
uint256 digits = 0;
|
255
|
+
while (temp != 0) {
|
256
|
+
digits++;
|
257
|
+
temp /= 10;
|
258
|
+
}
|
259
|
+
|
260
|
+
bytes memory buffer = new bytes(digits);
|
261
|
+
uint index = digits - 1;
|
262
|
+
|
263
|
+
temp = value;
|
264
|
+
while (temp != 0) {
|
265
|
+
buffer[index] = bytes1(uint8(48 + temp % 10));
|
266
|
+
temp /= 10;
|
267
|
+
|
268
|
+
if (index > 0) {
|
269
|
+
index--;
|
270
|
+
}
|
271
|
+
}
|
272
|
+
|
273
|
+
return string(buffer);
|
167
274
|
}
|
168
275
|
}
|
@@ -2,7 +2,8 @@
|
|
2
2
|
pragma solidity ^0.8.20;
|
3
3
|
|
4
4
|
import {Key32, KeyId, Key32Lib} from "./Key32.sol";
|
5
|
-
import {ROLE} from "./ObjectType.sol";
|
5
|
+
import {ObjectType, ROLE} from "./ObjectType.sol";
|
6
|
+
import {VersionPart} from "./Version.sol";
|
6
7
|
|
7
8
|
type RoleId is uint64;
|
8
9
|
|
@@ -12,116 +13,143 @@ using {
|
|
12
13
|
neRoleId as !=,
|
13
14
|
RoleIdLib.eqz,
|
14
15
|
RoleIdLib.gtz,
|
15
|
-
RoleIdLib.toInt
|
16
|
-
RoleIdLib.toKey32
|
16
|
+
RoleIdLib.toInt
|
17
|
+
// RoleIdLib.toKey32
|
17
18
|
} for RoleId global;
|
18
19
|
|
20
|
+
// general pure free functions
|
21
|
+
|
22
|
+
// @dev Returns true iff role ids a and b are identical
|
23
|
+
function eqRoleId(RoleId a, RoleId b) pure returns (bool isSame) {
|
24
|
+
return RoleId.unwrap(a) == RoleId.unwrap(b);
|
25
|
+
}
|
26
|
+
|
27
|
+
// @dev Returns true iff role ids a and b are different
|
28
|
+
function neRoleId(RoleId a, RoleId b) pure returns (bool isDifferent) {
|
29
|
+
return RoleId.unwrap(a) != RoleId.unwrap(b);
|
30
|
+
}
|
19
31
|
|
20
|
-
|
32
|
+
//--- OpenZeppelin provided roles -------------------------------------------//
|
33
|
+
|
34
|
+
/// @dev Role ID needs to match with oz AccessManager.ADMIN_ROLE
|
21
35
|
function ADMIN_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(type(uint64).min); }
|
22
36
|
|
23
|
-
/// @dev
|
37
|
+
/// @dev Role ID needs to match with oz AccessManager.PUBLIC_ROLE
|
24
38
|
function PUBLIC_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(type(uint64).max); }
|
25
39
|
|
26
|
-
|
40
|
+
//--- GIF roles (range: 1-99) ----------------------------------------------//
|
27
41
|
|
28
42
|
/// @dev cental role for gif release management.
|
29
43
|
/// this role is necessary to call ReleaseManager.createNextRelease/activateNextRelease
|
30
44
|
/// the actual deployment of a release requires the GIF_MANAGER_ROLE.
|
31
45
|
/// GIF_ADMIN_ROLE is the admin of the GIF_MANAGER_ROLE.
|
32
46
|
/// only a single holder may hold this role at any time
|
33
|
-
function GIF_ADMIN_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(
|
47
|
+
function GIF_ADMIN_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(1); }
|
34
48
|
|
35
49
|
/// @dev role for token whith/blacklisting, deploying and registering the services for a new major release
|
36
50
|
/// registering services for a new major release is only possible after a new initial release has been created by the GIF_ADMIN_ROLE
|
37
51
|
/// token white/blacklisting is possible for any active release
|
38
|
-
function GIF_MANAGER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(
|
39
|
-
|
40
|
-
/// @dev instance specific role to register/own a distribution component
|
41
|
-
function DISTRIBUTION_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2); }
|
42
|
-
|
43
|
-
/// @dev instance specific role to register/own an oracle component
|
44
|
-
function ORACLE_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(3); }
|
52
|
+
function GIF_MANAGER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2); }
|
45
53
|
|
46
|
-
/// @dev
|
47
|
-
function
|
54
|
+
/// @dev role for registering remote staking targets and reporting remote total value locked amounts.
|
55
|
+
function GIF_REMOTE_MANAGER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(3); }
|
48
56
|
|
49
57
|
/// @dev instance specific role to register/own a product component
|
50
|
-
function PRODUCT_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(
|
51
|
-
|
52
|
-
/// @dev role associated with an instance contract
|
53
|
-
/// this role is the admin role for the INSTANCE_OWNER_ROLE
|
54
|
-
function INSTANCE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2600); }
|
55
|
-
|
56
|
-
/// @dev required role to register/own an instance
|
57
|
-
/// allows instance specific target, role and access management
|
58
|
-
function INSTANCE_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(1900); }
|
59
|
-
|
60
|
-
function REGISTRY_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(1800); }
|
58
|
+
function PRODUCT_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(11); }
|
61
59
|
|
62
|
-
/// @dev instance specific
|
63
|
-
function
|
64
|
-
|
65
|
-
/// @dev role for creating gif target on instance service
|
66
|
-
function CAN_CREATE_GIF_TARGET__ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(1700); }
|
67
|
-
|
68
|
-
/// @dev role for registering gif components
|
69
|
-
function COMPONENT_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2001); }
|
70
|
-
|
71
|
-
/// @dev instance specific role for distribution service
|
72
|
-
function DISTRIBUTION_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2100); }
|
73
|
-
|
74
|
-
/// @dev instance specific role for oracle service
|
75
|
-
function ORACLE_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2150); }
|
76
|
-
|
77
|
-
/// @dev instance specific role for pool service
|
78
|
-
function POOL_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2200); }
|
60
|
+
/// @dev instance specific role to register/own an oracle component
|
61
|
+
function ORACLE_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(12); }
|
79
62
|
|
80
|
-
/// @dev instance specific role
|
81
|
-
function
|
63
|
+
/// @dev instance specific role to register/own a distribution component
|
64
|
+
function DISTRIBUTION_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(13); }
|
82
65
|
|
83
|
-
/// @dev instance specific
|
84
|
-
function
|
66
|
+
/// @dev instance specific role to register/own a pool component
|
67
|
+
function POOL_OWNER_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(14); }
|
68
|
+
|
69
|
+
//--- GIF core contract roles (range: 200 - 9'900) --------------------------//
|
70
|
+
// created and assigned during initial deployment for registry and staking
|
71
|
+
// granting for instances and components in instance service
|
72
|
+
// object type * 100 + 0, examples:
|
73
|
+
// - registry contract role: 200
|
74
|
+
// - staking contract role: 300
|
75
|
+
// - instance contract role: 1000
|
76
|
+
|
77
|
+
//--- GIF service roles (range 201 - 9'9xx) ---------------------------------//
|
78
|
+
// created and assigned by release manager contract
|
79
|
+
// object type * 100 + 1/major version, examples:
|
80
|
+
// - registry service role (any version): 299
|
81
|
+
// - registry service role (version 3): 203
|
82
|
+
// - registry service role (any version): 399
|
83
|
+
// - staking service role: (version 3): 303
|
84
|
+
// - application service role (version 3): 2003
|
85
|
+
|
86
|
+
//--- GIF component contract roles (range 12'001 - 19'099) ------------------//
|
87
|
+
// assigned at component registration time
|
88
|
+
// object type * 1000 + instane specific component counter
|
89
|
+
// on any instance a maximum number of 999 components may be deployed
|
90
|
+
// examples:
|
91
|
+
// - 1st pool on instance: 15001
|
92
|
+
// - 1st distribution on instance: 14002
|
93
|
+
// - 1st product on instance: 12003
|
94
|
+
// - 2nd pool on instance: 15004
|
95
|
+
// - 2nd distribution on instance: 14005
|
96
|
+
// - 2nd product on instance: 12006
|
97
|
+
|
98
|
+
|
99
|
+
//--- Custom roles (range >= 1'000'000) -------------------------------------//
|
100
|
+
|
101
|
+
function CUSTOM_ROLE_MIN() pure returns (RoleId) { return RoleIdLib.toRoleId(1000000); }
|
85
102
|
|
86
|
-
|
87
|
-
function POLICY_SERVICE_ROLE() pure returns (RoleId) { return RoleIdLib.toRoleId(2410); }
|
103
|
+
library RoleIdLib {
|
88
104
|
|
89
|
-
|
90
|
-
|
105
|
+
uint64 public constant ALL_VERSIONS = 99;
|
106
|
+
uint64 public constant SERVICE_DOMAIN_ROLE_FACTOR = 100;
|
107
|
+
uint64 public constant COMPONENT_ROLE_FACTOR = 100;
|
108
|
+
uint64 public constant CUSTOM_ROLE_MIN = 1000000;
|
91
109
|
|
92
|
-
/// @dev
|
93
|
-
function
|
110
|
+
/// @dev Converts the RoleId to a uint.
|
111
|
+
function zero() public pure returns (RoleId) {
|
112
|
+
return RoleId.wrap(0);
|
113
|
+
}
|
94
114
|
|
95
|
-
/// @dev
|
96
|
-
function
|
115
|
+
/// @dev Converts an uint into a role id.
|
116
|
+
function toRoleId(uint64 a) public pure returns (RoleId) {
|
117
|
+
return RoleId.wrap(a);
|
118
|
+
}
|
97
119
|
|
98
|
-
/// @dev
|
99
|
-
function
|
120
|
+
/// @dev Converts an uint into a component role id.
|
121
|
+
function toComponentRoleId(ObjectType objectType, uint64 index) public pure returns (RoleId) {
|
122
|
+
return toRoleId(COMPONENT_ROLE_FACTOR * uint64(objectType.toInt()) + index);
|
123
|
+
}
|
100
124
|
|
101
|
-
|
102
|
-
function
|
103
|
-
|
104
|
-
}
|
125
|
+
/// @dev Converts an uint into a custom role id.
|
126
|
+
function toCustomRoleId(uint64 index) public pure returns (RoleId) {
|
127
|
+
return toRoleId(CUSTOM_ROLE_MIN + index);
|
128
|
+
}
|
105
129
|
|
106
|
-
|
107
|
-
function
|
108
|
-
|
109
|
-
}
|
130
|
+
/// @dev Converts the role id to a uint.
|
131
|
+
function toInt(RoleId a) public pure returns (uint64) {
|
132
|
+
return uint64(RoleId.unwrap(a));
|
133
|
+
}
|
110
134
|
|
111
|
-
|
112
|
-
///
|
113
|
-
function
|
114
|
-
return RoleId.wrap(
|
135
|
+
/// @dev Converts an uint into a role id.
|
136
|
+
/// Used for GIF core contracts.
|
137
|
+
function roleForType(ObjectType objectType) public pure returns (RoleId) {
|
138
|
+
return RoleId.wrap(SERVICE_DOMAIN_ROLE_FACTOR * uint64(objectType.toInt()));
|
115
139
|
}
|
116
140
|
|
117
141
|
/// @dev Converts an uint into a RoleId.
|
118
|
-
|
119
|
-
|
142
|
+
/// Used for GIF core contracts.
|
143
|
+
function roleForTypeAndVersion(ObjectType objectType, VersionPart majorVersion) public pure returns (RoleId) {
|
144
|
+
return RoleId.wrap(
|
145
|
+
uint64(SERVICE_DOMAIN_ROLE_FACTOR * objectType.toInt() + majorVersion.toInt()));
|
120
146
|
}
|
121
147
|
|
122
|
-
/// @dev Converts
|
123
|
-
|
124
|
-
|
148
|
+
/// @dev Converts an uint into a RoleId.
|
149
|
+
/// Used for GIF core contracts.
|
150
|
+
function roleForTypeAndAllVersions(ObjectType objectType) public pure returns (RoleId) {
|
151
|
+
return RoleId.wrap(
|
152
|
+
uint64(SERVICE_DOMAIN_ROLE_FACTOR * objectType.toInt() + ALL_VERSIONS));
|
125
153
|
}
|
126
154
|
|
127
155
|
/// @dev Returns true if the value is non-zero (> 0).
|
@@ -0,0 +1,102 @@
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
|
4
|
+
type Selector is bytes4;
|
5
|
+
|
6
|
+
// type bindings
|
7
|
+
using {
|
8
|
+
eqSelector as ==,
|
9
|
+
neSelector as !=,
|
10
|
+
SelectorLib.toBytes4,
|
11
|
+
SelectorLib.eqz
|
12
|
+
} for Selector global;
|
13
|
+
|
14
|
+
// pure free functions for operators
|
15
|
+
function eqSelector(Selector s1, Selector s2) pure returns (bool isSame) {
|
16
|
+
return SelectorLib.eq(s1, s2);
|
17
|
+
}
|
18
|
+
|
19
|
+
function neSelector(Selector s1, Selector s2) pure returns (bool isDifferent) {
|
20
|
+
return SelectorLib.ne(s1, s2);
|
21
|
+
}
|
22
|
+
|
23
|
+
// library functions that operate on user defined type
|
24
|
+
library SelectorLib {
|
25
|
+
|
26
|
+
function zero() public pure returns (Selector) {
|
27
|
+
return Selector.wrap("");
|
28
|
+
}
|
29
|
+
|
30
|
+
function eqz(Selector s) public pure returns (bool) {
|
31
|
+
return Selector.unwrap(s) == "";
|
32
|
+
}
|
33
|
+
|
34
|
+
function eq(Selector s1, Selector s2) public pure returns (bool isSame) {
|
35
|
+
return Selector.unwrap(s1) == Selector.unwrap(s2);
|
36
|
+
}
|
37
|
+
|
38
|
+
function ne(Selector s1, Selector s2) public pure returns (bool isDifferent) {
|
39
|
+
return Selector.unwrap(s1) != Selector.unwrap(s2);
|
40
|
+
}
|
41
|
+
|
42
|
+
function toSelector(bytes4 selector) public pure returns (Selector) {
|
43
|
+
return Selector.wrap(selector);
|
44
|
+
}
|
45
|
+
|
46
|
+
function toBytes4(Selector s) public pure returns (bytes4) {
|
47
|
+
return Selector.unwrap(s);
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
// selector specific set library
|
52
|
+
// based on https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/structs/EnumerableSet.sol
|
53
|
+
library SelectorSetLib {
|
54
|
+
|
55
|
+
struct Set {
|
56
|
+
Selector[] selectors;
|
57
|
+
mapping(Selector selector => uint256 index) at;
|
58
|
+
}
|
59
|
+
|
60
|
+
function add(Set storage set, Selector selector) external {
|
61
|
+
// selector already in set
|
62
|
+
if (set.at[selector] > 0) { return; }
|
63
|
+
|
64
|
+
set.selectors.push(selector);
|
65
|
+
set.at[selector] = set.selectors.length;
|
66
|
+
}
|
67
|
+
|
68
|
+
function remove(Set storage set, Selector selector) external {
|
69
|
+
uint256 selectorIndex = set.at[selector];
|
70
|
+
|
71
|
+
// selector not in set
|
72
|
+
if (selectorIndex == 0) {return; }
|
73
|
+
|
74
|
+
uint256 toDeleteIndex = selectorIndex - 1;
|
75
|
+
uint256 lastIndex = set.selectors.length - 1;
|
76
|
+
|
77
|
+
if (lastIndex != toDeleteIndex) {
|
78
|
+
Selector lastSelector = set.selectors[lastIndex];
|
79
|
+
set.selectors[toDeleteIndex] = lastSelector;
|
80
|
+
set.at[lastSelector] = selectorIndex; // Replace lastValue's index to valueIndex
|
81
|
+
}
|
82
|
+
|
83
|
+
set.selectors.pop();
|
84
|
+
delete set.at[selector];
|
85
|
+
}
|
86
|
+
|
87
|
+
function isEmpty(Set storage set) external view returns(bool empty) {
|
88
|
+
return set.selectors.length == 0;
|
89
|
+
}
|
90
|
+
|
91
|
+
function contains(Set storage set, Selector selector) external view returns(bool inSet) {
|
92
|
+
return set.at[selector] > 0;
|
93
|
+
}
|
94
|
+
|
95
|
+
function size(Set storage set) external view returns(uint256 length) {
|
96
|
+
return set.selectors.length;
|
97
|
+
}
|
98
|
+
|
99
|
+
function at(Set storage set, uint256 index) external view returns(Selector selector) {
|
100
|
+
return set.selectors[index];
|
101
|
+
}
|
102
|
+
}
|